:root {
  --navy: #17367f;
  --navy-hover: #102a66;
  --navy-soft: #ebf0fb;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --line: #e3e7f0;
  --line-strong: #cfd5e3;
  --text: #111a33;
  --muted: #5f6984;
  --go: #1f9d5c;
  --go-hover: #188a50;
  --go-soft: #e7f7ee;
  --coral: #f2603a;
  --coral-soft: #fff0ea;
  --secret: #fff8e3;
  --secret-line: #f1cf6b;
  --danger: #e5484d;
  --danger-hover: #d43b40;
  --danger-soft: #fdecec;
  --radius: 24px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(17, 26, 51, .04), 0 8px 24px rgba(17, 26, 51, .06);
  --shadow-pop: 0 4px 12px rgba(17, 26, 51, .08), 0 18px 48px rgba(17, 26, 51, .14);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; }
h1 { font-size: 24px; line-height: 1.25; margin: 0 0 6px; letter-spacing: -.02em; font-weight: 800; }
h2 { font-size: 20px; line-height: 1.3; margin: 0 0 8px; letter-spacing: -.01em; font-weight: 700; }
h3 { font-size: 15px; margin: 22px 0 8px; }
p { margin: 0 0 10px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
.flag { width: 20px; height: 15px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.08); vertical-align: -2px; }

/* ------------------------------------------------------------- layout */

.screen { min-height: 100vh; min-height: 100dvh; }
.screen-center { display: grid; place-items: center; padding: 32px 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  width: 100%;
}
.card-head { margin-bottom: 4px; }
.card-head p { margin: 0; }

.logo { display: inline-flex; align-items: center; }
.logo img { height: 26px; width: auto; display: block; }
.logo-lg { justify-content: center; }
.logo-lg img { height: 36px; }

.auth-card { max-width: 420px; display: flex; flex-direction: column; gap: 18px; }
.auth-card h1 { font-size: 22px; }
.google-btn { display: flex; justify-content: center; min-height: 44px; }
.dev-form { border-top: 1px dashed var(--line-strong); padding-top: 14px; gap: 10px; }

/* ------------------------------------------------------------- forms */

.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 600; color: #3b4462; }
.field em { font-style: normal; font-weight: 400; }

input[type=text], input[type=email], input[type=number] {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 15px;
  font-weight: 400;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-soft); }

.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--navy); margin: 0; flex: none; }

.form-error {
  margin: 0; padding: 10px 12px; border-radius: 12px;
  background: var(--danger-soft); color: #b42318; font-size: 13px;
}

.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.actions-split { justify-content: space-between; align-items: center; }

/* ------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; white-space: nowrap; text-decoration: none;
  transition: background .15s, transform .05s, opacity .15s, border-color .15s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-lg { height: 54px; padding: 0 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--navy-hover); }
.btn-go { background: var(--go); color: #fff; }
.btn-go:hover:not(:disabled) { background: var(--go-hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }

.link { background: none; border: 0; padding: 0; color: var(--navy); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }
.link.danger { color: var(--danger); }

.icon-btn {
  width: 52px; height: 52px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line-strong); background: var(--surface);
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn:hover:not(:disabled) { background: var(--surface-2); }
.icon-btn[aria-pressed="false"] { background: var(--danger-soft); border-color: #f6c9ca; color: var(--danger); }
.icon-btn-sm { width: 36px; height: 36px; }
.icon-btn-sm svg { width: 16px; height: 16px; }

/* ------------------------------------------------------------- picker */

.picker { position: relative; }
.picker-box {
  display: flex; align-items: center; gap: 6px;
  min-height: 46px; padding: 0 8px 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface);
  cursor: text; transition: border-color .15s, box-shadow .15s;
}
.picker.open .picker-box { border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-soft); }
.picker-value { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 400; color: var(--text); white-space: nowrap; }
.picker-value img { width: 20px; height: 15px; border-radius: 2px; object-fit: cover; }
.picker-box .picker-input {
  flex: 1; width: auto; min-width: 60px; height: 44px; border: 0; outline: 0; padding: 0; background: transparent;
  font-size: 15px; font-weight: 400; box-shadow: none; border-radius: 0;
}
.picker-list {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px);
  max-height: 260px; overflow-y: auto; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-pop);
}
.picker-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: 9px; background: transparent; text-align: left;
  font-size: 14px; font-weight: 400;
}
.picker-item img { width: 22px; height: 16.5px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.06); }
.picker-item.active, .picker-item:hover { background: var(--navy-soft); }
.picker-empty { padding: 10px; color: var(--muted); font-size: 14px; }

/* ------------------------------------------------------------- onboarding */

.onboarding-card { max-width: 580px; }
.steps { display: flex; gap: 18px; list-style: none; padding: 0; margin: 0 0 26px; }
.steps li { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.steps li span {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--line-strong); font-size: 12px;
}
.steps li.current { color: var(--navy); }
.steps li.current span { background: var(--navy); border-color: var(--navy); color: #fff; }
.steps li.done span { background: var(--go); border-color: var(--go); color: #fff; }

.rules { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; counter-reset: rule; }
.rules li {
  counter-increment: rule; position: relative; padding: 12px 14px 12px 50px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px;
  display: flex; flex-direction: column; font-size: 14px;
}
.rules li::before {
  content: counter(rule); position: absolute; left: 14px; top: 13px;
  width: 24px; height: 24px; border-radius: 50%; background: var(--navy-soft); color: var(--navy);
  display: grid; place-items: center; font-weight: 700; font-size: 12px;
}
.rules li span { color: var(--muted); }

.quiz { display: grid; gap: 12px; }
.quiz-q { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px 8px; margin: 0; }
.quiz-q legend { font-weight: 600; padding: 0 4px; font-size: 14px; }
.quiz-q.wrong { border-color: #f3a5a7; background: var(--danger-soft); }
.quiz-opt { display: flex; align-items: center; gap: 10px; padding: 7px 4px; font-size: 14px; cursor: pointer; }
.quiz-opt input { accent-color: var(--navy); width: 17px; height: 17px; margin: 0; flex: none; }

.bullets { padding-left: 20px; color: var(--muted); margin: 14px 0 22px; }
.bullets li { margin: 4px 0; }

.test-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.pill {
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 99px;
  background: var(--navy-soft); color: var(--navy); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums;
}
.pill-warn { background: var(--coral-soft); color: var(--coral); }
.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-bottom: 22px; }
.progress div { height: 100%; width: 0; background: var(--navy); transition: width .3s; }
.test-item { min-height: 300px; }
.test-q { font-size: 20px; font-weight: 600; line-height: 1.4; margin-bottom: 18px; }
.test-options { display: grid; gap: 10px; }
.test-opt {
  text-align: left; padding: 14px 16px; border: 1.5px solid var(--line-strong); border-radius: 14px;
  background: var(--surface); font-size: 16px; transition: border-color .12s, background .12s;
}
.test-opt:hover:not(:disabled) { border-color: var(--navy); }
.test-opt.picked { border-color: var(--navy); background: var(--navy-soft); }
.test-opt:disabled:not(.picked) { opacity: .55; }
.listen { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.play-btn { height: 42px; }

.result-badge {
  width: 92px; height: 92px; border-radius: 50%; margin: 0 auto 16px;
  display: grid; place-items: center; background: var(--navy); color: #fff;
  font-size: 26px; font-weight: 800; letter-spacing: -.02em;
}
#level-result .btn { margin-top: 10px; }

/* ------------------------------------------------------------- lobby */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1120px; margin: 0 auto; padding: 18px 24px;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.online-pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 12px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 500;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--go); box-shadow: 0 0 0 3px var(--go-soft); }

.menu { position: relative; }
.avatar-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  padding: 0; overflow: hidden; display: grid; place-items: center; font-weight: 700; color: var(--navy);
}
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 230px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-pop);
  padding: 6px; display: flex; flex-direction: column;
}
.menu-head { display: flex; flex-direction: column; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-pop button, .menu-pop a {
  text-align: left; border: 0; background: transparent; padding: 9px 10px; border-radius: 10px; font-size: 14px; text-decoration: none;
}
.menu-pop button:hover:not(:disabled), .menu-pop a:hover { background: var(--navy-soft); }
.menu-pop button:disabled { color: var(--muted); }

.lobby {
  max-width: 1120px; margin: 0 auto; padding: 0 24px 48px;
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start;
}
.lobby-main { padding: 34px; }
.lobby-hello { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; font-weight: 500; }
.lane-chip {
  display: inline-flex; height: 26px; align-items: center; padding: 0 10px; border-radius: 99px;
  background: var(--navy-soft); color: var(--navy); font-size: 13px; font-weight: 700;
}
.lobby-title { font-size: 34px; letter-spacing: -.03em; margin-bottom: 8px; }

.mode { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0 18px; }
.mode-opt {
  display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px 16px;
  border: 1.5px solid var(--line-strong); border-radius: 18px; background: var(--surface);
  transition: border-color .15s, background .15s;
}
.mode-opt svg { width: 22px; height: 22px; flex: none; color: var(--navy); }
.mode-opt strong { display: block; font-size: 15px; }
.mode-opt small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.mode-opt[aria-checked="true"] { border-color: var(--navy); background: var(--navy-soft); }
.mode-opt.locked { opacity: .65; }
#lobby-idle .form-error { margin-bottom: 14px; }
#credits-line { margin: 12px 0 0; }

.search-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.search-head .spinner { flex: none; }
.search-title { font-size: 19px; font-weight: 700; margin: 0; }
.search-head p { margin: 0; }
.prep-note { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.task-card.preview { margin-bottom: 16px; background: var(--surface-2); box-shadow: none; }
.widen {
  background: var(--navy-soft); border-radius: 16px; padding: 14px 16px; margin-bottom: 14px;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start; font-size: 14px;
}
.widen p { margin: 0; }
#search-hint { margin-bottom: 14px; }

.lobby-side { display: grid; gap: 16px; }
.side-card { padding: 22px; }
.side-card h2 { font-size: 16px; margin-bottom: 4px; }
.hours { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.hours li { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.hours-time { font-weight: 600; font-variant-numeric: tabular-nums; }
.hours li.live { background: var(--go-soft); border-color: #bfe8d0; }
.hours li.live .muted { color: var(--go); font-weight: 600; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.stats-3 { grid-template-columns: repeat(3, 1fr); }
.stats div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; }
.stats strong { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; color: var(--navy); }
.stats span { color: var(--muted); font-size: 13px; }
.badges { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; gap: 6px; align-items: center; padding: 5px 10px; border-radius: 99px; background: var(--go-soft); color: #13643b; font-size: 13px; font-weight: 600; }
.badge span { opacity: .7; }
.empty { list-style: none; }
.flow { padding-left: 18px; margin: 10px 0 0; font-size: 14px; color: var(--muted); display: grid; gap: 6px; }
.flow strong { color: var(--text); }

/* ------------------------------------------------------------- task card */

.task-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.task-card h2 { font-size: 22px; letter-spacing: -.02em; margin-bottom: 6px; }
.task-card h3 { margin: 4px 0 8px; font-size: 19px; }
.task-card > p:last-child { margin-bottom: 0; }
.card-kicker { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--navy); margin-bottom: 6px; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-top .card-kicker { margin: 0; }
.swap { display: inline-block; background: var(--coral-soft); color: var(--coral); font-weight: 700; padding: 3px 10px; border-radius: 99px; font-size: 13px; white-space: nowrap; }
.secret {
  background: var(--secret); border: 1.5px dashed var(--secret-line); border-radius: 16px;
  padding: 12px 16px; margin: 12px 0 8px;
}
.secret p { margin: 4px 0 0; }
.secret-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #94680a; }
.secret .big { font-size: 18px; font-weight: 700; line-height: 1.35; }
/* "This or that": the two sides next to each other. */
.options { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 8px; margin: 12px 0 6px; }
.option {
  display: flex; align-items: center; padding: 12px 14px; border-radius: 14px;
  background: var(--navy-soft); color: #1d2f63; font-weight: 700; font-size: 15px; line-height: 1.35;
}
.option-or { align-self: center; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.questions { padding-left: 22px; margin: 10px 0 4px; display: grid; gap: 8px; font-size: 16px; }
.questions li::marker { color: var(--navy); font-weight: 700; }
.sides { padding-left: 20px; margin: 4px 0 8px; }
.phrases { margin-top: 12px; }
.phrases summary {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none;
  font-size: 13px; font-weight: 600; color: var(--navy); padding: 5px 12px; border-radius: 99px; background: var(--navy-soft);
}
.phrases summary::-webkit-details-marker { display: none; }
.phrases summary::after { content: "+"; font-weight: 700; }
.phrases[open] summary::after { content: "−"; }
.phrases ul { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.phrases li { background: var(--surface-2); border: 1px solid var(--line); color: #22396f; padding: 5px 11px; border-radius: 99px; font-size: 13.5px; }
.ready-btn { margin-top: 16px; }
.extend {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--navy-soft); border-radius: 16px; padding: 10px 10px 10px 16px; margin-top: 14px;
}
.extend p { margin: 0; font-size: 14px; font-weight: 600; }
.extend-asked { background: var(--go-soft); animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { box-shadow: 0 0 0 4px rgba(31, 157, 92, .18); } }

/* ------------------------------------------------------------- talk screen */

/* One narrow column on every screen: the people card, the talk balance, the task card. */
.talk-screen { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.talk-top, .talk-body, .talk-controls { width: 100%; max-width: 560px; margin-left: auto; margin-right: auto; }
.talk-screen.is-video .talk-top, .talk-screen.is-video .talk-body, .talk-screen.is-video .talk-controls { max-width: 760px; }
.talk-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none;
  padding: calc(16px + env(safe-area-inset-top)) 16px 12px;
}
.phases { display: flex; align-items: center; }
/* A short line joins the steps so they read as a sequence; it turns navy once the step before it is done. */
.phase-line { width: 16px; height: 2px; margin: 0 4px; border-radius: 2px; background: var(--line-strong); flex: none; }
.phases .done + .phase-line { background: var(--navy); }
.phases span {
  padding: 5px 12px; border-radius: 99px; font-size: 13px; font-weight: 600;
  color: var(--muted); background: var(--surface); border: 1px solid var(--line);
}
.phases span.current { background: var(--navy); border-color: var(--navy); color: #fff; }
.phases span.done { color: var(--navy); }
.timer { font-size: 28px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--navy); }
.timer-prep { font-size: 15px; font-weight: 700; color: var(--muted); }
.timer-end { color: var(--coral); }

.talk-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 16px 8px; display: flex; flex-direction: column; gap: 12px; }
.media {
  position: relative; flex: none; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
}
.people { display: grid; grid-template-columns: 1fr 1fr; }
.person { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 12px; min-width: 0; }
.person + .person { border-left: 1px solid var(--line); }
.person strong { font-size: 16px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .flag { flex: none; width: 22px; height: 16.5px; }
.bubble {
  --h: 220;
  position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: hsl(var(--h) 70% 93%); color: hsl(var(--h) 45% 32%);
  font-size: 18px; font-weight: 800;
}
.bubble::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 3px solid hsl(var(--h) 60% 55%); opacity: 0; transform: scale(.9);
  transition: opacity .15s, transform .15s;
}
.speaking .bubble::after { opacity: 1; transform: scale(1); animation: ring 1.1s ease-in-out infinite; }
@keyframes ring { 50% { transform: scale(1.08); } }

.is-video .media { aspect-ratio: 4 / 3; max-height: 52dvh; }
.videos { position: absolute; inset: 0; background: #0e1630; }
#remote-video { width: 100%; height: 100%; object-fit: cover; display: block; }
#local-video {
  position: absolute; right: 10px; bottom: 10px; z-index: 2;
  width: 26%; max-width: 150px; aspect-ratio: 3 / 4; object-fit: cover;
  border-radius: 12px; border: 2px solid rgba(255,255,255,.9); box-shadow: 0 6px 20px rgba(0,0,0,.25);
  transform: scaleX(-1); background: #1b2547;
}
#local-video.off { opacity: .25; }
.video-name {
  position: absolute; left: 14px; top: 12px; z-index: 2; display: flex; align-items: center; gap: 8px;
  color: #fff; font-weight: 700; font-size: 16px; text-shadow: 0 1px 2px rgba(0,0,0,.55), 0 0 12px rgba(0,0,0,.35);
}
.media-overlay {
  position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: rgba(255, 255, 255, .95); text-align: center; padding: 12px; font-weight: 600; font-size: 14px;
}
.is-video .media-overlay { background: rgba(14, 22, 48, .8); color: #fff; flex-direction: column; }
.media-overlay p { margin: 0; }
.media-overlay .spinner { width: 20px; height: 20px; border-width: 2.5px; flex: none; }
.tap-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  height: 44px; padding: 0 18px; border: 0; border-radius: 99px;
  background: var(--navy); color: #fff; font-weight: 600; box-shadow: var(--shadow-pop);
}
.tap-play svg { width: 18px; height: 18px; }

/* Talk balance: the partner's share from the left, yours from the right (same sides as the people card). */
.balance { flex: none; padding: 0 4px; }
.balance-bar { height: 6px; border-radius: 99px; background: var(--navy); overflow: hidden; }
.balance-bar div { height: 100%; width: 50%; background: #b9c6e8; transition: width .6s; }
.balance-labels { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 4px; }
.balance.uneven .balance-bar { background: var(--coral); }
.balance.uneven .balance-bar div { background: #f8c7b8; }

.talk-body .task-card { padding: 20px; border-radius: 20px; }

.talk-controls {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex: none;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
}
#btn-leave { min-width: 140px; height: 52px; }

/* On larger screens the controls sit right under the card instead of at the bottom of the window. */
@media (min-width: 901px) {
  .talk-top { padding-top: 32px; }
  .talk-body { flex: 0 1 auto; }
  .talk-controls { padding-top: 20px; }
}

/* ------------------------------------------------------------- feedback */

.feedback-card { max-width: 520px; }
.done-badge {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 16px;
  display: grid; place-items: center; background: var(--go); color: #fff; box-shadow: 0 0 0 8px var(--go-soft);
}
.done-badge svg { width: 36px; height: 36px; }
.unlock { display: flex; align-items: center; gap: 12px; background: var(--go-soft); color: #13643b; padding: 12px 14px; border-radius: 14px; font-size: 14px; }
.unlock svg { width: 22px; height: 22px; flex: none; }

.choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.choice button {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 8px 12px; border: 1.5px solid var(--line-strong); border-radius: 16px; background: var(--surface);
  font-weight: 700; font-size: 15px; color: var(--text);
  transition: border-color .15s, background .15s, box-shadow .15s, transform .1s;
}
.choice button:hover { border-color: var(--navy); }
.choice button:active { transform: scale(.97); }
.choice-icon {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy-soft); color: var(--navy); transition: background .15s, color .15s;
}
.choice-icon svg { width: 20px; height: 20px; }
.choice button[aria-checked="true"] { border-color: var(--navy); background: var(--navy-soft); box-shadow: 0 0 0 3px rgba(23, 54, 127, .14); }
.choice button[aria-checked="true"] .choice-icon { background: var(--navy); color: #fff; }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  padding: 8px 14px; border-radius: 99px; border: 1.5px solid var(--line-strong); background: var(--surface);
  font-size: 14px; font-weight: 600; color: #3b4462;
}
.tag[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ------------------------------------------------------------- dialogs */

dialog.sheet {
  border: 0; border-radius: var(--radius); padding: 24px; color: var(--text);
  width: min(440px, calc(100% - 24px)); max-height: calc(100dvh - 32px); overflow-y: auto;
  box-shadow: var(--shadow-pop);
}
dialog.sheet-wide { width: min(640px, calc(100% - 24px)); }
dialog::backdrop { background: rgba(14, 22, 48, .45); }
.sheet h2 { margin-bottom: 6px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-options { display: grid; gap: 8px; margin: 16px 0 12px; }
.sheet-opt {
  display: block; width: 100%; text-align: left; padding: 13px 16px;
  border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); font-weight: 600;
}
.sheet-opt:hover { background: var(--navy-soft); border-color: var(--navy); }
.sheet-opt small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.cam-preview video {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 16px; transform: scaleX(-1);
  background: #0e1630; display: block; margin: 14px 0 10px;
}
.cam-status { font-weight: 600; min-height: 1.5em; }
.cam-status.good { color: var(--go); }
.cam-status.bad { color: #b42318; }
.words { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.words li:not(.empty) { background: var(--secret); border: 1px solid var(--secret-line); padding: 4px 10px; border-radius: 99px; font-size: 14px; }
.history { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.history li:not(.empty) { display: flex; flex-direction: column; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.history-main { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.danger-zone { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--line); }

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

.spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid #d7dceb; border-top-color: var(--navy);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; left: 50%; top: calc(18px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 100;
  background: var(--text); color: #fff; padding: 11px 18px; border-radius: 99px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-pop); max-width: calc(100% - 32px); text-align: center;
}

@media (max-width: 900px) {
  .lobby { grid-template-columns: 1fr; padding: 0 16px 40px; }
  .topbar { padding: 14px 16px; }
  .lobby-main { padding: 24px 20px; }
  .lobby-title { font-size: 28px; }

  .talk-top { padding: calc(12px + env(safe-area-inset-top)) 12px 10px; }
  .talk-body { padding: 0 12px 8px; gap: 10px; }
  .talk-controls { padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); gap: 10px; }
  .task-card { padding: 18px; border-radius: 20px; }
  .timer { font-size: 26px; }
  dialog.sheet { margin: auto auto 0; width: 100%; max-width: 100%; border-radius: 24px 24px 0 0; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}

@media (max-width: 520px) {
  .card { padding: 24px 18px; border-radius: 20px; }
  .mode { grid-template-columns: 1fr; }
  .phases span { padding: 4px 9px; font-size: 12px; }
  .phase-line { width: 10px; margin: 0 3px; }
  .icon-btn { width: 48px; height: 48px; }
  #btn-leave { min-width: 0; flex: 1; max-width: 200px; }
  .test-q { font-size: 18px; }
  .stats-3 strong { font-size: 22px; }
}
