/* «Алаңдағы бестемше» 3D v2 — interface. Felt + ornament language: dark felt panels with stitched
 * edges, ochre ornament, cream type. Literata (display, numbers) + Onest (labels).
 * The UI lives in a 1920x1080 stage that is scaled to the window (BS3.ui.fit). */
:root {
  --cream: #F4ECDD; --cream-dim: rgba(244, 236, 221, 0.64); --cream-faint: rgba(244, 236, 221, 0.36);
  --ochre: #D9A441; --ochre-hi: #F2C866; --ochre-lo: #A9781C;
  --terra: #C25A33; --terra-hi: #E07A4E; --terra-lo: #86361A;
  --teal: #2A6574; --teal-hi: #3F8C9C; --teal-lo: #12333C;
  --ink: #140C08; --ink-2: #1E130D; --brown: #3A2418;
  --panel: rgba(20, 12, 8, 0.78); --panel-solid: #1A110C;
  --ease: cubic-bezier(.22, 1, .36, 1); --ease-io: cubic-bezier(.65, 0, .35, 1); --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
  --felt: none; /* set at runtime to a blob: URL of the felt detail texture */
}
html, body { margin: 0; height: 100%; background: #0b0705; overflow: hidden; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; outline: none; }
#gl.is-pick { cursor: pointer; }
.ui { --pad-t: 0px; --pad-l: 0px; position: fixed; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; pointer-events: none;
  font-family: Onest, 'Segoe UI', system-ui, sans-serif; color: var(--cream); user-select: none; }
.ui * { box-sizing: border-box; }
:where(.ui button) { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; pointer-events: auto; }
.ui button:focus { outline: none; }
.ui button:focus-visible { outline: 2px solid var(--ochre); outline-offset: 4px; }
.num { font-family: Literata, Georgia, serif; font-variant-numeric: lining-nums tabular-nums; }

/* ------------------------------------------------------------------ layers */
.layer { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .6s var(--ease), visibility 0s linear .6s; will-change: opacity; }
/* pre-warm: painted once (invisible) while the loading screen is up, so the first real show does not hitch */
.layer.is-warm { visibility: visible; opacity: 0.002; transition: none; }
.layer.is-on { opacity: 1; visibility: visible; transition: opacity .6s var(--ease), visibility 0s; }

/* ------------------------------------------------------------------ loading */
.loading { left: calc(-1 * var(--pad-l)); right: calc(-1 * var(--pad-l)); top: calc(-1 * var(--pad-t)); bottom: calc(-1 * var(--pad-t)); background: radial-gradient(ellipse at 50% 46%, #24160E 0%, #0B0705 62%); display: grid; place-items: center; }
.loading .ld-box { width: 520px; text-align: center; }
.loading svg.crest { width: 132px; height: 132px; display: block; margin: 0 auto 30px; overflow: visible; }
.loading svg.crest .draw { stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw 2.4s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.loading .ld-title { font-family: Literata, serif; font-weight: 600; font-size: 34px; letter-spacing: .02em; color: var(--cream); }
.loading .ld-line { height: 2px; margin: 26px auto 14px; width: 360px; background: rgba(244, 236, 221, .12); overflow: hidden; border-radius: 2px; }
.loading .ld-line i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ochre-lo), var(--ochre-hi)); transition: width .35s var(--ease); }
.loading .ld-label { font-size: 17px; letter-spacing: .14em; text-transform: uppercase; color: var(--cream-faint); min-height: 22px; }

/* ------------------------------------------------------------------ title */
.title-shade { position: absolute; left: calc(-1 * var(--pad-l)); right: calc(-1 * var(--pad-l)); top: calc(-1 * var(--pad-t)); bottom: calc(-1 * var(--pad-t)); background:
  linear-gradient(90deg, rgba(8, 5, 3, .92) 0, rgba(8, 5, 3, .92) var(--pad-l), rgba(8, 5, 3, .8) calc(var(--pad-l) + 538px), rgba(8, 5, 3, .35) calc(var(--pad-l) + 883px), rgba(8, 5, 3, 0) calc(var(--pad-l) + 1190px)),
  linear-gradient(0deg, rgba(8, 5, 3, .7) 0, rgba(8, 5, 3, .7) var(--pad-t), rgba(8, 5, 3, 0) calc(var(--pad-t) + 280px)); }
.brand { position: absolute; left: 132px; top: 236px; width: 900px; }
.brand .kicker { display: flex; align-items: center; gap: 18px; font-size: 19px; font-weight: 600; letter-spacing: .32em; text-transform: uppercase; color: var(--ochre); }
.brand .kicker svg { width: 46px; height: 46px; flex: none; }
.brand h1 { margin: 22px 0 0; font-family: Literata, serif; font-weight: 800; line-height: .94; letter-spacing: -.012em; color: var(--cream);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .25), 0 18px 46px rgba(0, 0, 0, .55); }
.brand h1 .l1 { display: block; font-size: 86px; font-weight: 600; color: var(--ochre-hi); letter-spacing: .005em; }
.brand h1 .l2 { display: block; font-size: 158px; margin-top: 4px;
  color: #F6ECD8; }
.brand .rule { margin: 34px 0 0; width: 560px; height: 26px; }
.brand .tagline { margin-top: 18px; font-size: 27px; font-weight: 500; color: var(--cream-dim); letter-spacing: .01em; }
.brand > * { opacity: 0; transform: translateY(18px); filter: blur(6px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease), filter 1.1s var(--ease); }
.is-on .brand > * { opacity: 1; transform: none; filter: none; }
.is-on .brand > :nth-child(2) { transition-delay: .12s; } .is-on .brand > :nth-child(3) { transition-delay: .3s; } .is-on .brand > :nth-child(4) { transition-delay: .42s; }
.press { position: absolute; left: 106px; top: 760px; text-align: left; font-size: 20px; letter-spacing: .22em; text-transform: uppercase; color: var(--cream);
  opacity: 0; transition: opacity 1s var(--ease) 1s; }
.is-on .press { opacity: 1; }
.press span { display: inline-block; padding: 14px 26px; animation: breathe 2.8s var(--ease-io) infinite; }
.press span::before, .press span::after { content: ''; display: inline-block; width: 44px; height: 1px; margin: 0 18px; vertical-align: middle; background: linear-gradient(90deg, transparent, var(--ochre)); }
.press span::before { display: none; }
.press span::after { background: linear-gradient(90deg, var(--ochre), transparent); }
@keyframes breathe { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.credit { position: absolute; left: 132px; bottom: 48px; font-size: 16px; letter-spacing: .08em; color: var(--cream-faint); }

/* corner chips (language etc.) */
.chips { position: absolute; right: 64px; bottom: 44px; display: flex; gap: 14px; pointer-events: auto; }
.chip { height: 46px; padding: 0 18px; border-radius: 23px; display: inline-flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--cream-dim); background: rgba(20, 12, 8, .55); box-shadow: inset 0 0 0 1px rgba(244, 236, 221, .14);
  transition: color .2s, background .2s, box-shadow .2s; }
.chip:hover { color: var(--cream); background: rgba(40, 26, 16, .75); box-shadow: inset 0 0 0 1px rgba(217, 164, 65, .55); }
.chip b { color: var(--ochre-hi); font-weight: 700; }
.chip .sep { width: 1px; height: 16px; background: rgba(244, 236, 221, .25); }
.chip .off { opacity: .45; }
.chip svg { width: 20px; height: 20px; }

/* ------------------------------------------------------------------ main menu */
.menu .title-shade { background:
  linear-gradient(90deg, rgba(8, 5, 3, .95) 0, rgba(8, 5, 3, .95) var(--pad-l), rgba(8, 5, 3, .86) calc(var(--pad-l) + 576px), rgba(8, 5, 3, .45) calc(var(--pad-l) + 883px), rgba(8, 5, 3, 0) calc(var(--pad-l) + 1190px)),
  linear-gradient(0deg, rgba(8, 5, 3, .55) 0, rgba(8, 5, 3, .55) var(--pad-t), rgba(8, 5, 3, 0) calc(var(--pad-t) + 260px)); }
.menu .mini-brand { position: absolute; left: 132px; top: 92px; display: flex; align-items: center; gap: 18px; }
.menu .mini-brand svg { width: 54px; height: 54px; }
.menu .mini-brand .t { font-family: Literata, serif; font-weight: 700; font-size: 40px; line-height: 1; color: var(--cream); }
.menu .mini-brand .t small { display: block; margin-top: 8px; font-family: Onest, sans-serif; font-size: 15px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--ochre); }
.menu .head { position: absolute; left: 132px; top: 236px; font-size: 18px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--cream-faint); }
.modes { position: absolute; left: 106px; top: 280px; width: 760px; list-style: none; margin: 0; padding: 0; }
.mode { position: relative; display: block; width: 100%; text-align: left; padding: 20px 26px 20px 92px; margin: 0; border-radius: 18px; pointer-events: auto;
  opacity: 0; transform: translateX(-26px); transition: opacity .7s var(--ease), transform .7s var(--ease), background .35s var(--ease); }
.is-on .mode { opacity: 1; transform: none; }
.mode .n { position: absolute; left: 26px; top: 24px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  font-family: Literata, serif; font-weight: 700; font-size: 22px; color: var(--cream-dim); box-shadow: inset 0 0 0 1.5px rgba(244, 236, 221, .22);
  transition: color .3s, box-shadow .3s, background .3s; }
.mode .nm { display: block; font-family: Literata, serif; font-weight: 700; font-size: 46px; line-height: 1.08; color: var(--cream); letter-spacing: -.005em; transition: color .3s, transform .45s var(--ease); }
.mode .sub { display: block; margin-top: 6px; font-size: 20px; font-weight: 500; color: var(--cream-faint); transition: color .3s, transform .45s var(--ease); }
.mode .orn { position: absolute; left: -16px; top: 50%; width: 30px; height: 30px; margin-top: -15px; opacity: 0; transform: translateX(-12px) scale(.8); transition: opacity .35s var(--ease), transform .45s var(--ease); }
.mode .stitch { position: absolute; left: 92px; right: 40px; bottom: 10px; height: 2px; overflow: visible; }
.mode .stitch line { stroke: var(--ochre); stroke-width: 2; stroke-dasharray: 9 7; stroke-dashoffset: 0; opacity: 0; transition: opacity .3s; }
.mode .tag { margin-left: 14px; font-family: Onest, sans-serif; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; vertical-align: 6px;
  color: var(--ochre); padding: 3px 9px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(217, 164, 65, .45); }
.mode.is-active { background: linear-gradient(90deg, rgba(217, 164, 65, .14), rgba(217, 164, 65, 0) 78%); }
.mode.is-active .n { color: var(--ink); background: var(--ochre); box-shadow: none; }
.mode.is-active .nm { color: #FFF6E6; transform: translateX(8px); }
.mode.is-active .sub { color: var(--cream-dim); transform: translateX(8px); }
.mode.is-active .orn { opacity: 1; transform: none; }
.mode.is-active .stitch line { opacity: .75; animation: stitchrun 1.2s linear infinite; }
@keyframes stitchrun { to { stroke-dashoffset: -32; } }
.menu .foot { position: absolute; left: 132px; bottom: 56px; display: flex; gap: 14px; pointer-events: auto; }
.menu .foot .chip { height: 50px; }
.menu .credit { display: none; }

/* ------------------------------------------------------------------ HUD */
.hud .scoreboard { position: absolute; left: 50%; top: calc(12px - var(--pad-t)); width: 1060px; height: 100px; margin-left: -530px; }
.sb-panel { position: absolute; inset: 0; border-radius: 26px; background:
  linear-gradient(180deg, rgba(36, 23, 15, .9), rgba(16, 10, 6, .9)); box-shadow: 0 18px 40px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 240, 215, .08), inset 0 0 0 1px rgba(244, 236, 221, .08); overflow: hidden; }
.sb-panel::before { content: ''; position: absolute; inset: 0; background-image: var(--felt); background-size: 256px; opacity: .07; }
.sb-panel::after { content: ''; position: absolute; inset: 7px; border-radius: 20px; border: 1.5px dashed rgba(217, 164, 65, .32); }
.team { position: absolute; top: 0; height: 100px; width: 430px; display: flex; align-items: center; gap: 18px; padding: 0 28px; transition: opacity .5s var(--ease); }
.team.t0 { left: 0; } .team.t1 { right: 0; flex-direction: row-reverse; text-align: right; }
.team .em { width: 62px; height: 62px; flex: none; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .45)); }
.team .who { flex: 1; min-width: 0; }
.team .nm { display: block; font-family: Literata, serif; font-weight: 700; font-size: 33px; line-height: 1.12; white-space: nowrap; color: var(--cream); }
.team .ai { display: block; font-size: 14px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ochre); height: 0; overflow: visible; }
.team .prog { position: relative; margin-top: 10px; height: 16px; margin-right: 30px; }
.team.t1 .prog { margin-right: 0; margin-left: 30px; }
.team .prog .track { position: absolute; inset: 3px 0; border-radius: 6px; background: rgba(244, 236, 221, .1); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .6); }
.team .prog .fill { position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 6px; transition: width .8s var(--ease); box-shadow: 0 0 10px rgba(242, 200, 102, .18); }
/* 13 segments = 26 stones, two stones per segment (the kazan holds them in two rows) */
.team .prog .ticks { position: absolute; inset: 3px 0; border-radius: 6px; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0, transparent calc(100% / 13 - 2px), rgba(10, 6, 4, .55) calc(100% / 13 - 2px), rgba(10, 6, 4, .55) calc(100% / 13)); }
.team.t1 .prog .fill { left: auto; right: 0; }
.team.t0 .prog .fill { background: linear-gradient(90deg, var(--terra-lo), var(--terra-hi)); }
.team.t1 .prog .fill { background: linear-gradient(270deg, var(--teal-lo), var(--teal-hi)); }
.team .prog .flag { position: absolute; top: -12px; width: 16px; height: 30px; }
.team.t0 .prog .flag { right: -9px; } .team.t1 .prog .flag { left: -9px; }
.team .prog .goal { position: absolute; top: -1px; font-family: Literata, serif; font-size: 17px; font-weight: 800; color: var(--ochre-hi); }
.team.t0 .prog .goal { right: -34px; } .team.t1 .prog .goal { left: -34px; }
.score { position: absolute; top: 0; height: 100px; width: 104px; display: grid; place-items: center; font-family: Literata, serif; font-weight: 800; font-size: 72px; line-height: 1; color: var(--cream);
  text-shadow: 0 3px 10px rgba(0, 0, 0, .5); }
.score.s0 { left: 418px; } .score.s1 { right: 418px; }
.score.pop { animation: pop .5s var(--ease-pop); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.22); color: var(--ochre-hi); } 100% { transform: scale(1); } }
.sb-mid { position: absolute; left: 530px; top: 0; height: 100px; width: 0; }
.sb-mid .colon { position: absolute; left: -12px; top: 24px; width: 24px; height: 52px; }
.turnmark { position: absolute; top: -6px; width: 430px; height: 30px; display: flex; justify-content: center; transition: transform .7s var(--ease); pointer-events: none; }
.turnmark .lbl { margin-top: 0; padding: 4px 16px 5px; border-radius: 0 0 12px 12px; font-size: 13px; font-weight: 700; letter-spacing: .26em; text-transform: uppercase; color: var(--ink);
  box-shadow: 0 10px 22px rgba(0, 0, 0, .35); transition: background .5s; }
.team.is-turn .nm { color: #FFF8EC; }
.team:not(.is-turn) { opacity: .62; }
.glow0, .glow1 { position: absolute; top: 0; width: 520px; height: 100px; opacity: 0; transition: opacity .7s var(--ease); pointer-events: none; }
.glow0 { left: 0; background: radial-gradient(ellipse at 28% 50%, rgba(224, 122, 78, .32), rgba(224, 122, 78, 0) 70%); }
.glow1 { right: 0; background: radial-gradient(ellipse at 72% 50%, rgba(63, 140, 156, .38), rgba(63, 140, 156, 0) 70%); }
.sb-on0 .glow0, .sb-on1 .glow1 { opacity: 1; }

.hud .modebadge { position: absolute; left: calc(52px - var(--pad-l)); top: calc(38px - var(--pad-t)); display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 700; letter-spacing: .26em; text-transform: uppercase; color: var(--cream-faint); }
.hud .modebadge svg { width: 30px; height: 30px; }
.iconbtn { position: absolute; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; pointer-events: auto;
  background: radial-gradient(circle at 40% 32%, #3A2618, #1A100A 70%); box-shadow: 0 10px 24px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(244, 236, 221, .12), inset 0 1px 0 rgba(255, 240, 215, .12);
  transition: transform .3s var(--ease), box-shadow .3s; }
.iconbtn::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; border: 1.5px dashed rgba(217, 164, 65, .38); }
.iconbtn:hover { transform: translateY(-2px) rotate(-8deg); box-shadow: 0 14px 28px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(217, 164, 65, .55); }
.iconbtn svg { width: 40px; height: 40px; }
.hud .menubtn { right: calc(46px - var(--pad-l)); top: calc(26px - var(--pad-t)); }
.hint { position: absolute; left: 50%; bottom: calc(22px - var(--pad-t)); transform: translateX(-50%); padding: 10px 24px 11px; border-radius: 20px; font-size: 19px; font-weight: 600; letter-spacing: .02em; color: var(--cream);
  background: rgba(16, 10, 6, .72); box-shadow: 0 10px 24px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(244, 236, 221, .1); opacity: 0; transition: opacity .35s var(--ease), transform .35s var(--ease); white-space: nowrap; }
.hint.is-on { opacity: 1; transform: translateX(-50%) translateY(-4px); }
.hint b { color: var(--ochre-hi); font-weight: 700; }

/* ------------------------------------------------------------------ cards (pause menu, help, toast) */
.scrim { position: absolute; left: calc(-1 * var(--pad-l)); right: calc(-1 * var(--pad-l)); top: calc(-1 * var(--pad-t)); bottom: calc(-1 * var(--pad-t)); background: radial-gradient(ellipse at 50% 50%, rgba(10, 6, 4, .55), rgba(10, 6, 4, .86)); pointer-events: auto; }
.card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -48%) scale(.98); width: 720px; padding: 54px 64px 50px; border-radius: 34px; pointer-events: auto;
  background: linear-gradient(180deg, #2A1B12, #160E09); box-shadow: 0 40px 90px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 240, 215, .1), inset 0 0 0 1px rgba(244, 236, 221, .1);
  transition: transform .5s var(--ease); }
.is-on .card { transform: translate(-50%, -50%); }
.card::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background-image: var(--felt); background-size: 256px; opacity: .08; pointer-events: none; }
.card::after { content: ''; position: absolute; inset: 10px; border-radius: 26px; border: 1.5px dashed rgba(217, 164, 65, .34); pointer-events: none; }
.card h2 { margin: 0 0 6px; font-family: Literata, serif; font-weight: 700; font-size: 44px; text-align: center; color: var(--cream); }
.card .orn-rule { display: block; width: 300px; height: 24px; margin: 8px auto 26px; }
.card .row { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 16px 22px; border-radius: 16px; font-size: 25px; font-weight: 600; text-align: left;
  transition: background .25s var(--ease), color .25s; color: var(--cream); }
.card .row:hover, .card .row.is-active { background: rgba(217, 164, 65, .13); }
.card .row .v { font-size: 19px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ochre-hi); }
.card .row .k { font-size: 15px; font-weight: 700; color: var(--cream-faint); letter-spacing: .1em; }
.card.help { width: 1100px; }
.help-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 44px; }
.help-grid h3 { margin: 0 0 14px; font-size: 16px; font-weight: 700; letter-spacing: .26em; text-transform: uppercase; color: var(--ochre); }
.help-grid p { margin: 0 0 16px; font-size: 22px; line-height: 1.42; color: var(--cream-dim); }
.help-grid p b { color: var(--cream); }
.help-grid ul { list-style: none; margin: 0; padding: 0; }
.help-grid li { padding: 9px 0; font-size: 20px; color: var(--cream-dim); border-bottom: 1px solid rgba(244, 236, 221, .07); }
.help-grid li kbd { display: inline-block; min-width: 34px; margin-right: 10px; padding: 2px 9px; border-radius: 8px; text-align: center; font: 700 16px Onest, sans-serif; color: var(--cream);
  background: rgba(244, 236, 221, .08); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(244, 236, 221, .14); }
.toast { position: absolute; left: 50%; bottom: 120px; transform: translate(-50%, 16px); padding: 16px 30px 17px; border-radius: 22px; font-size: 22px; font-weight: 600; color: var(--cream);
  background: rgba(20, 12, 8, .9); box-shadow: 0 16px 34px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(217, 164, 65, .35); opacity: 0; transition: opacity .4s var(--ease), transform .4s var(--ease); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------------ projector view: bigger, higher contrast */
.projector .team .nm { font-size: 36px; }
.projector .score { font-size: 80px; }
.projector .team:not(.is-turn) { opacity: .7; }

/* fps / debug */
.dbg { position: absolute; right: 10px; bottom: 8px; font: 12px/1.3 Consolas, monospace; color: rgba(255, 255, 255, .55); text-align: right; white-space: pre; }
@media (prefers-reduced-motion: reduce) {
  .press span, .mode.is-active .stitch line { animation: none; }
}

/* ------------------------------------------------------------------ Stage 2: moments */
.pause, .helpl { z-index: 10; }
.toast { z-index: 12; }
.fxlayer { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.float { position: absolute; transform: translate(-50%, -50%); pointer-events: none; will-change: transform, opacity; }
.float.gain { font-family: Literata, serif; font-weight: 800; font-size: 76px; color: #FFD879; letter-spacing: -.01em;
  text-shadow: 0 2px 0 #7A4C0E, 0 6px 18px rgba(30, 16, 4, .7), 0 0 30px rgba(255, 196, 80, .45);
  animation: floatUp 1.35s cubic-bezier(.22, 1, .36, 1) forwards; }
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); }
  14% { opacity: 1; transform: translate(-50%, -62%) scale(1.12); }
  30% { transform: translate(-50%, -70%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -185%) scale(1); }
}
.float.crest { width: 96px; height: 96px; animation: crestUp 1.5s cubic-bezier(.22, 1, .36, 1) forwards; filter: drop-shadow(0 0 14px rgba(255, 220, 150, .55)); }
.float.crest svg { width: 100%; height: 100%; }
@keyframes crestUp {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(.5) rotate(-20deg); }
  25% { opacity: 1; transform: translate(-50%, -70%) scale(1.05) rotate(0deg); }
  100% { opacity: 0; transform: translate(-50%, -120%) scale(1.15) rotate(8deg); }
}
.caption { position: absolute; left: 50%; bottom: calc(86px - var(--pad-t)); transform: translate(-50%, 10px); max-width: 1300px; padding: 14px 30px 15px; border-radius: 24px;
  font-size: 27px; font-weight: 600; color: var(--cream); text-align: center; background: rgba(16, 10, 6, .82);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .4), inset 0 0 0 1px rgba(217, 164, 65, .35); opacity: 0; transition: opacity .45s var(--ease), transform .45s var(--ease); z-index: 6; }
.caption.is-on { opacity: 1; transform: translate(-50%, 0); }
.banner { position: absolute; left: 0; right: 0; top: 380px; text-align: center; opacity: 0; transform: scale(.94); pointer-events: none; z-index: 7;
  transition: opacity .35s var(--ease), transform .5s var(--ease-pop); }
.banner.is-on { opacity: 1; transform: scale(1); }
.banner .b-glow { position: absolute; left: 50%; top: 50%; width: 1100px; height: 330px; transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(12, 7, 4, .78) 0%, rgba(12, 7, 4, .55) 40%, rgba(12, 7, 4, 0) 70%); }
.banner .b-title { position: relative; font-family: Literata, serif; font-weight: 800; font-size: 132px; line-height: 1.05; color: #FFE6AE; letter-spacing: -.01em;
  text-shadow: 0 3px 0 #8A5512, 0 10px 34px rgba(0, 0, 0, .6), 0 0 44px rgba(255, 190, 80, .35); }
.banner .b-rule { position: relative; display: block; margin: 10px auto 12px; }
.banner .b-sub { position: relative; font-size: 30px; font-weight: 600; color: var(--cream); text-shadow: 0 2px 10px rgba(0, 0, 0, .7); }
.winl { z-index: 5; }
.winl .w-scrim { position: absolute; left: calc(-1 * var(--pad-l)); right: calc(-1 * var(--pad-l)); top: calc(-1 * var(--pad-t)); bottom: calc(-1 * var(--pad-t));
  background: radial-gradient(ellipse at 50% 46%, rgba(10, 6, 4, .25) 0%, rgba(10, 6, 4, .55) 55%, rgba(10, 6, 4, .78) 100%); }
.wcard { position: absolute; left: 50%; top: 50%; width: 820px; padding: 40px 60px 40px; border-radius: 36px; text-align: center; pointer-events: auto;
  transform: translate(-50%, -46%) scale(.94); opacity: 0; transition: transform .7s var(--ease-pop), opacity .45s var(--ease);
  background: linear-gradient(180deg, rgba(44, 28, 18, .94), rgba(22, 14, 9, .95));
  box-shadow: 0 40px 100px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 240, 215, .12), inset 0 0 0 1px rgba(217, 164, 65, .32); }
.winl.is-on .wcard { transform: translate(-50%, -50%); opacity: 1; }
.winl.win-far .wcard { top: 58%; }
.winl.win-near .wcard { top: 44%; }
.wcard::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background-image: var(--felt); background-size: 256px; opacity: .08; pointer-events: none; }
.wcard::after { content: ''; position: absolute; inset: 11px; border-radius: 28px; border: 1.5px dashed rgba(217, 164, 65, .4); pointer-events: none; }
.w-crest { width: 110px; height: 110px; margin: -6px auto 6px; animation: crestSpin 14s linear infinite; }
.w-crest svg { width: 100%; height: 100%; }
@keyframes crestSpin { to { transform: rotate(360deg); } }
.w-title { font-family: Literata, serif; font-weight: 800; font-size: 104px; line-height: 1.02; letter-spacing: -.012em; color: #FFE3A2;
  text-shadow: 0 3px 0 #7A4C0E, 0 12px 34px rgba(0, 0, 0, .5); }
.draw .w-title { font-size: 58px; line-height: 1.15; }
.w-name { margin-top: 8px; font-family: Literata, serif; font-weight: 700; font-size: 54px; line-height: 1.15; }
.w-name.side0 { color: #F08D5F; } .w-name.side1 { color: #6FB6C6; }
.w-score { display: flex; align-items: center; justify-content: center; gap: 22px; margin-top: 14px; font-family: Literata, serif; font-weight: 800; font-size: 92px; line-height: 1; color: var(--cream); }
.w-score .s0 { color: #F08D5F; } .w-score .s1 { color: #6FB6C6; }
.w-score .colon { width: 26px; height: 58px; }
.w-reason { margin-top: 14px; font-size: 25px; font-weight: 600; color: var(--cream-dim); }
.w-btns { display: flex; justify-content: center; gap: 18px; margin-top: 30px; }
.wbtn { height: 66px; padding: 0 36px; border-radius: 33px; font-size: 25px; font-weight: 700; letter-spacing: .02em; color: var(--cream);
  background: rgba(244, 236, 221, .06); box-shadow: inset 0 0 0 1.5px rgba(244, 236, 221, .22); transition: transform .25s var(--ease), background .25s; }
.wbtn:hover { transform: translateY(-2px); background: rgba(244, 236, 221, .12); }
.wbtn.primary { color: #2A170C; background: linear-gradient(180deg, #F2C866, #D29B3A); box-shadow: 0 10px 24px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 250, 230, .5); }
.w-keys { margin-top: 16px; font-size: 16px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--cream-faint); }

/* ------------------------------------------------------------------ Stage 3: modes and content */
/* main menu: «continue the game» row (when an unfinished game is saved in this tab) */
.menu .resume { position: absolute; left: 106px; top: 206px; width: 760px; height: 62px; display: none; align-items: center; gap: 16px; padding: 0 26px; border-radius: 18px;
  text-align: left; pointer-events: auto; background: rgba(217, 164, 65, .08); box-shadow: inset 0 0 0 1.5px rgba(217, 164, 65, .38); transition: background .3s var(--ease), box-shadow .3s; }
.menu .resume.is-shown { display: flex; }
.menu.has-resume .head { display: none; }
.menu .resume .r-play { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; color: var(--ink); background: var(--ochre); }
.menu .resume .r-play svg { width: 18px; height: 18px; margin-left: 2px; }
.menu .resume .r-t { font-family: Literata, serif; font-weight: 700; font-size: 28px; color: var(--cream); }
.menu .resume .r-s { flex: 1; font-size: 19px; font-weight: 600; color: var(--cream-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu .resume .r-k { font-size: 15px; font-weight: 700; letter-spacing: .1em; color: var(--cream-faint); }
.menu .resume.is-active, .menu .resume:hover { background: rgba(217, 164, 65, .2); box-shadow: inset 0 0 0 1.5px rgba(242, 200, 102, .75); }

/* setup and examples screens share the menu's left column */
.setup .mini-brand, .scenesl .mini-brand { position: absolute; left: 132px; top: 92px; display: flex; align-items: center; gap: 18px; }
.setup .mini-brand svg, .scenesl .mini-brand svg { width: 54px; height: 54px; }
.setup .mini-brand .t, .scenesl .mini-brand .t { font-family: Literata, serif; font-weight: 700; font-size: 40px; line-height: 1; color: var(--cream); }
.setup .mini-brand .t small, .scenesl .mini-brand .t small { display: block; margin-top: 8px; font-family: Onest, sans-serif; font-size: 15px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--ochre); }
.setup .title-shade, .scenesl .title-shade { background:
  linear-gradient(90deg, rgba(8, 5, 3, .95) 0, rgba(8, 5, 3, .95) var(--pad-l), rgba(8, 5, 3, .88) calc(var(--pad-l) + 640px), rgba(8, 5, 3, .5) calc(var(--pad-l) + 940px), rgba(8, 5, 3, 0) calc(var(--pad-l) + 1230px)),
  linear-gradient(0deg, rgba(8, 5, 3, .55) 0, rgba(8, 5, 3, .55) var(--pad-t), rgba(8, 5, 3, 0) calc(var(--pad-t) + 260px)); }
.su-title { position: absolute; left: 132px; top: 206px; font-family: Literata, serif; font-weight: 700; font-size: 54px; line-height: 1.05; color: var(--cream); }
.su-label { position: absolute; left: 132px; top: 300px; font-size: 17px; font-weight: 700; letter-spacing: .28em; text-transform: uppercase; color: var(--cream-faint); }
.setup .su-label ~ .su-label { top: 480px; }
.su-first { position: absolute; left: 120px; top: 334px; display: flex; gap: 14px; padding: 6px; border-radius: 40px; transition: box-shadow .3s; }
.su-first.is-focus, .lvls.is-focus { box-shadow: inset 0 0 0 1.5px rgba(217, 164, 65, .3); }
.opt { height: 66px; padding: 0 28px 0 22px; border-radius: 33px; display: inline-flex; align-items: center; gap: 14px; font-size: 25px; font-weight: 700; color: var(--cream-dim);
  background: rgba(244, 236, 221, .05); box-shadow: inset 0 0 0 1.5px rgba(244, 236, 221, .16); pointer-events: auto;
  opacity: 0; transform: translateX(-20px); transition: opacity .6s var(--ease), transform .6s var(--ease), background .25s, color .25s, box-shadow .25s; }
.is-on .opt { opacity: 1; transform: none; }
.opt .dot { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(244, 236, 221, .4); transition: box-shadow .25s, background .25s; }
.opt.is-on { color: #FFF6E6; background: rgba(217, 164, 65, .16); box-shadow: inset 0 0 0 1.5px rgba(242, 200, 102, .8); }
.opt.is-on .dot { background: var(--ochre); box-shadow: inset 0 0 0 5px #2A170C, 0 0 0 2px var(--ochre); }
.su-note { position: absolute; left: 134px; top: 420px; font-size: 19px; font-weight: 500; color: var(--cream-faint); }
.lvls { position: absolute; left: 120px; top: 514px; display: flex; gap: 16px; padding: 6px; border-radius: 28px; transition: box-shadow .3s; }
.lvl { position: relative; width: 236px; height: 206px; padding: 22px 22px 18px; border-radius: 22px; text-align: left; pointer-events: auto;
  background: linear-gradient(180deg, rgba(44, 28, 18, .82), rgba(22, 14, 9, .82)); box-shadow: inset 0 0 0 1.5px rgba(244, 236, 221, .12), 0 14px 30px rgba(0, 0, 0, .35);
  opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease), box-shadow .25s, background .25s; }
.is-on .lvl { opacity: 1; transform: none; }
.lvl::after { content: ''; position: absolute; inset: 7px; border-radius: 16px; border: 1.5px dashed rgba(217, 164, 65, 0); transition: border-color .25s; pointer-events: none; }
.lvl .n { position: absolute; right: 18px; top: 16px; font-family: Literata, serif; font-weight: 700; font-size: 20px; color: var(--cream-faint); }
.lvl .pips { display: flex; gap: 7px; }
.lvl .pips i { width: 14px; height: 14px; transform: rotate(45deg); border-radius: 2px; box-shadow: inset 0 0 0 1.5px rgba(217, 164, 65, .5); }
.lvl .pips i.on { background: var(--ochre); box-shadow: none; }
.lvl .nm { display: block; margin-top: 18px; font-family: Literata, serif; font-weight: 800; font-size: 44px; line-height: 1; color: var(--cream); }
.lvl .sub { display: block; margin-top: 12px; font-size: 18px; font-weight: 500; line-height: 1.3; color: var(--cream-faint); }
.lvl.is-on { background: linear-gradient(180deg, rgba(92, 60, 26, .9), rgba(40, 26, 14, .9)); box-shadow: inset 0 0 0 2px rgba(242, 200, 102, .85), 0 18px 36px rgba(0, 0, 0, .45); }
.lvl.is-on::after { border-color: rgba(242, 200, 102, .45); }
.lvl.is-on .nm { color: #FFE9B8; }
.lvl.is-on .sub { color: var(--cream-dim); }
.lvl:hover { box-shadow: inset 0 0 0 1.5px rgba(217, 164, 65, .6), 0 18px 36px rgba(0, 0, 0, .45); }
.su-go { position: absolute; left: 126px; top: 768px; display: flex; gap: 18px; pointer-events: auto; }
.su-go .wbtn.is-focus { box-shadow: 0 0 0 3px rgba(242, 200, 102, .55), 0 10px 24px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 250, 230, .5); }
.su-keys { position: absolute; left: 132px; bottom: 50px; font-size: 16px; font-weight: 600; letter-spacing: .08em; color: var(--cream-faint); }

/* book examples list (compact rows) + records */
.scenesl .head { position: absolute; left: 132px; top: 236px; font-size: 18px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--cream-faint); }
.scenesl .sc-list { top: 272px; }
.scenesl .mode { padding: 13px 26px 13px 92px; }
.scenesl .mode .n { top: 18px; }
.scenesl .mode .nm { font-size: 36px; }
.scenesl .mode .sub { font-size: 19px; margin-top: 4px; }
.scenesl .mode .stitch { bottom: 6px; }
.scenesl .rec-label { top: 790px; }
.recs { position: absolute; left: 106px; top: 822px; width: 760px; display: flex; flex-direction: column; gap: 6px; }
.rec { display: flex; align-items: baseline; gap: 14px; padding: 10px 26px; border-radius: 14px; text-align: left; pointer-events: auto; opacity: 0; transition: opacity .6s var(--ease) .3s, background .25s; }
.is-on .rec { opacity: 1; }
.rec .ic { width: 28px; flex: none; color: var(--ochre); font-size: 18px; }
.rec .rt { font-size: 22px; font-weight: 700; color: var(--cream); white-space: nowrap; }
.rec .rs { font-size: 17px; font-weight: 500; color: var(--cream-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec.is-active, .rec:hover { background: rgba(217, 164, 65, .13); }
.scenesl .su-keys { bottom: 40px; }

/* the caption panel of a book example: a felt band under the board */
.scenep { position: absolute; left: 0; right: 0; bottom: calc(18px - var(--pad-t)); height: 222px; pointer-events: none; z-index: 6;
  opacity: 0; transform: translateY(24px); transition: opacity .5s var(--ease), transform .6s var(--ease); }
.scenep.is-on { opacity: 1; transform: none; }
.sp-card { position: absolute; left: 150px; right: 150px; top: 0; bottom: 0; padding: 20px 40px 0 44px; border-radius: 30px; pointer-events: auto;
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr auto; column-gap: 40px;
  background: linear-gradient(180deg, rgba(40, 26, 17, .93), rgba(20, 13, 8, .95));
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 240, 215, .1), inset 0 0 0 1px rgba(217, 164, 65, .3); }
.sp-card::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background-image: var(--felt); background-size: 256px; opacity: .08; pointer-events: none; }
.sp-card::after { content: ''; position: absolute; inset: 9px; border-radius: 23px; border: 1.5px dashed rgba(217, 164, 65, .32); pointer-events: none; }
.sp-head { grid-column: 1 / 3; display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; }
.sp-tag { padding: 4px 12px 5px; border-radius: 9px; font-size: 14px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: #2A170C; background: var(--ochre); }
.sp-title { font-family: Literata, serif; font-weight: 700; font-size: 26px; color: var(--ochre-hi); }
.sp-dots { margin-left: auto; display: flex; gap: 10px; }
.sp-dots i { width: 12px; height: 12px; transform: rotate(45deg); border-radius: 2px; box-shadow: inset 0 0 0 1.5px rgba(217, 164, 65, .55); transition: background .3s, box-shadow .3s; }
.sp-dots i.on { background: rgba(217, 164, 65, .55); box-shadow: none; }
.sp-dots i.cur { background: var(--ochre-hi); box-shadow: 0 0 10px rgba(242, 200, 102, .6); }
.sp-text { grid-column: 1; align-self: center; position: relative; z-index: 1; font-size: 29px; font-weight: 600; line-height: 1.32; color: var(--cream); text-wrap: pretty; transition: opacity .3s; }
.sp-text.swap { animation: spSwap .55s var(--ease); }
@keyframes spSwap { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.scenep.is-busy .sp-text { opacity: .5; }
.sp-btns { grid-column: 2; grid-row: 2; align-self: center; display: flex; gap: 14px; position: relative; z-index: 1; }
.sp-btns .wbtn { height: 62px; padding: 0 26px; display: inline-flex; align-items: center; gap: 10px; font-size: 23px; }
.sp-btns .arr { font-size: 26px; line-height: 1; }
.sp-btns .sp-list { display: none; }
.scenep.is-done .sp-btns .sp-list { display: inline-flex; }
.scenep.is-done .sp-btns .sp-next { display: none; }
.sp-text .nb { white-space: nowrap; }
.scenep.is-busy .sp-next { opacity: .45; }
.sp-keys { grid-column: 1 / 3; padding: 4px 0 14px; position: relative; z-index: 1; font-size: 14px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--cream-faint); }

/* dialog (R11 offer, restart, end now) */
.dlg { z-index: 11; }
.dcard { width: 820px; text-align: center; padding: 44px 64px 40px; }
.d-crest { width: 70px; height: 70px; margin: 0 auto 4px; }
.d-crest svg { width: 100%; height: 100%; }
.d-lines p { margin: 0 0 10px; font-size: 25px; line-height: 1.4; color: var(--cream-dim); }
.d-lines p:first-child { color: var(--cream); font-weight: 600; }
.dcard .w-btns { margin-top: 26px; }
.dcard .w-keys { margin-top: 18px; }

/* «Рахмет!» */
.thanksl { z-index: 5; }
.t-scrim { position: absolute; left: calc(-1 * var(--pad-l)); right: calc(-1 * var(--pad-l)); top: calc(-1 * var(--pad-t)); bottom: calc(-1 * var(--pad-t));
  background: radial-gradient(ellipse 62% 70% at 50% 42%, rgba(10, 6, 4, .74) 0%, rgba(10, 6, 4, .5) 52%, rgba(10, 6, 4, .2) 100%); }
.t-box { position: absolute; left: 50%; top: 40%; width: 1400px; transform: translate(-50%, -46%) scale(.96); opacity: 0; text-align: center; pointer-events: auto;
  transition: transform .9s var(--ease-pop), opacity .6s var(--ease); }
.thanksl.is-on .t-box { transform: translate(-50%, -50%); opacity: 1; }
.t-title { font-family: Literata, serif; font-weight: 800; font-size: 190px; line-height: 1; letter-spacing: -.015em; color: #FFE3A2;
  text-shadow: 0 4px 0 #7A4C0E, 0 18px 50px rgba(0, 0, 0, .55), 0 0 60px rgba(255, 196, 90, .25); }
.t-rule { display: block; margin: 16px auto 22px; }
.t-teams { display: flex; align-items: center; justify-content: center; gap: 30px; }
.t-teams .tn { flex: 1; font-family: Literata, serif; font-weight: 700; font-size: 58px; line-height: 1.1; }
.t-teams .t0 { text-align: right; color: #F08D5F; } .t-teams .t1 { text-align: left; color: #6FB6C6; }
.t-em { position: relative; display: flex; align-items: center; flex: none; }
.t-em .em { width: 96px; height: 96px; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .5)); }
.t-em .em:first-child { margin-right: -14px; } .t-em .em:last-child { margin-left: -14px; }
.t-em .knot { position: relative; z-index: 2; width: 74px; height: 74px; border-radius: 50%; background: radial-gradient(circle at 40% 32%, #3A2618, #1A100A 70%); box-shadow: 0 6px 16px rgba(0, 0, 0, .5), inset 0 0 0 2px rgba(217, 164, 65, .55); display: grid; place-items: center; }
.t-em .knot svg { width: 52px; height: 52px; animation: crestSpin 18s linear infinite; }
.t-sub { margin-top: 26px; font-size: 32px; font-weight: 600; color: var(--cream); }
.t-sub2 { margin-top: 8px; font-size: 25px; font-weight: 500; color: var(--cream-dim); }
.thanksl .w-btns { margin-top: 34px; }
.t-keys { margin-top: 16px; }

/* demo pill */
.demohint { position: absolute; left: 50%; bottom: calc(26px - var(--pad-t)); transform: translate(-50%, 10px); display: flex; align-items: center; gap: 12px; padding: 10px 24px 11px 18px; border-radius: 22px;
  font-size: 17px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--cream-dim); background: rgba(16, 10, 6, .72);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(244, 236, 221, .1); opacity: 0; transition: opacity .5s var(--ease), transform .5s var(--ease); pointer-events: none; z-index: 6; }
.demohint.is-on { opacity: 1; transform: translate(-50%, 0); }
.demohint .dh-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--terra-hi); box-shadow: 0 0 10px rgba(224, 122, 78, .7); animation: breathe 1.6s var(--ease-io) infinite; }

/* replay bar */
.replaybar { position: absolute; left: 50%; bottom: calc(24px - var(--pad-t)); transform: translate(-50%, 10px); display: flex; align-items: center; gap: 18px; padding: 10px 26px 11px; border-radius: 22px;
  background: rgba(16, 10, 6, .76); box-shadow: 0 10px 24px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(217, 164, 65, .3); opacity: 0; transition: opacity .5s var(--ease), transform .5s var(--ease); pointer-events: none; z-index: 6; white-space: nowrap; }
.replaybar.is-on { opacity: 1; transform: translate(-50%, 0); }
.rb-name { font-size: 16px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--ochre); }
.rb-step { font-size: 24px; font-weight: 800; color: var(--cream); }
.rb-keys { font-size: 15px; font-weight: 600; letter-spacing: .06em; color: var(--cream-faint); }

/* HUD: the computer is thinking */
.team .think { display: none; align-items: center; gap: 5px; font-size: 14px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ochre-hi); height: 0; overflow: visible; }
.team.t1 .think { justify-content: flex-end; }
.team .think b { font-weight: 700; margin-right: 3px; }
.team .think i { width: 5px; height: 5px; border-radius: 50%; background: var(--ochre-hi); animation: thinkDot 1.1s var(--ease-io) infinite; }
.team .think i:nth-of-type(2) { animation-delay: .18s; } .team .think i:nth-of-type(3) { animation-delay: .36s; }
@keyframes thinkDot { 0%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }
.team.is-thinking .ai { display: none; }
.team.is-thinking .think { display: flex; }
.team.is-thinking .em { animation: thinkPulse 1.3s var(--ease-io) infinite; }
@keyframes thinkPulse { 0%, 100% { transform: scale(1); filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .45)); } 50% { transform: scale(1.06); filter: drop-shadow(0 0 14px rgba(242, 200, 102, .55)); } }

/* pause card: two columns; help: rules + two key columns */
.card.wide { width: 1120px; padding: 48px 56px 44px; }
.card.wide .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 30px; }
.card.wide .row { font-size: 23px; padding: 13px 20px; }
.card.help { width: 1640px; }
.help-grid.g3 { grid-template-columns: 1.2fr 1fr 1fr; gap: 40px; }
.help-grid.g3 li { font-size: 18px; padding: 8px 0; }

/* win card: «Рахмет!» first; compact non-blocking card in the demo */
.winl.compact .w-scrim { opacity: .45; }
.winl.compact .wcard { pointer-events: none; }
.winl.compact.is-on .wcard { transform: translate(-50%, -50%) scale(.74); }
.winl.compact .w-btns, .winl.compact .w-keys { display: none; }
.w-next { margin-top: 18px; font-size: 22px; font-weight: 700; letter-spacing: .06em; color: var(--ochre-hi); }
.w-next:empty { display: none; }
.wbtn:focus-visible { outline: 2px solid var(--ochre-hi); outline-offset: 4px; }

/* undo: a short dim "rewind" over the stage */
.rewind { position: absolute; left: calc(-1 * var(--pad-l)); right: calc(-1 * var(--pad-l)); top: calc(-1 * var(--pad-t)); bottom: calc(-1 * var(--pad-t)); pointer-events: none; z-index: 9; opacity: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(10, 6, 4, .25), rgba(10, 6, 4, .7)); }
.rewind.go { animation: rewind .42s var(--ease-io); }
@keyframes rewind { 0% { opacity: 0; } 35% { opacity: 1; } 100% { opacity: 0; } }
/* the «Рахмет!» screen keeps the stage clean: no scoreboard */
.ui.thanks-on .hud { opacity: 0; transition: opacity .5s var(--ease); }
