body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background-color: #1c1c1c;
  color: #f0f0f0;
  background-image: url('tausta-tumma.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  transition: background-color 0.4s, color 0.4s;
}

body.light {
  background-color: #f5f5f5;
  color: #000;
  background-image: url('tausta-vaalea.png');
}

body.dark {
  background-color: #1c1c1c;
  color: #f0f0f0;
}

.rounded-block {
  border-radius: 20px;
  margin-bottom: 30px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  overflow-wrap: break-word;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  background: #ffb300;
  flex-wrap: wrap;
}

body.dark header {
  background: #111;
}

.logo {
  font-weight: bold;
  font-size: 1.7em;
}

body.dark .logo {
  color: #ff8243;
  text-shadow: 
    1px 1px 0 #000;
}

body.light .logo {
  color: #ff8243;
  text-shadow: 
    1px 1px 0 #000;
}

.logo a {
  color: inherit;
  text-decoration: none;
}

body.dark .logo a {
  background: inherit;
  -webkit-background-clip: inherit;
  -webkit-text-fill-color: inherit;
  background-clip: inherit;
}

@supports not (background-clip: text) or not (-webkit-background-clip: text) {
  body.dark .logo {
    color: #ffa500;
  }
}

.header-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

.header-right button {
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background-color: #fff;
  cursor: pointer;
  font-size: 0.95em;
  transition: all 0.3s ease;
}

body.dark .header-right button {
  background-color: #333;
  color: #fff;
}

.header-right button:hover {
  background-color: #eee;
  transform: scale(1.05);
}

.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 30px 20px;
}

.navbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  background-color: #ffaa00;
  padding: 15px 25px;
  gap: 15px;
  border-radius: 35px;
}

body.dark .navbar {
  background-color: #111;
}

.navbar button {
  background: none;
  border: none;
  font-size: 1.2em;
  font-weight: 500;
  cursor: pointer;
  color: inherit;
  transition: transform 0.2s ease, color 0.2s ease;
  padding: 8px 12px;
}

body.dark .navbar button:hover {
  transform: translateY(-2px);
  color: #fff;
}

body.light .navbar button:hover {
  transform: translateY(-2px);
  color: #222;
}

.content {
  background-color: #111;
  color: #fff;
  padding: 40px 30px;
  text-align: center;
  font-size: 1.6em;
}

body.light .content {
  background-color: #fff;
  color: #000;
}

footer {
  background-color: #ffb300;
  text-align: center;
  padding: 25px;
  font-size: 0.95em;
}

body.dark footer {
  background-color: #111;
  color: #f0f0f0;
}

.footer-links {
  margin-top: 10px;
}

.footer-links a {
  color: inherit;
  margin: 0 12px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  text-decoration: underline;
  color: #333;
}

.game-box {
  margin-top: 20px;
  padding: 20px;
  background: #222;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

body.light .game-box {
  background: #eee;
  color: #000;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.coin-face {
  font-size: 2em;
  margin: 20px 0;
  font-weight: bold;
}

.game-button {
  padding: 10px 18px;
  font-size: 1em;
  border: none;
  border-radius: 10px;
  background-color: #ffa500;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.game-button:hover {
  background-color: #ff8800;
  transform: scale(1.05);
}

.coin-graphic {
  width: 100px;
  height: 100px;
  margin: 20px auto;
  perspective: 1000px;
}

.coin {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: gold;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2em;
  transition: transform 1s ease;
  transform-style: preserve-3d;
  position: relative;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

.coin.flipping {
  animation: flip 1s linear;
  transform: rotateY(1800deg);
}

@keyframes flip {
  0% { transform: rotateY(0); }
  100% { transform: rotateY(1800deg); }
}

.coin[data-face="HEADS"] .tails,
.coin[data-face="TAILS"] .heads {
  display: none;
}

.coin .heads, .coin .tails {
  position: absolute;
  backface-visibility: hidden;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 3px solid #cc9900;
}

.coin .heads {
  background-color: gold;
  color: #333;
  z-index: 2;
}

.coin .tails {
  background-color: silver;
  color: #333;
  transform: rotateY(180deg);
  z-index: 1;
}

.coin[data-face="HEADS"] {
  transform: rotateY(0deg);
}

.coin[data-face="TAILS"] {
  transform: rotateY(180deg);
}

.coin-face-highlight {
  animation: resultPulse 0.5s 2;
  color: #ffa500;
}

@keyframes resultPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.reel-wrapper {
  position: relative;
  width: 100%;
  height: 120px;
  border: 2px solid #444;
  border-radius: 10px;
  overflow: hidden;
  margin: 20px 0;
  background: #333;
}

body.light .reel-wrapper {
  background: #ddd;
  border-color: #bbb;
}

.reel {
  display: flex;
  height: 100%;
  overflow: hidden;
  scroll-behavior: auto;
}

.tile {
  min-width: 140px;
  width: 140px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
  font-size: 14px;
  border-right: 1px solid #444;
  background-color: #222;
  color: #fff;
  transition: all 0.3s ease;
  border-radius: 8px;
  margin: 10px 5px;
  flex-shrink: 0;
  overflow: hidden;
}

body.light .tile {
  background-color: #f0f0f0;
  border-right: 1px solid #ccc;
  color: #000;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  transition: transform 0.3s ease;
}

.tile.highlight {
  background-color: #ffa500;
  color: #000;
  transform: scale(1.05);
  z-index: 10;
  font-weight: bold;
  border-color: #ffa500;
  box-shadow: 0 0 15px rgba(255, 165, 0, 0.8);
}

.tile.highlight img {
  transform: scale(1.05);
}

body.light .tile.highlight {
  background-color: #ffa500;
  color: #000;
}

.tile.text-fallback {
  background: #444;
  color: #fff;
  font-size: 12px;
  text-align: center;
  padding: 8px;
  font-weight: bold;
  border: 2px solid #666;
}

.tile.text-fallback.highlight {
  background: #ffa500;
  color: #000;
  border-color: #ff8800;
}

body.light .tile.text-fallback {
  background: #e0e0e0;
  color: #333;
  border-color: #999;
}

body.light .tile.text-fallback.highlight {
  background: #ff8800;
  color: #fff;
  border-color: #ff6600;
}

.selector {
  position: absolute;
  left: 50%;
  top: 10px;
  height: calc(100% - 20px);
  width: 2px;
  background-color: #ffa500;
  transform: translateX(-50%);
  z-index: 100;
  transition: width 0.3s;
}

.selector.active {
  width: 4px;
  background-color: #ffa500;
}

.selector.highlight {
  width: 6px;
  background-color: #ff0;
  box-shadow: 0 0 10px #ff0;
}

.selector.flash {
  animation: selectorFlash 0.1s infinite;
}

@keyframes selectorFlash {
  0% { background-color: #ffa500; }
  50% { background-color: #fff; }
  100% { background-color: #ffa500; }
}

#randomSlotResult {
  font-size: 18px;
  font-weight: bold;
  margin-top: 15px;
  padding: 10px;
  border: 1px dashed #ffa500;
  border-radius: 10px;
}

.coin-face.flip {
  animation: textFlip 0.3s;
}

@keyframes textFlip {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.hidden {
  display: none;
}

#providerSettings {
  border: 1px solid #444;
  padding: 15px;
  border-radius: 10px;
  margin: 15px 0;
  background-color: #333;
  text-align: left;
}

body.light #providerSettings {
  background-color: #ddd;
  border-color: #aaa;
}

#providerSettings label {
  display: block;
  margin: 5px 0;
  font-size: 0.9em;
}

#providerSettings input[type="checkbox"] {
  margin-right: 8px;
}

.standard-button {
  min-width: 150px;
  padding: 10px 18px;
  font-size: 1em;
  text-align: center;
}

.game-button.disabled {
  background-color: #aaa;
  cursor: not-allowed;
  transform: none;
}

.picking {
  animation: picking 0.5s infinite;
}

@keyframes picking {
  0% { opacity: 0.7; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}

.result-highlight {
  animation: highlightResult 0.5s;
  border: 2px solid #ffa500;
  background-color: rgba(255, 165, 0, 0.1);
  box-shadow: 0 0 10px rgba(255, 165, 0, 0.5);
}

@keyframes highlightResult {
  0% { transform: scale(1); background-color: rgba(255, 165, 0, 0); }
  50% { transform: scale(1.05); background-color: rgba(255, 165, 0, 0.2); }
  100% { transform: scale(1); background-color: rgba(255, 165, 0, 0.1); }
}

.ad-container {
  background-color: #111;
  color: #fff;
  padding: 25px;
  text-align: center;
  margin-bottom: 30px;
}

body.light .ad-container {
  background-color: #fff;
  color: #000;
}

.ad-container h3 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 1.4em;
  color: #fff;
}

body.light .ad-container h3 {
  color: #000;
}

.ad-placeholder {
  border: 2px dashed #444;
  padding: 30px;
  margin: 15px 0;
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.05);
}

body.light .ad-placeholder {
  border: 2px dashed #ccc;
  background-color: rgba(0, 0, 0, 0.05);
}

.footer-content {
  background-color: #111;
  color: #fff;
  padding: 30px;
  margin-bottom: 30px;
  display: none; 
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.footer-content.active {
  opacity: 1;
  transform: translateY(0);
}

body.light .footer-content {
  background-color: #fff;
  color: #000;
}

.close-button {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #aaa;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
  z-index: 10;
}

.close-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

body.light .close-button:hover {
  background-color: rgba(0, 0, 0, 0.1);
  color: #000;
}

.contact-form {
  max-width: 600px;
  margin: 20px auto;
  text-align: left;
}

.contact-info {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #333;
  font-size: 0.9em;
}

body.light .contact-info {
  border-top: 1px solid #ddd;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #444;
  border-radius: 8px;
  background-color: #222;
  color: #fff;
  font-family: inherit;
}

body.light .form-group input,
body.light .form-group textarea {
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  color: #000;
}

.terms-content, 
.privacy-content, 
.about-content {
  text-align: left;
  line-height: 1.6;
  font-size: 0.9em;
}

.terms-content h3, 
.privacy-content h3 {
  margin-top: 25px;
  font-size: 1.2em;
}

.effective-date {
  font-style: italic;
  color: #999;
  margin-bottom: 20px;
}

body.light .effective-date {
  color: #666;
}

.privacy-content ul {
  padding-left: 20px;
  margin: 15px 0;
}

.privacy-content li {
  margin-bottom: 5px;
}

/* Newsletter */
#mc_embed_signup {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

#mc_embed_signup form {
  padding: 10px 0;
}

#mc_embed_signup h2 {
  font-size: 1.4em;
  margin-bottom: 15px;
  color: #ffa500;
}

body.light #mc_embed_signup h2 {
  color: #ff8800;
}

#mc_embed_signup .mc-field-group label {
  margin-bottom: 8px;
  display: block;
  font-weight: bold;
}

#mc_embed_signup .indicates-required {
  text-align: right;
  font-size: 0.85em;
  margin-bottom: 10px;
}

#mc_embed_signup .asterisk {
  color: #ffa500;
  font-size: 1.2em;
}

#mc_embed_signup .button {
  background-color: #ffa500;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: normal;
  height: auto;
  line-height: 1.5;
  margin: 15px 0 0 0;
}

#mc_embed_signup .button:hover {
  background-color: #ff8800;
  transform: scale(1.05);
}

/* Response messages */
#mc_embed_signup #mce-success-response {
  color: #4CAF50;
}

#mc_embed_signup #mce-error-response {
  color: #f44336;
}

#mc_embed_signup .age-verification-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
  width: 100%;
}

#mc_embed_signup .input-group {
  padding-bottom: 2%;
  width: 100%;
}

#mc_embed_signup .mc-field-group.input-group {
  padding-left: 0;
  padding-right: 0;
  width: 100%;
}

#mc_embed_signup .age-verification-checkbox input[type="checkbox"] {
  margin-right: 10px;
  margin-left: 0; 
}

/* Contact */
#contact-feedback {
  margin-bottom: 15px;
  padding: 10px 15px;
  border-radius: 8px;
  font-weight: bold;
}

#contact-feedback.success {
  background-color: rgba(76, 175, 80, 0.2);
  color: #4CAF50;
  border: 1px solid #4CAF50;
}

#contact-feedback.error {
  background-color: rgba(244, 67, 54, 0.2);
  color: #f44336;
  border: 1px solid #f44336;
}

.asterisk {
  color: #ffa500;
  font-size: 1.2em;
}

.content img {
  max-width: 100%;
  height: auto;
}

.content h2 img {
  max-width: 90%;
  max-height: 150px;
  object-fit: contain;
}

.notification {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: #fff;
  padding: 15px;
  border-radius: 5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  z-index: 1000;
}

.notification.show {
  opacity: 1;
  pointer-events: auto;
}

.cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 250px;
  background-color: #333;
  color: #fff;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transition: all 0.3s ease;
  font-size: 0.9em;
}

body.light .cookie-banner {
  background-color: #f5f5f5;
  color: #000;
}

.cookie-banner button {
  margin: 5px 5px 0 0;
  padding: 5px 10px;
  background-color: #555;
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 5px;
  font-size: 0.85em;
  transition: background-color 0.3s ease;
}

body.light .cookie-banner button {
  background-color: #ddd;
  color: #000;
}

.cookie-banner button:hover {
  background-color: #777;
}

body.light .cookie-banner button:hover {
  background-color: #ccc;
}

.cookie-banner a {
  color: #ffa500;
  text-decoration: underline;
  margin-right: 5px;
  font-size: 0.85em;
}

body.light .cookie-banner a {
  color: #ff8800;
}

@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .header-right {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .logo {
    font-size: 1.5em;
  }

  .navbar {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .navbar button {
    font-size: 1.1em;
    padding: 6px 10px;
  }

  .content {
    font-size: 1.2em;
    padding: 30px 15px;
  }

  .footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }
  
  .reel-wrapper {
    height: 100px;
  }
  
  .tile {
    min-width: 120px;
    width: 120px;
    height: 80px;
    margin: 10px 3px;
    font-size: 12px;
  }
  
  .selector {
    top: 10px;
    height: calc(100% - 20px);
  }

  .ad-container,
  .footer-content {
    padding: 20px 15px;
  }
  
  .contact-form {
    padding: 0 10px;
  }
  
  .close-button {
    top: 10px;
    right: 10px;
  }
  
  .terms-content, 
  .privacy-content, 
  .about-content {
    font-size: 0.85em;
  }

  .ad-box-container {
    min-width: 200px;
    margin: 5px 0;
    width: 100%;
    max-width: 300px;
  }
  
  .ad-box {
    height: 100px;
  }
  
  .content h2 img {
    max-height: 100px;
  }

  .cookie-banner {
    width: 90%;
    left: 5%;
    bottom: 15px;
  }

  .notification {
    width: 15%;
    left: 5%;
    transform: none;
  }

  #mc_embed_signup .mc-field-group {
    padding-bottom: 10px;
    min-height: auto;
  }
  
  #mc_embed_signup .indicates-required {
    text-align: left;
  }
  
  #mc_embed_signup h2 {
    font-size: 1.2em;
  }
}