:root {
  color-scheme: dark;
  --page: #141729;
  --panel: #1e2238;
  --line: #373c57;
  --text: #f9f7ee;
  --soft: #c4c9e1;
  --mint: #b9f1c8;
  --ink: #19232c;
  --radius: 22px;
  font-family: 'Trebuchet MS', system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 83% 18%, #25223b 0%, var(--page) 52%); color: var(--text); min-height: 100vh; }
button, input, select { font: inherit; }
a { color: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button, .button { min-height: 46px; border-radius: 13px; padding: 10px 18px; border: 1px solid transparent; font-weight: 750; cursor: pointer; }
.button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #ffd480; outline-offset: 4px; }
button:disabled { opacity: .62; cursor: default; }
.primary { color: #172a23; background: var(--mint); }
.primary:hover:not(:disabled) { background: #d3fbe0; }
.secondary { color: var(--text); background: #272b44; border-color: #414760; }
.secondary:hover:not(:disabled), .account:hover { background: #343955; }
.plain { color: var(--soft); background: transparent; border-color: var(--line); }
.wrap { width: min(1070px, calc(100% - 40px)); margin-inline: auto; }
.top { border-bottom: 1px solid #343952; background: #171a2d; }
.top-inner { min-height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-size: 1.15rem; font-weight: 800; letter-spacing: -.025em; }
.brand > span:last-child { color: var(--soft); font-weight: 600; }
.brand-mark { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 11px; font-size: 1.15rem; color: var(--ink); background: var(--mint); margin-right: 2px; }
.account { border: 1px solid #444961; border-radius: 12px; padding: 10px 15px; font-weight: 700; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.035em; }
h1 { font-size: clamp(2.45rem, 6vw, 4.4rem); line-height: 1.01; margin-bottom: 20px; }
h2 { font-size: clamp(1.65rem, 4vw, 2.2rem); margin-bottom: 12px; }
h3 { font-size: 1.2rem; margin-bottom: 8px; }
p { color: var(--soft); line-height: 1.55; }
.hero { display: grid; grid-template-columns: 1.45fr 1fr; gap: 20px; min-height: 365px; align-items: center; padding: 52px 0 37px; }
.hero h1 em { color: var(--mint); font-style: normal; }
.hero p { max-width: 440px; font-size: 1.09rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.art { position: relative; align-self: stretch; min-height: 258px; overflow: hidden; border-radius: 27px; background: radial-gradient(ellipse at 60% 42%, #473957, #2c2b45 64%, #26263e); border: 1px solid #504763; }
.art::before, .art::after { content: ''; position: absolute; border: 1px solid #786885; border-radius: 50%; inset: -12% 13% -20%; transform: rotate(-30deg); opacity: .25; }
.art::after { inset: -30% -3%; }
.art-card { position: absolute; width: clamp(105px, 13vw, 155px); aspect-ratio: 3 / 4; border-radius: 16px; box-shadow: 0 16px 28px #11122280; display: grid; place-items: center; font-family: Georgia, serif; font-size: clamp(2.9rem, 5vw, 4.4rem); color: #2a2735; }
.art-card strong { position: absolute; left: 11px; top: 7px; font-size: .38em; }
.art-card:nth-child(1) { background: #b9f1c8; left: 22%; top: 19%; transform: rotate(-20deg); }
.art-card:nth-child(2) { background: #fbd283; left: 40%; top: 15%; transform: rotate(2deg); }
.art-card:nth-child(3) { background: #f7a7b3; left: 55%; top: 26%; transform: rotate(20deg); color: #70243f; }
.spark { position: absolute; color: #ffe3a0; font-size: 1.6rem; }
.spark.one { top: 14%; left: 12%; }
.spark.two { bottom: 13%; right: 9%; font-size: 2.25rem; }
.catalog { padding: 14px 0 45px; }
.catalog-header { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 7px; margin-bottom: 13px; }
.catalog-header p { margin: 0; }
.catalog-header h2 { margin: 0; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.game { display: block; width: 100%; min-height: 145px; text-align: left; background: var(--panel); border: 1px solid var(--line); color: var(--text); padding: 17px 18px 15px; border-radius: var(--radius); }
.game:hover:not(:disabled), .game[aria-pressed=true] { border-color: var(--mint); background: #292e47; }
.game strong { display: block; font-size: 1.15rem; margin: 10px 0 3px; letter-spacing: -.025em; }
.game small { display: block; font-size: .91rem; line-height: 1.4; color: var(--soft); font-weight: 500; }
.glyph { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: var(--ink); font-weight: 900; font-size: 1.35rem; background: #b9f1c8; }
.glyph.gold { background: #fbd283; }
.glyph.lilac { background: #d7c3fa; }
.glyph.blue { background: #b8dafa; }
.glyph.rose { background: #f9b5c1; }
.glyph.peach { background: #ffd0af; }
.narrow { max-width: 570px; margin: 40px auto; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 4vw, 30px); }
.panel + .panel { margin-top: 15px; }
.room { max-width: 760px; margin: 28px auto 50px; }
.room h1, .narrow h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: 13px; }
.roombar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.roombar .spacer { flex: 1; }
.code { display: inline-block; font-family: ui-monospace, Consolas, monospace; color: var(--mint); letter-spacing: .13em; }
.roombar .code { font-size: 1.35rem; }
.waiting { padding: 12px 14px; color: var(--soft); border: 1px dashed #505772; border-radius: 13px; font-size: .98rem; }
form { display: grid; gap: 13px; }
label { display: grid; gap: 7px; text-align: left; font-weight: 750; }
input, select { color: var(--text); background: #15192d; padding: 11px 13px; min-height: 47px; width: 100%; border: 1px solid #555c77; border-radius: 11px; font-size: 1rem; }
input::placeholder { color: #a5abc6; }
.form-head { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.form-head h1 { margin: 0; }
.choice { width: 100%; min-height: 56px; margin: 0 0 9px; display: block; text-align: left; overflow-wrap: anywhere; }
.choice.correct { color: var(--ink); background: var(--mint); border: 1px solid var(--mint); }
.choice small { display: block; font-weight: 500; margin-top: 5px; }
.result-choice { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.result-choice p { margin: 4px 0 0; }
.result-choice.correct p { color: #253b32; }
.result { color: var(--mint); }
.room-toolbar { margin-top: 17px; }
.players { list-style: none; margin: 12px 0 0; display: flex; gap: 8px; flex-wrap: wrap; padding: 0; }
.players li { background: #2a304a; padding: 7px 10px; border-radius: 10px; overflow-wrap: anywhere; max-width: 100%; }
.players strong { color: var(--mint); margin-left: 5px; }
.status { margin-bottom: 11px; }
.cards { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
.card { min-width: 50px; min-height: 61px; border: 2px solid #ede4d6; border-radius: 9px; background: #fff4df; color: #252538; padding: 5px; font-size: 1.08rem; text-align: center; font-weight: 800; }
.card.red { color: #a22b4a; }
.card.selected { outline: 3px solid var(--mint); outline-offset: 1px; }
.card span { display: block; }
.toast { position: fixed; z-index: 1; bottom: 17px; left: 50%; width: max-content; max-width: calc(100% - 30px); transform: translateX(-50%); background: #fff1cd; color: #242238; border-radius: 12px; padding: 12px 17px; box-shadow: 0 4px 24px #0008; font-weight: 750; }
@media (max-width: 730px) {
  .hero { grid-template-columns: 1.35fr 1fr; }
  .art { min-height: 220px; }
  .art-card:nth-child(1) { left: 12%; }
  .art-card:nth-child(2) { left: 31%; }
  .art-card:nth-child(3) { left: 47%; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 500px) {
  .wrap { width: calc(100% - 30px); }
  .top-inner { min-height: 62px; }
  .hero { display: block; padding: 36px 0 19px; }
  .hero h1 { font-size: clamp(2.7rem, 11vw, 3.4rem); }
  .hero p { font-size: 1rem; }
  .art { min-height: 150px; margin-top: 24px; }
  .art-card { width: 83px; font-size: 2.15rem; border-radius: 11px; }
  .art-card:nth-child(1) { left: 26%; top: 18%; }
  .art-card:nth-child(2) { left: 41%; top: 11%; }
  .art-card:nth-child(3) { left: 55%; top: 22%; }
  .game { padding: 12px; min-height: 134px; }
  .game small { font-size: .88rem; }
  .grid { gap: 9px; }
}
@media (prefers-reduced-motion: no-preference) {
  .choice.correct, .result { animation: reveal .23s ease-out; }
  @keyframes reveal { from { opacity: .45; transform: translateY(4px); } }
}
