:root {
  color-scheme: light;
  --ink: #172b3a;
  --muted: #63727c;
  --cream: #fffaf0;
  --paper: #ffffff;
  --gold: #f2b84b;
  --gold-deep: #d99018;
  --mint: #dff3e5;
  --green: #2d8a5b;
  --red: #bd4b50;
  --line: #e7e1d5;
  --shadow: 0 18px 45px rgba(23, 43, 58, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(242, 184, 75, .24), transparent 38%),
    linear-gradient(160deg, #f6f0df 0%, #f5f8f3 55%, #e7f1ec 100%);
}

button, input { font: inherit; }

.shell {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(30px, env(safe-area-inset-bottom));
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 2px 20px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: var(--ink);
  background: var(--gold);
  font-weight: 900;
  font-size: 26px;
  box-shadow: 0 8px 20px rgba(217, 144, 24, .25);
}

.brand h1 { margin: 1px 0 0; font-size: 24px; line-height: 1; }
.eyebrow { font-size: 10px; letter-spacing: .16em; font-weight: 800; color: var(--muted); }
.connection { margin-left: auto; color: #a8b1b6; font-size: 20px; }
.connection.online { color: var(--green); }

.card {
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 24px;
  padding: 22px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.hero-card {
  overflow: hidden;
  position: relative;
  background: var(--ink);
  color: white;
}

.hero-card::after {
  content: "АСА";
  position: absolute;
  right: -18px;
  bottom: -18px;
  font-size: 86px;
  font-weight: 900;
  color: rgba(255,255,255,.06);
}

h2, h3, p { margin-top: 0; }
h2 { font-size: 26px; margin-bottom: 10px; }
h3 { font-size: 18px; margin-bottom: 10px; }
p { line-height: 1.48; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

.field { margin: 14px 0; }
.field label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 800; color: var(--muted); }
.input {
  width: 100%;
  min-height: 52px;
  border: 2px solid var(--line);
  border-radius: 15px;
  padding: 12px 14px;
  background: white;
  color: var(--ink);
  outline: none;
  font-size: 18px;
}
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(242, 184, 75, .16); }

.button {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 15px;
  padding: 12px 16px;
  cursor: pointer;
  color: var(--ink);
  background: var(--gold);
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(217, 144, 24, .2);
}
.button:hover { filter: brightness(.98); }
.button:active { transform: translateY(1px); }
.button.secondary { background: #edf1ef; box-shadow: none; }
.button.danger { background: #f8dddd; color: #792c31; box-shadow: none; }
.button:disabled { opacity: .5; cursor: default; transform: none; }
.button + .button { margin-top: 10px; }

.join-code {
  display: inline-flex;
  padding: 8px 13px;
  border-radius: 12px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 950;
  letter-spacing: .13em;
  font-size: 24px;
}

.qr {
  width: min(250px, 82vw);
  aspect-ratio: 1;
  display: block;
  margin: 14px auto;
  padding: 10px;
  background: white;
  border-radius: 18px;
}

.players { display: grid; gap: 9px; }
.player {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 8px 11px;
  border-radius: 14px;
  background: #f5f6f2;
}
.player.eliminated { opacity: .52; }
.rank {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: white;
  font-weight: 900;
}
.score { font-weight: 900; }
.lives { letter-spacing: 2px; font-size: 14px; }

.level-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.level-pill { padding: 6px 10px; border-radius: 999px; background: var(--mint); color: var(--green); font-weight: 900; font-size: 13px; }
.direction { color: var(--muted); font-size: 13px; font-weight: 800; }

.prompt {
  margin: 18px 0;
  padding: 20px 14px;
  border: 2px dashed var(--gold-deep);
  border-radius: 18px;
  background: var(--cream);
  text-align: center;
  font-size: clamp(24px, 7vw, 40px);
  font-weight: 950;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.timer {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  margin: 10px auto;
  border: 7px solid var(--gold);
  border-radius: 50%;
  background: white;
  font-size: 25px;
  font-weight: 950;
}
.timer.urgent { border-color: var(--red); color: var(--red); }

.progress { height: 8px; margin: 12px 0 18px; border-radius: 999px; overflow: hidden; background: #edf0ed; }
.progress > div { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), #ef8f46); }

.answer-state { padding: 14px; border-radius: 15px; margin: 13px 0; font-weight: 800; }
.answer-state.good { background: var(--mint); color: var(--green); }
.answer-state.bad { background: #f8dddd; color: #8c343a; }
.answer-state.wait { background: #eef1f6; color: #566574; }

.notice {
  position: sticky;
  top: 10px;
  z-index: 20;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 14px;
  color: white;
  background: var(--red);
  box-shadow: var(--shadow);
}
.hidden { display: none !important; }

.champion { font-size: 50px; margin: 4px 0 10px; }
.split { display: grid; gap: 12px; }

@media (min-width: 620px) {
  .split { grid-template-columns: 1fr 1fr; }
  .shell { padding-left: 24px; padding-right: 24px; }
}
