/* Ranna Studios — Spin The Wheel: Colors
 *
 * THE INTERFACE is Ranna, and only Ranna. Every value below is one of the six
 * brand colours, a tint of one over the background, or plain white. The tint
 * steps mirror the 20/40/60/80% ramps on the brand sheet.
 *
 *   Ember Dawn        #FB9203     Veil of Becoming  #68097D
 *   Burnt Horizon     #E3500A     Dusk Matter       #3F184D
 *   Crimson Bloom     #C91B7A     Abyssal Black     #080035
 *
 * THE CIRCLE COLOURS are not, deliberately. They live in src/config.js and are
 * plain primaries — red, blue, yellow, green - because they are wayfinding, not
 * branding: a guest has to spot their circle across a dark room and say its
 * name to a stranger. They arrive as inline styles from the server, so nothing
 * in this file should ever try to define one.
 *
 * Type: Prompt for display, Poppins for everything that has to be read.
 */

:root {
  --ember: #FB9203;
  --burnt: #E3500A;
  --crimson: #C91B7A;
  --veil: #68097D;
  --dusk: #3F184D;
  --abyss: #080035;

  /* Surfaces: Dusk Matter laid over Abyssal Black at brand tint steps. */
  --bg: #080035;
  --surface: #180B3D;
  --surface-2: #241247;
  --line: rgba(251, 146, 3, 0.16);
  --line-soft: rgba(255, 255, 255, 0.10);

  --text: #FFFFFF;
  --muted: rgba(255, 255, 255, 0.62);
  --faint: rgba(255, 255, 255, 0.38);

  --radius: 18px;
  --shadow: 0 18px 50px rgba(8, 0, 53, 0.6);

  --display: 'Prompt', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}

body {
  display: flex;
  flex-direction: column;
  /* A wash of Veil and Crimson so the black is never flat. */
  background-image:
    radial-gradient(90vw 60vh at 12% -8%, rgba(104, 9, 125, 0.55), transparent 62%),
    radial-gradient(70vw 46vh at 96% 4%, rgba(201, 27, 122, 0.28), transparent 60%);
  background-attachment: fixed;
}

h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.015em; line-height: 1.1; }

/* --- shared --------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 20px calc(28px + env(safe-area-inset-bottom));
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* The lockup stacks "Ranna / Studios" beside the mark, so it needs a little
   more height than a single-line wordmark to stay readable. Phone default;
   the console and the projector scale it up for their viewing distance. */
.brand-logo { display: flex; align-items: center; height: 32px; }
.brand-logo img { height: 100%; width: auto; display: block; }
/* Until the real asset is dropped in, a wordmark stands in. */
.brand-logo .wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--text);
}
.brand-logo .wordmark b { color: var(--ember); font-weight: 700; }

.eyebrow {
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ember);
  font-weight: 600;
}

.muted { color: var(--muted); }
.center { text-align: center; }

button {
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  border: 0;
  border-radius: 999px;
  padding: 16px 26px;
  background: var(--ember);
  color: var(--abyss);
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}
button:active { transform: scale(0.97); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
button.block { width: 100%; }

input, select {
  width: 100%;
  font-family: var(--font);
  font-size: 16px; /* 16px stops iOS zooming on focus */
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 15px 16px;
  outline: none;
  transition: border-color 0.15s ease;
}
input::placeholder { color: var(--faint); }
input:focus, select:focus { border-color: var(--ember); }
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 7px 2px;
}
.field { margin-bottom: 15px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 18px;
}

/* --- sound toggle --------------------------------------------------------- */

.sound-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  letter-spacing: 0.04em;
}
.sound-btn.on { color: var(--ember); border-color: rgba(251, 146, 3, 0.5); }

/* --- screens -------------------------------------------------------------- */

.screen { display: none; flex: 1; flex-direction: column; }
.screen.on { display: flex; animation: rise 0.4s ease both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* --- join ----------------------------------------------------------------- */

.hero-title { font-size: 36px; margin: 24px 0 6px; }
.hero-title span { color: var(--ember); display: block; }
.hero-sub { color: var(--muted); margin-bottom: 24px; font-size: 15px; }
.consent { font-size: 12px; color: var(--faint); margin-top: 14px; line-height: 1.5; }

/* --- wheel ---------------------------------------------------------------- */

.wheel-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 10px 0;
}

.wheel-holder { position: relative; width: min(78vw, 320px); aspect-ratio: 1; }

.wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transform: rotate(0deg);
  filter: drop-shadow(0 14px 34px rgba(8, 0, 53, 0.75));
}
.wheel.spinning { transition: transform 4.6s cubic-bezier(0.13, 0.85, 0.16, 1); }

.wheel-hub {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 22%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--abyss);
  border: 4px solid var(--dusk);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--ember);
}

.pointer {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 26px solid var(--ember);
  filter: drop-shadow(0 3px 6px rgba(8, 0, 53, 0.7));
  z-index: 2;
}

.tap-hint { font-size: 14px; color: var(--muted); }

/* --- result --------------------------------------------------------------- */

.result-color {
  border-radius: var(--radius);
  padding: 26px 20px;
  text-align: center;
  box-shadow: var(--shadow);
  animation: pop 0.5s cubic-bezier(0.2, 1.2, 0.3, 1) both;
}

@keyframes pop {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: none; }
}

.result-label { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.75; font-weight: 600; font-family: var(--display); }
.result-name { font-family: var(--display); font-size: 40px; font-weight: 700; letter-spacing: -0.02em; margin: 4px 0; line-height: 1.05; }
.result-huddle { font-size: 15px; font-weight: 500; opacity: 0.85; }

.timer-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 18px 0 8px;
}
.timer { font-family: var(--display); font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.timer.urgent { color: var(--ember); }

.bar { height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--crimson), var(--ember)); border-radius: 3px; transition: width 1s linear; }

.question {
  margin-top: 16px;
  border-left: 3px solid var(--ember);
  padding: 4px 0 4px 14px;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.4;
}

.people { list-style: none; margin-top: 12px; display: grid; gap: 8px; }
.person {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  padding: 11px 13px;
}
.avatar {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
}
.person-name { font-weight: 600; font-size: 15px; }
.person-meta { font-size: 12.5px; color: var(--muted); }

.stat-strip { display: flex; gap: 10px; margin-top: 16px; }
.stat {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  padding: 12px;
  text-align: center;
}
.stat b { display: block; font-family: var(--display); font-size: 24px; font-weight: 700; color: var(--ember); }
.stat span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }

/* --- move overlay --------------------------------------------------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(8, 0, 53, 0.95);
  backdrop-filter: blur(8px);
  text-align: center;
  padding: 30px;
}
.overlay.on { display: flex; animation: rise 0.3s ease both; }
.overlay h2 { font-size: 42px; color: var(--ember); }
.overlay p { color: var(--muted); max-width: 22ch; }

.pulse { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.05); } }

/* --- misc ----------------------------------------------------------------- */

.notice { margin-top: auto; font-size: 13px; color: var(--faint); text-align: center; padding-top: 18px; }

/* Centred under every screen. Ember, but held back to about two thirds so it
   reads as a signature at the foot of the page rather than a call to action. */
.site-foot {
  padding: 26px 0 2px;
  text-align: center;
}
.site-foot a {
  display: inline-block;
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 400;
  color: var(--ember);
  opacity: 0.7;
  text-decoration: none;
  transition: opacity 0.18s ease;
}
.site-foot a:hover,
.site-foot a:active { opacity: 1; }

.offline {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--burnt);
  color: #FFFFFF;
  font-size: 12.5px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  display: none;
  z-index: 50;
}
.offline.on { display: block; }

@media (prefers-reduced-motion: reduce) {
  .wheel.spinning { transition-duration: 0.6s; }
  .screen.on, .result-color, .overlay.on { animation: none; }
  .pulse { animation: none; }
}
