/* ============================================================
   NEON ARCADE · 二十合一
   Shared design system + shell
   ============================================================ */

*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --bg: #edf0f5;
  --bg-2: #e3e7f0;
  --panel: #dfe3ec;
  --panel-2: #d4dae7;
  --line: rgba(73,110,212,0.14);
  --line-strong: rgba(31,101,255,0.28);
  --ink: #00123d;
  --muted: #39476c;
  --dim: #637094;
  --cyan: #28e3c6;
  --blue: #2583f8;
  --violet: #5c28f6;
  --pink: #ef2f93;
  --gold: #dea104;
  --danger: #f92543;
  --green: #24a676;
  --arcade: #0facc4;
  --board: #8f24fa;
  --radius: 18px;
  --font: "Segoe UI Variable Display", "Segoe UI", "Microsoft YaHei UI",
    "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --display: "Bahnschrift", "DIN Alternate", "Segoe UI", "Microsoft YaHei UI",
    sans-serif;
  --mono: "Cascadia Mono", "Consolas", "SFMono-Regular", ui-monospace, monospace;
}

html { color-scheme: light; }

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 700px at 12% -12%, rgba(15,172,196,0.13), transparent 60%),
    radial-gradient(1000px 640px at 92% 2%, rgba(92,40,246,0.14), transparent 62%),
    radial-gradient(900px 700px at 50% 110%, rgba(239,47,147,0.08), transparent 65%),
    linear-gradient(180deg, #ebedf4 0%, #f0f1f6 100%);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select { font: inherit; color: inherit; }

button { cursor: pointer; }

a { color: inherit; text-decoration: none; }

::selection { background: rgba(15,172,196,0.32); color: #1f1f1f; }

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #eceff4; }
::-webkit-scrollbar-thumb {
  background: #bbc8e3;
  border: 2px solid #eceff4;
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: #9fb1d5; }

/* ---------- ambient background ---------- */

#bg-stars {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
}

.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.orb {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.22;
  animation: orb-float 22s ease-in-out infinite alternate;
}

.orb-a {
  width: 520px; height: 520px;
  left: -180px; top: -160px;
  background: #0897b9;
}
.orb-b {
  width: 460px; height: 460px;
  right: -160px; top: 30%;
  background: #5b14d6;
  animation-delay: -7s;
}
.orb-c {
  width: 420px; height: 420px;
  left: 38%; bottom: -260px;
  background: #ac1654;
  opacity: 0.12;
  animation-delay: -14s;
}

@keyframes orb-float {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(40px, 60px, 0) scale(1.12); }
}

#app {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#view { flex: 1 0 auto; }

body.in-game #site-foot,
body.in-game #bg-stars,
body.in-game .aurora { display: none; }

.noise {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- typography helpers ---------- */

.eyebrow {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--cyan);
}

.grad-text {
  background: linear-gradient(92deg, #001a3d 0%, #26e2f8 40%, #5125f9 78%, #f12d97 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mono { font-family: var(--mono); }

/* ---------- top site header (menu) ---------- */

.site-head {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 22px 40px 8px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #6fd5f1, #e0e4ee 70%);
  border: 1px solid rgba(40,227,198,0.45);
  box-shadow: 0 0 24px rgba(34,211,238,0.126), inset 0 1px 0 rgba(255,255,255,0.16);
  font-family: var(--display);
  font-size: 20px;
  font-weight: 800;
  color: #0b808e;
}

.brand-copy { display: flex; flex-direction: column; line-height: 1.1; }
.brand-copy b {
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: 0.16em;
  font-weight: 700;
}
.brand-copy small {
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 0.34em;
  color: var(--dim);
  margin-top: 3px;
}

.site-head .head-spacer { flex: 1; }

.head-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(223,227,236,0.55);
  backdrop-filter: blur(8px);
}
.head-note .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(223,227,236,0.7);
  color: var(--muted);
  transition: 0.18s ease;
  flex: 0 0 auto;
}
.icon-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: #c4d0e9;
  transform: translateY(-1px);
}
.icon-btn:active { transform: translateY(0) scale(0.97); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.on { color: var(--cyan); border-color: rgba(15,172,196,0.4); }

/* ---------- menu ---------- */

.menu {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 10px 40px 60px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  align-items: center;
  gap: 40px;
  padding: 42px 0 46px;
}

.hero-copy { min-width: 0; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 9px;
  border-radius: 999px;
  border: 1px solid rgba(15,172,196,0.24);
  background: rgba(182,221,247,0.28);
  color: #0b808e;
  font-size: 11px;
  letter-spacing: 0.12em;
  font-weight: 600;
  margin-bottom: 22px;
}
.hero-badge .pulse {
  width: 18px; height: 18px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(15,172,196,0.16);
}
.hero-badge .pulse::after {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.1); }
}

.hero h1 {
  margin: 0;
  font-size: clamp(44px, 5.4vw, 82px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 800;
  font-family: var(--display);
}
.hero h1 .grad-text { display: block; padding-bottom: 0.08em; }

.hero-sub {
  margin: 20px 0 0;
  max-width: 540px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}
.hero-sub b { color: #00133d; font-weight: 600; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}
.stat-pill {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(223,227,236,0.6);
}
.stat-pill b {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  color: #1f1f1f;
  letter-spacing: 0.02em;
}
.stat-pill span { font-size: 11px; color: var(--dim); letter-spacing: 0.08em; }

/* hero emblem */

.hero-emblem {
  position: relative;
  justify-self: center;
  width: min(360px, 100%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.emblem-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0 8%,
    rgba(15,172,196,0.7) 12%,
    transparent 22%,
    transparent 48%,
    rgba(143,36,250,0.6) 55%,
    transparent 66%,
    transparent 84%,
    rgba(239,47,147,0.5) 90%,
    transparent 100%
  );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #fcfcfc calc(100% - 1px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #fcfcfc calc(100% - 1px));
  animation: spin 26s linear infinite;
  opacity: 0.9;
}
.emblem-ring::after {
  content: "";
  position: absolute;
  inset: 26px;
  border-radius: 50%;
  border: 1px dashed rgba(73,110,212,0.22);
}

@keyframes spin { to { transform: rotate(360deg); } }

.emblem-disc {
  position: absolute;
  inset: 44px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 26%, rgba(15,172,196,0.18), transparent 52%),
    radial-gradient(circle at 72% 78%, rgba(92,40,246,0.2), transparent 55%),
    linear-gradient(160deg, #d5dbe8 0%, #eaedf4 72%);
  border: 1px solid rgba(31,101,255,0.22);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 40px 90px -30px rgba(34,211,238,0.203);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.emblem-disc .num {
  font-family: var(--display);
  font-size: 88px;
  line-height: 0.9;
  font-weight: 800;
  letter-spacing: -0.05em;
  background: linear-gradient(180deg, #1f1f1f, #24b5fa 70%, #5c28f6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 28px rgba(34,211,238,0.158));
}
.emblem-disc .lbl {
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--muted);
  margin-top: 8px;
  padding-left: 0.4em;
}
.emblem-disc .split {
  display: flex;
  gap: 14px;
  margin-top: 14px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--dim);
}
.emblem-disc .split i { color: var(--cyan); font-style: normal; }
.emblem-disc .split u { color: var(--violet); text-decoration: none; }

.emblem-chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(229,232,240,0.9);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(10px);
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
  box-shadow: 0 18px 40px -18px rgba(15,23,42,0.28);
}
.emblem-chip b { color: #1f1f1f; font-size: 11px; }
.emblem-chip.c1 { top: 8%; left: -6%; animation: bob 5s ease-in-out infinite; }
.emblem-chip.c2 { bottom: 10%; right: -7%; animation: bob 6s ease-in-out -2s infinite; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* toolbar */

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 4px 0 20px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(229,232,240,0.7);
}
.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 9px;
  transition: 0.16s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); background: rgba(31,31,31,0.04); }
.tab.active {
  color: #2e526b;
  background: linear-gradient(135deg, #26e2f8, #27def6);
  box-shadow: 0 4px 18px -6px rgba(34,211,238,0.293);
}
.tab.active .n { color: rgba(46,82,107,1); }
.tab .n {
  font-family: var(--display);
  font-size: 10px;
  color: var(--dim);
}

.search {
  margin-left: auto;
  position: relative;
  width: 220px;
}
.search input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(229,232,240,0.7);
  color: var(--ink);
  font-size: 13px;
  outline: none;
  transition: 0.18s;
}
.search input::placeholder { color: var(--dim); }
.search input:focus {
  border-color: rgba(15,172,196,0.45);
  box-shadow: 0 0 0 3px rgba(34,211,238,0.036);
}
.search svg {
  position: absolute;
  left: 12px; top: 50%;
  width: 15px; height: 15px;
  transform: translateY(-50%);
  color: var(--dim);
  pointer-events: none;
}

.result-count {
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.06em;
  padding-left: 2px;
}

/* card grid */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 16px;
}

.game-card {
  --accent: var(--cyan);
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: left;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(168deg, rgba(211,217,230,0.86), rgba(233,236,243,0.92));
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.22s, box-shadow 0.22s;
  animation: card-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.game-card:nth-child(1) { animation-delay: 0.02s; }
.game-card:nth-child(2) { animation-delay: 0.04s; }
.game-card:nth-child(3) { animation-delay: 0.06s; }
.game-card:nth-child(4) { animation-delay: 0.08s; }
.game-card:nth-child(5) { animation-delay: 0.1s; }
.game-card:nth-child(6) { animation-delay: 0.12s; }
.game-card:nth-child(7) { animation-delay: 0.14s; }
.game-card:nth-child(8) { animation-delay: 0.16s; }
.game-card:nth-child(9) { animation-delay: 0.18s; }
.game-card:nth-child(10) { animation-delay: 0.2s; }

@keyframes card-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.game-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(420px 200px at 80% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity 0.25s;
}
.game-card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow:
    0 24px 48px -28px color-mix(in srgb, var(--accent) 65%, rgba(15,23,42,0.28)),
    0 0 0 1px color-mix(in srgb, var(--accent) 16%, transparent);
}
.game-card:hover::after { opacity: 1; }
.game-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.game-card:active { transform: translateY(-2px) scale(0.995); }

.card-art {
  position: relative;
  height: 112px;
  margin: 9px 9px 0;
  border-radius: 12px;
  overflow: hidden;
  background:
    radial-gradient(140% 130% at 82% 4%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 58%),
    linear-gradient(155deg, #d4dae7 0%, #e9ecf3 78%);
  border: 1px solid rgba(31,31,31,0.055);
}
.card-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(31,94,255,0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31,94,255,0.09) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(135deg, #fcfcfc 0%, transparent 72%);
  mask-image: linear-gradient(135deg, #fcfcfc 0%, transparent 72%);
  opacity: 0.7;
}
.card-art::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  right: -52px;
  bottom: -80px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 12%, transparent) inset;
}
.card-num {
  position: absolute;
  right: 12px;
  top: 6px;
  font-family: var(--display);
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: rgba(31,31,31,0.077);
  -webkit-text-stroke: 1px rgba(31,31,31,0.112);
  z-index: 0;
}
.card-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, rgba(235,238,244,0.9));
  color: color-mix(in srgb, var(--accent) 82%, #1f1f1f);
  box-shadow: 0 0 26px -6px color-mix(in srgb, var(--accent) 45%, transparent);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 1;
}
.game-card:hover .card-icon { transform: translateY(-50%) scale(1.06) rotate(-3deg); }
.card-icon svg { width: 27px; height: 27px; }

.card-cat {
  position: absolute;
  left: 80px;
  top: 18px;
  font-family: var(--display);
  font-size: 8px;
  letter-spacing: 0.26em;
  color: color-mix(in srgb, var(--accent) 75%, #1f1f1f);
  opacity: 0.85;
  z-index: 1;
}
.card-mini {
  position: absolute;
  left: 80px;
  bottom: 16px;
  display: flex;
  gap: 4px;
  z-index: 1;
}
.card-mini i {
  width: 5px; height: 5px;
  border-radius: 1px;
  background: color-mix(in srgb, var(--accent) 45%, transparent);
}
.card-mini i.hot { background: var(--accent); box-shadow: 0 0 6px var(--accent); }

.card-body {
  padding: 14px 16px 15px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  position: relative;
  z-index: 1;
}
.card-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.card-en {
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 0.13em;
  color: var(--dim);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}
.card-foot {
  margin-top: auto;
  padding-top: 9px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-top: 1px solid rgba(73,110,212,0.09);
}
.tag {
  font-size: 10px;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 3px 6px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.card-best {
  margin-left: auto;
  font-family: var(--display);
  font-size: 10px;
  color: var(--dim);
  display: flex;
  align-items: center;
  gap: 4px;
}
.card-best b { color: var(--gold); font-size: 12px; font-weight: 600; }

.empty-state {
  grid-column: 1 / -1;
  padding: 70px 20px;
  text-align: center;
  color: var(--dim);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  font-size: 14px;
}
.empty-state b { display: block; color: var(--muted); font-size: 17px; margin-bottom: 8px; }

.site-foot {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 24px 40px 30px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: rgba(70,79,104,1);
  border-top: 1px solid rgba(73,110,212,0.08);
}

/* ============================================================
   GAME SHELL
   ============================================================ */

.game-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 0 18px;
}

.game-head {
  height: 74px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 26px;
  border-bottom: 1px solid rgba(73,110,212,0.1);
  background: linear-gradient(180deg, rgba(233,236,243,0.9), rgba(233,236,243,0.45));
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 6;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 13px 0 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(223,227,236,0.7);
  color: var(--muted);
  font-size: 12px;
  transition: 0.16s;
}
.back-btn:hover { color: var(--ink); border-color: var(--line-strong); background: #c4d0e9; }
.back-btn svg { width: 15px; height: 15px; }

.game-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.game-title h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.game-title span {
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--dim);
  text-transform: uppercase;
  white-space: nowrap;
}

.game-hud {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hud-stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(228,232,240,0.72);
  min-height: 38px;
}
.hud-stat span {
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--dim);
}
.hud-stat strong {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  color: #1f1f1f;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.hud-extra { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.hud-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(228,232,240,0.6);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.hud-chip b { color: #1f1f1f; font-family: var(--display); font-size: 13px; font-weight: 600; }
.hud-chip.good b { color: var(--green); }
.hud-chip.warn b { color: var(--gold); }
.hud-chip.bad b { color: var(--danger); }

.game-actions { display: flex; gap: 6px; margin-left: 4px; }

.game-body {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 18px 26px;
  min-height: 0;
}

.stage-wrap {
  flex: 0 1 960px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.rotate-hint { display: none; }

.stage {
  position: relative;
  width: min(100%, 960px, calc((100dvh - 180px) * 1.6));
  aspect-ratio: 8 / 5;
  border-radius: 18px;
  overflow: hidden;
  background: #f0f2f7;
  border: 1px solid rgba(31,101,255,0.22);
  box-shadow:
    0 40px 100px -40px rgba(15,23,42,0.252),
    0 0 60px -20px rgba(34,211,238,0.099);
  isolation: isolate;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 25;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.036),
    inset 0 0 70px rgba(15,23,42,0.03);
}
.stage:not(.stage-board)::after { box-shadow: none; }
.stage:focus { outline: none; }

.game-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.game-side {
  width: 248px;
  flex: 0 0 248px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 1px;
}
.side-card {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(227,230,239,0.62);
  padding: 14px 15px;
}
.side-card h3 {
  margin: 0 0 8px;
  font-size: 9px;
  letter-spacing: 0.2em;
  font-family: var(--display);
  color: var(--dim);
  font-weight: 600;
  text-transform: uppercase;
}
.side-card p {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}
.side-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.side-card li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  color: var(--muted);
}
.side-card kbd {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 21px;
  padding: 0 6px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  background: rgba(196,208,233,0.9);
  font-family: var(--mono);
  font-size: 9px;
  color: #00133d;
  white-space: nowrap;
}
.best-val {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.01em;
  line-height: 1;
  text-shadow: 0 0 24px rgba(251,191,36,0.113);
}
.best-val small { font-size: 10px; color: var(--dim); letter-spacing: 0.1em; margin-left: 6px; }

/* ---------- overlays ---------- */

.stage-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(241,244,248,0.7);
  backdrop-filter: blur(9px);
  animation: fade-in 0.22s ease both;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  width: min(420px, 100%);
  max-height: 100%;
  overflow: auto;
  border-radius: 20px;
  padding: 28px 26px 24px;
  text-align: center;
  background:
    radial-gradient(130% 100% at 50% -20%, rgba(15,172,196,0.12), transparent 60%),
    linear-gradient(168deg, #cfd6e4, #e6eaf1 75%);
  border: 1px solid var(--line-strong);
  box-shadow:
    0 40px 90px -30px rgba(15,23,42,0.28),
    inset 0 1px 0 rgba(255,255,255,0.064);
  animation: pop-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
@keyframes pop-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.result-badge {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--rc, var(--cyan));
  border: 1px solid color-mix(in srgb, var(--rc, var(--cyan)) 42%, transparent);
  background: color-mix(in srgb, var(--rc, var(--cyan)) 11%, rgba(232,235,242,0.9));
  box-shadow: 0 0 34px -8px var(--rc, var(--cyan));
}
.result-badge svg { width: 26px; height: 26px; }

.modal-card .eyebrow { display: block; margin-bottom: 8px; }
.modal-card h2 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.modal-card .modal-detail {
  margin: 0 auto 18px;
  max-width: 320px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}
.modal-score {
  display: flex;
  justify-content: center;
  gap: 26px;
  padding: 14px 0;
  margin-bottom: 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.modal-score div { display: flex; flex-direction: column; gap: 4px; }
.modal-score span { font-size: 9px; letter-spacing: 0.16em; color: var(--dim); }
.modal-score b {
  font-family: var(--display);
  font-size: 26px;
  color: #1f1f1f;
  font-variant-numeric: tabular-nums;
}
.modal-score b.gold { color: var(--gold); }

.modal-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(196,208,233,0.8);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  transition: 0.16s;
  white-space: nowrap;
}
.btn:hover { background: #b5c4e2; border-color: rgba(0,25,65,0.42); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn.primary {
  background: linear-gradient(135deg, #27def6, #0facc4);
  border-color: transparent;
  color: #2e526b;
  box-shadow: 0 8px 26px -10px rgba(34,211,238,0.36);
}
.btn.primary:hover { background: linear-gradient(135deg, #26e2f8, #27def6); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: 0.38; pointer-events: none; }
.btn svg { width: 15px; height: 15px; }

.pause-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}
.pause-list .btn { width: 100%; }

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

#toast-root {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(221,226,236,0.94);
  backdrop-filter: blur(10px);
  font-size: 12px;
  color: #00133d;
  box-shadow: 0 20px 40px -20px rgba(15,23,42,0.28);
  animation: toast-in 0.24s ease both;
  white-space: nowrap;
}
.toast.good { border-color: rgba(36,166,118,0.4); color: #128751; }
.toast.bad { border-color: rgba(249,37,67,0.4); color: #3c0108; }
.toast.out { animation: toast-out 0.24s ease both; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(6px) scale(0.97); }
}

/* ============================================================
   REUSABLE IN-GAME UI (available to every game)
   ============================================================ */

.g-stage-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 18px;
}
.g-center { display: grid; place-items: center; }
.g-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.g-row { display: flex; align-items: center; gap: 8px; }
.g-col { display: flex; flex-direction: column; gap: 8px; }

.g-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(226,230,239,0.82);
  padding: 14px;
  backdrop-filter: blur(8px);
}
.g-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.g-sub {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}
.g-muted { color: var(--muted); }
.g-dim { color: var(--dim); }
.g-cyan { color: var(--cyan); }
.g-gold { color: var(--gold); }
.g-green { color: var(--green); }
.g-red { color: var(--danger); }
.g-violet { color: var(--violet); }

.g-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(212,218,231,0.75);
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.g-chip b { color: var(--ink); font-weight: 600; }
.g-chip.on {
  border-color: rgba(15,172,196,0.4);
  background: rgba(15,172,196,0.1);
  color: #0b808e;
}

.g-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 15px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(196,208,233,0.82);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  transition: 0.15s;
  white-space: nowrap;
}
.g-btn:hover { background: #b1c1e1; border-color: rgba(0,25,65,0.42); }
.g-btn:active { transform: scale(0.97); }
.g-btn.primary {
  background: linear-gradient(135deg, #27def6, #0facc4);
  color: #2e526b;
  border-color: transparent;
  box-shadow: 0 8px 24px -12px rgba(34,211,238,0.405);
}
.g-btn.primary:hover { background: linear-gradient(135deg, #26e2f8, #27def6); }
.g-btn.gold {
  background: linear-gradient(135deg, #fbd022, #bb7808);
  color: #6f502a;
  border-color: transparent;
}
.g-btn.ghost { background: transparent; }
.g-btn.danger { border-color: rgba(249,37,67,0.4); color: #3c0108; }
.g-btn:disabled { opacity: 0.35; pointer-events: none; }
.g-btn.sm { min-height: 30px; padding: 0 10px; font-size: 10.5px; border-radius: 7px; }

.g-hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(10,25,55,1);
  pointer-events: none;
  white-space: nowrap;
  z-index: 10;
}

.g-divider { height: 1px; background: var(--line); border: 0; margin: 10px 0; }

/* playing-card baseline (blackjack / poker / UNO) */
.pcard {
  position: relative;
  width: 64px;
  aspect-ratio: 5 / 7;
  border-radius: 7px;
  background: linear-gradient(160deg, #ffffff, #e8edf7);
  color: #111827;
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.9), inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  transition: transform 0.18s ease;
}
.pcard.red { color: #dc2626; }
.pcard .rank { position: absolute; top: 4px; left: 5px; font-size: 13px; font-weight: 700; line-height: 1; }
.pcard .suit-sm { position: absolute; top: 17px; left: 6px; font-size: 9px; line-height: 1; }
.pcard .suit-lg { font-size: 25px; line-height: 1; }
.pcard .corner { position: absolute; bottom: 4px; right: 5px; font-size: 13px; font-weight: 700; transform: rotate(180deg); line-height: 1; }
.pcard.back {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.11) 0 2px, transparent 2px 6px),
    linear-gradient(160deg, #1e3a8a, #0f1c3f);
  border: 2px solid #dfe8ff;
  color: transparent;
}
.pcard.back::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 3px;
}

/* coin / chip shortcut */
.coin {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fbd022, #bb7808 55%, #b95509);
  border: 1px solid #dea104;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.144);
  display: inline-block;
}

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  .game-side { display: none; }
  .stage-wrap { flex: 1 1 auto; }
  .stage { max-width: 960px; }
}

@media (max-width: 960px) {
  .site-head, .menu, .site-foot { padding-left: 24px; padding-right: 24px; }
  .hero { grid-template-columns: 1fr; gap: 12px; padding: 30px 0 34px; }
  .hero-emblem { display: none; }
  .hero h1 { font-size: clamp(44px, 9vw, 62px); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 13px; }
  .game-body { padding: 12px 16px 0; }
  .game-head { padding: 0 14px; height: 66px; gap: 10px; }
  .game-title span { display: none; }
  .hud-stat { padding: 5px 9px; min-height: 34px; }
  .hud-stat strong { font-size: 15px; }
  .hud-chip { height: 34px; padding: 0 8px; font-size: 10px; }
  .hud-chip b { font-size: 12px; }
}

@media (max-width: 720px) and (orientation: portrait) {
  .rotate-hint {
    display: block;
    font-size: 10px;
    letter-spacing: 0.18em;
    color: rgba(53,66,100,1);
    padding: 2px 0 6px;
  }
}

@media (max-width: 720px) {
  .stage.stage-board {
    aspect-ratio: auto;
    width: 100%;
    height: calc(100dvh - 146px);
    max-height: none;
  }
  .stage.stage-board[data-game="holdem"] {
    aspect-ratio: 8 / 5;
    height: auto;
  }
  .site-head { padding: 16px 16px 4px; }
  .head-note { display: none; }
  .menu { padding: 6px 16px 40px; }
  .site-foot { padding: 18px 16px 24px; font-size: 8px; }
  .foot-mid { display: none; }
  .hero { padding-top: 22px; }
  .hero h1 { font-size: clamp(38px, 11.5vw, 52px); }
  .hero-sub { font-size: 13.5px; margin-top: 14px; }
  .hero-stats { margin-top: 18px; gap: 7px; }
  .stat-pill { padding: 8px 12px; }
  .stat-pill b { font-size: 18px; }
  .toolbar { gap: 8px; padding-top: 16px; }
  .tab { padding: 8px 11px; font-size: 12px; }
  .search { width: 100%; margin-left: 0; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; }
  .card-art { height: 92px; margin: 7px 7px 0; }
  .card-icon { width: 42px; height: 42px; left: 12px; border-radius: 12px; }
  .card-icon svg { width: 22px; height: 22px; }
  .card-cat { left: 64px; top: 14px; font-size: 7px; }
  .card-mini { left: 64px; bottom: 12px; }
  .card-body { padding: 10px 11px 11px; gap: 4px; }
  .card-title { font-size: 14px; }
  .card-en { font-size: 8px; }
  .card-desc { font-size: 10.5px; line-height: 1.5; min-height: 32px; }
  .card-foot { padding-top: 7px; gap: 4px; }
  .tag { font-size: 9px; padding: 2px 5px; }
  .card-best { font-size: 9px; }
  .card-best b { font-size: 10px; }
  .card-num { font-size: 34px; }

  .game-view { min-height: 100dvh; padding-bottom: 8px; }
  .game-head { height: auto; min-height: 58px; padding: 8px 10px; flex-wrap: wrap; gap: 8px; }
  .back-btn { height: 34px; padding: 0 10px; }
  .back-btn span { display: none; }
  .game-title h1 { font-size: 15px; }
  .game-hud { order: 3; width: 100%; margin-left: 0; gap: 5px; overflow-x: auto; padding-bottom: 2px; }
  .hud-stat { flex: 0 0 auto; }
  .game-actions { margin-left: auto; }
  .game-actions .icon-btn { width: 34px; height: 34px; border-radius: 9px; }
  .game-body { padding: 8px 8px 0; }
  .stage { border-radius: 12px; max-height: calc(100dvh - 150px); }
  .modal-card { padding: 22px 18px 18px; border-radius: 16px; }
  .modal-card h2 { font-size: 22px; }
  .modal-score b { font-size: 22px; }
  .toast { font-size: 11px; }
}

@media (max-width: 420px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .card-desc { display: none; }
  .card-foot .tag:nth-child(2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  #bg-stars { display: none; }
}

/* language switch: a two-letter label in the same round button as the other header icons */
.lang-btn{font-family:var(--display);font-weight:800;font-size:13px;letter-spacing:.04em;line-height:1}

/* ============================================================
   Light theme polish: white surfaces, soft shadows, crisp ink.
   Sits after the converted rules so these values win.
   ============================================================ */
:root {
  --bg: #f6f8fc;
  --bg-2: #eef2f8;
  --panel: #ffffff;
  --panel-2: #f4f6fb;
  --line: #e3e8f1;
  --line-strong: #cbd5e3;
  --ink: #0f172a;
  --muted: #475569;
  --dim: #64748b;
  --cyan: #0891b2;
  --blue: #2563eb;
  --violet: #7c3aed;
  --pink: #db2777;
  --gold: #d97706;
  --danger: #e11d48;
  --green: #059669;
  --arcade: #0891b2;
  --board: #7c3aed;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 2px 8px -4px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 1px 2px rgba(15, 23, 42, 0.05), 0 14px 32px -18px rgba(15, 23, 42, 0.28);
  --shadow-lg: 0 2px 4px rgba(15, 23, 42, 0.04), 0 30px 60px -30px rgba(15, 23, 42, 0.35);
}

body {
  background:
    radial-gradient(1100px 620px at 8% -10%, rgba(14, 165, 233, 0.10), transparent 60%),
    radial-gradient(900px 600px at 95% 0%, rgba(139, 92, 246, 0.09), transparent 62%),
    linear-gradient(180deg, #f8fafd 0%, #f2f5fa 100%);
  color: var(--ink);
}
::selection { background: rgba(14, 165, 233, 0.22); color: var(--ink); }
::-webkit-scrollbar-track { background: #f1f4f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-color: #f1f4f9; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.orb { opacity: 0.08; filter: blur(110px); }
.orb-c { opacity: 0.05; }
.noise { display: none; }
#bg-stars { opacity: 0.55; }

.eyebrow { color: var(--cyan); }
.grad-text {
  background: linear-gradient(92deg, #0f172a 0%, #0e7490 42%, #6d28d9 78%, #be185d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* header pieces */
.brand-mark {
  background: linear-gradient(145deg, #0891b2, #4f46e5);
  border: 0;
  color: #fff;
  box-shadow: 0 10px 22px -10px rgba(79, 70, 229, 0.6);
}
.brand-copy b { color: var(--ink); }
.head-note,
.icon-btn,
.stat-pill,
.tabs,
.search,
.back-btn,
.hud-stat,
.hud-chip,
.emblem-chip {
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  color: var(--muted);
}
.icon-btn:hover,
.back-btn:hover { background: #f1f5f9; color: var(--ink); border-color: var(--line-strong); }
.icon-btn.on { color: var(--cyan); border-color: rgba(8, 145, 178, 0.45); background: #ecfeff; }
.head-note .dot { box-shadow: none; }

/* hero */
.hero-badge { background: #ecfeff; border-color: #a5f3fc; color: #0e7490; }
.hero-badge .pulse { background: rgba(8, 145, 178, 0.15); }
.hero-badge .pulse::after { box-shadow: none; }
.hero-sub { color: var(--muted); }
.hero-sub b { color: var(--ink); }
.stat-pill b { color: var(--ink); }
.emblem-disc {
  background:
    radial-gradient(circle at 32% 24%, rgba(34, 211, 238, 0.18), transparent 55%),
    radial-gradient(circle at 74% 80%, rgba(167, 139, 250, 0.2), transparent 58%),
    linear-gradient(160deg, #ffffff 0%, #eef2fb 80%);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 #fff, 0 40px 80px -36px rgba(37, 99, 235, 0.45);
}
.emblem-disc .num {
  background: linear-gradient(180deg, #0f172a, #2563eb 65%, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  filter: none;
}
.emblem-chip b { color: var(--ink); }

/* toolbar */
.tab { color: var(--muted); }
.tab:hover { color: var(--ink); background: #f1f5f9; }
.tab.active { color: #ffffff; background: #0f172a; box-shadow: 0 6px 16px -8px rgba(15, 23, 42, 0.6); }
.tab.active .n { color: rgba(255, 255, 255, 0.65); }
.search input { color: var(--ink); }
.search:focus-within { border-color: #7dd3fc; box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15); }

/* game cards */
.game-card {
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}
.game-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, #e3e8f1);
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.05), 0 26px 46px -24px color-mix(in srgb, var(--accent) 55%, rgba(15, 23, 42, 0.4));
}
.card-art {
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    linear-gradient(160deg, color-mix(in srgb, var(--accent) 9%, #ffffff), #f6f8fc);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, #e3e8f1);
}
.card-icon {
  background: #ffffff;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, #e3e8f1);
  color: color-mix(in srgb, var(--accent) 80%, #0f172a);
  box-shadow: 0 10px 22px -14px color-mix(in srgb, var(--accent) 80%, transparent);
}
.card-num { color: color-mix(in srgb, var(--accent) 22%, #e2e8f0); }
.card-cat { color: color-mix(in srgb, var(--accent) 70%, #334155); }
.card-title { color: var(--ink); }
.card-en { color: var(--dim); }
.card-desc { color: var(--muted); }
.tag { background: #f8fafc; border: 1px solid var(--line); color: var(--muted); }
.card-best { color: var(--dim); }
.site-foot { color: var(--dim); border-top: 1px solid var(--line); }

/* game shell */
.game-head {
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.game-title h1 { color: var(--ink); }
.game-title span { color: var(--dim); }
.hud-stat span, .hud-chip span { color: var(--dim); }
.hud-stat strong, .hud-chip b { color: var(--ink); }
.stage {
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}
.side-card {
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.side-card h3 { color: var(--dim); }
.side-card p, .side-card li { color: var(--muted); }
.side-card kbd { background: #f1f5f9; border-color: #cbd5e1; color: var(--ink); }
.best-val { color: var(--gold); }

/* overlays and buttons */
.stage-overlay { background: rgba(241, 245, 249, 0.72); backdrop-filter: blur(6px); }
.modal-card {
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 40px 80px -30px rgba(15, 23, 42, 0.45);
  color: var(--ink);
}
.modal-card h2 { color: var(--ink); }
.modal-card .modal-detail { color: var(--muted); }
.modal-score { background: #f8fafc; border: 1px solid var(--line); }
.modal-score b { color: var(--ink); }
.btn, .g-btn {
  background: #ffffff;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.btn:hover, .g-btn:hover { background: #f1f5f9; border-color: #94a3b8; }
.btn.primary, .g-btn.primary {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 10px 22px -12px rgba(37, 99, 235, 0.7);
}
.btn.primary:hover, .g-btn.primary:hover { background: linear-gradient(135deg, #0891b2, #2563eb); }
.btn.ghost, .g-btn.ghost { background: transparent; box-shadow: none; }
.g-btn.gold { background: linear-gradient(135deg, #fcd34d, #f59e0b); border-color: transparent; color: #451a03; }
.g-btn.danger { background: #fff1f2; border-color: #fecdd3; color: #be123c; }
.g-chip { background: #ffffff; border: 1px solid var(--line); color: var(--muted); }
.g-panel { background: #ffffff; border: 1px solid var(--line); }
.toast { background: #ffffff; border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow-md); }
.toast.good { color: #047857; border-color: #a7f3d0; }
.toast.bad { color: #be123c; border-color: #fecdd3; }
.search input { background: transparent; }
.btn:focus-visible, .g-btn:focus-visible, .icon-btn:focus-visible, .back-btn:focus-visible, .tab:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}
.btn:focus:not(:focus-visible), .g-btn:focus:not(:focus-visible) { outline: none; }
