/* Spin & Win — layout and UI chrome.
 * Colors/fonts come from config.js via CSS variables set in src/main.js. */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font, system-ui, sans-serif);
  background: var(--bg, #141c2e);
  color: var(--text, #fff);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
  padding: 16px;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

header { text-align: center; margin: 8px 0 4px; }
h1 { font-size: clamp(22px, 5vw, 34px); letter-spacing: 0.5px; }
#subtitle { opacity: 0.75; font-size: clamp(13px, 3vw, 16px); margin-top: 4px; }

/* embed mode (?embed=1): tight chrome for iframes */
body.embed { padding: 6px; justify-content: center; }
body.embed header { display: none; }
body.embed #wheel-wrap { margin: 4px 0; }
body.embed #wheel-box { width: min(96vw, 92dvh, 480px); height: min(96vw, 92dvh, 480px); }
body.embed #mute-btn { right: 8px; top: 8px; width: 34px; height: 34px; font-size: 16px; }

#wheel-wrap { position: relative; margin: 18px 0 8px; }

#wheel-box {
  width: min(92vw, 62dvh, 480px);
  height: min(92vw, 62dvh, 480px);
}

#spin-btn {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 22%; height: 22%;
  border-radius: 50%;
  border: 0;
  background: var(--primary);
  color: #1a1a2a;
  font-family: inherit;
  font-size: clamp(14px, 3.4vw, 22px);
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  transition: transform 0.1s;
}
#spin-btn:active { transform: translate(-50%, -50%) scale(0.94); }
#spin-btn:disabled { filter: grayscale(0.9); cursor: default; }

#status { min-height: 22px; font-size: 14px; opacity: 0.85; }

#mute-btn {
  position: fixed;
  right: 14px; top: 14px;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  font-size: 20px;
  cursor: pointer;
}

/* result modal */
#modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s;
}
#modal.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
#modal .modal-card { transform: scale(0.85); transition: transform 0.25s ease; }
#modal.open .modal-card { transform: scale(1); }

.modal-card {
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 26px 22px;
  width: min(92vw, 360px);
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
#modal-title { font-size: 24px; margin-bottom: 8px; }
#modal-prize { font-size: 17px; min-height: 22px; margin-bottom: 12px; }
#modal-code-label { font-size: 13px; opacity: 0.7; }

#modal-code-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin: 8px 0 4px;
}
#modal-code {
  font: 700 20px/1 ui-monospace, monospace;
  background: rgba(255, 255, 255, 0.1);
  padding: 10px 14px;
  border-radius: 8px;
  letter-spacing: 2px;
}

.modal-card button {
  font-family: inherit;
  font-size: 15px;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
}
#modal-copy { background: rgba(255, 255, 255, 0.14); color: var(--text); }
#modal-again { background: var(--primary); color: #1a1a2a; font-weight: 700; margin-top: 14px; }
#modal-close { background: transparent; color: var(--text); opacity: 0.6; margin-top: 6px; }
