:root {
  --studio-bg: #0B0813;
  --studio-vignette: #170F26;
  --studio-fg: #F3EDE3;
  --studio-muted: #9C90AE;
  --studio-line: rgba(243, 237, 227, 0.12);

  --ink: #170F2C;
  --ink-soft: #221936;
  --ink-box: #1E1533;
  --paper: #F3EDE3;
  --paper-dim: rgba(243, 237, 227, 0.58);
  --paper-faint: rgba(243, 237, 227, 0.16);

  --orange: #EE8B57;
  --mauve: #C98599;
  --violet: #8A6FD1;

  --grad: linear-gradient(128deg, #F0955E 0%, #E68C6C 28%, #C4849A 56%, #8E6FC8 82%, #7C63BE 100%);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse 900px 560px at 50% -8%, var(--studio-vignette) 0%, var(--studio-bg) 62%), var(--studio-bg);
  color: var(--studio-fg);
  font-family: 'Manrope', system-ui, sans-serif;
  padding: 32px 16px 56px;
}

.wrap {
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* ---- login / search screen ---- */

.brandline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.brandline .logos {
  display: flex;
  align-items: center;
  gap: 18px;
}
.brandline .logos img { display: block; }
.brandline .logo-2day { height: 30px; filter: brightness(0) invert(1); opacity: 0.92; }
.brandline .logo-finboo { height: 15px; opacity: 0.8; }
.brandline h1 {
  margin: 0;
  font-family: 'Hina Mincho', Georgia, 'Times New Roman', serif;
  font-weight: 400;
  font-size: 24px;
  letter-spacing: 0.03em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-wrap: balance;
}

.login-card {
  width: 100%;
  background: var(--ink-soft);
  border: 1px solid var(--paper-faint);
  border-radius: 18px;
  padding: 22px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
/* An unconditioned `display` on an author rule always outranks the
   browser's default `[hidden] { display: none }`, regardless of
   selector specificity - so `.hidden = true` from JS silently did
   nothing here. This restores it. */
.login-card[hidden] { display: none; }
.login-card label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--studio-muted);
  font-weight: 700;
}
.search-box { position: relative; }
.search-box input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 11px;
  border: 1px solid var(--paper-faint);
  background: var(--ink);
  color: var(--paper);
  font-size: 16px;
  font-family: 'Manrope', sans-serif;
  outline: none;
}
.search-box input:focus { border-color: var(--violet); }
.suggestions {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 6px);
  background: var(--ink);
  border: 1px solid var(--paper-faint);
  border-radius: 11px;
  overflow: hidden;
  z-index: 5;
  box-shadow: 0 14px 30px -10px rgba(0,0,0,0.6);
}
.suggestions button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--paper-faint);
  color: var(--paper);
  font-family: 'Manrope', sans-serif;
  font-size: 14.5px;
  cursor: pointer;
}
.suggestions button:last-child { border-bottom: none; }
.suggestions button:hover, .suggestions button:focus { background: var(--ink-box); }
.suggestions .hint { font-size: 11px; color: var(--studio-muted); }
.suggestions .taken { font-size: 10px; color: var(--orange); text-transform: uppercase; letter-spacing: 0.06em; }
.empty-hint {
  font-size: 12.5px;
  color: var(--studio-muted);
  padding: 2px 2px 0;
}
.status-msg {
  font-size: 13px;
  color: var(--orange);
  min-height: 1em;
}

/* ---- the card (guest view, after check-in) ---- */

.card {
  width: 320px;
  max-width: 100%;
  background: var(--ink);
  border-radius: 22px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 2px 2px rgba(0,0,0,0.25), 0 30px 60px -18px rgba(0,0,0,0.75), 0 12px 28px -10px rgba(138,111,209,0.35);
  display: flex;
  flex-direction: column;
}
.card::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 0.75px solid rgba(243,237,227,0.14);
  border-radius: 15px;
  pointer-events: none;
}
.masthead {
  background: var(--grad);
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}
.masthead .logos { display: flex; align-items: center; justify-content: space-between; }
.masthead .logos img { display: block; height: 22px; width: auto; }
.masthead .logo-2day { height: 38px; filter: brightness(0) invert(1); opacity: 0.96; }
.masthead .logo-finboo { height: 16px; opacity: 0.96; }
.masthead .title {
  text-align: center;
  font-family: 'Hina Mincho', Georgia, 'Times New Roman', serif;
  font-weight: 400;
  font-size: 20px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1B1130;
  text-shadow: 0 1px 0 rgba(255,255,255,0.18);
}
.guest-name {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(27,17,48,0.72);
  font-weight: 700;
  margin-top: -4px;
}

.body {
  flex: 1;
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.qbox {
  border: 1px solid var(--paper-faint);
  background: var(--ink-box);
  border-radius: 11px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.qbox .chip {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1.4px solid var(--chip-color, var(--orange));
  color: var(--chip-color, var(--orange));
  font-weight: 800;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.qbox p { margin: 0; font-size: 13.5px; line-height: 1.38; color: var(--paper); font-weight: 500; }
.qbox-partner { display: block; margin-top: 2px; font-size: 11px; font-weight: 500; color: var(--studio-muted); }
.qbox.bonus {
  border-color: rgba(138,111,209,0.55);
  background: linear-gradient(135deg, rgba(138,111,209,0.16), rgba(30,21,51,0.4));
}
.qbox.bonus .chip {
  width: auto; max-width: 60px; height: auto; min-height: 24px;
  border-radius: 12px; padding: 5px 8px;
  background: var(--violet); border-color: var(--violet); color: var(--ink);
  font-size: 9.5px; line-height: 1.2; letter-spacing: 0.02em; text-transform: uppercase;
  white-space: normal; text-align: center;
}
.qbox.bonus.pending p { color: var(--paper-dim); font-style: italic; }

.rules {
  flex-shrink: 0;
  padding: 13px 16px 17px;
  border-top: 1px solid var(--paper-faint);
}
.rules .label {
  font-family: 'Hina Mincho', Georgia, 'Times New Roman', serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0 0 7px;
}
.rules ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.rules li { display: flex; align-items: flex-start; gap: 7px; font-size: 11.5px; line-height: 1.35; color: var(--paper-dim); }
.rules li::before { content: ""; width: 6px; height: 6px; margin-top: 3.5px; flex-shrink: 0; background: var(--tick, var(--orange)); border-radius: 1.5px; }

.footer-note {
  font-size: 11.5px;
  color: var(--studio-muted);
  text-align: center;
}

@media (max-width: 400px) {
  .card { width: 100%; }
}

/* ---- waiting-for-start screen ---- */
.waiting-card {
  width: 100%;
  background: var(--ink-soft);
  border: 1px solid var(--paper-faint);
  border-radius: 18px;
  padding: 30px 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.waiting-card .pulse-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--violet);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}
.waiting-card h2 {
  margin: 4px 0 0;
  font-family: 'Hina Mincho', Georgia, serif;
  font-weight: 400;
  font-size: 19px;
  color: var(--paper);
}
.waiting-card p { margin: 0; font-size: 13px; color: var(--paper-dim); line-height: 1.5; }
.waiting-card .relogin-btn {
  margin-top: 6px;
  background: none;
  border: none;
  color: var(--studio-muted);
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  padding: 4px;
}
.waiting-card .relogin-btn:hover { color: var(--paper-dim); }

/* ---- live round / timer screen ---- */
.session {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.timer-ring {
  position: relative;
  width: 168px; height: 168px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.timer-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.timer-ring circle.track { fill: none; stroke: var(--paper-faint); stroke-width: 5; }
.timer-ring circle.progress {
  fill: none;
  stroke: var(--phase-color, var(--violet));
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.3s linear;
}
.timer-ring .inner { text-align: center; }
.timer-ring .time {
  font-variant-numeric: tabular-nums;
  font-size: 34px;
  font-weight: 800;
  color: var(--paper);
  line-height: 1;
}
.timer-ring .round-lbl {
  margin-top: 4px;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--studio-muted);
}

.phase-label {
  text-align: center;
  font-family: 'Hina Mincho', Georgia, serif;
  font-weight: 400;
  font-size: 24px;
  letter-spacing: 0.03em;
  color: var(--phase-color, var(--violet));
  text-wrap: balance;
}
.phase-hint {
  margin: -10px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--paper-dim);
  max-width: 320px;
}

.active-question {
  width: 100%;
  border: 1.4px solid var(--phase-color, var(--violet));
  background: var(--ink-soft);
  border-radius: 16px;
  padding: 20px 18px;
  text-align: center;
}
.active-question p {
  margin: 0;
  font-size: 17px;
  line-height: 1.4;
  color: var(--paper);
  font-weight: 600;
}
.active-question.bonus-box p { font-size: 15.5px; }
.active-question .waiting-note { font-style: italic; color: var(--paper-dim); font-size: 14px; font-weight: 500; }

.partner-input-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.partner-input-wrap label {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--studio-muted);
  font-weight: 700;
}
.partner-input-wrap input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--paper-faint);
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  font-family: 'Manrope', sans-serif;
}
.partner-input-wrap input:focus { border-color: var(--violet); }

.recap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.recap .recap-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--paper-faint);
  border-radius: 10px;
  background: var(--ink-box);
  opacity: 0.55;
}
.recap .recap-item .n {
  flex-shrink: 0;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1px solid var(--paper-faint);
  color: var(--studio-muted);
  font-size: 10px;
  display: flex; align-items: center; justify-content: center;
}
.recap .recap-item p { margin: 0; font-size: 12px; color: var(--paper-dim); }
.recap-partner { color: var(--studio-muted); }

/* ---- end screen ---- */
.end-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}
.end-card .end-title {
  font-family: 'Hina Mincho', Georgia, serif;
  font-weight: 400;
  font-size: 30px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.end-card .end-sub { margin-top: -10px; font-size: 13px; color: var(--paper-dim); text-align: center; }
