/* Kiosk tablet UI — dark evening-ritual palette: charcoal base, amber primary, teal accent. */

:root {
  --bg: #131722;
  --bg-card: #1d2330;
  --bg-raised: #262e3f;
  --text: #f3f4f6;
  --text-dim: #9aa3b5;
  --primary: #fbbf24;       /* amber */
  --primary-ink: #1a1405;
  --accent: #2dd4bf;        /* teal */
  --correct: #34d399;
  --line: #313a4e;
  --radius: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: "Cairo", system-ui, sans-serif;
  background: radial-gradient(1200px 700px at 70% -10%, #1d2638 0%, var(--bg) 60%);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.kiosk {
  width: 100%;
  max-width: 1100px;
  min-height: 700px;
  position: relative;
  display: flex;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  animation: screen-in 320ms ease both;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

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

.screen-title { font-size: 44px; font-weight: 900; text-align: center; }
.screen-sub { font-size: 19px; color: var(--text-dim); text-align: center; margin-top: 10px; max-width: 620px; align-self: center; }

.btn-primary {
  font: inherit; font-weight: 800; font-size: 19px;
  background: var(--primary); color: var(--primary-ink);
  border: none; border-radius: 16px;
  padding: 16px 34px; cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
  box-shadow: 0 6px 24px rgba(251, 191, 36, 0.25);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(251, 191, 36, 0.35); }
.btn-primary:active { transform: translateY(0); }
.btn-xl { font-size: 23px; padding: 20px 44px; }

.btn-ghost {
  font: inherit; font-weight: 700; font-size: 17px;
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 22px; cursor: pointer;
  transition: color 160ms, border-color 160ms;
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-dim); }

.back-btn { position: absolute; top: 0; inset-inline-start: 0; }

.avatar {
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; color: #10131b;
  flex-shrink: 0;
  transition: opacity 200ms;
}
.avatar-dimmed { opacity: 0.32; }

.streak-flame {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 999px; padding: 12px 22px;
}
.flame-icon { font-size: 26px; }
.flame-value { font-size: 30px; font-weight: 900; color: var(--primary); }
.flame-label { font-size: 15px; color: var(--text-dim); max-width: 90px; line-height: 1.2; }

/* ---------- idle ---------- */

.idle-header { display: flex; justify-content: space-between; align-items: center; }
.idle-date { color: var(--text-dim); font-size: 18px; font-weight: 700; }
.idle-family { font-size: 40px; font-weight: 900; }

.idle-question-card {
  margin: 36px 0 28px;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-align: center;
}
.idle-pack-tag {
  font-size: 14px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  color: var(--accent); background: rgba(45, 212, 191, 0.1);
  border: 1px solid rgba(45, 212, 191, 0.35);
  padding: 6px 14px; border-radius: 999px;
}
.idle-live { display: flex; align-items: center; gap: 10px; font-size: 26px; font-weight: 900; }
.live-dot {
  width: 12px; height: 12px; border-radius: 50%; background: var(--correct);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
  50% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); }
}
.idle-hint { color: var(--text-dim); font-size: 17px; }

.idle-members { display: flex; gap: 16px; justify-content: center; }
.idle-member {
  flex: 1; max-width: 170px;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: border-color 200ms;
}
.idle-member.is-done { border-color: rgba(52, 211, 153, 0.45); }
.idle-member-name { font-weight: 800; font-size: 18px; }
.idle-member-state { font-size: 14px; color: var(--text-dim); }
.idle-member-state.ok { color: var(--correct); font-weight: 700; }

.idle-footer {
  margin-top: auto; padding-top: 26px;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--text-dim); font-size: 16px;
}

/* ---------- member select ---------- */

.select-screen { position: relative; justify-content: center; gap: 8px; }
.select-grid { display: flex; gap: 18px; justify-content: center; margin-top: 38px; }
.select-card {
  font: inherit; color: var(--text);
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px 18px;
  width: 180px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms, background 180ms;
}
.select-card:hover:not(:disabled) { transform: translateY(-6px); border-color: var(--primary); background: var(--bg-raised); }
.select-card:disabled { cursor: default; opacity: 0.6; }
.select-name { font-size: 22px; font-weight: 900; }
.select-role { font-size: 15px; color: var(--text-dim); }
.select-locked { font-size: 14px; font-weight: 800; color: var(--correct); }

/* ---------- ready + question ---------- */

.ready-screen { align-items: center; justify-content: center; gap: 18px; }

.question-screen { gap: 30px; }
.question-top { display: flex; align-items: center; justify-content: space-between; }
.question-who { display: flex; align-items: center; gap: 12px; font-size: 21px; font-weight: 800; }

.countdown-ring { position: relative; width: 128px; height: 128px; }
.ring-track { fill: none; stroke: var(--line); stroke-width: 10; }
.ring-fill {
  fill: none; stroke: var(--primary); stroke-width: 10; stroke-linecap: round;
  transition: stroke-dashoffset 120ms linear, stroke 300ms;
}
.countdown-urgent .ring-fill { stroke: #f87171; }
.ring-number {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 44px; font-weight: 900;
}
.countdown-urgent .ring-number { color: #f87171; animation: tick 1s infinite; }
@keyframes tick { 50% { transform: scale(1.12); } }

.question-text { font-size: 42px; font-weight: 900; text-align: center; max-width: 850px; align-self: center; }

.options-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
  max-width: 860px; width: 100%; align-self: center;
}
.option-btn {
  font: inherit; font-size: 24px; font-weight: 800; color: var(--text);
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 24px;
  display: flex; align-items: center; gap: 16px;
  cursor: pointer; text-align: start;
  transition: transform 140ms ease, border-color 140ms, background 140ms;
}
.option-btn:hover { transform: scale(1.02); border-color: var(--primary); background: var(--bg-raised); }
.option-letter {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: var(--bg-raised); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; color: var(--text-dim);
}

/* ---------- locked ---------- */

.locked-screen { align-items: center; justify-content: center; gap: 16px; }
.locked-badge { font-size: 72px; animation: pop-in 420ms cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes pop-in { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.locked-progress { display: flex; gap: 12px; margin-top: 14px; }
.locked-count { color: var(--text-dim); font-weight: 700; }

/* ---------- reveal ---------- */

.reveal-screen { gap: 22px; align-items: center; }
.reveal-options { width: 100%; max-width: 760px; display: flex; flex-direction: column; gap: 12px; }
.reveal-option {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  font-size: 22px; font-weight: 800;
  animation: screen-in 400ms ease both;
}
.reveal-option.is-correct {
  border-color: var(--correct);
  background: rgba(52, 211, 153, 0.1);
  box-shadow: 0 0 30px rgba(52, 211, 153, 0.15);
}
.reveal-option-text { display: flex; align-items: center; gap: 12px; }
.reveal-check { color: var(--correct); font-size: 26px; }
.reveal-pickers { display: flex; gap: 10px; }
.reveal-picker { display: flex; align-items: center; gap: 6px; }
.reveal-points { font-size: 16px; font-weight: 900; color: var(--correct); }
.reveal-missed { color: var(--text-dim); font-size: 17px; }
.reveal-fact {
  max-width: 700px; text-align: center;
  background: var(--bg-card); border: 1px dashed var(--line);
  border-radius: var(--radius); padding: 18px 26px;
  color: var(--text-dim); font-size: 17px; line-height: 1.5;
}
.fact-tag { color: var(--accent); font-weight: 900; margin-right: 6px; }
.reveal-actions { display: flex; gap: 14px; margin-top: 6px; }

/* ---------- recap ---------- */

.recap-screen { position: relative; gap: 8px; align-items: center; }
.recap-board { width: 100%; max-width: 700px; display: flex; flex-direction: column; gap: 10px; margin-top: 26px; }
.recap-row {
  display: flex; align-items: center; gap: 16px;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 22px;
}
.recap-row.is-leader { border-color: var(--primary); box-shadow: 0 0 26px rgba(251, 191, 36, 0.12); }
.recap-rank { font-size: 21px; font-weight: 900; color: var(--text-dim); width: 28px; }
.recap-row.is-leader .recap-rank { color: var(--primary); }
.recap-name { font-size: 21px; font-weight: 800; flex: 1; }
.recap-streak { color: var(--text-dim); font-weight: 700; }
.recap-points { font-size: 21px; font-weight: 900; color: var(--primary); width: 90px; text-align: end; }

.recap-awards { display: flex; gap: 14px; margin-top: 24px; }
.award-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 20px;
}
.award-icon { font-size: 30px; }
.award-title { font-weight: 900; font-size: 16px; }
.award-detail { color: var(--text-dim); font-size: 14px; margin-top: 2px; }

/* ---------- demo controls (PoC only) ---------- */

.demo-pill { position: fixed; bottom: 16px; right: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.demo-toggle {
  font: inherit; font-size: 13px; font-weight: 700;
  background: rgba(29, 35, 48, 0.85); color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; cursor: pointer; backdrop-filter: blur(6px);
}
.demo-actions { display: flex; flex-direction: column; gap: 6px; }
.demo-actions button {
  font: inherit; font-size: 13px; font-weight: 700;
  background: var(--bg-raised); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 14px; cursor: pointer;
}
.demo-actions button:disabled { opacity: 0.4; cursor: default; }
