  :root {
    --cyan: #6ce7ff;
    --green: #66ffae;
    --orange: #ffb454;
    --red: #ff5a6e;
    --ink: #050b18;
  }
  * { box-sizing: border-box; }
  html, body {
    margin: 0;
    height: 100%;
    background: #030711;
    color: #e8f4ff;
    font-family: "Segoe UI", Arial, sans-serif;
    overflow: hidden;
  }
  body {
    display: block;
    padding: 0;
  }
  #game {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: #050a16;
  }
  #sky { position:absolute; inset:0; z-index:0; overflow:hidden; background:#050a16; }
  .sky-layer { position:absolute; inset:-2%; background-size:cover; background-position:center; transition:opacity .9s ease; }
  #sky-a { opacity:1; }
  #sky-b { opacity:0; }
  #sky-tint { position:absolute; inset:0; mix-blend-mode:color; opacity:.5; background-color:#2f8dff; pointer-events:none; transition:background-color .7s ease, opacity .7s ease; }
  /* Квадратная сетка поверх туманностей: цвет задаётся режимом слов через --grid-line. */
  #sky-grid {
    position:absolute; inset:-120px; pointer-events:none;
    opacity:.16; will-change:transform;
    background-image:
      repeating-linear-gradient(0deg, var(--grid-line, rgba(108,231,255,.55)) 0 1px, transparent 1px 56px),
      repeating-linear-gradient(90deg, var(--grid-line, rgba(108,231,255,.55)) 0 1px, transparent 1px 56px);
    animation:sky-grid-drift 18s linear infinite;
  }
  @keyframes sky-grid-drift {
    from { transform:translate3d(0,0,0); }
    to   { transform:translate3d(56px,56px,0); }
  }
  @media (prefers-reduced-motion: reduce) {
    #sky-grid { animation:none; }
  }
  /* Экран загрузки: скрывается только когда все ресурсы déjà в памяти. */
  .loader {
    position:fixed; inset:0; z-index:500; display:grid; place-items:center;
    background:radial-gradient(ellipse at 50% 45%, #0b1b36 0%, #030711 72%);
    transition:opacity .35s ease; font-family:Consolas, "Courier New", monospace;
  }
  .loader.hidden { opacity:0; pointer-events:none; visibility:hidden; transition:opacity .35s ease, visibility 0s linear .35s; }
  .loader-box {
    width:min(460px,86vw); padding:22px 24px; text-align:center;
    border:2px solid var(--cyan); border-radius:3px;
    background:linear-gradient(180deg, rgba(18,40,74,.96), rgba(7,20,44,.96));
    box-shadow:6px 6px 0 rgba(0,0,0,.6);
  }
  .loader-brand {
    color:var(--cyan); font-size:20px; font-weight:900; letter-spacing:.18em;
  }
  .loader-caption {
    margin-top:6px; color:#9ab3d0; font-size:10px; font-weight:800; letter-spacing:.16em;
  }
  .loader-bar {
    height:8px; margin:18px 0 10px; border:1px solid rgba(108,231,255,.4);
    background:#061224; overflow:hidden;
  }
  #loader-fill {
    height:100%; width:0;
    background:linear-gradient(90deg, #2f8dff, var(--cyan), var(--green));
    transition:width .18s linear;
  }
  .loader-status {
    min-height:14px; color:#c7e4f7; font-size:10px; font-weight:700; letter-spacing:.1em;
  }
  canvas {
    display: block;
    width: 100%;
    height: 100%;
  }
  #fx3d { position:absolute; inset:0; width:100%; height:100%; z-index:0; pointer-events:none; }
  #fx-fade {
    position:absolute; inset:0; z-index:1; pointer-events:none;
    background:#030711; opacity:0; transition:opacity .24s ease;
  }
  #fx-fade.show { opacity:1; }
  #field { position:absolute; inset:0; width:100%; height:100%; z-index:1; pointer-events:auto; }
  #hud { z-index: 4; }
  #hint, #warning, #mobile-input { z-index: 4; }
  .overlay { z-index: 6; }
  #shop {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 50% 0%, rgba(24,58,104,.5), transparent 60%), rgba(1,4,10,.9);
    backdrop-filter: blur(6px); z-index: 20;
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right))
             max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }
  #shop.hidden { display: none; }
  .hangar {
    --edge: rgba(108,231,255,.45);
    --hot: #ffd166;
    position: relative;
    width: min(100%, 560px); height: min(100%, 900px);
    display: flex; flex-direction: column; overflow: hidden;
    border: 2px solid var(--edge); border-radius: 10px;
    background: linear-gradient(180deg, rgba(16,36,68,.98), rgba(4,10,24,.99));
    box-shadow: 6px 6px 0 rgba(0,0,0,.55), 0 0 0 1px rgba(0,0,0,.85), inset 0 0 0 1px rgba(255,255,255,.04);
  }
  .hangar::after {
    content:''; position:absolute; inset:0; z-index:9; pointer-events:none;
    background:repeating-linear-gradient(0deg, rgba(108,231,255,.025) 0 1px, transparent 1px 4px);
  }
  .hg-topbar { display:flex; align-items:center; gap:10px; padding:10px 12px 6px; }
  #closeShop.hg-icon-btn {
    width:34px; height:34px; flex:0 0 auto; display:grid; place-items:center; cursor:pointer;
    border:2px solid rgba(108,231,255,.5); border-radius:4px; background:#0d2444; color:var(--cyan);
    box-shadow:3px 3px 0 rgba(0,0,0,.5);
  }
  .hg-icon-btn svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:2.6; stroke-linecap:square; stroke-linejoin:miter; }
  .hg-title { flex:1; display:flex; flex-direction:column; gap:1px; line-height:1.05; min-width:0; }
  .hg-title span, .hg-wallet, .hg-stage-tag, .hg-chip, .hg-drag-hint, .hg-tab b, .hg-section,
  .hg-price, .hg-hint, .skin-meta em {
    font-family: Consolas, "Courier New", monospace;
  }
  .hg-title span { font-size:9px; font-weight:900; letter-spacing:.16em; color:var(--cyan); }
  .hg-title strong { font-size:17px; font-weight:900; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .hg-wallet {
    display:flex; align-items:center; gap:5px; padding:6px 9px; border-radius:4px;
    background:#1a1204; border:2px solid rgba(255,209,102,.55); color:var(--hot);
    font-weight:900; font-size:13px; box-shadow:3px 3px 0 rgba(0,0,0,.45);
  }
  .hg-wallet-label { font-size:9px; opacity:.72; letter-spacing:.1em; }
  .hg-coin {
    width:14px; height:14px; display:grid; place-items:center; border-radius:2px; font-size:9px;
    background:linear-gradient(135deg,#fff0b0,#ffb454); color:#5a3100;
  }
  .hg-stage {
    position: relative; flex:0 0 auto; height:clamp(280px, 46vh, 560px); min-height:0;
    margin:6px 10px 0; border-radius:8px; overflow:hidden;
    background:
      radial-gradient(circle at 50% 38%, rgba(58,138,220,.3), transparent 62%),
      linear-gradient(180deg, #0a203c, #030915);
    border:2px solid rgba(108,231,255,.3);
    box-shadow: inset 0 0 30px rgba(0,0,0,.65), 3px 3px 0 rgba(0,0,0,.4);
  }
  .hg-stage::before {
    content:''; position:absolute; inset:6px; pointer-events:none; z-index:2; opacity:.85;
    background:
      linear-gradient(var(--cyan),var(--cyan)) left top/14px 2px no-repeat,
      linear-gradient(var(--cyan),var(--cyan)) left top/2px 14px no-repeat,
      linear-gradient(var(--cyan),var(--cyan)) right top/14px 2px no-repeat,
      linear-gradient(var(--cyan),var(--cyan)) right top/2px 14px no-repeat,
      linear-gradient(var(--cyan),var(--cyan)) left bottom/14px 2px no-repeat,
      linear-gradient(var(--cyan),var(--cyan)) left bottom/2px 14px no-repeat,
      linear-gradient(var(--cyan),var(--cyan)) right bottom/14px 2px no-repeat,
      linear-gradient(var(--cyan),var(--cyan)) right bottom/2px 14px no-repeat;
  }
  .hg-stage-grid {
    position:absolute; left:-24%; right:-24%; bottom:-36%; height:76%;
    transform:perspective(260px) rotateX(60deg); transform-origin:bottom;
    background-image:linear-gradient(rgba(108,231,255,.14) 1px, transparent 1px),
                     linear-gradient(90deg, rgba(108,231,255,.14) 1px, transparent 1px);
    background-size:26px 26px; mask-image:linear-gradient(to top, #000, transparent); pointer-events:none;
  }
  .hg-stage-ring {
    position:absolute; left:50%; top:52%; width:min(440px, 62vh, 72%); aspect-ratio:1;
    transform:translate(-50%,-50%); border-radius:50%;
    border:1px dashed rgba(108,231,255,.3); box-shadow:0 0 30px rgba(108,231,255,.12);
    animation:hg-spin 24s linear infinite; pointer-events:none;
  }
  .hg-stage-ring::after { content:''; position:absolute; inset:18px; border-radius:50%; border:1px solid rgba(108,231,255,.12); }
  @keyframes hg-spin { to { transform:translate(-50%,-50%) rotate(360deg); } }
  .hg-stage-floor {
    position:absolute; left:50%; top:66%; width:220px; height:26px; transform:translate(-50%,-50%);
    border-radius:50%; background:radial-gradient(ellipse, rgba(108,231,255,.26), transparent 72%);
    filter:blur(3px); pointer-events:none;
  }
  #preview-canvas {
    position:absolute; inset:0; width:100%; height:100%; background:transparent;
    touch-action:none; cursor:grab;
  }
  #preview-canvas:active { cursor:grabbing; }
  .hg-stage-tag {
    position:absolute; top:8px; padding:4px 7px; border-radius:2px; pointer-events:none; z-index:3;
    background:rgba(2,8,20,.78); border:1px solid rgba(108,231,255,.22);
    font-size:8px; font-weight:900; letter-spacing:.12em; color:rgba(190,225,255,.7);
  }
  .hg-stage-tag-left { left:8px; }
  .hg-stage-tag-right { right:8px; color:var(--cyan); border-color:rgba(108,231,255,.45); }
  .hg-stage-bottom {
    position:absolute; left:8px; right:8px; bottom:7px; z-index:3; pointer-events:none;
    display:flex; align-items:center; justify-content:space-between; gap:6px;
  }
  .hg-chip {
    padding:4px 8px; border-radius:2px; background:rgba(2,8,20,.82);
    border:1px solid rgba(108,231,255,.35); color:#dff6ff; font-size:9px; font-weight:900; letter-spacing:.08em;
  }
  .hg-drag-hint { font-size:8px; font-weight:900; letter-spacing:.08em; color:rgba(180,210,235,.55); }
  .hg-tabs {
    display:flex; gap:4px; margin:8px 10px 0; padding:3px; border-radius:4px;
    background:#030b1a; border:2px solid rgba(108,231,255,.22);
  }
  .hg-tab {
    flex:1; border:2px solid transparent; border-radius:2px; padding:7px 6px; cursor:pointer;
    background:transparent; color:#7fa3c0; font:900 10px Consolas, "Courier New", monospace;
    letter-spacing:.08em; display:flex; align-items:center; justify-content:center; gap:6px;
  }
  .hg-tab.active {
    color:#04121f; background:var(--cyan); border-color:#bff4ff;
    box-shadow:2px 2px 0 rgba(0,0,0,.45);
  }
  .hg-tab b { font-size:9px; opacity:.7; }
  .hg-tab.active b { opacity:.9; }
  .hg-tab span { font-size:9px; }
  .hg-pages { position:relative; flex:1 1 auto; min-height:0; overflow:hidden; }
  .hg-page { display:none; height:100%; overflow:auto; padding:8px 10px 10px; -webkit-overflow-scrolling:touch; }
  .hg-page.active { display:block; }
  .hg-section {
    display:flex; justify-content:space-between; gap:8px; margin-bottom:8px;
    font-size:9px; font-weight:900; letter-spacing:.12em; color:rgba(160,200,230,.65);
  }
  .hg-section span:last-child { color:var(--hot); }
  .skins { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; padding-bottom:4px; }
  .skin-card {
    position:relative; border:2px solid rgba(255,255,255,.12); border-radius:4px; padding:7px;
    min-width:0; text-align:left; color:#fff; cursor:pointer; overflow:hidden;
    background:linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.015));
    box-shadow:3px 3px 0 rgba(0,0,0,.4);
    transition:transform .12s, border-color .12s, background .12s;
  }
  .skin-card:active { transform:translate(2px,2px); box-shadow:1px 1px 0 rgba(0,0,0,.4); }
  .skin-card.active {
    border-color:var(--hot); background:linear-gradient(160deg, rgba(255,209,102,.16), rgba(255,209,102,.03));
    box-shadow:3px 3px 0 rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,209,102,.5);
  }
  .skin-art {
    position:relative; display:block; width:100%; height:44px; margin-bottom:6px; border-radius:2px;
    background:radial-gradient(circle at 50% 60%, rgba(108,231,255,.18), transparent 72%),
               linear-gradient(180deg, rgba(255,255,255,.04), transparent);
    border-bottom:1px solid rgba(108,231,255,.12);
  }
  .skin-art::before {
    content:''; position:absolute; left:50%; top:48%; width:44px; height:44px;
    transform:translate(-50%,-50%);
    clip-path:polygon(50% 0, 63% 38%, 100% 78%, 62% 66%, 50% 100%, 38% 66%, 0 78%, 37% 38%);
    background:linear-gradient(180deg,#dcecff,#55779b);
    filter:drop-shadow(0 3px 8px rgba(0,0,0,.5));
  }
  .skin-art::after {
    content:''; position:absolute; left:50%; bottom:5px; width:36px; height:4px;
    transform:translateX(-50%); border-radius:50%; background:rgba(108,231,255,.35); filter:blur(2px);
  }
  .art-interceptor::before { clip-path:polygon(50% 0, 59% 34%, 86% 76%, 57% 64%, 50% 100%, 43% 64%, 14% 76%, 41% 34%); background:linear-gradient(180deg,#7dffea,#0f766e); }
  .art-twin::before { clip-path:polygon(50% 0, 62% 32%, 100% 70%, 70% 62%, 62% 100%, 38% 100%, 30% 62%, 0 70%, 38% 32%); background:linear-gradient(180deg,#e5e7eb,#4b5563); }
  .art-heavy::before { clip-path:polygon(50% 0, 66% 36%, 100% 70%, 72% 70%, 66% 100%, 34% 100%, 28% 70%, 0 70%, 34% 36%); background:linear-gradient(180deg,#d4d4d8,#3f3f46); }
  .art-stealth::before { clip-path:polygon(50% 0, 72% 46%, 100% 84%, 58% 68%, 50% 100%, 42% 68%, 0 84%, 28% 46%); background:linear-gradient(180deg,#6b7280,#111827); }
  .art-ufo::before { clip-path:polygon(34% 24%, 66% 24%, 82% 46%, 100% 66%, 72% 62%, 62% 80%, 38% 80%, 28% 62%, 0 66%, 18% 46%); background:linear-gradient(180deg,#d8b4fe,#581c87); }
  .art-arrow::before { clip-path:polygon(50% 0, 58% 30%, 78% 76%, 56% 64%, 50% 100%, 44% 64%, 22% 76%, 42% 30%); background:linear-gradient(180deg,#bae6fd,#0369a1); }
  .art-cruiser::before { clip-path:polygon(50% 0, 72% 30%, 100% 74%, 70% 68%, 64% 100%, 36% 100%, 30% 68%, 0 74%, 28% 30%); background:linear-gradient(180deg,#fed7aa,#b45309); }
  .skin-meta { display:flex; flex-direction:column; gap:1px; }
  .skin-meta strong { font-size:12px; font-weight:900; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .skin-meta small { font-size:9px; color:#7fa3c0; font-family:Consolas, "Courier New", monospace; }
  .skin-meta em { margin-top:4px; font-style:normal; font-size:10px; font-weight:900; color:var(--hot); letter-spacing:.06em; }
  .skin-meta em.own { color:var(--green); }
  .hg-swatches { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:9px; }
  .hg-swatch {
    position:relative; aspect-ratio:1; border:0; cursor:pointer;
    clip-path:polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    background:var(--swatch); filter:drop-shadow(2px 2px 0 rgba(0,0,0,.45));
    transition:transform .12s, filter .12s;
  }
  .hg-swatch::before {
    content:''; position:absolute; inset:4px; clip-path:inherit;
    background:rgba(255,255,255,.18);
  }
  .hg-swatch.auto {
    background:conic-gradient(#ff5a6e,#ffd166,#66ffae,#6ce7ff,#a78bfa,#ff5a6e);
  }
  .hg-swatch.auto span {
    position:absolute; inset:5px; display:grid; place-items:center; clip-path:inherit;
    background:#0a1730; color:#fff; font-size:11px; font-style:normal;
  }
  .hg-swatch.active { transform:scale(1.1); filter:drop-shadow(0 0 0 2px var(--hot)) drop-shadow(2px 2px 0 rgba(0,0,0,.45)); }
  .hg-reset {
    margin-top:14px; width:100%; padding:9px; border-radius:3px; cursor:pointer;
    border:2px solid rgba(255,255,255,.18); background:#0b1b34; color:#cfE6f8;
    font:900 10px Consolas, "Courier New", monospace; letter-spacing:.1em;
    box-shadow:3px 3px 0 rgba(0,0,0,.45);
    display:flex; align-items:center; justify-content:center; gap:8px;
  }
  .hg-key {
    display:inline-grid; place-items:center; min-width:18px; height:18px; padding:0 3px;
    border:1px solid currentColor; border-radius:2px; font:900 9px Consolas, "Courier New", monospace;
    opacity:.9;
  }
  .hg-bottom {
    display:flex; align-items:center; gap:10px; padding:9px 12px max(10px, env(safe-area-inset-bottom));
    border-top:2px solid rgba(108,231,255,.24); background:#020814;
  }
  .hg-price {
    flex:1; display:flex; align-items:center; gap:7px; min-width:0;
    font-size:10px; font-weight:900; letter-spacing:.04em; line-height:1.3; color:#9dbcd6;
  }
  .hg-price .hg-key { color:#7fa3c0; flex:0 0 auto; }
  .hg-primary {
    flex:0 0 auto; min-width:145px; padding:11px 14px; border:2px solid #bff4ff; border-radius:3px; cursor:pointer;
    background:linear-gradient(180deg,#8ff0ff,#38a8ff); color:#04121f;
    font:900 11px Consolas, "Courier New", monospace; letter-spacing:.08em;
    display:flex; align-items:center; justify-content:center; gap:8px;
    box-shadow:4px 4px 0 rgba(0,0,0,.5);
  }
  .hg-primary .hg-key { border-color:#04121f; background:rgba(255,255,255,.35); }
  .hg-primary:disabled { opacity:.5; cursor:default; }
  .hg-toast {
    position:absolute; left:50%; bottom:76px; z-index:10; pointer-events:none;
    transform:translate(-50%,8px); opacity:0; transition:opacity .16s, transform .16s;
    padding:8px 12px; border:2px solid rgba(255,90,110,.7); border-radius:2px; white-space:nowrap;
    background:#260a12; color:#ffb3bf; font:900 10px Consolas, "Courier New", monospace; letter-spacing:.08em;
    box-shadow:3px 3px 0 rgba(0,0,0,.5);
  }
  .hg-toast.show { opacity:1; transform:translate(-50%,0); }
  .skins::-webkit-scrollbar, .hg-page::-webkit-scrollbar { width:6px; }
  .skins::-webkit-scrollbar-thumb, .hg-page::-webkit-scrollbar-thumb { background:rgba(108,231,255,.35); border-radius:0; }
  @media (max-height: 700px) {
    .hg-topbar { padding:7px 10px 4px; }
    .hg-stage { height:clamp(210px, 42%, 340px); margin-top:4px; }
    .hg-tabs { margin-top:5px; }
    .hg-page { padding:6px 10px 8px; }
    .skin-art { height:36px; }
    .skin-art::before { width:36px; height:36px; }
    .hg-bottom { padding-top:7px; }
    .hg-primary { padding:9px 12px; min-width:135px; }
  }
  @media (max-width: 380px) {
    .hg-swatches { grid-template-columns:repeat(5,minmax(0,1fr)); }
    .skin-meta strong { font-size:11px; }
  }
  #hint {
    position:absolute;
    bottom:max(8px, env(safe-area-inset-bottom));
    left:50%; transform:translateX(-50%);
    width:max-content; max-width:calc(100vw - 20px);
    text-align:center; font-size:10px; font-weight:700; line-height:1.35;
    color:rgba(190,215,240,.7); pointer-events:none;
    padding:7px 14px; border-radius:999px;
    background:rgba(6,16,36,.66); border:1px solid rgba(255,255,255,.08);
    backdrop-filter:blur(8px);
  }
  #mobile-input {
    position:absolute;
    left:50%; bottom:max(14px, env(safe-area-inset-bottom));
    transform:translateX(-50%);
    width:min(92vw, 400px);
    padding:14px 18px;
    border-radius:20px;
    border:1px solid rgba(108,231,255,.36);
    background:linear-gradient(180deg, rgba(14,32,64,.94), rgba(5,12,28,.94));
    color:#e8f4ff;
    font:800 18px "Segoe UI",Arial,sans-serif;
    letter-spacing:.16em; text-transform:uppercase; text-align:center;
    box-shadow:0 16px 40px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.1);
    backdrop-filter:blur(12px);
    z-index:5; display:none;
  }
  #mobile-input::placeholder { color:#6686a5; letter-spacing:.08em; text-transform:none; font-size:13px; font-weight:600; }
  #mobile-input:focus { outline:none; border-color:rgba(108,231,255,.9); box-shadow:0 0 0 4px rgba(108,231,255,.14), 0 16px 40px rgba(0,0,0,.35); }
  @media (pointer: coarse), (max-width: 820px) {
    #mobile-input { display:block; }
    #hint { bottom:82px; font-size:9px; }
  }
  #warning {
    position:absolute; inset:0;
    display:flex; align-items:center; justify-content:center;
    text-align:center; width:100%; pointer-events:none; z-index:5;
    opacity:0; transition:opacity .15s;
  }
  #warning.show { opacity:1; }
  .warn-card {
    padding:22px 34px; border-radius:28px;
    background:linear-gradient(180deg, rgba(120,18,38,.82), rgba(38,6,18,.9));
    border:1px solid rgba(255,120,140,.4);
    box-shadow:0 0 60px rgba(255,75,95,.35), inset 0 1px 0 rgba(255,255,255,.16);
    backdrop-filter:blur(10px);
    animation:warnPulse .5s linear infinite alternate;
  }
  .warn-kicker {
    display:block; max-width:min(86vw,520px); font-size:clamp(9px,1.6vw,14px); font-weight:900;
    letter-spacing:.18em; text-indent:.18em; color:#ffd1d8;
    overflow-wrap:anywhere; white-space:normal; line-height:1.2;
  }
  .warn-main {
    display:block; margin-top:4px; font-size:clamp(44px,10vw,110px); line-height:1;
    font-weight:900; letter-spacing:.18em; text-indent:.18em; color:#fff;
    text-shadow:0 0 30px rgba(255,75,95,.85), 0 0 80px rgba(255,75,95,.45);
  }
  @keyframes warnPulse { from { transform:scale(1); filter:brightness(1); } to { transform:scale(1.05); filter:brightness(1.25); } }
  .overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 14px;
    padding: 24px;
    background: radial-gradient(ellipse at center, rgba(8, 20, 45, .18), rgba(2, 5, 12, .38));
    backdrop-filter: blur(1px);
  }
  .game-panel {
    width:min(560px, 100%); max-height:calc(100dvh - 32px); overflow:auto;
    padding:clamp(20px,4vw,34px);
    border-radius:32px;
    border:1px solid rgba(255,255,255,.14);
    background:linear-gradient(180deg, rgba(16,36,70,.92), rgba(5,12,28,.95));
    box-shadow:0 30px 90px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.12);
    backdrop-filter:blur(18px);
    display:flex; flex-direction:column; align-items:center; gap:14px;
    scrollbar-width:thin;
  }
  .panel-badge {
    width:64px; height:64px; border-radius:22px; display:grid; place-items:center;
    font-size:30px; font-weight:900; color:#04182e;
    background:linear-gradient(135deg,#7ef0ff,#5aa8ff);
    box-shadow:0 14px 36px rgba(90,168,255,.35), inset 0 1px 0 rgba(255,255,255,.6);
  }
  .panel-badge.danger { background:linear-gradient(135deg,#ffb454,#ff5a6e); color:#290408; box-shadow:0 14px 36px rgba(255,90,110,.3), inset 0 1px 0 rgba(255,255,255,.5); }
  .panel-badge.win { background:linear-gradient(135deg,#7affc0,#2abf7a); color:#062717; box-shadow:0 14px 36px rgba(102,255,174,.28), inset 0 1px 0 rgba(255,255,255,.5); }
  .game-panel h2 { font-size:clamp(30px,6vw,48px); margin:0; }
  .game-panel p { margin:0; }
  .game-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; width:100%; margin-top:4px; }
  .game-actions button.play { width:100%; margin:0; padding:16px 14px; font-size:14px; border-radius:18px; }
  .game-actions button.play:first-child, .game-actions button.play.wide { grid-column:1 / -1; }
  .game-actions button.play.ghost { background:linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.04)); color:#dceeff; box-shadow:inset 0 1px 0 rgba(255,255,255,.12); }
  .result-score {
    width:100%; padding:18px; border-radius:24px;
    background:linear-gradient(135deg, rgba(108,231,255,.14), rgba(122,108,255,.12));
    border:1px solid rgba(108,231,255,.22);
  }
  .result-score > span { display:block; font-size:10px; letter-spacing:.2em; font-weight:900; color:#9dc0da; text-transform:uppercase; }
  .result-score > b { display:block; margin-top:2px; font-size:clamp(48px,10vw,72px); line-height:1; color:#fff; }
  .result-score small { display:block; margin-top:6px; font-size:13px; color:#a8c6de; font-weight:700; }
  .result-score small span { color:#fff; }
  #over-stars { font-size:36px !important; line-height:1; letter-spacing:8px !important; }
  #pong-over-detail { font-size:14px; line-height:1.5; font-weight:700; color:#cfe4f6; }
  .result-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; width:100%; }
  .result-grid > div {
    padding:10px 12px; border-radius:16px; min-width:0;
    background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.08);
  }
  .result-grid span { display:block; font-size:9px; font-weight:900; letter-spacing:.14em; color:#8fb2d0; text-transform:uppercase; }
  .result-grid b { display:block; margin-top:3px; font-size:13px; color:#fff; overflow-wrap:anywhere; white-space:normal; }
  .room-code {
    font:900 clamp(26px,6vw,44px)/1 "Consolas",monospace; letter-spacing:.12em;
    color:#6ce7ff; padding:12px 20px; border-radius:18px;
    background:rgba(108,231,255,.08); border:1px solid rgba(108,231,255,.2);
    overflow-wrap:anywhere;
  }
  /* === MOBILE-GAME MENU REDESIGN === */
  #start {
    padding:0; align-items:stretch; justify-content:stretch; overflow:hidden;
    background:
      radial-gradient(ellipse 80% 50% at 50% 0%, rgba(90,170,255,.16), transparent 60%),
      radial-gradient(ellipse 60% 40% at 80% 100%, rgba(255,120,50,.1), transparent 55%),
      linear-gradient(180deg, rgba(4,10,28,.12) 0%, rgba(4,10,28,.02) 40%, rgba(4,10,28,.55) 100%);
    backdrop-filter:none;
  }
  #start::before {
    content:""; position:absolute; inset:0; pointer-events:none;
    background:
      linear-gradient(90deg, rgba(3,7,20,.55) 0%, rgba(3,7,20,0) 28%, rgba(3,7,20,0) 62%, rgba(3,7,20,.45) 100%),
      linear-gradient(180deg, rgba(3,7,20,.25) 0%, transparent 25%, transparent 70%, rgba(3,7,20,.35) 100%);
  }
  .menu-shell {
    width:100%; height:100%; margin:0; position:relative; z-index:1;
    display:grid; grid-template-columns: minmax(0,1.15fr) minmax(440px,560px);
    gap:0; align-items:stretch;
  }
  .menu-hero, .menu-panel { background:transparent; border:0; border-radius:0; box-shadow:none; backdrop-filter:none; }

  /* --- Hero / left side --- */
  .menu-hero {
    text-align:left; display:flex; flex-direction:column; justify-content:space-between;
    padding: clamp(28px,4.5vw,64px) clamp(28px,5vw,72px); position:relative; overflow:hidden;
  }
  .menu-hero::after {
    content:""; position:absolute; left:-15%; bottom:-25%; width:70%; height:70%;
    background: radial-gradient(circle, rgba(90,200,255,.09), transparent 65%); pointer-events:none;
  }
  .menu-brand { display:flex; align-items:center; gap:22px; position:relative; }
  .menu-logo {
    width: clamp(82px,8.8vw,124px); height: clamp(82px,8.8vw,124px); border-radius: 32px; flex-shrink:0;
    position:relative; overflow:hidden;
    background:
      radial-gradient(circle at 30% 25%, rgba(158,245,255,.28), transparent 35%),
      radial-gradient(circle at 70% 75%, rgba(255,180,84,.18), transparent 38%),
      linear-gradient(160deg, rgba(20,46,82,.95), rgba(8,20,40,.95));
    border:1px solid rgba(160,245,255,.42);
    display:grid; place-items:center;
    box-shadow:
      0 28px 80px rgba(24,120,255,.28),
      0 0 0 1px rgba(255,255,255,.08),
      inset 0 1px 0 rgba(255,255,255,.22),
      inset 0 -18px 30px rgba(0,0,0,.18);
  }
  .menu-logo::before {
    content:""; position:absolute; inset:-35%;
    background: conic-gradient(from 210deg, transparent 0 18%, rgba(108,231,255,.18) 24%, transparent 30% 62%, rgba(255,209,102,.12) 68%, transparent 74% 100%);
    animation: logoSpin 14s linear infinite;
  }
  .menu-logo::after {
    content:""; position:absolute; inset:10px; border-radius:24px;
    border:1px solid rgba(255,255,255,.08);
    box-shadow: inset 0 0 0 1px rgba(108,231,255,.06);
  }
  .menu-logo svg {
    width:78%; height:78%; position:relative; z-index:1;
    filter: drop-shadow(0 0 18px rgba(108,231,255,.45)) drop-shadow(0 8px 18px rgba(0,0,0,.35));
  }
  @keyframes logoSpin { to { transform: rotate(360deg); } }
  .menu-badge {
    display:inline-flex; width:fit-content; gap:8px; align-items:center;
    padding:10px 18px; border-radius:999px;
    background:linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.05));
    border:1px solid rgba(255,255,255,.16);
    color:#e6faff; font-size:12px; font-weight:900; letter-spacing:.16em; text-transform:uppercase;
    margin-bottom:14px; backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(0,0,0,.15), inset 0 1px 0 rgba(255,255,255,.15);
  }
  .menu-hero h1 {
    font-size: clamp(60px, 8.5vw, 128px); line-height:.86; margin:0; max-width: 950px; position:relative;
    font-weight: 900; letter-spacing: -.035em; text-transform: uppercase; color:#f7fcff;
    text-shadow: 0 6px 0 rgba(0,0,0,.12), 0 24px 60px rgba(0,0,0,.4), 0 0 120px rgba(100,220,255,.1);
  }
  .menu-hero h1 .accent {
    display:block; font-size:.48em; letter-spacing:.1em; margin-top:12px;
    background: linear-gradient(135deg, #7ef0ff, #5aa8ff);
    -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text;
    filter: drop-shadow(0 0 24px rgba(100,220,255,.3));
  }
  .menu-hero p {
    max-width: 680px; margin:30px 0 0; position:relative;
    font-size: clamp(16px,1.6vw,22px); line-height:1.55; color:#d4e6f7; font-weight:600;
    text-shadow: 0 2px 16px rgba(0,0,0,.45);
  }
  .menu-stats { display:flex; gap:16px; flex-wrap:wrap; margin-top:32px; position:relative; }
  .menu-stats .stat {
    background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.04));
    border:1px solid rgba(255,255,255,.14); border-radius: 24px;
    padding: 18px 24px; min-width: 160px; flex:1; max-width:280px;
    box-shadow: 0 16px 40px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.15);
    backdrop-filter: blur(12px);
  }
  .menu-stats .stat span:first-child { font-size:11px; letter-spacing:.14em; color:#a4c8e4; font-weight:900; }
  .menu-stats .stat b {
    font-size: clamp(28px,3vw,44px); font-weight:900; color:#fff; margin-top:6px; display:block; line-height:1.05;
    max-width:100%; overflow-wrap:anywhere; text-overflow:clip; white-space:normal;
  }

  /* --- Typing statistics --- */
  #menu-stats { gap:12px; }
  .typing-hero { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); gap:10px; }
  .typing-hero-main, .typing-mini, .typing-tile, .typing-mode, .typing-history {
    border:1px solid rgba(255,255,255,.1); border-radius:20px;
    background:linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.035));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 12px 30px rgba(0,0,0,.14);
  }
  .typing-hero-main { padding:16px 18px; min-width:0; }
  .typing-hero-main .label, .typing-mini .label, .typing-tile .label {
    display:block; font-size:10px; letter-spacing:.13em; font-weight:900; color:#9dc0da;
  }
  .typing-hero-main b {
    display:block; margin-top:4px; font-size:clamp(34px,5vw,56px); line-height:1; font-weight:900;
    color:#66ffae; text-shadow:0 0 24px rgba(102,255,174,.25);
  }
  .typing-hero-main b.low { color:#ffb454; text-shadow:0 0 24px rgba(255,180,84,.25); }
  .typing-hero-main small {
    display:block; margin-top:10px; font-size:12px; line-height:1.45; color:#c8dcee; font-weight:600;
    overflow-wrap:anywhere; white-space:normal;
  }
  .typing-hero-side { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
  .typing-mini { padding:12px 14px; min-width:0; }
  .typing-mini b, .typing-tile b {
    display:block; margin-top:5px; font-size:clamp(19px,2.6vw,28px); line-height:1.05; font-weight:900; color:#fff;
    overflow-wrap:anywhere; white-space:normal;
  }
  .typing-tile b { color:#d6f3ff; }
  .typing-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
  .typing-tile { padding:12px 14px; min-width:0; }
  .typing-modes { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
  .typing-mode { padding:12px 14px; min-width:0; }
  .typing-mode-head, .typing-mode-sub { display:flex; justify-content:space-between; gap:8px; align-items:baseline; }
  .typing-mode-head span { font-size:12px; font-weight:900; color:#dceeff; overflow-wrap:anywhere; }
  .typing-mode-head b { font-size:18px; color:#6ce7ff; }
  .typing-mode-sub { margin-top:3px; font-size:11px; color:#93b1cb; font-weight:700; }
  .typing-bar { margin-top:9px; height:6px; border-radius:999px; background:rgba(255,255,255,.1); overflow:hidden; }
  .typing-bar i { display:block; height:100%; width:0; border-radius:999px; background:linear-gradient(90deg,#66ffae,#6ce7ff); transition:width .35s ease; }
  .typing-history { padding:14px; max-height:230px; overflow:auto; scrollbar-width:thin; }
  .typing-subhead { font-size:12px; letter-spacing:.12em; font-weight:900; color:#a4c8e4; margin-bottom:10px; }
  .typing-row { padding:9px 0; border-top:1px solid rgba(255,255,255,.07); }
  .typing-row:first-child { border-top:0; }
  .typing-row-top { display:flex; justify-content:space-between; gap:8px; align-items:baseline; }
  .typing-row-top b { font-size:13px; color:#fff; font-weight:800; overflow-wrap:anywhere; }
  .typing-row-top span { font-size:12px; color:#6ce7ff; font-weight:800; white-space:nowrap; }
  .typing-row-sub { margin-top:3px; font-size:11px; color:#9dc0da; line-height:1.4; }
  .typing-empty { font-size:12px; color:#8fa9c4; line-height:1.5; }
  .typing-reset.armed { border-color:rgba(255,154,165,.6); color:#ff9aa5; }
  @media (max-width: 560px) {
    .typing-hero { grid-template-columns:1fr; }
    .typing-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .typing-modes { grid-template-columns:1fr; }
  }

  /* --- Panel / right side --- */
  .menu-panel {
    padding: clamp(24px,3.5vw,48px);
    display:flex; flex-direction:column; justify-content:flex-start; gap:16px; text-align:left;
    background: linear-gradient(180deg, rgba(12,26,52,.38), rgba(5,12,28,.62));
    border-left: 1px solid rgba(255,255,255,.08);
    box-shadow: inset 1px 0 0 rgba(255,255,255,.04), -20px 0 60px rgba(0,0,0,.15);
    min-height:0; overflow:hidden auto;
    scrollbar-width:thin; scrollbar-color:rgba(108,231,255,.4) transparent;
  }
  .menu-panel::-webkit-scrollbar { width:8px; }
  .menu-panel::-webkit-scrollbar-thumb { background:rgba(108,231,255,.35); border-radius:999px; }
  .menu-panel-header { margin-bottom: 4px; }
  .menu-subhead {
    font-size: clamp(30px,3.4vw,48px); font-weight:900; color:#fff;
    letter-spacing:-.025em; margin:0; text-transform:uppercase; line-height:1;
  }
  .panel-sub { color:#93b8d4; font-size:15px; margin-top:8px; font-weight:700; letter-spacing:.01em; }

  /* --- Buttons --- */
  .menu-btn {
    cursor:pointer; position:relative; overflow:hidden; isolation:isolate;
    border:1px solid rgba(255,255,255,.12);
    background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.04));
    color:#fff; border-radius: 26px;
    padding: 24px 28px; padding-right:56px;
    font: 900 22px/1.1 "Segoe UI",Arial; text-align:left; letter-spacing:-.01em;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
    box-shadow: 0 12px 36px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.14);
    backdrop-filter: blur(10px);
  }
  .menu-btn::after {
    content:""; position:absolute; right:24px; top:50%; width:14px; height:14px;
    border-right:3px solid rgba(255,255,255,.4); border-top:3px solid rgba(255,255,255,.4);
    transform:translateY(-60%) rotate(45deg); transition:transform .18s, border-color .18s;
  }
  .menu-btn::before {
    content:""; position:absolute; inset:0; z-index:-1;
    background:linear-gradient(115deg, transparent 30%, rgba(255,255,255,.14), transparent 70%);
    transform:translateX(-150%); transition:transform .6s;
  }
  .menu-btn:hover, .menu-btn:focus-visible {
    transform: translateY(-3px) scale(1.01);
    border-color: rgba(140,235,255,.5);
    background: linear-gradient(180deg, rgba(255,255,255,.17), rgba(255,255,255,.06));
    box-shadow: 0 22px 50px rgba(0,0,0,.26), 0 0 0 1px rgba(140,235,255,.12), inset 0 1px 0 rgba(255,255,255,.2);
    outline:none;
  }
  .menu-btn:hover::before { transform:translateX(150%); }
  .menu-btn:hover::after { transform:translate(4px,-60%) rotate(45deg); border-color:rgba(255,255,255,.85); }
  .menu-btn:active { transform: translateY(0) scale(0.995); transition-duration:.06s; }
  .menu-btn span { display:block; }
  .menu-btn .btn-title { display:block; font-size:1.1em; font-weight:900; letter-spacing:-.02em; }
  .menu-btn small { display:block; margin-top:8px; font-size:14px; font-weight:600; color:#a8c6de; line-height:1.35; max-width: calc(100% - 8px); letter-spacing:0; }

  .menu-btn.primary {
    background: linear-gradient(135deg, #63e4ff 0%, #4594ff 42%, #7a6cff 100%);
    border-color: rgba(255,255,255,.32); color:#04182e;
    box-shadow: 0 20px 55px rgba(69,148,255,.4), 0 4px 0 rgba(30,80,180,.25), inset 0 1px 0 rgba(255,255,255,.5);
  }
  .menu-btn.primary small { color: rgba(4,24,46,.72); }
  .menu-btn.primary::after { border-color: rgba(4,24,46,.4); }
  .menu-btn.primary:hover, .menu-btn.primary:focus-visible {
    box-shadow: 0 26px 65px rgba(69,148,255,.5), 0 4px 0 rgba(30,80,180,.25), 0 0 0 1px rgba(255,255,255,.25), inset 0 1px 0 rgba(255,255,255,.6);
  }
  .menu-btn.primary:hover::after { border-color: rgba(4,24,46,.75); }

  /* --- Главное меню: крупные пункты без лишних подписей --- */
  .main-menu-list { display:flex; flex-direction:column; gap:10px; margin-top:10px; }
  .main-btn {
    position:relative; display:flex; align-items:center; gap:14px; width:100%;
    min-height:74px; padding:12px 14px; border:2px solid rgba(255,255,255,.14); border-radius:3px;
    background:linear-gradient(180deg, #12284a, #07142c); color:#fff; text-align:left;
    box-shadow:3px 3px 0 rgba(0,0,0,.5); font-family:Consolas, "Courier New", monospace;
    transition:transform .12s, border-color .12s, background .12s, box-shadow .12s;
  }
  .main-btn::before {
    content:''; position:absolute; left:6px; top:6px; width:11px; height:11px;
    border-left:2px solid rgba(108,231,255,.5); border-top:2px solid rgba(108,231,255,.5);
  }
  .main-btn:hover, .main-btn:focus-visible {
    transform:translate(2px,2px); box-shadow:1px 1px 0 rgba(0,0,0,.5); outline:none;
    border-color:var(--cyan); background:linear-gradient(180deg, #183760, #0a1c38);
  }
  .main-btn:active { transform:translate(3px,3px); }
  .main-btn-key {
    flex:0 0 auto; display:grid; place-items:center; min-width:40px; height:40px;
    border:2px solid rgba(108,231,255,.45); border-radius:2px; background:#061224;
    color:#bfe9ff; font:900 14px Consolas, "Courier New", monospace; letter-spacing:.06em;
  }
  .main-btn-copy { flex:1; min-width:0; }
  .main-btn-copy b {
    display:block; font-size:clamp(17px, 2.4vw, 24px); line-height:1.1;
    font-weight:900; letter-spacing:.06em; color:#fff;
  }
  .main-btn-copy small {
    display:block; margin-top:3px; font:700 10px/1.2 Consolas, "Courier New", monospace;
    letter-spacing:.06em; color:#8fb0cc; overflow-wrap:anywhere;
  }
  .main-btn-go {
    flex:0 0 auto; color:rgba(160,200,230,.45); font:900 24px Consolas, "Courier New", monospace;
    transition:transform .12s, color .12s;
  }
  .main-btn:hover .main-btn-go, .main-btn:focus-visible .main-btn-go {
    color:var(--cyan); transform:translateX(3px);
  }
  .main-btn.primary {
    border-color:rgba(255,209,102,.55);
    background:linear-gradient(180deg, rgba(255,209,102,.16), rgba(255,209,102,.04));
  }
  .main-btn.primary::before { border-color:rgba(255,209,102,.7); }
  .main-btn.primary .main-btn-key { border-color:var(--hot); color:var(--hot); background:#1b1505; }
  .main-btn.primary .main-btn-copy b { color:var(--hot); }
  .main-btn.primary .main-btn-go { color:var(--hot); }
  .main-btn.primary:hover {
    border-color:var(--hot); background:linear-gradient(180deg, rgba(255,209,102,.24), rgba(255,209,102,.07));
  }
  /* Все кнопки старта игры (уровень, свободный полёт, сеть, пинг-понг) — одного размера. */
  .main-btn.start-action { min-height:54px; padding:8px 12px; gap:10px; margin-top:8px; }
  .main-btn.start-action .main-btn-key { min-width:36px; height:36px; font-size:12px; }
  .main-btn.start-action .main-btn-copy b { font-size:16px; }
  .main-btn.start-action .main-btn-go { font-size:20px; }
  @media (max-width: 520px) {
    .main-menu-list { gap:8px; margin-top:8px; }
    .main-btn { min-height:62px; padding:10px 12px; gap:10px; }
    .main-btn-key { min-width:34px; height:34px; font-size:12px; }
    .main-btn-copy b { font-size:17px; }
    .main-btn-go { font-size:20px; }
  }
  @media (max-height: 700px) {
    .main-btn { min-height:58px; padding:8px 10px; }
    .main-btn-key { min-width:30px; height:30px; font-size:11px; }
    .main-btn-copy b { font-size:16px; }
    .main-btn-go { font-size:18px; }
    .main-btn.start-action { min-height:48px; }
  }

  .menu-sub { display:none; flex-direction:column; gap:14px; min-height:0; animation: menuSlide .25s ease; }
  .menu-sub.show { display:flex; margin-block:auto; }
  @keyframes menuSlide { from { opacity:0; transform:translateY(14px) scale(.99); } to { opacity:1; transform:translateY(0) scale(1); } }
  #menu-missions { flex:1; overflow:hidden; }

  /* --- Back button --- */
  .back-btn {
    align-self:flex-start; cursor:pointer;
    border:1px solid rgba(255,255,255,.12);
    background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.04));
    color:#e4f2ff; font:800 14px "Segoe UI",Arial;
    padding:12px 20px 12px 16px; border-radius:999px;
    margin-bottom:6px; transition:transform .15s,background .15s,border-color .15s;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
  }
  .back-btn:hover { transform:translateX(-2px); background:rgba(255,255,255,.14); border-color:rgba(255,255,255,.22); color:#fff; }

  /* --- Net --- */
  .net-box {
    display:flex; flex-direction:column; gap:14px; padding:22px;
    border:1px solid rgba(255,255,255,.1);
    background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.03));
    border-radius:28px; box-shadow: 0 16px 40px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.1);
  }
  .net-box input {
    width:100%; padding:18px 20px; border-radius:18px;
    border:1px solid rgba(255,255,255,.14); background:rgba(3,10,24,.5);
    color:#fff; font:700 17px "Segoe UI",Arial; outline:none; transition:border-color .15s, box-shadow .15s;
  }
  .net-box input::placeholder { color:#7a99b8; }
  .net-box input:focus { border-color:rgba(108,231,255,.6); box-shadow:0 0 0 4px rgba(108,231,255,.14); }
  .room-list { display:flex; flex-direction:column; gap:10px; }
  .room-btn {
    cursor:pointer; border:1px solid rgba(255,255,255,.1); background:rgba(255,255,255,.04);
    color:#fff; border-radius:18px; padding:18px 20px; font:800 17px "Segoe UI",Arial;
    text-align:left; display:flex; justify-content:space-between; align-items:center;
    transition:transform .15s, border-color .15s, background .15s, box-shadow .15s;
  }
  .room-btn:hover { transform:translateY(-2px); border-color:rgba(108,231,255,.4); background:rgba(255,255,255,.07); }
  .room-btn.active { border-color:rgba(108,231,255,.6); background:linear-gradient(135deg, rgba(108,231,255,.16), rgba(60,140,255,.08)); box-shadow: 0 8px 24px rgba(80,180,255,.12); }
  .room-btn small { color:#0a1e30; font-size:14px; font-weight:900; background:linear-gradient(135deg,#7eefff,#56b8ff); padding:7px 14px; border-radius:999px; margin:0; display:inline-block; min-width:44px; text-align:center; box-shadow: 0 4px 12px rgba(80,200,255,.25); }
  .net-status { font-size:14px; color:#a4c4de; min-height:22px; font-weight:700; padding:0 4px; }
  .net-status.err { color:#ff8090; }
  #net-hud { color:#9ef5ff; font-size:12px; max-width:min(340px, 72vw); white-space:normal; overflow-wrap:anywhere; text-overflow:clip; line-height:1.25; }

  .menu-row { display:flex; gap:12px; flex-wrap:wrap; }
  .menu-row .diff { flex:1; min-width: 120px; }
  .diff-row { margin-top:4px; }
  .free-card {
    padding: 22px; border-radius: 28px;
    border: 1px solid rgba(255,255,255,.1);
    background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.03));
    box-shadow: 0 16px 40px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.1);
  }
  .free-card-title, .net-label {
    font-size: 12px; font-weight:900; letter-spacing:.14em; text-transform:uppercase;
    color:#9fc4df; margin:0 0 14px;
  }
  .net-label { margin:4px 0 0; }
  .room-name { font-weight:900; letter-spacing:.01em; }
  .pong-diff-note { margin-top:6px; font-size:12px; color:#8fb0cc; font-weight:600; }
  .pong-wait-diff { width:100%; }
  .pong-wait-diff button.diff { padding:16px 10px; }
  .pong-wait-note { font-size:13px; color:#9fc4df; font-weight:700; }
  .pong-help {
    margin-top:4px; padding:16px 18px; border-radius:20px;
    background:rgba(108,231,255,.07); border:1px solid rgba(108,231,255,.18);
    color:#bcd9ef; font-size:13px; font-weight:600; line-height:1.5;
  }

  /* --- Pong HUD --- */
  #pong-hud { position:absolute; inset:0; z-index:4; pointer-events:none; color:#fff; }
  #pong-hud.hidden { display:none; }
  .pong-side {
    position:absolute; left:50%; transform:translateX(-50%);
    display:flex; align-items:center; justify-content:space-between; gap:10px;
    padding:10px 14px; border-radius:20px;
    width:min(600px, calc(100vw - 20px)); max-width:calc(100vw - 20px);
    background:linear-gradient(180deg, rgba(16,36,70,.88), rgba(5,12,28,.8));
    border:1px solid rgba(255,255,255,.14); backdrop-filter:blur(12px);
    box-shadow:0 14px 36px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.1);
    white-space:normal;
  }
  .pong-side b {
    font-size:17px; font-weight:900; letter-spacing:-.01em;
    flex:1 1 auto; min-width:0; max-width:none;
    white-space:normal; overflow-wrap:anywhere; text-overflow:clip; line-height:1.05;
  }
  .pong-side span { font-size:16px; color:#ff6b7a; letter-spacing:1px; flex:0 0 auto; white-space:nowrap; }
  .pong-side small { font-size:11px; color:#9fc4df; font-weight:800; flex:0 0 auto; white-space:nowrap; }
  .pong-top { top:max(12px, env(safe-area-inset-top)); }
  .pong-bottom { bottom:max(12px, env(safe-area-inset-bottom)); }
  .pong-center {
    position:absolute; left:50%; top:calc(max(12px, env(safe-area-inset-top)) + 66px);
    transform:translateX(-50%);
    width:min(600px, calc(100vw - 20px)); text-align:center; pointer-events:none;
    display:flex; flex-direction:row; flex-wrap:wrap; align-items:center; justify-content:center; gap:8px;
  }
  .pong-room {
    font-size:9px; font-weight:900; letter-spacing:.14em; color:#6ce7ff; text-transform:uppercase;
    padding:4px 10px; border-radius:999px; background:rgba(6,16,36,.7);
    border:1px solid rgba(108,231,255,.2); backdrop-filter:blur(8px); overflow-wrap:anywhere;
  }
  .pong-turn {
    font-size:12px; font-weight:900; color:#ffd166; text-transform:uppercase; letter-spacing:.06em;
    max-width:100%; overflow-wrap:anywhere; text-shadow:0 2px 12px rgba(0,0,0,.6);
  }
  .pong-speed { font-size:11px; font-weight:800; color:#a8c6de; letter-spacing:.06em; }
  .pong-esc { position:absolute; right:16px; bottom:max(70px, calc(env(safe-area-inset-bottom) + 58px)); font-size:10px; font-weight:700; color:#7f9cb6; }
  .pong-exit {
    margin-left:8px; padding:5px 9px; border:2px solid rgba(255,138,152,.5); border-radius:3px;
    background:rgba(10,27,52,.85); color:#ffb4bf; font:900 10px/1 Consolas, "Courier New", monospace;
    letter-spacing:.06em; cursor:pointer; box-shadow:2px 2px 0 rgba(0,0,0,.5);
  }
  .pong-exit:hover, .pong-exit:focus-visible { border-color:#ff8a98; color:#fff; outline:none; }

  @media (max-width: 1020px) {
    .menu-shell { grid-template-columns: 1fr; grid-template-rows: auto minmax(0,1fr); }
    /* Подэкраны (миссии, сложность, сеть…) — полноэкранная консоль. */
    .menu-shell.console-mode { grid-template-rows: 100%; }
    .menu-shell.console-mode .menu-hero { display:none; }
    .menu-shell.console-mode .menu-panel { padding: 12px 14px calc(14px + env(safe-area-inset-bottom)); }
    .menu-shell.console-mode .menu-sub.show { margin-block:0; }
    /* Главный экран на узком экране: герой убирается, список режимов занимает всю высоту. */
    .menu-shell:not(.console-mode) { grid-template-rows: 100%; }
    .menu-shell:not(.console-mode) .menu-hero { display:none; }
    .menu-shell:not(.console-mode) .menu-panel { padding: 12px 14px calc(14px + env(safe-area-inset-bottom)); }
    .menu-shell:not(.console-mode) .menu-sub.show { margin-block:0; }
    .menu-hero { padding: 28px 24px 12px; justify-content:flex-start; gap:12px; min-height:0; }
    .menu-hero p { margin-top: 16px; max-width: 100%; font-size: 16px; }
    .menu-stats { margin-top: 18px; gap:12px; }
    .menu-stats .stat { min-width: 0; padding: 14px 16px; border-radius: 18px; max-width:none; }
    .menu-stats .stat b { font-size: 30px; }
    .menu-panel {
      border-left:0; border-top:1px solid rgba(255,255,255,.1);
      padding: 22px 24px calc(24px + env(safe-area-inset-bottom));
      justify-content:flex-start; overflow:auto;
      background: linear-gradient(180deg, rgba(10,22,46,.5), rgba(5,12,28,.75));
      box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
    }
    .menu-btn { padding: 20px 24px; padding-right:52px; font-size: 20px; border-radius: 22px; }
    .menu-btn small { font-size: 13px; }
    .menu-hero h1 { font-size: clamp(52px, 12vw, 88px); }
  }
  /* Телефон в горизонтальном положении: возвращаем две колонки, иначе панель меню исчезает. */
  @media (max-width: 1020px) and (max-height: 520px) and (orientation: landscape) {
    .menu-shell {
      grid-template-columns: minmax(0, 1fr) clamp(260px, 45vw, 420px);
      grid-template-rows: 100%;
    }
    .menu-hero { padding: 16px 22px; gap: 8px; }
    .menu-hero h1 { font-size: clamp(44px, 7vw, 68px); }
    .menu-hero p { margin-top: 8px; font-size: 14px; }
    .menu-stats { margin-top: 8px; gap: 8px; }
    .menu-stats .stat { padding: 8px 12px; }
    .menu-stats .stat b { font-size: 22px; }
    .menu-panel { padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); }
    .menu-btn { padding: 14px 18px; padding-right: 44px; font-size: 17px; }
    .menu-btn small { font-size: 12px; margin-top: 4px; }
    .menu-subhead { font-size: 30px; }
    .panel-sub { font-size: 12px; margin-top: 4px; }
  }
  @media (max-width: 560px) {
    .menu-stats .stat { flex:1; }
    .menu-btn { padding: 18px 20px; padding-right:46px; font-size: 18px; }
    .menu-btn::after { right:18px; width:12px; height:12px; }
    .menu-hero h1 { font-size: clamp(48px, 14vw, 72px); }
    #hud { grid-template-columns:1fr auto; gap:6px; padding:8px 8px 0; }
    #hud .hud-center { grid-column:1 / -1; grid-row:2; justify-content:flex-start; gap:6px; }
    #hud .hud-side.right { grid-column:2; grid-row:1; }
    .hud-card { padding:6px 9px; border-radius:14px; }
    .hud-card b { font-size:15px; }
    .hud-chip { padding:5px 8px; border-radius:12px; }
    .hud-chip b { font-size:11px; }
    .hud-chip span { font-size:8px; }
    .heat-stat { min-width:104px; }
    .hud-actions button { width:32px; height:32px; border-radius:12px; font-size:13px; }
    #buffs { font-size:10px; }
    #net-hud { font-size:10px; max-width:min(240px, 52vw); }
    .pong-side { padding:7px 10px; gap:6px; border-radius:16px; }
    .pong-side b { font-size:13px; }
    .pong-side span { font-size:13px; }
    .pong-side small { font-size:9px; }
    .pong-center { top:calc(max(8px, env(safe-area-inset-top)) + 58px); gap:6px; width:94vw; }
    .game-actions button.play { padding:14px 10px; font-size:12px; }
    .result-grid { gap:6px; }
    .result-grid b { font-size:11px; }
    .game-panel { padding:18px; border-radius:26px; }
  }
  @media (max-height: 520px) and (orientation: landscape) {
    #hud { grid-template-columns:auto minmax(0,1fr) auto; align-items:center; padding:6px 10px 0; gap:6px; }
    #hud .hud-center { grid-column:2; grid-row:1; justify-content:center; }
    #hud .hud-side.right { grid-column:3; grid-row:1; }
    .hud-card { padding:5px 9px; border-radius:12px; }
    .hud-card b { font-size:14px; }
    .hud-chip { padding:4px 8px; border-radius:11px; }
    .hud-chip b { font-size:11px; }
    .hud-chip span { font-size:8px; }
    .heat-stat { min-width:96px; }
    .hud-actions button { width:30px; height:30px; border-radius:11px; font-size:12px; }
    #hint { font-size:8px; padding:5px 10px; }
    #mobile-input { width:min(58vw,320px); padding:9px 12px; bottom:8px; font-size:15px; border-radius:16px; }
    .pong-side { padding:5px 10px; }
    .pong-center { top:calc(max(6px, env(safe-area-inset-top)) + 48px); gap:4px; }
    .game-panel { max-height:calc(100dvh - 12px); padding:14px 18px; gap:8px; }
    .panel-badge { width:44px; height:44px; border-radius:14px; font-size:22px; }
    .result-grid { gap:5px; }
    .result-grid > div { padding:6px 9px; }
  }
  .overlay.hidden { display: none; }
  .overlay:not(#start) h1 {
    margin: 0;
    font-size: clamp(26px, 4.2vw, 46px);
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--cyan);
    text-shadow: 0 0 24px rgba(108, 231, 255, .55);
  }
  .overlay h2 { margin: 0; font-size: clamp(34px, 5vw, 64px); color: #fff; font-weight: 900; letter-spacing:-.02em; text-transform:uppercase; text-shadow: 0 10px 40px rgba(0,0,0,.35); }
  .overlay .game-panel h2 { font-size:clamp(30px,6vw,48px); }
  .overlay:not(#start) p { margin: 0; max-width: 560px; line-height: 1.6; color: #c7dbef; font-size: 16px; font-weight:500; }
  .keys { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 4px 0; }
  .keys span {
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px; font-weight:700;
    color: #d8eaff;
  }
  button.play {
    cursor: pointer;
    margin-top: 8px;
    padding: 20px 40px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 22px;
    background: linear-gradient(135deg, #63e4ff 0%, #4594ff 42%, #7a6cff 100%);
    color: #04182e;
    font: 900 18px "Segoe UI", Arial, sans-serif;
    letter-spacing: .04em;
    text-transform: uppercase;
    box-shadow: 0 20px 55px rgba(69,148,255,.4), inset 0 1px 0 rgba(255,255,255,.5);
    transition: transform .15s, filter .15s;
  }
  button.play:hover { filter: brightness(1.06); transform: translateY(-1px); }
  #pause, #over {
    background: radial-gradient(900px 500px at 50% 20%, rgba(70,150,255,.12), transparent 60%), rgba(3,8,20,.42);
    backdrop-filter: blur(8px);
  }
  .difficulty { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 4px; }
  button.diff {
    cursor: pointer; flex:1; min-width: 130px;
    padding: 20px 16px; border: 1px solid rgba(255,255,255,.18); border-radius: 22px;
    color: #04101f; font: 900 18px "Segoe UI", Arial, sans-serif;
    letter-spacing: .02em; text-transform: uppercase;
    box-shadow: 0 16px 34px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.4);
    transition: transform .15s, filter .15s, box-shadow .15s;
  }
  button.diff:hover { filter: brightness(1.07); transform: translateY(-2px); }
  button.diff.active { outline: 3px solid #fff; box-shadow: 0 0 0 4px rgba(108,231,255,.25), 0 14px 30px rgba(0,0,0,.28); transform: translateY(-1px); }
  button.diff b { display: block; font-size: 18px; font-weight:900; }
  button.diff small { display:block; margin-top:4px; font-size:12px; font-weight:700; letter-spacing:0; text-transform:none; opacity:.75; }
  button.diff.easy { background: linear-gradient(180deg, #7affc0, #2fca8e); }
  button.diff.normal { background: linear-gradient(180deg, #8aefff, #3f93ff); }
  button.diff.hard { background: linear-gradient(180deg, #ffd27f, #ff6d5e); }
  .small-hint { font-size: 12px !important; color: #8fa9c4 !important; }
  .final { color: var(--cyan); font-size: 18px; }
  .final b { color: #fff; }
  #levels-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 6px 4px 6px 0;
    align-content: start;
  }
  #levels-grid::-webkit-scrollbar { width: 10px; }
  #levels-grid::-webkit-scrollbar-thumb { background: rgba(140,235,255,.28); border-radius: 999px; border:2px solid transparent; background-clip:padding-box; }
  .lvl {
    cursor: pointer;
    border: 1px solid rgba(255,255,255,.12);
    background: linear-gradient(180deg, rgba(255,255,255,.11), rgba(255,255,255,.03));
    color: #fff;
    border-radius: 20px;
    padding: 18px 8px;
    font: 900 24px "Segoe UI", Arial, sans-serif;
    box-shadow: 0 10px 24px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.1);
    transition: transform .15s, border-color .15s, background .15s, box-shadow .15s;
  }
  .lvl:hover { transform:translateY(-3px); border-color: rgba(108,231,255,.55); background:rgba(108,231,255,.1); box-shadow: 0 16px 30px rgba(0,0,0,.18); }
  .lvl:active { transform:translateY(0); }
  .lvl.active { outline: 3px solid #ffd166; outline-offset:-1px; border-color: rgba(255,209,102,.65); background: linear-gradient(180deg, rgba(255,209,102,.18), rgba(255,209,102,.06)); }
  .lvl .stars { display:block; font-size: 13px; color: #ffd166; margin-top: 6px; min-height: 16px; letter-spacing: 2px; text-shadow: 0 0 12px rgba(255,209,102,.25); }
  .lvl .stars.none { color: #607890; text-shadow:none; }
  #level-progress { color: #b9cee2; font-size: clamp(11px,1vw,14px); }

  /* --- Консольный выбор миссий и сложности --- */
  .menu-panel-header.console-head {
    flex:0 0 auto;
    display:flex; flex-direction:column; gap:6px; padding:10px 12px;
    border:2px solid rgba(108,231,255,.35); border-radius:4px;
    background:linear-gradient(180deg, #0d2342, #040c1c);
    box-shadow:4px 4px 0 rgba(0,0,0,.45);
  }
  .console-head .back-btn {
    align-self:flex-start; display:flex; align-items:center; gap:8px;
    padding:5px 9px; border:2px solid rgba(108,231,255,.45); border-radius:2px;
    background:#0a1b34; color:#bfe9ff; font:900 10px Consolas, "Courier New", monospace;
    letter-spacing:.08em; box-shadow:2px 2px 0 rgba(0,0,0,.45);
  }
  .console-head .back-btn:hover { transform:translate(-2px,2px); background:#102b50; }
  .console-head .back-btn .hg-key { min-width:16px; height:16px; color:#bfe9ff; }
  .console-head .menu-subhead {
    font:900 clamp(22px,3vw,32px) Consolas, "Courier New", monospace;
    letter-spacing:.08em; color:#fff;
  }
  .console-head .panel-sub {
    margin-top:2px; font:700 10px Consolas, "Courier New", monospace;
    letter-spacing:.1em; color:var(--cyan);
  }
  .console-section {
    flex:0 0 auto;
    display:flex; justify-content:space-between; gap:8px; padding:5px 8px;
    border-left:3px solid var(--cyan); background:rgba(108,231,255,.07);
    font:900 9px Consolas, "Courier New", monospace; letter-spacing:.12em;
    color:rgba(175,215,240,.75);
  }
  .console-section span:last-child { color:var(--hot); }
  .diff-section { border-left-color:var(--hot); background:rgba(255,209,102,.07); margin-top:6px; }
  .level-brief {
    flex:0 0 auto; margin-top:8px; padding:10px 12px;
    border:2px solid rgba(255,209,102,.38); border-radius:3px;
    background:linear-gradient(180deg, rgba(255,209,102,.09), rgba(4,12,28,.85));
    box-shadow:3px 3px 0 rgba(0,0,0,.45); color:#fff;
    font-family:Consolas, "Courier New", monospace;
  }
  .brief-top { display:flex; justify-content:space-between; align-items:center; gap:8px; }
  .brief-mode {
    padding:2px 5px; border:1px solid rgba(255,209,102,.55); color:var(--hot);
    font-size:9px; font-weight:900; letter-spacing:.12em;
  }
  .brief-index { color:#7899b6; font-size:9px; font-weight:900; letter-spacing:.08em; }
  .brief-title { margin-top:5px; font-size:17px; font-weight:900; letter-spacing:.08em; color:#fff; }
  .brief-desc { margin-top:3px; font-size:10px; line-height:1.35; color:#a9c7de; font-weight:600; }
  .brief-meta { margin-top:5px; font-size:9px; letter-spacing:.05em; color:#7899b6; font-weight:900; }
  .brief-cleared { margin-top:4px; font-size:9px; font-weight:900; letter-spacing:.05em; color:#5d7791; }
  .brief-cleared.has-data { color:#66ffae; }
  @media (max-height: 700px) {
    .level-brief { margin-top:6px; padding:7px 10px; }
    .brief-title { margin-top:3px; font-size:14px; }
    .brief-desc { font-size:9px; line-height:1.3; }
    .brief-meta { margin-top:3px; font-size:8px; }
  }
  #levels-grid {
    grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; padding:8px 2px;
    scrollbar-width:thin; scrollbar-color:rgba(108,231,255,.4) transparent;
  }
  #levels-grid::-webkit-scrollbar { width:6px; }
  #levels-grid::-webkit-scrollbar-thumb { background:rgba(108,231,255,.35); border-radius:0; }
  .lvl {
    position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center;
    min-height:72px; padding:8px 4px 6px; border:2px solid rgba(255,255,255,.14); border-radius:3px;
    background:linear-gradient(180deg, #12284a, #07142c); color:#fff;
    box-shadow:3px 3px 0 rgba(0,0,0,.5); font-family:Consolas, "Courier New", monospace;
    transition:transform .12s, border-color .12s, background .12s;
  }
  .lvl::before {
    content:''; position:absolute; left:4px; top:4px; width:8px; height:8px;
    border-left:2px solid rgba(108,231,255,.5); border-top:2px solid rgba(108,231,255,.5);
  }
  .lvl:hover {
    transform:translate(2px,2px); box-shadow:1px 1px 0 rgba(0,0,0,.5);
    border-color:var(--cyan); background:linear-gradient(180deg, #183760, #0a1c38);
  }
  .lvl.active {
    border-color:var(--hot); background:linear-gradient(180deg, rgba(255,209,102,.2), rgba(255,209,102,.05));
    box-shadow:3px 3px 0 rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,209,102,.55);
  }
  .lvl.cleared .lvl-num { color:var(--green); }
  .lvl-code {
    position:absolute; top:4px; right:5px; font-size:7px; letter-spacing:.14em;
    color:rgba(160,200,230,.45);
  }
  .lvl-num { font-size:22px; font-weight:900; line-height:1; letter-spacing:.04em; }
  .lvl .stars {
    display:block; margin-top:5px; min-height:12px; font-size:10px;
    letter-spacing:1px; color:var(--hot); text-shadow:none;
  }
  .lvl .stars.none { color:#49627c; text-shadow:none; }
  .lvl-boss {
    position:absolute; bottom:3px; right:4px; padding:1px 3px;
    border:1px solid rgba(255,90,110,.55); color:#ff8a98;
    font-size:7px; font-weight:900; letter-spacing:.08em;
  }
  .lvl-diffs {
    position:absolute; bottom:3px; left:4px; padding:1px 3px;
    border:1px solid rgba(102,255,174,.45); color:#66ffae;
    font-size:7px; font-weight:900; letter-spacing:.08em;
  }
  .menu-row .diff { min-width:0; }
  .menu-row.diff-row { flex:0 0 auto; gap:8px; margin-top:0; }
  button.diff {
    position:relative; flex:1; min-width:0; padding:10px 8px 9px;
    border:2px solid rgba(255,255,255,.16); border-radius:3px;
    color:#fff; text-align:left; font-family:Consolas, "Courier New", monospace;
    background:#0a1b34; box-shadow:3px 3px 0 rgba(0,0,0,.5);
    transition:transform .12s, border-color .12s, background .12s;
  }
  button.diff::before { content:''; position:absolute; left:0; top:0; bottom:0; width:4px; background:currentColor; }
  button.diff.easy, button.diff.normal, button.diff.hard { background:#0a1b34; }
  button.diff.easy { color:var(--green); }
  button.diff.normal { color:var(--cyan); }
  button.diff.hard { color:#ff8a5e; }
  button.diff b { display:block; font-size:12px; font-weight:900; letter-spacing:.06em; color:#fff; }
  button.diff small {
    display:block; margin-top:4px; font-size:9px; font-weight:700;
    letter-spacing:.04em; color:#93b5cf; text-transform:none;
  }
  button.diff:hover {
    transform:translate(2px,2px); box-shadow:1px 1px 0 rgba(0,0,0,.5);
    filter:none; border-color:currentColor;
  }
  button.diff.active {
    outline:none; border-color:currentColor;
    background:linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.03));
    box-shadow:3px 3px 0 rgba(0,0,0,.5), inset 0 0 0 1px currentColor;
    transform:none;
  }
  button.diff.active::after { content:'▶'; position:absolute; right:7px; top:8px; font-size:9px; color:currentColor; }
  @media (max-width: 520px) {
    #levels-grid { gap:6px; }
    .lvl { min-height:64px; padding:6px 3px 5px; }
    .lvl-num { font-size:19px; }
    button.diff { padding:8px 6px; }
    button.diff b { font-size:11px; }
    button.diff small { font-size:8px; }
  }
  @media (max-height: 700px) {
    .menu-panel-header.console-head { padding:7px 10px; }
    .console-head .menu-subhead { font-size:20px; }
    .lvl { min-height:58px; }
  }

  /* --- Настройки: системный экран консоли --- */
  .settings-list { display:flex; flex-direction:column; gap:10px; margin-top:10px; }
  .setting-row {
    position:relative; display:flex; align-items:center; gap:12px; width:100%;
    padding:14px 14px; border:2px solid rgba(255,255,255,.14); border-radius:3px;
    background:linear-gradient(180deg, #12284a, #07142c); color:#fff; text-align:left;
    box-shadow:3px 3px 0 rgba(0,0,0,.5); cursor:pointer;
    font-family:Consolas, "Courier New", monospace;
    transition:transform .12s, border-color .12s, background .12s;
  }
  .setting-row::before {
    content:''; position:absolute; left:5px; top:5px; width:9px; height:9px;
    border-left:2px solid rgba(108,231,255,.5); border-top:2px solid rgba(108,231,255,.5);
  }
  .setting-row:hover { transform:translate(2px,2px); box-shadow:1px 1px 0 rgba(0,0,0,.5); border-color:rgba(108,231,255,.55); }
  .setting-row.on { border-color:rgba(102,255,174,.55); background:linear-gradient(180deg, rgba(102,255,174,.13), rgba(102,255,174,.03)); }
  .setting-key {
    flex:0 0 auto; display:grid; place-items:center; min-width:24px; height:24px;
    border:2px solid rgba(108,231,255,.6); border-radius:2px; color:#bfe9ff;
    font:900 11px Consolas, "Courier New", monospace; background:#08182f;
  }
  .setting-copy { flex:1; display:flex; flex-direction:column; gap:3px; min-width:0; }
  .setting-copy b { font-size:14px; font-weight:900; letter-spacing:.1em; color:#fff; }
  .setting-copy small { font-size:9px; font-weight:700; letter-spacing:.1em; color:#7fa3c0; }
  .setting-state { flex:0 0 auto; display:flex; align-items:center; gap:8px; }
  .setting-led {
    width:10px; height:10px; border-radius:50%; background:#3b546e;
    box-shadow:inset 0 0 0 2px rgba(0,0,0,.45);
  }
  .setting-row.on .setting-led { background:var(--green); box-shadow:0 0 12px rgba(102,255,174,.7); }
  .setting-value {
    min-width:42px; text-align:center; padding:5px 7px; border:2px solid rgba(255,255,255,.18);
    border-radius:2px; font-size:11px; font-weight:900; letter-spacing:.08em; color:#9dbcd6; background:#061224;
  }
  .setting-row.on .setting-value { color:var(--green); border-color:rgba(102,255,174,.55); background:rgba(102,255,174,.08); }
  .settings-note {
    margin-top:14px; padding:10px 12px; border-left:3px solid var(--hot);
    background:rgba(255,209,102,.06); color:#b9cee2;
    font:700 10px/1.5 Consolas, "Courier New", monospace; letter-spacing:.06em;
  }
  @media (max-width: 520px) {
    .setting-row { padding:11px 10px; gap:9px; }
    .setting-copy b { font-size:12px; }
    .setting-copy small { font-size:8px; }
    .setting-value { min-width:38px; font-size:10px; }
  }
  @media (max-height: 700px) {
    .settings-list { gap:7px; margin-top:7px; }
    .setting-row { padding:10px 11px; }
    .settings-note { margin-top:9px; padding:7px 10px; }
  }

  /* --- Остальные подэкраны: тот же консольный язык --- */
  .console-note {
    margin-top:8px; padding:9px 11px; border-left:3px solid var(--hot);
    background:rgba(255,209,102,.06); color:#a9c7de;
    font:700 10px/1.45 Consolas, "Courier New", monospace; letter-spacing:.04em;
  }

  /* Свободный полёт */
  .free-card {
    padding:12px; border:2px solid rgba(255,255,255,.14); border-radius:3px;
    background:linear-gradient(180deg, #12284a, #07142c);
    box-shadow:3px 3px 0 rgba(0,0,0,.5);
  }
  .free-card-title {
    display:flex; justify-content:space-between; gap:8px;
    margin:0 0 10px; color:var(--cyan);
    font:900 10px Consolas, "Courier New", monospace; letter-spacing:.12em;
  }
  .free-card-title span { color:#8fa9c4; letter-spacing:.06em; }
  .free-card-title + .free-card-title { margin-top:12px; }
  .free-mode-row { gap:8px; }
  .free-mode {
    flex:1 1 120px; min-width:110px; padding:9px 10px; text-align:left;
    border:2px solid rgba(255,255,255,.16); border-radius:3px;
    background:#0a1b34; color:#cfe6f7; box-shadow:2px 2px 0 rgba(0,0,0,.5);
    font:900 10px Consolas, "Courier New", monospace; letter-spacing:.06em;
    cursor:pointer; transition:border-color .12s, background .12s, transform .12s;
  }
  .free-mode b { display:block; color:#fff; font-size:11px; }
  .free-mode small { display:block; margin-top:2px; color:#8fa9c4; font-size:9px; }
  .free-mode:hover, .free-mode:focus-visible { border-color:#bff4ff; outline:none; }
  .free-mode.active { border-color:var(--cyan); background:linear-gradient(180deg, rgba(108,231,255,.18), rgba(108,231,255,.04)); }
  .free-mode.active small { color:#bfe9ff; }
  .free-modes-hint {
    margin:6px 0 12px; color:#7fa3c0;
    font:700 9px/1.4 Consolas, "Courier New", monospace; letter-spacing:.04em;
  }
  .free-card .diff-row { margin-top:0; }

  /* Еженедельная гонка */
  .weekly-card {
    margin-bottom:12px; padding:12px;
    border:2px solid rgba(255,209,102,.42); border-radius:3px;
    background:linear-gradient(180deg, #2b2140, #0d1730);
    box-shadow:3px 3px 0 rgba(0,0,0,.5);
  }
  .weekly-card .free-card-title { color:var(--gold); }
  .weekly-card .free-card-title span { color:#b7a6cd; }
  .weekly-line {
    margin:4px 0; color:#cbb9e6;
    font:700 10px/1.45 Consolas, "Courier New", monospace; letter-spacing:.04em;
  }
  .weekly-card .main-btn { margin-top:10px; }
  .weekly-toolbar { display:flex; justify-content:flex-end; margin:8px 0 12px; }
  .weekly-toolbar .stats-tab { flex:0 0 auto; padding:8px 14px; }
  .weekly-summary { margin:4px 0 12px; }
  .weekly-summary .typing-empty { grid-column:1 / -1; }

  /* Сетевое лобби */
  .net-setup-panel { width:min(760px, calc(100vw - 24px)); }
  .net-setup-card { width:100%; text-align:left; }
  .net-setup-result {
    width:100%; padding:10px 12px; border:2px solid rgba(255,209,102,.4);
    background:rgba(255,209,102,.08); color:var(--gold);
    font:900 11px/1.4 Consolas, "Courier New", monospace; letter-spacing:.06em;
  }
  .net-setup-players {
    width:100%; padding:10px 12px; border:2px solid rgba(255,255,255,.12);
    background:#081a34; color:#b9d4ee;
    font:700 10px/1.5 Consolas, "Courier New", monospace; letter-spacing:.04em;
  }
  .net-setup-waiting {
    width:100%; padding:12px 14px; border:2px dashed rgba(108,231,255,.35);
    color:var(--cyan); text-align:center;
    font:900 11px/1.4 Consolas, "Courier New", monospace; letter-spacing:.08em;
  }
  .net-setup-waiting.hidden { display:none; }
  .net-setup-panel .free-mode:disabled,
  .net-setup-panel .diff:disabled { opacity:.45; cursor:not-allowed; filter:saturate(.6); }

  /* Сеть и пинг-понг */
  .net-box {
    display:flex; flex-direction:column; gap:8px; padding:12px;
    border:2px solid rgba(255,255,255,.14); border-radius:3px;
    background:linear-gradient(180deg, #12284a, #07142c);
    box-shadow:3px 3px 0 rgba(0,0,0,.5);
  }
  .net-box .console-section { margin-top:4px; }
  .net-box input {
    width:100%; padding:11px 12px; border:2px solid rgba(108,231,255,.28); border-radius:2px;
    background:#061224; color:#eaf6ff; outline:none;
    font:800 13px Consolas, "Courier New", monospace; letter-spacing:.08em; text-transform:uppercase;
    box-shadow:none;
  }
  .net-box input::placeholder { color:#597894; letter-spacing:.08em; }
  .net-box input:focus { border-color:var(--cyan); box-shadow:0 0 0 2px rgba(108,231,255,.14); }
  .room-list { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
  .room-btn {
    display:flex; flex-direction:column; gap:6px; align-items:flex-start;
    padding:9px 10px; border:2px solid rgba(255,255,255,.14); border-radius:3px;
    background:#0a1b34; color:#fff; text-align:left;
    box-shadow:3px 3px 0 rgba(0,0,0,.5);
    font:900 10px Consolas, "Courier New", monospace; letter-spacing:.08em;
    transition:transform .12s, box-shadow .12s, border-color .12s, background .12s;
  }
  .room-btn small {
    min-width:0; padding:2px 7px; border:1px solid rgba(108,231,255,.35); border-radius:2px;
    background:#061224; color:var(--cyan); font:900 10px Consolas, "Courier New", monospace;
  }
  .room-btn:hover { transform:translate(2px,2px); box-shadow:1px 1px 0 rgba(0,0,0,.5); border-color:var(--cyan); }
  .room-btn.active {
    border-color:var(--hot); color:var(--hot);
    background:linear-gradient(180deg, rgba(255,209,102,.18), rgba(255,209,102,.04));
  }
  .room-btn.active small { border-color:rgba(255,209,102,.5); color:var(--hot); }
  .room-btn.busy small { border-color:rgba(102,255,174,.6); color:var(--green); }
  .pong-rooms { max-height:132px; overflow:auto; align-content:start; }
  .pong-rooms .typing-empty { grid-column:1 / -1; }
  .pong-room-btn b { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .pong-room-btn small { border-color:rgba(255,209,102,.45); color:var(--hot); }
  .net-status {
    min-height:18px; padding:6px 8px; border-left:3px solid var(--cyan);
    background:rgba(108,231,255,.06); color:#9fc4df;
    font:700 10px/1.4 Consolas, "Courier New", monospace; letter-spacing:.04em; overflow-wrap:anywhere;
  }
  .net-status.err { border-left-color:#ff5a6e; background:rgba(255,90,110,.07); color:#ff9aa5; }
  .pong-diff-note {
    margin-top:0; color:#7fa3c0;
    font:700 9px/1.4 Consolas, "Courier New", monospace; letter-spacing:.04em;
  }
  .pong-help {
    margin-top:8px; padding:10px 12px; border-left:3px solid var(--hot); border-radius:0;
    background:rgba(255,209,102,.06); color:#a9c7de;
    font:700 10px/1.45 Consolas, "Courier New", monospace; letter-spacing:.04em;
  }

  /* Статистика */
  #menu-stats { gap:8px; }
  .typing-hero, .typing-grid, .typing-modes { gap:8px; }
  .typing-hero-main, .typing-mini, .typing-tile, .typing-mode, .typing-history {
    border:2px solid rgba(255,255,255,.14); border-radius:3px;
    background:linear-gradient(180deg, #12284a, #07142c);
    box-shadow:3px 3px 0 rgba(0,0,0,.5);
    font-family:Consolas, "Courier New", monospace;
  }
  .typing-hero-main { padding:12px; }
  .typing-hero-main .label, .typing-mini .label, .typing-tile .label {
    font-size:9px; letter-spacing:.1em; color:#7fa3c0;
  }
  .typing-hero-main b { margin-top:3px; font-size:clamp(30px,5vw,48px); color:var(--green); }
  .typing-hero-main b.low { color:var(--hot); }
  .typing-hero-main small { margin-top:6px; font-size:10px; color:#a9c7de; }
  .typing-mini, .typing-tile, .typing-mode { padding:9px 10px; }
  .typing-mini b, .typing-tile b { margin-top:3px; font-size:clamp(17px,2.4vw,24px); }
  .typing-mode-head span { font-size:10px; letter-spacing:.06em; color:#cfe6f7; }
  .typing-mode-head b { font-size:15px; }
  .typing-mode-sub { font-size:9px; color:#7fa3c0; }
  .typing-bar { height:5px; border-radius:0; background:#061224; border:1px solid rgba(255,255,255,.1); }
  .typing-bar i { border-radius:0; background:linear-gradient(90deg, var(--green), var(--cyan)); }
  .typing-history { padding:10px; max-height:190px; }
  .typing-subhead { font-size:10px; color:var(--hot); }
  .typing-row { padding:7px 0; border-top:1px solid rgba(255,255,255,.08); }
  .typing-row-top b { font-size:11px; }
  .typing-row-top span { font-size:10px; }
  .typing-row-sub, .typing-empty { font-size:9px; }
  .typing-reset {
    display:flex; align-items:center; gap:8px; width:100%; padding:10px 12px;
    border:2px solid rgba(255,90,110,.45); border-radius:3px;
    background:#1a0a12; color:#ff9aa5; box-shadow:3px 3px 0 rgba(0,0,0,.45);
    font:900 11px Consolas, "Courier New", monospace; letter-spacing:.1em; cursor:pointer;
  }
  .typing-reset .hg-key { border-color:rgba(255,90,110,.6); color:#ff9aa5; }
  .typing-reset.armed { border-color:#ff5a6e; background:rgba(255,90,110,.14); }
  @media (max-width: 520px) {
    .room-list { grid-template-columns:1fr; }
    .room-btn { flex-direction:row; align-items:center; justify-content:space-between; min-height:42px; }
    .net-box input { padding:9px 10px; font-size:12px; }
    .typing-hero-side { gap:6px; }
    .typing-grid, .typing-modes { gap:6px; }
    .typing-mini, .typing-tile, .typing-mode { padding:7px 8px; }
  }
  @media (max-height: 700px) {
    .net-box { gap:6px; padding:9px; }
    .room-btn { min-height:40px; padding:6px 8px; }
    .net-box input { padding:8px 10px; }
    .typing-hero-main { padding:9px 10px; }
    .typing-hero-main b { margin-top:2px; font-size:30px; }
    .typing-hero-main small { margin-top:5px; font-size:9px; }
    .typing-history { max-height:130px; }
  }

  /* === Единый консольный интерфейс: HUD, оверлеи, подсказки === */
  #hud {
    position:absolute; inset:0 0 auto 0; z-index:4;
    display:grid; grid-template-columns:1fr auto 1fr; align-items:start; gap:8px;
    padding:10px 12px; pointer-events:none;
    background:linear-gradient(180deg, rgba(3,9,22,.92), rgba(3,9,22,0));
    font-family:Consolas, "Courier New", monospace;
  }
  .hud-side { display:flex; align-items:flex-start; gap:8px; min-width:0; }
  .hud-side.right { justify-content:flex-end; }
  .hud-center {
    display:flex; flex-wrap:wrap; justify-content:center; align-items:flex-start;
    gap:6px; max-width:min(560px, 46vw); min-width:0;
  }
  .hud-card, .hud-chip {
    display:flex; flex-direction:column; gap:2px; min-width:0;
    padding:6px 9px; border:2px solid rgba(255,255,255,.14); border-radius:3px;
    background:linear-gradient(180deg, #12284a, #07142c);
    box-shadow:3px 3px 0 rgba(0,0,0,.5);
  }
  .hud-card span, .hud-chip span {
    font-size:9px; font-weight:900; letter-spacing:.12em; line-height:1;
    color:#7fa3c0; text-transform:uppercase;
  }
  .hud-card b, .hud-chip b {
    display:block; font-size:18px; font-weight:900; line-height:1.05;
    color:#fff; overflow-wrap:anywhere; white-space:normal; text-shadow:none;
  }
  #score, #net-hud { color:var(--cyan) !important; }
  #level, #coins { color:var(--hot) !important; }
  #lives { color:var(--red) !important; }
  #combo { color:var(--orange) !important; }
  #boss-hud { color:#ff8a98 !important; font-size:12px !important; }
  #buffs { color:var(--green) !important; font-size:12px !important; max-width:180px; }
  .heat-stat { min-width:132px; }
  .heat-bar {
    width:100%; height:6px; margin:3px 0; border:1px solid rgba(255,255,255,.18); border-radius:0;
    background:#061224; overflow:hidden;
  }
  #heat-fill {
    height:100%; width:0; border-radius:0;
    background:linear-gradient(90deg, var(--green), var(--hot), var(--red));
    transition:width .08s linear;
  }
  #heat-text { font-size:10px !important; color:#9fc4df !important; }
  .heat-stat.hot #heat-text { color:var(--hot) !important; }
  .heat-stat.jammed #heat-text { color:var(--red) !important; }
  .hud-actions { display:flex; gap:6px; pointer-events:auto; }
  .hud-actions button {
    display:grid; place-items:center; width:34px; height:34px; padding:7px;
    border:2px solid rgba(108,231,255,.35); border-radius:3px;
    background:#0a1b34; color:#bfe9ff; box-shadow:2px 2px 0 rgba(0,0,0,.5);
    cursor:pointer; transition:transform .12s, box-shadow .12s, border-color .12s;
  }
  .hud-actions button:hover, .hud-actions button:focus-visible {
    transform:translate(1px,1px); box-shadow:1px 1px 0 rgba(0,0,0,.5);
    border-color:var(--cyan); outline:none;
  }
  .hud-actions button svg { width:100%; height:100%; fill:none; stroke:currentColor; stroke-width:2.2; stroke-linecap:square; stroke-linejoin:miter; }
  .hud-actions button.exit { border-color:rgba(255,138,152,.45); color:#ffb4bf; }
  .hud-actions button.exit:hover, .hud-actions button.exit:focus-visible { border-color:#ff8a98; }

  /* Главный экран: герой в той же системе */
  .menu-hero::after { display:none; }
  .menu-logo {
    border:2px solid var(--cyan); border-radius:3px; background:#0a1b34;
    box-shadow:4px 4px 0 rgba(0,0,0,.45); backdrop-filter:none;
  }
  .menu-logo::before, .menu-logo::after { display:none; }
  .menu-logo svg { filter:none; }
  .menu-badge {
    padding:5px 9px; border:2px solid rgba(255,209,102,.5); border-radius:2px;
    background:rgba(255,209,102,.07); color:var(--hot); box-shadow:3px 3px 0 rgba(0,0,0,.45);
    font:900 10px Consolas, "Courier New", monospace; backdrop-filter:none;
  }
  .menu-hero h1 {
    font-family:Consolas, "Courier New", monospace; letter-spacing:.04em; line-height:.98;
    text-shadow:none;
  }
  .menu-hero h1 .accent {
    color:var(--cyan); font-size:.52em; background:none; -webkit-text-fill-color:currentColor;
    filter:none; letter-spacing:.12em;
  }
  .menu-hero p {
    font:700 13px/1.55 Consolas, "Courier New", monospace; color:#a9c7de; text-shadow:none;
  }
  .menu-stats .stat {
    padding:12px 14px; border:2px solid rgba(255,255,255,.14); border-radius:3px;
    background:linear-gradient(180deg, #12284a, #07142c);
    box-shadow:4px 4px 0 rgba(0,0,0,.45); backdrop-filter:none;
  }
  .menu-stats .stat span:first-child {
    font:900 9px Consolas, "Courier New", monospace; letter-spacing:.12em; color:#7fa3c0;
  }
  .menu-stats .stat b {
    font:900 clamp(24px,3vw,38px) Consolas, "Courier New", monospace;
    color:var(--cyan); text-shadow:none;
  }
  .menu-stats .stat:nth-child(2) b { color:var(--hot); }
  .menu-stats .stat:nth-child(3) b { color:#fff; font-size:clamp(16px,2vw,24px); }

  /* Оверлеи паузы/результата */
  .overlay { backdrop-filter:none; }
  #pause, #over { background:rgba(2,7,18,.82); backdrop-filter:none; }
  .game-panel {
    padding:20px 22px; border:2px solid rgba(108,231,255,.35); border-radius:4px;
    background:linear-gradient(180deg, #0d2342, #040c1c);
    box-shadow:5px 5px 0 rgba(0,0,0,.55); backdrop-filter:none;
    font-family:Consolas, "Courier New", monospace;
  }
  .panel-badge {
    width:52px; height:52px; border:2px solid var(--cyan); border-radius:3px;
    background:#0a1b34; color:var(--cyan); box-shadow:3px 3px 0 rgba(0,0,0,.5);
    font:900 22px Consolas, "Courier New", monospace;
  }
  .panel-badge.danger { border-color:var(--red); color:var(--red); }
  .panel-badge.win { border-color:var(--green); color:var(--green); }
  .game-panel h2, .overlay h2, .overlay:not(#start) h1 {
    font-family:Consolas, "Courier New", monospace; letter-spacing:.08em; text-shadow:none;
  }
  .game-panel p, .overlay:not(#start) p {
    font:700 12px/1.5 Consolas, "Courier New", monospace; color:#a9c7de; text-shadow:none;
  }
  .keys span {
    padding:5px 8px; border:2px solid rgba(108,231,255,.3); border-radius:2px;
    background:#0a1b34; color:#cfe6f7; box-shadow:2px 2px 0 rgba(0,0,0,.45);
    font:900 10px Consolas, "Courier New", monospace;
  }
  button.play, .game-actions button.play, .game-actions button.play:first-child {
    padding:12px 18px; border:2px solid var(--cyan); border-radius:3px;
    background:linear-gradient(180deg, rgba(108,231,255,.2), rgba(108,231,255,.05));
    color:#fff; box-shadow:3px 3px 0 rgba(0,0,0,.5);
    font:900 12px Consolas, "Courier New", monospace; letter-spacing:.1em;
    transition:transform .12s, box-shadow .12s, border-color .12s;
  }
  button.play:hover, .game-actions button.play:hover { filter:none; transform:translate(1px,1px); box-shadow:2px 2px 0 rgba(0,0,0,.5); border-color:#bff4ff; }
  .game-actions button.play.ghost {
    border-color:rgba(255,255,255,.2); background:#0a1b34; color:#cfe6f7;
  }
  .result-score {
    padding:12px; border:2px solid rgba(255,209,102,.35); border-radius:3px;
    background:rgba(255,209,102,.06); box-shadow:3px 3px 0 rgba(0,0,0,.45);
  }
  .result-score > span, .result-grid span {
    font:900 9px Consolas, "Courier New", monospace; letter-spacing:.12em; color:#7fa3c0;
  }
  .result-score > b { font:900 clamp(38px,8vw,64px) Consolas, "Courier New", monospace; }
  .result-score small { font:700 11px Consolas, "Courier New", monospace; color:#a9c7de; }
  .result-grid > div {
    padding:8px 10px; border:2px solid rgba(255,255,255,.14); border-radius:3px;
    background:#0a1b34; box-shadow:2px 2px 0 rgba(0,0,0,.45);
  }
  .result-grid b { font:900 12px Consolas, "Courier New", monospace; }
  .room-code {
    padding:10px 14px; border:2px solid var(--cyan); border-radius:3px;
    background:#061224; box-shadow:3px 3px 0 rgba(0,0,0,.45);
  }
  .small-hint, .final { font-family:Consolas, "Courier New", monospace; }

  /* Окно «уровень пройден» — отдельный консольный экран результата */
  #level-clear { background:radial-gradient(ellipse at center, rgba(12,48,38,.5), rgba(2,7,18,.86)); }
  #level-clear .game-panel {
    width:min(620px, 100%); align-items:stretch; gap:10px;
    border-color:rgba(102,255,174,.5);
  }
  .clear-kicker { border-left-color:var(--green); background:rgba(102,255,174,.07); }
  .clear-kicker span:last-child { color:var(--green); }
  .clear-title {
    margin:0; text-align:center; color:#fff;
    font:900 clamp(26px, 5vw, 44px) Consolas, "Courier New", monospace;
    letter-spacing:.1em;
  }
  .clear-stars {
    text-align:center; color:#ffd166; letter-spacing:.16em; line-height:1;
    font:900 clamp(30px, 6vw, 48px) Consolas, "Courier New", monospace;
    text-shadow:0 0 24px rgba(255,209,102,.35);
  }
  .clear-score {
    padding:10px 12px; border:2px solid rgba(255,209,102,.4); border-radius:3px;
    background:rgba(255,209,102,.06); box-shadow:3px 3px 0 rgba(0,0,0,.45); text-align:center;
  }
  .clear-score span {
    display:block; font:900 9px Consolas, "Courier New", monospace;
    letter-spacing:.12em; color:#8fa9c4; text-transform:uppercase;
  }
  .clear-score b {
    display:block; font:900 clamp(34px, 7vw, 56px) Consolas, "Courier New", monospace;
    color:#fff; line-height:1.05;
  }
  .clear-target {
    text-align:center; color:#8fa9c4;
    font:900 10px Consolas, "Courier New", monospace; letter-spacing:.08em;
  }
  .clear-grid { grid-template-columns:repeat(3, minmax(0, 1fr)); }
  #level-clear .game-actions button.play {
    border-color:rgba(102,255,174,.55);
    background:linear-gradient(180deg, rgba(102,255,174,.18), rgba(102,255,174,.04));
  }
  #level-clear .game-actions button.play.ghost { border-color:rgba(255,255,255,.2); background:#0a1b34; }
  @media (max-width: 520px) {
    .clear-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); }
  }

  /* Pong HUD */
  .pong-side {
    padding:8px 10px; border:2px solid rgba(108,231,255,.35); border-radius:3px;
    background:#0a1b34; box-shadow:3px 3px 0 rgba(0,0,0,.5); backdrop-filter:none;
    font-family:Consolas, "Courier New", monospace;
  }
  .pong-side b, .pong-side span, .pong-side small { font-family:Consolas, "Courier New", monospace; }
  .pong-side b { font-size:14px; }
  .pong-side span { font-size:14px; }
  .pong-side small { font-size:10px; }
  .pong-room {
    padding:4px 8px; border:2px solid rgba(108,231,255,.35); border-radius:2px;
    background:#061224; box-shadow:2px 2px 0 rgba(0,0,0,.45);
    font:900 10px Consolas, "Courier New", monospace; backdrop-filter:none;
  }
  .pong-turn { font:900 12px Consolas, "Courier New", monospace; text-shadow:none; }
  .pong-speed, .pong-esc { font-family:Consolas, "Courier New", monospace; }

  /* Подсказки, ввод и предупреждения */
  #hint {
    padding:6px 10px; border:2px solid rgba(108,231,255,.25); border-radius:3px;
    background:#061224; color:#9fc4df; box-shadow:3px 3px 0 rgba(0,0,0,.45);
    font:700 10px/1.4 Consolas, "Courier New", monospace; backdrop-filter:none;
  }
  #mobile-input {
    padding:12px 16px; border:2px solid var(--cyan); border-radius:3px;
    background:#061224; box-shadow:3px 3px 0 rgba(0,0,0,.45);
    font:900 18px Consolas, "Courier New", monospace; backdrop-filter:none;
  }
  #mobile-input:focus { border-color:#bff4ff; box-shadow:3px 3px 0 rgba(0,0,0,.45), 0 0 0 2px rgba(108,231,255,.2); }
  .warn-card {
    padding:18px 26px; border:2px solid var(--red); border-radius:3px;
    background:#260a12; box-shadow:5px 5px 0 rgba(0,0,0,.55); backdrop-filter:none;
    font-family:Consolas, "Courier New", monospace;
  }
  .warn-kicker, .warn-main { font-family:Consolas, "Courier New", monospace; text-shadow:none; }

  @media (max-width: 820px) {
    #hud { grid-template-columns:1fr auto; gap:6px; padding:8px 8px 0; }
    #hud .hud-center { grid-column:1 / -1; grid-row:2; justify-content:flex-start; max-width:none; }
    #hud .hud-side.right { grid-column:2; grid-row:1; }
    .hud-card, .hud-chip { padding:5px 8px; }
    .hud-card b, .hud-chip b { font-size:14px; }
    .hud-card span, .hud-chip span { font-size:8px; }
    .hud-actions button { width:30px; height:30px; padding:6px; }
    .heat-stat { min-width:112px; }
  }
  @media (max-width: 520px) {
    .hud-center { gap:5px; }
    .hud-card, .hud-chip { padding:4px 7px; }
    .hud-card b, .hud-chip b { font-size:12px; }
    #boss-hud, #net-hud, #buffs { font-size:10px !important; }
    .pong-side { padding:6px 8px; }
    .pong-center { gap:4px; }
    #hint { font-size:9px; }
  }
  @media (max-height: 520px) and (orientation: landscape) {
    #hud { grid-template-columns:auto minmax(0,1fr) auto; align-items:center; padding:6px 10px 0; }
    #hud .hud-center { grid-column:2; grid-row:1; justify-content:center; }
    #hud .hud-side.right { grid-column:3; grid-row:1; }
    .hud-card, .hud-chip { padding:4px 8px; }
    .hud-card b, .hud-chip b { font-size:12px; }
    .hud-actions button { width:28px; height:28px; }
  }

  /* --- Авторизация LDAP прямо в игре (без редиректов) --- */
  #auth-modal {
    position:fixed; inset:0; z-index:200; display:none;
    align-items:center; justify-content:center;
    background:rgba(3,10,20,.78); backdrop-filter:blur(3px);
  }
  .auth-card {
    width:min(430px,92vw); max-height:92vh; overflow:auto; padding:22px;
    border:2px solid rgba(108,231,255,.45);
    background:linear-gradient(180deg,#12284a,#07142c);
    box-shadow:0 0 0 4px rgba(0,0,0,.35), 0 16px 48px rgba(0,0,0,.6);
    font:700 12px/1.5 Consolas, "Courier New", monospace; color:#d8ecff;
  }
  .auth-card h2 { margin:0 0 4px; font-size:18px; letter-spacing:.08em; color:#9ef5ff; }
  .auth-card p { margin:0 0 14px; font-size:11px; color:#a4c4de; }
  .auth-card label {
    display:block; margin:12px 0 5px; font-size:10px;
    letter-spacing:.1em; color:#8fb4d4;
  }
  .auth-card input {
    width:100%; box-sizing:border-box; padding:10px 12px;
    border:1px solid rgba(108,231,255,.35); background:#061225;
    color:#eafcff; font:700 13px Consolas, "Courier New", monospace; outline:none;
  }
  .auth-card input:focus { border-color:#6ce7ff; box-shadow:0 0 0 2px rgba(108,231,255,.18); }
  .auth-card .main-btn { width:100%; margin-top:18px; }
  .auth-error { min-height:16px; margin-top:12px; font-size:11px; color:#ff9aa5; }
  .auth-links { display:flex; justify-content:space-between; gap:10px; margin-top:8px; }
  .auth-link {
    padding:0; border:0; background:none; cursor:pointer;
    color:#a4c4de; font:700 10px Consolas, "Courier New", monospace;
    text-decoration:underline;
  }
  .auth-link:hover { color:#9ef5ff; }

  /* --- вкладки статистики и список игроков --- */
  .stats-tabs { display:flex; gap:8px; margin:10px 0 12px; }
  .stats-tab {
    flex:1; padding:9px 10px; cursor:pointer;
    border:1px solid rgba(108,231,255,.28); background:#07182f;
    color:#a4c4de; font:700 10px Consolas, "Courier New", monospace;
    letter-spacing:.06em;
  }
  .stats-tab.active {
    border-color:#6ce7ff; color:#eafcff;
    background:linear-gradient(180deg,#17385f,#0a1e3a);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.1);
  }
  .players-list { display:flex; flex-direction:column; gap:6px; }
  .player-row {
    display:flex; justify-content:space-between; gap:12px; padding:9px 11px;
    border-left:3px solid rgba(108,231,255,.5); background:rgba(108,231,255,.05);
    font:700 11px Consolas, "Courier New", monospace; color:#d8ecff;
  }
  .player-row.me { border-left-color:#66ffae; background:rgba(102,255,174,.06); }
  .player-row .player-name { color:#9ef5ff; }
  .player-row .player-login { display:block; font-size:10px; color:#8fb4d4; }
  .player-row .player-time { font-size:10px; color:#a4c4de; white-space:nowrap; }

  /* --- Большое модальное окно статистики --- */
  .stats-modal {
    position:fixed; inset:0; z-index:180; display:none;
    align-items:center; justify-content:center;
    padding:clamp(10px,2.5vw,32px);
    background:rgba(3,10,22,.86); backdrop-filter:blur(4px);
  }
  .stats-modal.show { display:flex; }
  .stats-card {
    width:min(1080px,100%); height:min(94vh,900px); max-height:none; overflow:auto;
    padding:clamp(16px,2.2vw,30px);
    border:2px solid rgba(108,231,255,.42);
    background:linear-gradient(180deg,#102644,#061227);
    box-shadow:0 0 0 5px rgba(0,0,0,.45), 0 22px 70px rgba(0,0,0,.65);
    scrollbar-width:thin; scrollbar-color:rgba(108,231,255,.4) transparent;
  }
  .stats-card .menu-panel-header { position:relative; padding-right:54px; }
  .stats-close {
    position:absolute; top:0; right:0; width:38px; height:38px;
    border:1px solid rgba(255,255,255,.22); background:rgba(255,255,255,.06);
    color:#dceeff; font:700 24px/1 Consolas, "Courier New", monospace; cursor:pointer;
  }
  .stats-close:hover { border-color:#6ce7ff; color:#9ef5ff; }
  .stats-card .typing-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  @media (max-width: 700px) {
    .stats-card .typing-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  }

  /* --- Таблица рекордов --- */
  .records-toolbar { display:flex; align-items:center; gap:10px; margin:0 0 12px; flex-wrap:wrap; }
  .records-toolbar label { font:700 10px Consolas, "Courier New", monospace; color:#8fb4d4; letter-spacing:.06em; }
  .records-toolbar select {
    flex:1; min-width:180px; padding:8px 10px; cursor:pointer;
    border:1px solid rgba(108,231,255,.28); background:#07182f; color:#d8ecff;
    font:700 11px Consolas, "Courier New", monospace;
  }
  .records-toolbar .stats-tab { flex:0 0 auto; padding:8px 14px; }
  .records-list { overflow:auto; }
  .records-table { width:100%; border-collapse:collapse; font:700 11px Consolas, "Courier New", monospace; }
  .records-table th {
    position:sticky; top:0; z-index:1; text-align:left; padding:9px 10px;
    color:#8fb4d4; background:#0b203c; border-bottom:1px solid rgba(108,231,255,.25);
    font-size:10px; letter-spacing:.05em; white-space:nowrap;
  }
  .records-table td { padding:9px 10px; border-bottom:1px solid rgba(255,255,255,.06); color:#d8ecff; white-space:nowrap; }
  .records-table tr.me td { color:#9ef5ff; background:rgba(102,255,174,.06); }
  .records-table .rec-place { width:46px; color:#ffcf6a; }
  .records-table .rec-score { color:#9ef5ff; }
  .records-table .rec-login { display:block; font-size:10px; color:#8fb4d4; }
