  :root {
    --bg: #07080c;
    --bg-2: #0d1018;
    --ink: #e8ecf2;
    --ink-dim: #6b7689;
    --ink-faint: #2a3142;
    --accent: #ff3864;
    --accent-2: #2de2e6;
    --accent-3: #f9c80e;
    --good: #4dd56b;
  }

  * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

  html, body {
    margin: 0; padding: 0;
    width: 100%; height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--ink);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    user-select: none;
    -webkit-user-select: none;
    overscroll-behavior: none;
    touch-action: manipulation;
  }

  #stage {
    position: fixed;
    inset: 0;
    overflow: hidden;
  }

  /* matrix rain canvas */
  #rain {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.35;
  }

  /* vignette over rain */
  .vignette {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
      radial-gradient(ellipse at center, transparent 0%, rgba(7,8,12,0.55) 60%, rgba(7,8,12,0.95) 100%);
  }

  /* ─────── HUD ─────── */
  .hud {
    position: fixed;
    top: 0; left: 0; right: 0;
    padding: 14px 16px 0;
    padding-top: max(14px, env(safe-area-inset-top));
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 10;
    pointer-events: none;
  }
  .hud > * { pointer-events: auto; }

  .hud-block {
    background: rgba(7, 8, 12, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(232, 236, 242, 0.08);
    padding: 8px 12px;
    border-radius: 2px;
  }

  .label {
    font-size: 9px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-dim);
    margin-bottom: 4px;
  }

  .value {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
    color: var(--accent-2);
    font-variant-numeric: tabular-nums;
  }
  .value.small {
    font-size: 13px;
    color: var(--ink);
  }

  /* ─────── Counter (big top center) ─────── */
  .counter-wrap {
    position: fixed;
    top: max(72px, calc(env(safe-area-inset-top) + 72px));
    left: 0; right: 0;
    z-index: 10;
    text-align: center;
    pointer-events: none;
  }
  .counter-label {
    font-size: 9px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--ink-dim);
    margin-bottom: 6px;
  }
  .counter {
    font-family: 'Major Mono Display', monospace;
    font-size: 38px;
    line-height: 1;
    color: var(--ink);
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 18px rgba(45, 226, 230, 0.25);
  }
  .counter.glitch {
    animation: glitch 0.4s steps(2);
  }
  @keyframes glitch {
    0%   { transform: translate(0, 0); color: var(--ink); }
    20%  { transform: translate(-2px, 1px); color: var(--accent); }
    40%  { transform: translate(2px, -1px); color: var(--accent-2); }
    60%  { transform: translate(-1px, 2px); color: var(--accent-3); }
    100% { transform: translate(0, 0); color: var(--ink); }
  }

  .rate {
    font-size: 11px;
    color: var(--ink-dim);
    margin-top: 6px;
    letter-spacing: 0.1em;
    font-variant-numeric: tabular-nums;
  }
  .rate b { color: var(--accent-2); font-weight: 500; }

  /* ─────── ASCII server (clickable) ─────── */
  .server-wrap {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    cursor: pointer;
    padding: 30px;
    touch-action: manipulation;
  }
  .server {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    line-height: 1.1;
    color: var(--accent-2);
    white-space: pre;
    text-align: center;
    text-shadow: 0 0 10px rgba(45, 226, 230, 0.6);
    transition: transform 0.08s ease;
    pointer-events: none;
  }
  .server-wrap:active .server {
    transform: scale(0.96);
  }
  .server-wrap.pulse .server {
    animation: serverPulse 0.18s ease;
  }
  @keyframes serverPulse {
    0%   { transform: scale(1); filter: brightness(1); }
    50%  { transform: scale(1.03); filter: brightness(1.4); }
    100% { transform: scale(1); filter: brightness(1); }
  }

  /* tap floats */
  .tap-float {
    position: absolute;
    pointer-events: none;
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-3);
    text-shadow: 0 0 6px rgba(249, 200, 14, 0.6);
    animation: tapFloat 0.9s ease-out forwards;
    z-index: 8;
    font-variant-numeric: tabular-nums;
  }
  @keyframes tapFloat {
    0%   { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -50px); }
  }

  /* ─────── Bottom bar ─────── */
  .bottom-bar {
    position: fixed;
    left: 0; right: 0;
    bottom: 0;
    padding: 0 12px max(12px, env(safe-area-inset-bottom)) 12px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  /* tail log */
  .log {
    background: rgba(7, 8, 12, 0.75);
    border: 1px solid rgba(232, 236, 242, 0.06);
    border-radius: 2px;
    padding: 6px 10px;
    font-size: 10px;
    line-height: 1.5;
    color: var(--ink-dim);
    height: 56px;
    overflow: hidden;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.02em;
  }
  .log-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .log-line .t { color: var(--ink-faint); }
  .log-line .c { color: var(--accent-2); }
  .log-line .w { color: var(--accent-3); }
  .log-line .e { color: var(--accent); }
  .log-line .g { color: var(--good); }

  /* upgrades button row */
  .btn-row {
    display: flex;
    gap: 8px;
  }
  .btn {
    flex: 1;
    background: rgba(7, 8, 12, 0.7);
    border: 1px solid rgba(232, 236, 242, 0.12);
    color: var(--ink);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 12px 8px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    overflow: hidden;
  }
  .btn::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--accent-2);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.2s ease;
  }
  .btn:active::before { transform: scaleY(1); }
  .btn:active { background: rgba(45, 226, 230, 0.08); }
  .btn .badge {
    position: absolute;
    top: 4px; right: 6px;
    font-size: 9px;
    color: var(--accent-3);
    font-weight: 700;
  }

  /* ─────── Modal ─────── */
  .modal-bg {
    position: fixed;
    inset: 0;
    background: rgba(4, 5, 10, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: stretch;
    justify-content: center;
    z-index: 30;
    animation: fadeIn 0.2s ease;
  }
  .modal-bg.show { display: flex; }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

  .modal {
    width: 100%;
    max-width: 480px;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: max(20px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
    min-height: 0;
  }

  .modal-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(232, 236, 242, 0.08);
  }
  .modal-title {
    font-family: 'Major Mono Display', monospace;
    font-size: 22px;
    letter-spacing: 0.06em;
    color: var(--ink);
  }
  .modal-close {
    background: none;
    border: 1px solid rgba(232, 236, 242, 0.15);
    color: var(--ink);
    width: 32px; height: 32px;
    border-radius: 2px;
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
  }
  .modal-close:active { background: rgba(255, 56, 100, 0.15); }

  .modal-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
  }
  .tab {
    flex: 1;
    background: rgba(232, 236, 242, 0.03);
    border: 1px solid rgba(232, 236, 242, 0.08);
    color: var(--ink-dim);
    font-family: inherit;
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 8px;
    border-radius: 2px;
    cursor: pointer;
  }
  .tab.active {
    color: var(--accent-2);
    border-color: var(--accent-2);
    background: rgba(45, 226, 230, 0.08);
  }

  .upgrade-list {
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 20px;
  }

  .upgrade {
    background: linear-gradient(180deg, rgba(45, 226, 230, 0.04), rgba(45, 226, 230, 0.01));
    border: 1px solid rgba(232, 236, 242, 0.08);
    padding: 12px 14px;
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease;
    overflow: hidden;
    border-radius: 2px;
  }
  .upgrade::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--accent-2);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.2s ease;
  }
  .upgrade.affordable:active { background: rgba(45, 226, 230, 0.12); }
  .upgrade.affordable:active::before { transform: scaleY(1); }
  .upgrade.locked {
    opacity: 0.4;
    cursor: not-allowed;
  }
  .upgrade.poor {
    opacity: 0.7;
  }
  .upgrade-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
  }
  .upgrade-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    letter-spacing: 0.03em;
    line-height: 1.4;
  }
  .upgrade-cost {
    font-size: 12px;
    color: var(--accent-3);
    font-weight: 700;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
  }
  .upgrade.affordable .upgrade-cost { color: var(--good); }
  .upgrade-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 10px;
    color: var(--ink-dim);
    letter-spacing: 0.06em;
    line-height: 1.5;
  }
  .upgrade-meta .owned { color: var(--accent-2); }

  /* ─────── DDoS event ─────── */
  .ddos-alert {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 56, 100, 0.15);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 8px 16px;
    font-size: 10px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    z-index: 12;
    border-radius: 2px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: alertPulse 0.6s infinite alternate;
    display: none;
  }
  .ddos-alert.show { display: block; }
  @keyframes alertPulse {
    from { box-shadow: 0 0 0 rgba(255, 56, 100, 0.4); }
    to   { box-shadow: 0 0 20px rgba(255, 56, 100, 0.6); }
  }

  .packet {
    position: absolute;
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 10px rgba(255, 56, 100, 0.8);
    z-index: 7;
    cursor: pointer;
    padding: 8px;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    touch-action: manipulation;
  }
  .packet.destroyed {
    animation: packetDestroy 0.3s ease forwards;
  }
  @keyframes packetDestroy {
    0%   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2); opacity: 0; color: var(--good); }
  }

  /* Welcome / offline modal */
  .welcome-modal {
    background: rgba(7, 8, 12, 0.95);
    border: 1px solid var(--accent-2);
    padding: 24px;
    max-width: 320px;
    text-align: center;
    border-radius: 2px;
    align-self: center;
    margin: auto;
  }
  .welcome-title {
    font-family: 'Major Mono Display', monospace;
    font-size: 18px;
    color: var(--accent-2);
    margin-bottom: 12px;
    letter-spacing: 0.06em;
  }
  .welcome-body {
    font-size: 11px;
    line-height: 1.6;
    color: var(--ink);
    margin-bottom: 16px;
    letter-spacing: 0.03em;
  }
  .welcome-body b { color: var(--accent-3); }
  .welcome-btn {
    background: var(--accent-2);
    color: var(--bg);
    border: none;
    padding: 10px 24px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 2px;
  }
  .welcome-btn:active { transform: scale(0.96); }

  /* DDoS health bar */
  .ddos-hp {
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 3px;
    background: rgba(255, 56, 100, 0.15);
    z-index: 11;
    display: none;
  }
  .ddos-hp.show { display: block; }
  .ddos-hp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #ff7a99);
    transition: width 0.2s ease;
    box-shadow: 0 0 8px rgba(255, 56, 100, 0.6);
  }

  /* small bit-particle when tapping */
  .bit-particle {
    position: absolute;
    pointer-events: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--accent-2);
    z-index: 6;
    text-shadow: 0 0 4px rgba(45, 226, 230, 0.8);
    animation: bitFly 0.7s ease-out forwards;
  }
  @keyframes bitFly {
    0%   { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.4); }
  }

  /* ─────── Settings button (top-right corner) ─────── */
  .settings-btn {
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    right: 16px;
    width: 36px; height: 36px;
    background: rgba(7, 8, 12, 0.65);
    border: 1px solid rgba(232, 236, 242, 0.12);
    border-radius: 2px;
    color: var(--ink);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    z-index: 15;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none; /* hidden — moved into HUD block */
  }

  /* Ghost button style (matches other games) */
  .btn.ghost {
    background: transparent;
    border: 1px solid rgba(232, 236, 242, 0.2);
    color: var(--ink-dim);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  .btn.ghost:active {
    background: rgba(232, 236, 242, 0.05);
    color: var(--ink);
  }

  .welcome-modal .btn.ghost {
    margin-top: 10px;
    padding: 8px 16px;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.18em;
    width: 100%;
  }

  /* Settings modal extras */
  .settings-section {
    margin-bottom: 16px;
  }
  .settings-section a, .settings-section button {
    display: block;
    width: 100%;
    background: transparent;
    border: 1px solid rgba(232, 236, 242, 0.12);
    color: var(--ink);
    text-decoration: none;
    text-align: center;
    padding: 12px;
    font-family: inherit;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 2px;
    margin-bottom: 8px;
  }
  .settings-section a:active, .settings-section button:active {
    background: rgba(232, 236, 242, 0.05);
  }
  .settings-section .danger {
    color: var(--accent);
    border-color: rgba(255, 56, 100, 0.3);
  }
  .settings-section .danger:active {
    background: rgba(255, 56, 100, 0.08);
  }
  .settings-info {
    font-size: 10px;
    color: var(--ink-dim);
    letter-spacing: 0.08em;
    text-align: center;
    margin: 10px 0;
    line-height: 1.6;
  }
  .settings-info b { color: var(--accent-2); }

  /* ─────── Achievements ─────── */
  .ach-item {
    background: linear-gradient(180deg, rgba(45, 226, 230, 0.04), rgba(45, 226, 230, 0.01));
    border: 1px solid rgba(232, 236, 242, 0.08);
    padding: 12px 14px;
    border-radius: 2px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
  }
  .ach-item.unlocked {
    border-color: rgba(45, 226, 230, 0.3);
    background: linear-gradient(180deg, rgba(45, 226, 230, 0.08), rgba(45, 226, 230, 0.02));
  }
  .ach-item.unlocked::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--accent-2);
  }
  .ach-item.locked { opacity: 0.55; }
  .ach-icon {
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
    line-height: 1;
    width: 28px;
    text-align: center;
    color: var(--ink-faint);
    flex-shrink: 0;
    padding-top: 2px;
  }
  .ach-item.unlocked .ach-icon { color: var(--accent-2); }
  .ach-body { flex: 1; min-width: 0; }
  .ach-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--ink);
    letter-spacing: 0.03em;
    line-height: 1.4;
  }
  .ach-item.locked .ach-name { color: var(--ink-dim); }
  .ach-desc {
    font-size: 10px;
    color: var(--ink-dim);
    margin-top: 4px;
    letter-spacing: 0.04em;
    line-height: 1.5;
  }

  /* Achievement toast */
  .ach-toast {
    position: fixed;
    top: max(20px, calc(env(safe-area-inset-top) + 20px));
    left: 50%;
    transform: translate(-50%, -120%);
    background: rgba(7, 8, 12, 0.95);
    border: 1px solid var(--accent-2);
    padding: 10px 16px;
    border-radius: 2px;
    z-index: 25;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 0 24px rgba(45, 226, 230, 0.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 220px;
    text-align: center;
    transition: transform 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    pointer-events: none;
  }
  .ach-toast.show {
    transform: translate(-50%, 0);
  }
  .ach-toast-label {
    font-size: 9px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--accent-2);
  }
  .ach-toast-name {
    font-size: 13px;
    color: var(--ink);
    font-weight: 500;
    letter-spacing: 0.05em;
  }
  .ach-toast-icon {
    font-size: 14px;
    color: var(--accent-2);
  }

  /* ─────── Bonus token (golden glitch symbol) ─────── */
  .bonus-token {
    position: fixed;
    font-family: 'JetBrains Mono', monospace;
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-3);
    text-shadow:
      0 0 14px rgba(249, 200, 14, 0.9),
      0 0 28px rgba(249, 200, 14, 0.5);
    cursor: pointer;
    z-index: 9;
    padding: 12px;
    transform: translate(-50%, -50%);
    animation: bonusPulse 1.4s infinite alternate, bonusGlitch 0.15s steps(2) infinite;
    pointer-events: auto;
    touch-action: manipulation;
  }
  @keyframes bonusPulse {
    from { filter: brightness(0.9); transform: translate(-50%, -50%) scale(1); }
    to   { filter: brightness(1.5); transform: translate(-50%, -50%) scale(1.12); }
  }
  @keyframes bonusGlitch {
    0%   { transform: translate(-50%, -50%); }
    50%  { transform: translate(calc(-50% + 1px), calc(-50% - 1px)); }
    100% { transform: translate(-50%, -50%); }
  }
  .bonus-token.collected {
    animation: bonusCollect 0.4s ease forwards;
  }
  @keyframes bonusCollect {
    0%   { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(2.5); }
  }

  /* Bonus active indicator */
  .bonus-indicator {
    position: fixed;
    top: max(58px, calc(env(safe-area-inset-top) + 58px));
    right: 16px;
    background: rgba(249, 200, 14, 0.15);
    border: 1px solid var(--accent-3);
    color: var(--accent-3);
    padding: 4px 10px;
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    border-radius: 2px;
    z-index: 11;
    display: none;
    font-weight: 700;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  .bonus-indicator.show { display: block; }

  /* ─────── Stage progression label ─────── */
  .stage-label {
    font-size: 9px;
    color: var(--accent-2);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    text-align: center;
    margin-top: 8px;
    opacity: 0.7;
    font-weight: 500;
  }

  /* ─────── Prestige card ─────── */
  .prestige-card {
    background: linear-gradient(180deg, rgba(255, 56, 100, 0.06), rgba(255, 56, 100, 0.01));
    border: 1px solid rgba(255, 56, 100, 0.25);
    border-radius: 2px;
    padding: 14px 14px 12px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
  }
  .prestige-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--accent);
  }
  .prestige-head {
    margin-bottom: 12px;
  }
  .prestige-title {
    font-family: 'Major Mono Display', monospace;
    font-size: 14px;
    color: var(--accent);
    letter-spacing: 0.06em;
    margin-bottom: 2px;
  }
  .prestige-sub {
    font-size: 9px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-dim);
  }
  .prestige-stats {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
  }
  .prestige-stat {
    flex: 1;
    background: rgba(7, 8, 12, 0.5);
    border: 1px solid rgba(232, 236, 242, 0.05);
    padding: 6px 8px;
    border-radius: 2px;
    text-align: center;
  }
  .prestige-stat-label {
    font-size: 8px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ink-dim);
    margin-bottom: 2px;
  }
  .prestige-stat-value {
    font-size: 14px;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
  }
  .prestige-gain {
    text-align: center;
    font-size: 11px;
    color: var(--ink);
    padding: 8px;
    background: rgba(255, 56, 100, 0.05);
    border-radius: 2px;
    margin-bottom: 10px;
    letter-spacing: 0.04em;
  }
  .prestige-gain b {
    color: var(--accent-3);
    font-size: 14px;
    font-weight: 700;
  }
  .prestige-btn {
    width: 100%;
    background: var(--accent);
    color: var(--bg);
    border: none;
    padding: 12px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.15s ease;
  }
  .prestige-btn:active { transform: scale(0.97); }
  .prestige-btn:disabled {
    background: rgba(232, 236, 242, 0.08);
    color: var(--ink-dim);
    cursor: not-allowed;
  }
  .prestige-btn.confirming {
    background: var(--accent-3);
    color: var(--bg);
    animation: confirmPulse 0.6s infinite alternate;
  }
  @keyframes confirmPulse {
    from { box-shadow: 0 0 0 rgba(249, 200, 14, 0.4); }
    to   { box-shadow: 0 0 16px rgba(249, 200, 14, 0.6); }
  }
  .prestige-info {
    font-size: 10px;
    color: var(--ink-dim);
    text-align: center;
    line-height: 1.6;
    margin-top: 10px;
    letter-spacing: 0.04em;
  }
  .prestige-info b { color: var(--accent-2); }

  /* Exploits HUD badge — shown when exploits > 0 */
  .exploits-badge {
    position: fixed;
    top: max(58px, calc(env(safe-area-inset-top) + 58px));
    left: 16px;
    background: rgba(255, 56, 100, 0.12);
    border: 1px solid rgba(255, 56, 100, 0.4);
    color: var(--accent);
    padding: 4px 10px;
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    border-radius: 2px;
    z-index: 11;
    display: none;
    font-weight: 700;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  .exploits-badge.show { display: block; }
  .exploits-badge b { color: var(--ink); font-weight: 700; }

  /* Reboot flash overlay */
  .reboot-flash {
    position: fixed;
    inset: 0;
    background: var(--accent);
    z-index: 100;
    pointer-events: none;
    opacity: 0;
  }
  .reboot-flash.go {
    animation: rebootFlash 1.4s ease forwards;
  }
  @keyframes rebootFlash {
    0%   { opacity: 0; }
    20%  { opacity: 0.85; }
    100% { opacity: 0; }
  }

  /* Narrow screens */
  @media (max-width: 380px) {
    .counter { font-size: 32px; }
    .server { font-size: 10px; }
    .server-wrap { padding: 20px; }
  }
  @media (max-height: 700px) {
    .counter-wrap { top: max(58px, calc(env(safe-area-inset-top) + 58px)); }
    .counter { font-size: 30px; }
  }
