/* Override global scroll/bg for this page */
html, body {
  height: 100%;
  background-color: #b8dbd8;
  overflow: hidden;
}

/* On mobile allow scrolling when result is shown */
@media (max-width: 699px) {
  html, body {
    overflow: auto;
  }
}

#heading {
  background-color: #f7fff7;
}

/* ── Layout ─────────────────────────────────────────────────────────────────── */

#ikvall-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: calc(100dvh - var(--heading-h, 60px));
  overflow: hidden;
}

@media (max-width: 699px) {
  #ikvall-wrapper {
    height: auto;
    min-height: calc(100dvh - var(--heading-h, 60px));
    overflow: visible;
  }
}

#ikvall-title {
  font-size: 2em;
  padding: 0.25em 0;
  flex-shrink: 0;
}

#game-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  flex: 1;
  min-height: 0;
}

/* Desktop: canvas left, result right */
@media (min-width: 700px) {
  #game-area {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 2em;
    padding: 0 1.5em;
  }

  #result {
    width: 280px;
    flex-shrink: 0;
    overflow: auto;
    max-height: 80dvh;
  }

  #result-img {
    max-width: 140px;
    max-height: 140px;
  }
}

/* Mobile: stacked result — scrolls with the page */
@media (max-width: 699px) {
  #game-area {
    overflow: visible;
  }

  #result {
    width: calc(100vw - 2em);
    margin: 0.75em auto 1em;
    overflow: visible;
  }

  #result-name {
    font-size: 1.5em !important;
  }

  #result-img {
    max-width: 100px !important;
    max-height: 100px !important;
    float: left;
    margin: 0 0.75em 0.5em 0;
  }

  #result-desc {
    font-size: 0.9em !important;
    margin: 0.2em 0 !important;
  }

  #result-details {
    font-size: 0.95em !important;
  }
}

/* ── Wheel column ─────────────────────────────────────────────────────────── */

#wheel-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

#wheel-canvas {
  display: block;
}

#controls {
  margin: 0.8em auto 0;
  display: flex;
  justify-content: center;
  gap: 0.8em;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

#spin-btn,
#reshuffle-btn {
  font-family: "Redressed", cursive;
  font-size: 1.6em;
  padding: 0.25em 0.9em;
  border: 3px solid #1a535c;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

#spin-btn {
  background-color: #1a535c;
  color: #f7fff7;
}

#spin-btn:hover:not(:disabled) {
  background-color: #4ecdc4;
  border-color: #4ecdc4;
  color: #1a535c;
}

#spin-btn:disabled,
#reshuffle-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#reshuffle-btn {
  background-color: #f7fff7;
  color: #1a535c;
}

#reshuffle-btn:hover:not(:disabled) {
  background-color: #1a535c;
  color: #f7fff7;
}

/* ── Result card ─────────────────────────────────────────────────────────── */

#result {
  padding: 0.75em 1em;
  border: 3px solid #f4a261;
  border-radius: 12px;
  background-color: #fffdf9;
  animation: fadeIn 0.4s ease;
  box-sizing: border-box;
}

#result.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

#result-name {
  font-size: 1.8em;
  color: #1a535c;
  margin-bottom: 0.15em;
}

#result-img {
  max-width: 180px;
  max-height: 180px;
  margin: 0.4em auto;
  display: block;
}

#result-desc {
  font-size: 1em;
  color: #333;
  margin: 0.3em 0;
  line-height: 1.4;
}

#result-details {
  font-size: 1em;
  font-weight: bold;
  color: #1a535c;
  margin: 0.3em 0;
}

#result-link {
  display: inline-block;
  margin-top: 0.4em;
  font-size: 1.1em;
  color: #1a535c;
  text-decoration: underline;
}
