/* mymeet games — shared design system.
   mymeet canon: white surfaces, border-only cards, radius 4, Inter 400/500,
   DS v2 (special.mymeet.ai): buttons only blue #0138C7 (white text) or white; no lime, no slate #585E6C.
   Apple layer: translucent chrome, instant press feedback, critically damped motion,
   reduced-motion / reduced-transparency fallbacks. */

:root{
  --gx-blue:#0138C7;--gx-blue-hover:#0032B1;--gx-blue-press:#002C9C;
  --gx-accent:#32C1FE;          /* single-value highlight (bluePro) */
  --gx-accent-soft:#E4ECFA;     /* soft highlight: badges, records, tags — blue text on it */
  --gx-text:#212833;--gx-muted:#818AA3;--gx-muted2:#818AA3;--gx-disabled:#C7C8CA;
  --gx-bg:#FFFFFF;--gx-subtle:#F7F7F8;--gx-card-hover:#FAFAFA;--gx-tile:#F2F2F2;
  --gx-border:#EFEFEF;--gx-border-strong:#DDDEDF;
  --gx-sea:#E4ECFA;--gx-sea-light:#F6F8FE;
  --gx-success:#0D9655;--gx-danger:#CC3333;
  --gx-purple:#8A38F5;--gx-orange:#FF9D16;--gx-yellow:#F2C300;--gx-teal:#0DACAA;
  --gx-r:4px;
  /* Critically damped "spring" approximation for CSS (Apple: damping 1.0, response ~0.35s) */
  --gx-ease:cubic-bezier(.2,.8,.2,1);
  --gx-ease-out:cubic-bezier(.16,1,.3,1);
  --gx-font:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',system-ui,sans-serif;
}

*{margin:0;padding:0;box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html{-webkit-text-size-adjust:100%}
/* `hidden` must always win over component display rules (.screen{display:flex}, .gx-btn…) */
[hidden]{display:none!important}
body{font-family:var(--gx-font);font-optical-sizing:auto;background:var(--gx-bg);color:var(--gx-text);
  font-size:16px;line-height:1.4;letter-spacing:-0.01em;-webkit-font-smoothing:antialiased}
a{color:var(--gx-blue);text-decoration:none}
button{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--gx-blue);outline-offset:2px;border-radius:var(--gx-r)}

/* ── Translucent top bar (Apple material) ── */
.gx-bar{position:sticky;top:0;z-index:40;height:56px;display:flex;align-items:center;gap:16px;
  padding:0 16px;background:rgba(255,255,255,.72);
  -webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);
  border-bottom:1px solid rgba(33,40,51,.06)}
.gx-bar-inner{width:100%;max-width:1120px;margin:0 auto;display:flex;align-items:center;gap:16px}
.gx-back{display:inline-flex;align-items:center;gap:8px;color:var(--gx-text);font-size:14px;font-weight:500;
  padding:8px 12px 8px 8px;border-radius:var(--gx-r);transition:background .15s}
.gx-back:hover{background:var(--gx-subtle)}
.gx-back svg{width:20px;height:20px;fill:var(--gx-blue)}
.gx-logo{display:flex;align-items:center;gap:12px;color:var(--gx-text)}
.gx-logo img{height:26px;width:auto;display:block}
.gx-logo-sep{width:1px;height:20px;background:var(--gx-border-strong)}
.gx-logo-sub{font-size:14px;font-weight:500;color:var(--gx-muted2)}
.gx-bar-title{font-size:15px;font-weight:500;letter-spacing:-0.02em;flex:1;text-align:center;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gx-bar-slot{min-width:88px;display:flex;justify-content:flex-end;gap:8px}

/* ── Buttons: feedback on press, not release ── */
.gx-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;
  padding:0 20px;border:none;border-radius:var(--gx-r);font-size:16px;font-weight:500;letter-spacing:-0.01em;
  cursor:pointer;user-select:none;-webkit-user-select:none;text-decoration:none;
  transition:background .15s,transform .1s var(--gx-ease),opacity .15s}
.gx-btn:active{transform:scale(.97)}
.gx-btn[disabled]{opacity:.4;pointer-events:none}
/* Primary and product CTA are both brand blue; secondary is a white button with a hairline */
.gx-btn-cta,.gx-btn-primary{background:var(--gx-blue);color:#fff}
.gx-btn-cta:hover,.gx-btn-primary:hover{background:var(--gx-blue-hover)}
.gx-btn-cta:active,.gx-btn-primary:active{background:var(--gx-blue-press)}
.gx-btn-ghost{background:#fff;color:var(--gx-text);box-shadow:inset 0 0 0 1px var(--gx-border-strong)}
.gx-btn-ghost:hover{background:var(--gx-card-hover)}
/* In a result sheet the product CTA leads; «Ещё раз» steps back to a white button */
.gx-sheet-actions:has(.gx-btn-cta) .gx-btn-primary{background:#fff;color:var(--gx-text);box-shadow:inset 0 0 0 1px var(--gx-border-strong)}
.gx-btn-lg{min-height:48px;padding:0 28px;font-size:16px}
.gx-btn-icon{width:44px;padding:0}
.gx-btn-icon svg{width:20px;height:20px;fill:currentColor}

/* ── Type ── */
.gx-eyebrow{font-size:14px;font-weight:500;color:var(--gx-blue);letter-spacing:-0.01em}
.gx-h1{font-size:clamp(36px,7vw,64px);font-weight:500;letter-spacing:-0.04em;line-height:1.02}
.gx-h2{font-size:clamp(28px,4.5vw,40px);font-weight:500;letter-spacing:-0.03em;line-height:1.1}
.gx-h3{font-size:20px;font-weight:500;letter-spacing:-0.02em;line-height:1.2}
.gx-lead{font-size:18px;line-height:1.5;color:var(--gx-text);max-width:560px}
.gx-micro{font-size:11px;font-weight:500;text-transform:uppercase;letter-spacing:.04em;color:var(--gx-muted)}
.gx-num{font-variant-numeric:tabular-nums}

/* ── Surfaces ── */
.gx-card{background:#fff;border:1px solid var(--gx-border);border-radius:var(--gx-r)}
.gx-stat{display:flex;flex-direction:column;gap:4px;padding:8px 16px;border:1px solid var(--gx-border);
  border-radius:var(--gx-r);background:#fff;min-width:84px}
.gx-stat-label{font-size:11px;font-weight:500;text-transform:uppercase;letter-spacing:.04em;color:var(--gx-muted)}
.gx-stat-val{font-size:20px;font-weight:500;letter-spacing:-0.02em;font-variant-numeric:tabular-nums}
.gx-chip{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px;border-radius:var(--gx-r);
  background:var(--gx-subtle);font-size:13px;font-weight:500;color:var(--gx-muted2)}
.gx-kbd{display:inline-flex;align-items:center;height:24px;padding:0 8px;border-radius:var(--gx-r);
  border:1px solid var(--gx-border-strong);border-bottom-width:2px;font-size:12px;font-weight:500;color:var(--gx-muted2);background:#fff}
.gx-input{height:48px;width:100%;padding:0 16px;border:1px solid var(--gx-border-strong);border-radius:var(--gx-r);
  font:inherit;font-size:16px;color:var(--gx-text);background:#fff;outline:none;transition:border-color .15s,box-shadow .15s}
.gx-input:focus{border-color:var(--gx-blue);box-shadow:0 0 0 3px rgba(1,56,199,.12)}

/* ── Sheet / modal: dim to focus, materialize instead of fade ── */
/* The scrim starts under the top bar: «← Игры» stays reachable, the result never traps the player */
.gx-scrim{position:fixed;inset:56px 0 0 0;z-index:80;background:rgba(33,40,51,.32);display:flex;align-items:center;
  justify-content:center;padding:16px;opacity:0;pointer-events:none;transition:opacity .25s var(--gx-ease)}
.gx-scrim.is-open{opacity:1;pointer-events:auto}
.gx-sheet{width:100%;max-width:440px;max-height:calc(100dvh - 56px - 32px);overflow:auto;background:#fff;border-radius:12px;
  padding:32px 24px 24px;box-shadow:0 24px 64px rgba(33,40,51,.24);text-align:center;
  transform:translateY(16px) scale(.97);transition:transform .35s var(--gx-ease-out)}
.gx-scrim.is-open .gx-sheet{transform:none}
.gx-sheet-actions{display:flex;flex-direction:column;gap:8px;margin-top:24px}
.gx-sheet-actions .gx-btn{width:100%}
.gx-sheet-home{display:inline-flex;align-items:center;gap:4px;margin-top:16px;min-height:44px;padding:0 8px;
  font-size:16px;font-weight:500;color:var(--gx-blue)}
.gx-sheet-home svg{width:18px;height:18px;fill:currentColor}
@media (max-width:520px){
  .gx-scrim{align-items:flex-end;padding:0}
  .gx-sheet{border-radius:16px 16px 0 0;max-width:none;padding-bottom:calc(24px + env(safe-area-inset-bottom));
    transform:translateY(100%)}
}

/* ── Leaderboard ── */
.gx-lb{width:100%;text-align:left}
.gx-lb-head{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:8px}
.gx-lb-title{font-size:15px;font-weight:500}
.gx-lb-list{list-style:none;border:1px solid var(--gx-border);border-radius:var(--gx-r);overflow:hidden}
.gx-lb-row{display:flex;align-items:center;gap:12px;height:44px;padding:0 16px;font-size:14px}
.gx-lb-row+.gx-lb-row{border-top:1px solid var(--gx-border)}
.gx-lb-row.is-me{background:var(--gx-sea-light)}
.gx-lb-rank{width:20px;color:var(--gx-muted);font-variant-numeric:tabular-nums}
.gx-lb-row:nth-child(-n+3) .gx-lb-rank{color:var(--gx-text);font-weight:500}
.gx-lb-name{flex:1;min-width:0;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gx-lb-score{font-weight:500;font-variant-numeric:tabular-nums}
.gx-lb-empty{padding:16px;font-size:14px;color:var(--gx-muted);text-align:center}

/* ── Toast ── */
.gx-toast{position:fixed;left:50%;bottom:calc(24px + env(safe-area-inset-bottom));z-index:90;
  transform:translate(-50%,16px);opacity:0;pointer-events:none;background:var(--gx-text);color:#fff;
  font-size:14px;font-weight:500;padding:12px 16px;border-radius:8px;box-shadow:0 8px 24px rgba(33,40,51,.24);
  transition:opacity .2s,transform .3s var(--gx-ease-out);white-space:nowrap}
.gx-toast.is-on{opacity:1;transform:translate(-50%,0)}

/* ── Entrance motion (opacity + small rise, critically damped) ── */
@keyframes gx-rise{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
.gx-rise{animation:gx-rise .5s var(--gx-ease-out) both}
@keyframes gx-pop{0%{transform:scale(.92);opacity:0}100%{transform:none;opacity:1}}

#gx-confetti{position:fixed;inset:0;pointer-events:none;z-index:100}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;
    transition-duration:.12s!important}
  .gx-sheet{transform:none!important}
}
@media (prefers-reduced-transparency:reduce){
  .gx-bar{background:#fff;-webkit-backdrop-filter:none;backdrop-filter:none}
}
