:root {
  --bg: #04060d;
  --panel: rgba(9, 14, 32, 0.66);
  --panel-2: rgba(14, 22, 48, 0.72);
  --line: rgba(120, 160, 255, 0.16);
  --line-2: rgba(120, 160, 255, 0.3);
  --txt: #e8eeff;
  --dim: #8894b8;
  --cyan: #00f0ff;
  --pink: #ff2bd6;
  --lime: #b6ff1a;
  --gold: #ffd04d;
  --red: #ff3b5c;
  --accent: #00f0ff;
  --font: 'Rajdhani', 'Tajawal', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 16px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--bg); color: var(--txt); font-family: var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
html[dir="rtl"] { --font: 'Tajawal', 'Rajdhani', system-ui, sans-serif; }
body { touch-action: none; user-select: none; -webkit-user-select: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
[hidden] { display: none !important; }

#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }

.panel {
  background: linear-gradient(160deg, rgba(20, 30, 64, 0.62), rgba(6, 10, 24, 0.72));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.screen { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; touch-action: pan-y; }
#menu { background: radial-gradient(ellipse at 30% 20%, rgba(0, 240, 255, 0.07), transparent 55%), radial-gradient(ellipse at 80% 90%, rgba(255, 43, 214, 0.08), transparent 55%), linear-gradient(180deg, rgba(4, 6, 13, 0.55), rgba(4, 6, 13, 0.82)); animation: fadeIn 0.5s ease both; }
.menu-wrap { flex: 1; width: min(1180px, 100%); margin: 0 auto; padding: calc(40px + var(--safe-t)) 28px 20px; display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 36px; align-items: center; }

.logo { position: relative; font-weight: 700; font-size: clamp(50px, 7.6vw, 104px); letter-spacing: 0.04em; line-height: 0.95; display: flex; flex-wrap: wrap; gap: 0 0.2em; align-items: baseline; direction: ltr; font-family: 'Rajdhani', sans-serif; }
.logo span { position: relative; display: inline-block; }
.logo-echo { color: #eaffff; text-shadow: 0 0 18px rgba(0, 240, 255, 0.75), 0 0 48px rgba(0, 240, 255, 0.35); }
.logo-core { color: var(--pink); text-shadow: 0 0 18px rgba(255, 43, 214, 0.8), 0 0 56px rgba(255, 43, 214, 0.4); animation: flicker 6s infinite; }
.logo-echo::before, .logo-echo::after, .logo-core::before, .logo-core::after { content: attr(data-text); position: absolute; left: 0; top: 0; pointer-events: none; }
.logo-echo::before { color: transparent; -webkit-text-stroke: 1px rgba(0, 240, 255, 0.45); animation: echo 2.8s ease-in-out infinite; }
.logo-echo::after { color: transparent; -webkit-text-stroke: 1px rgba(0, 240, 255, 0.2); animation: echo 2.8s ease-in-out 0.35s infinite; }
.logo-core::before { color: transparent; -webkit-text-stroke: 1px rgba(255, 43, 214, 0.45); animation: echo 2.8s ease-in-out 0.15s infinite; }
.logo-core::after { color: transparent; -webkit-text-stroke: 1px rgba(255, 43, 214, 0.2); animation: echo 2.8s ease-in-out 0.5s infinite; }
.tagline { margin-top: 14px; font-size: clamp(17px, 1.7vw, 21px); color: #b9c4e6; font-weight: 600; letter-spacing: 0.02em; max-width: 34ch; }

.play { margin-top: 26px; padding: 20px; display: grid; gap: 16px; max-width: 480px; }
.field input { width: 100%; height: 56px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(3, 6, 16, 0.7); font-size: 22px; font-weight: 700; letter-spacing: 0.03em; outline: none; transition: border-color 0.2s, box-shadow 0.2s; user-select: text; -webkit-user-select: text; }
.field input::placeholder { color: #56618a; font-weight: 600; }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent), 0 0 24px color-mix(in srgb, var(--accent) 30%, transparent); }
.swatches { display: flex; flex-wrap: wrap; gap: 9px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; position: relative; background: transparent; border: 2.5px solid var(--c); box-shadow: 0 0 10px color-mix(in srgb, var(--c) 55%, transparent), inset 0 0 8px color-mix(in srgb, var(--c) 45%, transparent); transition: transform 0.15s; }
.swatch::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: var(--c); opacity: 0; transform: scale(0.4); transition: 0.18s; box-shadow: 0 0 12px var(--c); }
.swatch:hover { transform: scale(1.12); }
.swatch[aria-checked="true"] { transform: scale(1.15); }
.swatch[aria-checked="true"]::after { opacity: 1; transform: scale(1); }

.btn { position: relative; height: 56px; padding: 0 28px; border-radius: 12px; font-weight: 700; font-size: 22px; letter-spacing: 0.12em; text-transform: uppercase; overflow: hidden; transition: transform 0.12s, box-shadow 0.2s, opacity 0.2s; }
.btn.primary { color: #041018; background: linear-gradient(100deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #fff)); box-shadow: 0 0 26px color-mix(in srgb, var(--accent) 55%, transparent), inset 0 -3px 0 rgba(0, 0, 0, 0.18); }
.btn.primary::before { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent); transform: skewX(-20deg); animation: shine 3.2s ease-in-out infinite; }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 75%, transparent), inset 0 -3px 0 rgba(0, 0, 0, 0.18); }
.btn.primary:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn.ghost { border: 1px solid var(--line-2); color: var(--txt); background: rgba(255, 255, 255, 0.03); }
.btn.ghost:hover { border-color: var(--accent); }
.btn span { position: relative; }
.hint { font-size: 14px; color: var(--dim); text-align: center; letter-spacing: 0.04em; }
.only-touch { display: none; }
body.touch .only-touch { display: inline; }
body.touch .only-desk { display: none; }

.tips { margin-top: 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 640px; }
.tip { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(8, 12, 28, 0.5); }
.tip svg { width: 40px; height: 40px; flex: none; filter: drop-shadow(0 0 6px var(--accent)); }
.tip h3 { font-size: 15px; font-weight: 700; letter-spacing: 0.04em; color: #fff; }
.tip p { font-size: 13px; color: var(--dim); line-height: 1.3; margin-top: 2px; }
.ic-ring { fill: none; stroke: var(--accent); stroke-width: 3; }
.ic-fill { fill: var(--accent); }
.ic-glow { fill: color-mix(in srgb, var(--accent) 25%, transparent); }
.ic-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 4 3; opacity: 0.8; }
.ic-dot { fill: #fff; }

.side { display: grid; gap: 16px; align-content: center; }
.profile { padding: 18px; display: grid; grid-template-columns: auto 1fr; gap: 14px 16px; align-items: center; }
.emblem { position: relative; width: 70px; height: 70px; --t: #d08c5b; }
.emblem svg { width: 100%; height: 100%; filter: drop-shadow(0 0 10px var(--t)); }
.emblem svg path { fill: color-mix(in srgb, var(--t) 18%, transparent); stroke: var(--t); stroke-width: 2.5; }
.emblem svg path.inner { fill: color-mix(in srgb, var(--t) 35%, transparent); stroke-width: 1.5; opacity: 0.8; }
.emblem b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; font-weight: 700; color: #fff; text-shadow: 0 0 8px var(--t); }
.p-tier { font-size: 20px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--t, #fff); }
.p-rp { font-size: 15px; color: var(--dim); }
.p-rp b { font-size: 26px; color: #fff; font-weight: 700; }
.bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.07); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--t, var(--accent)), #fff); box-shadow: 0 0 10px var(--t, var(--accent)); transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
html[dir="rtl"] .bar i { background: linear-gradient(-90deg, var(--t, var(--accent)), #fff); }
.p-next { font-size: 12px; color: var(--dim); margin-top: 5px; letter-spacing: 0.03em; }
.p-stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.p-stats div { padding: 9px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); }
.p-stats dt { font-size: 11px; color: var(--dim); letter-spacing: 0.08em; text-transform: uppercase; }
.p-stats dd { font-size: 20px; font-weight: 700; }

.boards { padding: 14px; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px; border-radius: 12px; background: rgba(0, 0, 0, 0.3); }
.tab { height: 34px; border-radius: 9px; font-weight: 700; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); transition: 0.2s; }
.tab.active { color: #041018; background: var(--accent); box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 50%, transparent); }
.gboard { list-style: none; margin-top: 10px; max-height: 290px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; touch-action: pan-y; }
.gboard li { display: grid; grid-template-columns: 28px 12px 1fr auto; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 8px; font-size: 16px; font-weight: 600; }
.gboard li:nth-child(odd) { background: rgba(255, 255, 255, 0.025); }
.gboard .n { color: var(--dim); font-size: 14px; text-align: center; }
.gboard li:nth-child(1) .n { color: var(--gold); }
.gboard li:nth-child(2) .n { color: #d8e2f5; }
.gboard li:nth-child(3) .n { color: #e59a62; }
.gboard .d { width: 10px; height: 10px; transform: rotate(45deg); border-radius: 2px; background: var(--c, #555); box-shadow: 0 0 8px var(--c, transparent); }
.gboard .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: plaintext; }
.gboard .v { font-variant-numeric: tabular-nums; color: #cfe; }
.gboard .empty { display: block; text-align: center; color: var(--dim); padding: 22px 0; background: none; }

.menu-foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 28px calc(14px + var(--safe-b)); width: min(1180px, 100%); margin: 0 auto; color: var(--dim); font-size: 15px; }
.online { display: flex; align-items: center; gap: 6px; }
.online i { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); animation: pulse 1.6s infinite; }
.online b { color: #fff; }
.foot-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.chip.social { display: inline-flex; align-items: center; justify-content: center; width: 34px; min-width: 34px; padding: 0; color: var(--txt); }
.chip.social svg { width: 15px; height: 15px; fill: currentColor; }
.chip { height: 34px; min-width: 44px; padding: 0 14px; border-radius: 17px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.04); font-weight: 700; font-size: 14px; letter-spacing: 0.06em; transition: 0.2s; }
.chip:hover { border-color: var(--accent); color: #fff; }

#hud { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
.hud-tl { position: absolute; top: calc(14px + var(--safe-t)); left: calc(14px + var(--safe-l)); display: grid; gap: 10px; }
html[dir="rtl"] .hud-tl { left: auto; right: calc(14px + var(--safe-r)); }
.stat-card { padding: 10px 14px; border-radius: 14px; background: rgba(6, 10, 24, 0.55); border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); min-width: 170px; }
.mass { display: flex; align-items: baseline; gap: 6px; }
.mass b { font-size: 34px; font-weight: 700; line-height: 1; color: #fff; text-shadow: 0 0 14px var(--accent); font-variant-numeric: tabular-nums; }
.mass span, .sub em { font-size: 12px; color: var(--dim); letter-spacing: 0.12em; text-transform: uppercase; font-style: normal; }
.sub { display: flex; gap: 12px; margin-top: 4px; font-size: 16px; font-weight: 700; }
.sub b { font-variant-numeric: tabular-nums; }
.feed { list-style: none; display: grid; gap: 4px; }
.feed li { font-size: 14px; font-weight: 600; padding: 4px 10px; border-radius: 8px; background: rgba(6, 10, 24, 0.55); border: 1px solid var(--line); width: max-content; max-width: 320px; animation: slideIn 0.3s ease both; transition: opacity 0.5s; unicode-bidi: plaintext; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed li.me { border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 25%, transparent); }
.feed li.out { opacity: 0; }
.feed b { font-weight: 700; }
.feed em { color: var(--dim); font-style: normal; margin: 0 5px; }

.hud-tr { position: absolute; top: calc(14px + var(--safe-t)); right: calc(14px + var(--safe-r)); }
html[dir="rtl"] .hud-tr { right: auto; left: calc(14px + var(--safe-l)); }
.lboard { width: 230px; padding: 10px 12px; border-radius: 14px; background: rgba(6, 10, 24, 0.55); }
.lboard h4 { font-size: 12px; letter-spacing: 0.16em; color: var(--dim); text-transform: uppercase; margin-bottom: 6px; }
.lboard ol { list-style: none; }
.lboard li, .lb-me { display: grid; grid-template-columns: 20px 9px 1fr auto; gap: 7px; align-items: center; font-size: 15px; font-weight: 600; padding: 2px 0; }
.lboard li .n, .lb-me .n { color: var(--dim); font-size: 13px; }
.lboard li .d, .lb-me .d { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.lboard li .nm, .lb-me .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: plaintext; }
.lboard li .v, .lb-me .v { font-variant-numeric: tabular-nums; color: #cfe; }
.lboard li.me, .lb-me { color: var(--accent); }
.lboard li:first-child .n { color: var(--gold); }
.lb-me { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }

.hud-bc { position: absolute; bottom: calc(16px + var(--safe-b)); left: 50%; transform: translateX(-50%); display: flex; gap: 12px; align-items: center; }
.echo { width: 260px; padding: 9px 14px 11px; border-radius: 14px; background: rgba(6, 10, 24, 0.55); border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.echo-top { display: flex; justify-content: space-between; font-size: 12px; letter-spacing: 0.16em; color: var(--dim); text-transform: uppercase; }
.echo-top b { text-transform: none; color: #fff; font-size: 16px; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.echo-bar { position: relative; height: 6px; margin-top: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.07); overflow: hidden; direction: ltr; }
.echo-bar i { position: absolute; inset: 0 auto 0 0; width: 100%; border-radius: inherit; background: linear-gradient(90deg, #fff, var(--accent)); box-shadow: 0 0 12px var(--accent); transition: width 0.4s; }
.echo-bar s { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(4, 6, 13, 0.8); }
.echo-bar s:nth-of-type(1) { left: 20%; } .echo-bar s:nth-of-type(2) { left: 40%; } .echo-bar s:nth-of-type(3) { left: 60%; } .echo-bar s:nth-of-type(4) { left: 80%; }
.surge { --p: 1; width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; background: radial-gradient(circle, rgba(6, 10, 24, 0.9) 60%, transparent 61%), conic-gradient(var(--accent) calc(var(--p) * 360deg), rgba(255, 255, 255, 0.08) 0); box-shadow: 0 0 calc(var(--p) * 18px) color-mix(in srgb, var(--accent) 40%, transparent); color: var(--dim); transition: box-shadow 0.2s; }
.surge.ready { color: #fff; animation: ready 1.4s ease-in-out infinite; }

.warn { position: absolute; top: 22%; left: 50%; transform: translateX(-50%); padding: 8px 18px; border-radius: 10px; font-weight: 700; font-size: 18px; letter-spacing: 0.2em; color: #fff; background: rgba(255, 30, 70, 0.18); border: 1px solid rgba(255, 59, 92, 0.7); box-shadow: 0 0 30px rgba(255, 59, 92, 0.45); animation: alarm 0.7s ease-in-out infinite; white-space: nowrap; }
.net { direction: ltr; unicode-bidi: isolate; position: absolute; bottom: calc(6px + var(--safe-b)); right: calc(16px + var(--safe-r)); font-size: 11px; color: rgba(136, 148, 184, 0.7); letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }

#death { align-items: center; justify-content: center; padding: 20px; background: radial-gradient(ellipse at center, rgba(40, 0, 20, 0.35), rgba(4, 6, 13, 0.72)); animation: fadeIn 0.6s ease 0.35s both; }
.death-card { width: min(460px, 100%); padding: 26px 24px 22px; text-align: center; animation: pop 0.55s cubic-bezier(0.2, 1.3, 0.4, 1) 0.4s both; }
.d-kicker { font-size: 13px; letter-spacing: 0.3em; color: var(--red); text-transform: uppercase; font-weight: 700; }
.death-card h2 { font-size: clamp(32px, 7vw, 44px); letter-spacing: 0.06em; margin-top: 4px; text-shadow: 0 0 22px rgba(255, 59, 92, 0.6); line-height: 1.05; }
.d-by { color: var(--dim); margin-top: 6px; font-size: 17px; }
.d-by b { color: var(--kc, #fff); text-shadow: 0 0 10px var(--kc, transparent); unicode-bidi: plaintext; }
.d-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 18px; }
.d-stats div { padding: 10px 4px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); display: grid; }
.d-stats b { font-size: 24px; font-variant-numeric: tabular-nums; }
.d-stats span { font-size: 11px; color: var(--dim); letter-spacing: 0.1em; text-transform: uppercase; }
.d-rank { margin-top: 14px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.2); text-align: start; }
.d-rp { display: flex; align-items: baseline; gap: 6px; justify-content: center; }
.d-rp b { font-size: 34px; font-variant-numeric: tabular-nums; }
.d-rp b.up { color: var(--lime); text-shadow: 0 0 14px rgba(182, 255, 26, 0.5); }
.d-rp b.down { color: var(--red); text-shadow: 0 0 14px rgba(255, 59, 92, 0.5); }
.d-rp span { color: var(--dim); font-size: 14px; letter-spacing: 0.1em; }
.d-tier { display: flex; justify-content: space-between; font-size: 14px; font-weight: 700; margin-top: 4px; letter-spacing: 0.06em; }
.d-tier span:first-child { color: var(--t); text-transform: uppercase; }
.d-tier span:last-child { color: var(--dim); }
.d-btns { display: grid; grid-template-columns: 1.6fr 1fr; gap: 10px; margin-top: 18px; }

#touch { position: fixed; inset: 0; z-index: 4; }
#stick { position: absolute; width: 124px; height: 124px; margin: -62px 0 0 -62px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.14); background: radial-gradient(circle, rgba(255, 255, 255, 0.05), transparent 70%); opacity: 0; transition: opacity 0.15s; pointer-events: none; }
#stick.on { opacity: 1; }
#stick i { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 35%, transparent); border: 2px solid var(--accent); box-shadow: 0 0 18px var(--accent); }
#surgeBtn { position: absolute; right: calc(22px + var(--safe-r)); bottom: calc(96px + var(--safe-b)); width: 88px; height: 88px; border-radius: 50%; font-weight: 700; font-size: 13px; letter-spacing: 0.12em; color: #fff; border: 2px solid var(--accent); background: radial-gradient(circle, color-mix(in srgb, var(--accent) 30%, transparent), rgba(6, 10, 24, 0.7) 70%); box-shadow: 0 0 22px color-mix(in srgb, var(--accent) 45%, transparent); }
#surgeBtn:active { transform: scale(0.94); }

#toasts { position: fixed; top: 16%; left: 50%; transform: translateX(-50%); z-index: 8; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { padding: 6px 18px; font-size: 22px; font-weight: 700; letter-spacing: 0.14em; color: #fff; text-shadow: 0 0 16px var(--c, var(--accent)), 0 0 4px var(--c, var(--accent)); animation: toast 1.9s cubic-bezier(0.2, 0.9, 0.3, 1) both; white-space: nowrap; }
.toast small { display: block; font-size: 14px; letter-spacing: 0.1em; color: #cdd6f4; text-align: center; }

.conn { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); z-index: 20; display: flex; gap: 10px; align-items: center; padding: 10px 18px; border-radius: 30px; background: rgba(6, 10, 24, 0.85); border: 1px solid var(--line-2); font-weight: 700; letter-spacing: 0.1em; transition: opacity 0.3s, transform 0.3s; }
.conn i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--accent); border-top-color: transparent; animation: spin 0.8s linear infinite; }
.conn.ok { opacity: 0; transform: translate(-50%, 20px); pointer-events: none; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; font-size: 20px; }

@keyframes echo { 0%, 100% { transform: translate(0, 0); opacity: 0; } 30% { opacity: 1; } 60% { transform: translate(-10px, 6px); opacity: 0; } }
@keyframes flicker { 0%, 92%, 96%, 100% { opacity: 1; } 93%, 95% { opacity: 0.55; } }
@keyframes shine { 0% { left: -60%; } 55%, 100% { left: 130%; } }
@keyframes pulse { 50% { opacity: 0.35; } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-14px); } }
@keyframes pop { from { opacity: 0; transform: scale(0.86) translateY(16px); } }
@keyframes ready { 50% { box-shadow: 0 0 26px color-mix(in srgb, var(--accent) 70%, transparent); } }
@keyframes alarm { 50% { background: rgba(255, 30, 70, 0.34); box-shadow: 0 0 44px rgba(255, 59, 92, 0.7); } }
@keyframes toast { 0% { opacity: 0; transform: translateY(12px) scale(0.85); } 12% { opacity: 1; transform: none; } 78% { opacity: 1; } 100% { opacity: 0; transform: translateY(-16px); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .menu-wrap { grid-template-columns: 1fr; gap: 18px; padding-top: calc(24px + var(--safe-t)); padding-inline: 16px; }
  .hero { display: grid; justify-items: center; text-align: center; }
  .play { width: 100%; }
  .swatches { justify-content: center; }
  .tips { grid-template-columns: 1fr; width: 100%; }
  .tip { text-align: start; }
  .menu-foot { padding-inline: 16px; }
}

@media (max-width: 700px), (max-height: 520px) {
  .stat-card { min-width: 0; padding: 7px 10px; }
  .mass b { font-size: 24px; }
  .sub { font-size: 13px; gap: 8px; }
  .lboard { width: 160px; padding: 7px 9px; }
  .lboard li, .lb-me { font-size: 12px; grid-template-columns: 14px 7px 1fr auto; gap: 5px; }
  .lboard li:nth-child(n+6) { display: none; }
  .lboard h4 { font-size: 10px; margin-bottom: 3px; }
  .feed li { font-size: 12px; max-width: 220px; }
  .feed li:nth-child(n+4) { display: none; }
  .echo { width: 170px; padding: 6px 10px 8px; }
  .surge { width: 50px; height: 50px; font-size: 9px; }
  body.touch .hud-bc .surge { display: none; }
  .warn { font-size: 14px; top: 18%; }
  .toast { font-size: 17px; }
  .d-stats b { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

html[lang="ru"] { --font: 'Rajdhani', 'Segoe UI', Roboto, 'Helvetica Neue', system-ui, sans-serif; }
html[lang="zh-CN"] { --font: 'Rajdhani', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', 'Hiragino Sans GB', system-ui, sans-serif; }
html[lang="ja"] { --font: 'Rajdhani', 'Hiragino Sans', 'Yu Gothic UI', 'Meiryo', 'Noto Sans JP', system-ui, sans-serif; }
html:is([lang="zh-CN"], [lang="ja"]) body :not(.logo, .logo *) { letter-spacing: 0.02em; }
html:is([lang="zh-CN"], [lang="ja"]) .tip p, html:is([lang="zh-CN"], [lang="ja"]) .hint { line-height: 1.5; }

.lang-wrap { position: relative; }
.lang-btn { display: inline-flex; align-items: center; gap: 7px; }
.lang-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; opacity: 0.85; }
.lang-menu { position: absolute; bottom: calc(100% + 8px); inset-inline-end: 0; z-index: 30; min-width: 210px; padding: 6px; display: grid; gap: 2px; max-height: min(420px, 70vh); overflow-y: auto; animation: pop 0.18s ease both; touch-action: pan-y; }
.lang-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 38px; padding: 0 12px; border-radius: 9px; font-size: 16px; font-weight: 600; color: var(--txt); text-align: start; font-family: system-ui, 'Segoe UI', sans-serif; transition: background 0.15s; }
.lang-opt:hover, .lang-opt:focus-visible { background: rgba(255, 255, 255, 0.07); outline: none; }
.lang-opt[aria-checked="true"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.lang-opt[aria-checked="true"]::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); flex: none; }
.surge.long { font-size: 8.5px; letter-spacing: 0.02em; }
#surgeBtn.long { font-size: 11px; letter-spacing: 0.02em; }
.arena-chip { display: inline-flex; align-items: center; gap: 7px; }
.arena-chip svg { width: 15px; height: 15px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.arena-chip em { font-style: normal; color: var(--accent); padding-inline-start: 7px; border-inline-start: 1px solid var(--line-2); }
@media (max-width: 520px) { .menu-foot { flex-wrap: wrap; gap: 10px; justify-content: center; } .foot-btns { justify-content: center; } .arena-chip span { display: none; } }

.badge { display: inline-block; width: 14px; height: 14px; margin-inline-start: 5px; vertical-align: -2px; border-radius: 50%; background: #29b6ff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.2 8.3l2.4 2.4 5.2-5.4' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat; box-shadow: 0 0 8px rgba(41, 182, 255, 0.6); flex: none; }
.acct-row { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.acct-id { display: grid; grid-template-columns: auto auto 1fr; align-items: center; column-gap: 2px; min-width: 0; }
.acct-id b { font-size: 18px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-id small { grid-column: 1 / -1; font-size: 12px; color: var(--dim); }
.acct-id .tiny { grid-column: 1 / -1; justify-self: start; font-size: 11px; opacity: 0.75; }
.acct-btns { display: flex; gap: 6px; flex: none; }
.chip.accent { background: var(--accent); color: #041018; border-color: transparent; box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 45%, transparent); }
.linkish { color: var(--accent); font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); padding: 2px 0; }
.linkish:hover { text-decoration-color: var(--accent); }
.clickwrap { font-size: 12px; color: var(--dim); text-align: center; line-height: 1.5; margin-top: -6px; }
.clickwrap a, .check a, .legal-links a { color: var(--txt); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line-2); }
.clickwrap a:hover, .check a:hover, .legal-links a:hover { color: var(--accent); }
.foot-left { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.legal-links { display: flex; gap: 14px; font-size: 13px; }

.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(2, 3, 10, 0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadeIn 0.2s ease both; overflow-y: auto; touch-action: pan-y; }
.modal-card { position: relative; width: min(420px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 24px 22px 20px; animation: pop 0.28s cubic-bezier(0.2, 1.2, 0.4, 1) both; scrollbar-width: thin; }
.modal-x { position: absolute; top: 10px; inset-inline-end: 12px; width: 34px; height: 34px; border-radius: 50%; font-size: 24px; line-height: 1; color: var(--dim); }
.modal-x:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
#authBody { display: grid; gap: 12px; }
#authBody h3 { font-size: 24px; letter-spacing: 0.02em; padding-inline-end: 30px; display: flex; align-items: center; }
.auth-form { display: grid; gap: 10px; }
.fld { display: grid; gap: 4px; }
.fld span { font-size: 12px; color: var(--dim); letter-spacing: 0.06em; text-transform: uppercase; }
.fld input { height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(3, 6, 16, 0.75); font-size: 17px; outline: none; user-select: text; -webkit-user-select: text; transition: border-color 0.2s, box-shadow 0.2s; }
.fld input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.hint { font-size: 12px; color: var(--dim); margin-top: -6px; }
.form-note { font-size: 14px; color: #b9c4e6; line-height: 1.45; }
.form-note.caution { color: #ffd9a0; }
.form-err { min-height: 18px; font-size: 14px; color: #ff6b85; font-weight: 600; }
.form-err:empty { min-height: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: #c4cde8; line-height: 1.45; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--accent); flex: none; }
.auth-form .btn { height: 48px; font-size: 18px; }
.btn.danger { color: #fff; background: linear-gradient(100deg, #ff3b5c, #ff6b85); box-shadow: 0 0 20px rgba(255, 59, 92, 0.4); }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.codes { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.35); border: 1px dashed var(--line-2); direction: ltr; }
.codes li { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 15px; letter-spacing: 0.06em; text-align: center; user-select: text; -webkit-user-select: text; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row2 .btn { height: 44px; font-size: 14px; letter-spacing: 0.02em; padding: 0 10px; line-height: 1.1; display: grid; place-items: center; text-decoration: none; }
.qr-box { display: grid; place-items: center; }
.qr { width: 200px; height: 200px; border-radius: 12px; image-rendering: pixelated; box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 30%, transparent); }
.secret { display: block; text-align: center; font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 15px; letter-spacing: 0.08em; padding: 8px; border-radius: 8px; background: rgba(0, 0, 0, 0.35); user-select: all; -webkit-user-select: all; direction: ltr; word-break: break-all; }
.acct-head small { color: var(--dim); font-size: 13px; }
.acct-fold { border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; background: rgba(255, 255, 255, 0.02); }
.acct-fold summary { cursor: pointer; padding: 12px 0; font-weight: 700; font-size: 16px; display: flex; justify-content: space-between; align-items: center; list-style: none; }
.acct-fold summary::-webkit-details-marker { display: none; }
.acct-fold summary::after { content: '+'; color: var(--dim); font-size: 20px; }
.acct-fold[open] summary::after { content: '–'; }
.acct-fold summary em { font-style: normal; font-size: 12px; padding: 2px 8px; border-radius: 10px; margin-inline-start: auto; margin-inline-end: 10px; }
.acct-fold summary em.on { background: rgba(0, 255, 163, 0.15); color: #6dffc6; }
.acct-fold summary em.off { background: rgba(255, 255, 255, 0.07); color: var(--dim); }
.acct-fold .auth-form { padding-bottom: 14px; }
.acct-fold.danger summary { color: #ff6b85; }
.acct-sec { display: grid; gap: 8px; }
.lboard li .nm, .gboard .nm { display: flex; align-items: center; min-width: 0; }
.lboard li .nm .badge, .gboard .nm .badge { width: 12px; height: 12px; }
@media (max-width: 520px) { .acct-row { flex-wrap: wrap; } .codes { grid-template-columns: 1fr; } }
.auth-form .hint { text-align: start; }

.chip.support { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; color: #ffd1e8; border-color: rgba(255, 43, 214, 0.45); background: rgba(255, 43, 214, 0.08); }
.chip.support i { width: 13px; height: 12px; background: #ff2bd6; clip-path: path('M6.5 11.5 1.2 6.3A3.3 3.3 0 0 1 6.5 2a3.3 3.3 0 0 1 5.3 4.3Z'); box-shadow: 0 0 8px #ff2bd6; }
.chip.support:hover { color: #fff; border-color: #ff2bd6; }
.ad-wrap { position: relative; display: grid; gap: 4px; padding: 8px; border-radius: 12px; border: 1px solid var(--line); background: rgba(6, 10, 24, 0.55); min-height: 120px; }
.ad-wrap ins.adsbygoogle { display: block; min-width: 250px; min-height: 100px; }
.ad-label { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
#death .ad-wrap { width: min(460px, 100%); margin-top: 22px; }
@media (max-width: 900px) { .side .ad-wrap { order: 3; } }
