* { box-sizing: border-box; margin: 0; padding: 0; user-select: none; -webkit-user-select: none; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  color: #e7e9ff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px 64px;
  background:
    radial-gradient(1100px 700px at 15% -10%, rgba(88, 60, 180, .55) 0%, transparent 60%),
    radial-gradient(900px 650px at 90% 110%, rgba(30, 90, 180, .45) 0%, transparent 55%),
    linear-gradient(160deg, #0d0e21 0%, #171838 100%);
}

header { width: min(780px, 100%); display: flex; flex-direction: column; align-items: center; gap: 16px; }

h1 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: .14em;
  background: linear-gradient(90deg, #a78bfa, #60a5fa, #34d399, #f9ca24);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline { color: #9aa0d0; font-size: .95rem; letter-spacing: .05em; }

.hud { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }

.pill {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: .85rem;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .13);
  backdrop-filter: blur(8px);
}
.pill b { color: #a5b4fc; font-variant-numeric: tabular-nums; }

button, select, a.btn {
  font: inherit;
  font-size: .85rem;
  color: #e7e9ff;
  text-decoration: none;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 12px;
  padding: 9px 16px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform .15s ease, background .15s ease, opacity .15s ease;
}
button:hover:not(:disabled), select:hover, a.btn:hover { background: rgba(255, 255, 255, .17); transform: translateY(-1px); }
button:active:not(:disabled) { transform: translateY(0); }
button:disabled { opacity: .35; cursor: default; }
select option { color: #111; }

/* ---- arcade dashboard ---- */

#games {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  justify-content: center;
  margin-top: 48px;
  width: min(780px, 100%);
}

.game-card {
  flex: 1 1 300px;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 30px 28px;
  border-radius: 22px;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(160deg, rgba(255,255,255,.09), rgba(255,255,255,.03));
  border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .35);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.game-card:hover {
  transform: translateY(-6px);
  border-color: rgba(167, 139, 250, .55);
  box-shadow: 0 22px 55px rgba(0, 0, 0, .45), 0 0 34px rgba(139, 92, 246, .22);
}

.game-card .icon { display: flex; gap: 6px; align-items: flex-end; height: 56px; }
.game-card .icon .mini-tube {
  width: 20px; height: 52px;
  border: 2px solid rgba(255,255,255,.3);
  border-top: none;
  border-radius: 3px 3px 10px 10px;
  position: relative;
  overflow: hidden;
}
.game-card .icon .mini-tube::before {
  content: "";
  position: absolute;
  left: 2px; right: 2px; bottom: 2px;
  height: 55%;
  border-radius: 3px 3px 8px 8px;
  background: var(--fill, #1e90ff);
}
.game-card .icon .orb-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--fill, #ff5470);
  box-shadow: inset -4px -6px 10px rgba(0,0,0,.3), inset 3px 4px 8px rgba(255,255,255,.35);
}
.game-card .icon .belt-strip {
  align-self: center;
  width: 100%; height: 10px;
  border-radius: 6px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.22) 0 12px, rgba(255,255,255,.08) 12px 24px);
}
.game-card .icon .virus-cell {
  align-self: center;
  width: 40px; height: 40px;
  border-radius: 46% 54% 52% 48% / 48% 46% 54% 52%;
  background: var(--fill, #2ed573);
  box-shadow: inset -4px -7px 12px rgba(0,0,0,.35), inset 3px 5px 9px rgba(255,255,255,.3), 0 6px 14px rgba(0,0,0,.35);
}
.game-card .icon .virus-cell.small { width: 26px; height: 26px; }

.game-card h2 { font-size: 1.4rem; letter-spacing: .04em; }
.game-card .desc { color: #b4b9e8; font-size: .9rem; line-height: 1.45; flex: 1; }
.game-card .hs { font-size: .82rem; color: #9aa0d0; min-height: 1.2em; }
.game-card .hs b { color: #f9ca24; font-variant-numeric: tabular-nums; }

.game-card .play {
  display: inline-block;
  margin-top: 4px;
  padding: 11px 20px;
  border-radius: 13px;
  text-align: center;
  font-weight: 600;
  letter-spacing: .06em;
  background: linear-gradient(90deg, #7c3aed, #4f46e5);
  transition: filter .15s ease;
}
.game-card:hover .play { filter: brightness(1.2); }

/* ---- end-of-level modal ---- */

#modal {
  position: fixed; inset: 0;
  display: none;
  place-items: center;
  background: rgba(6, 7, 18, .6);
  backdrop-filter: blur(6px);
  z-index: 100;
}
#modal.show { display: grid; }

.modal-card {
  text-align: center;
  padding: 38px 52px;
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(52, 48, 105, .96), rgba(22, 22, 46, .98));
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .55), 0 0 40px rgba(139, 92, 246, .25);
  animation: pop .35s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes pop { from { transform: scale(.75); opacity: 0; } }

.modal-card h2 {
  font-size: 1.9rem;
  margin-bottom: 6px;
  background: linear-gradient(90deg, #f9ca24, #fd79a8, #a55eea);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.modal-card .stats { margin: 18px 0 24px; display: flex; gap: 26px; justify-content: center; }
.modal-card .stats div { display: flex; flex-direction: column; gap: 4px; }
.modal-card .stats .num { font-size: 1.5rem; font-weight: 700; color: #a5b4fc; font-variant-numeric: tabular-nums; }
.modal-card .stats .lbl { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: #9aa0d0; }
.modal-card button { font-size: 1rem; padding: 12px 28px; border-radius: 14px; background: linear-gradient(90deg, #7c3aed, #4f46e5); border: none; }
.modal-card button:hover:not(:disabled) { background: linear-gradient(90deg, #8b5cf6, #6366f1); }

/* ---- toast ---- */

#toast {
  position: fixed;
  bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 20px;
  border-radius: 12px;
  font-size: .85rem;
  background: rgba(220, 60, 90, .92);
  opacity: 0;
  transition: .25s ease;
  pointer-events: none;
  z-index: 90;
}
#toast.show { opacity: 1; transform: translateX(-50%); }
