/* ==========================================================================
   pao.gg — dark neon / glassmorphism theme
   ========================================================================== */

:root {
  --bg: #07070f;
  --bg-2: #0d0d1f;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.2);
  --text: #eef0ff;
  --muted: #a3a8cc;
  --primary: #8b5cf6;
  --accent: #22d3ee;
  --pink: #f472b6;
  --ok: #34d399;
  --online: #22c55e; /* the green "online" dot of the PAO logo */
  --danger: #f87171;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #22d3ee 100%);
  --grad-text: linear-gradient(90deg, #c4b5fd 0%, #67e8f9 100%);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
  --font-head: "Kanit", "Noto Sans Thai", system-ui, sans-serif;
  --font-body: "IBM Plex Sans Thai", "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  --header-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ambient neon glow background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60vmax 40vmax at 8% -5%, rgba(139, 92, 246, 0.28), transparent 60%),
    radial-gradient(50vmax 40vmax at 100% 10%, rgba(34, 211, 238, 0.16), transparent 60%),
    radial-gradient(50vmax 40vmax at 50% 110%, rgba(244, 114, 182, 0.14), transparent 60%),
    var(--bg);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
}

[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.25; margin: 0; letter-spacing: 0.1px; }
p { margin: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.container { width: min(1240px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.grad-text { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(7, 7, 15, 0.55);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
.site-header.scrolled { border-bottom-color: var(--border); background: rgba(7, 7, 15, 0.8); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand { display: inline-flex; align-items: center; gap: 10px; line-height: 0; }
.brand img { height: 32px; width: auto; display: block; filter: drop-shadow(0 0 14px rgba(34, 197, 94, 0.22)); transition: transform 0.4s var(--ease), filter 0.4s; }
.brand:hover img { transform: translateY(-1px); filter: drop-shadow(0 0 16px rgba(34, 197, 94, 0.5)); }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s, background 0.2s;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  --h: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--h);
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: rgba(255, 255, 255, 0.14); border-color: var(--border-strong); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn-primary {
  border-color: transparent;
  background: var(--grad);
  color: #07071a;
  box-shadow: 0 8px 28px -8px rgba(139, 92, 246, 0.8), 0 0 0 0 rgba(34, 211, 238, 0.4);
}
.btn-primary:hover { background: var(--grad); filter: brightness(1.1); box-shadow: 0 12px 34px -8px rgba(34, 211, 238, 0.6); }
.btn-sm { --h: 38px; padding: 0 14px; font-size: 0.88rem; }
.btn-ghost { background: transparent; }
.btn .ico { font-size: 1.1em; line-height: 1; }

/* ---------- Badges ---------- */
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  --c: #a78bfa;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px 2px 8px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.6;
  color: color-mix(in srgb, var(--c) 45%, white);
  background: color-mix(in srgb, var(--c) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
  white-space: nowrap;
}
.badge.lg { font-size: 0.88rem; padding: 4px 14px 4px 10px; }

/* ---------- Intro + Hero carousel ---------- */
.intro { padding: 34px 0 22px; text-align: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 12px; padding: 4px 14px; border-radius: 999px; font-family: var(--font-head); font-weight: 500; font-size: 0.82rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); background: var(--surface); border: 1px solid var(--border); }
.live-dot { position: relative; width: 9px; height: 9px; border-radius: 50%; background: var(--online); box-shadow: 0 0 10px var(--online); }
.live-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--online); opacity: 0; animation: ping 2.2s ease-out infinite; }
@keyframes ping { 0% { transform: scale(0.5); opacity: 0.7; } 80%, 100% { transform: scale(1.5); opacity: 0; } }
.intro h1 { font-size: clamp(1.7rem, 4.6vw, 3rem); font-weight: 700; }
.intro p { text-wrap: balance; color: var(--muted); max-width: 640px; margin: 10px auto 0; font-size: clamp(0.95rem, 2.4vw, 1.1rem); }
.intro .stats { display: inline-flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; justify-content: center; }
.stat {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.88rem; color: var(--muted);
}
.stat b { color: var(--text); font-family: var(--font-head); font-weight: 600; }

.hero { position: relative; }
.carousel {
  position: relative;
  height: clamp(420px, 56vw, 500px);
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-2);
  box-shadow: var(--shadow), 0 0 80px -30px rgba(139, 92, 246, 0.6);
  touch-action: pan-y;
  isolation: isolate;
}
.slide {
  position: absolute; inset: 0;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 32px;
  padding: 44px 64px 64px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}
.slide.active { opacity: 1; visibility: visible; z-index: 1; }
.slide-bg {
  position: absolute; inset: -40px; z-index: -2;
  background-size: cover; background-position: center;
  filter: blur(36px) saturate(1.5) brightness(0.55);
  transform: scale(1.15);
  transition: transform 7s linear;
}
.slide.active .slide-bg { transform: scale(1.3); }
.slide::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(7, 7, 15, 0.85) 0%, rgba(7, 7, 15, 0.35) 60%, rgba(7, 7, 15, 0.1) 100%);
}
.slide-copy > * { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.slide.active .slide-copy > * { opacity: 1; transform: none; }
.slide.active .slide-copy > :nth-child(2) { transition-delay: 0.08s; }
.slide.active .slide-copy > :nth-child(3) { transition-delay: 0.16s; }
.slide.active .slide-copy > :nth-child(4) { transition-delay: 0.24s; }
.slide.active .slide-copy > :nth-child(5) { transition-delay: 0.32s; }
.slide-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; margin-bottom: 14px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.3px;
  color: #fde68a; background: rgba(251, 191, 36, 0.14); border: 1px solid rgba(251, 191, 36, 0.4);
}
.slide h2 { font-size: clamp(1.7rem, 3.6vw, 2.8rem); font-weight: 700; margin-bottom: 10px; text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5); }
.slide-desc {
  color: #d3d6f0; font-size: clamp(0.95rem, 1.6vw, 1.08rem); max-width: 520px; margin-bottom: 16px;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.slide .badges { margin-bottom: 22px; }
.slide-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.slide-art { position: relative; justify-self: center; width: min(100%, 440px); perspective: 900px; }
.slide-art .frame {
  display: block; position: relative; border-radius: 22px; overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--border-strong);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.8), 0 0 60px -10px var(--glow, rgba(139, 92, 246, 0.6));
  transform: rotateY(-10deg) rotateX(4deg) translateY(10px);
  opacity: 0;
  transition: transform 0.9s var(--ease), opacity 0.7s var(--ease);
}
.slide.active .slide-art .frame { transform: rotateY(-6deg) rotateX(2deg); opacity: 1; }
.slide-art .frame:hover { transform: rotateY(0) rotateX(0) scale(1.03); }
.slide-art img { width: 100%; height: 100%; object-fit: cover; }
.slide-art .play-fab {
  position: absolute; inset: 0; margin: auto; width: 68px; height: 68px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.6rem; padding-left: 4px;
  background: rgba(7, 7, 15, 0.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-strong);
  opacity: 0.0; transform: scale(0.8); transition: 0.35s var(--ease);
}
.slide-art .frame:hover .play-fab { opacity: 1; transform: scale(1); }

.car-btn {
  position: absolute; top: 50%; z-index: 3; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.1rem;
  background: rgba(7, 7, 15, 0.5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  transition: background 0.2s, transform 0.2s var(--ease), border-color 0.2s;
}
.car-btn:hover { background: rgba(139, 92, 246, 0.5); border-color: var(--border-strong); transform: translateY(-50%) scale(1.08); }
.car-btn.prev { left: 14px; }
.car-btn.next { right: 14px; }

.car-dots { position: absolute; left: 0; right: 0; bottom: 20px; z-index: 3; display: flex; justify-content: center; gap: 8px; }
.car-dot {
  position: relative; width: 10px; height: 10px; padding: 0; border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, 0.3); overflow: hidden;
  transition: width 0.4s var(--ease), background 0.3s;
}
.car-dot::after { content: ""; position: absolute; inset: 0; background: #fff; transform: scaleX(0); transform-origin: left; }
.car-dot.active { width: 38px; }
.car-dot.active::after { transform: scaleX(1); }
.carousel.autoplay .car-dot.active::after { transform: scaleX(0); animation: dotfill var(--dur, 6s) linear forwards; }
.carousel.paused .car-dot.active::after { animation-play-state: paused; }
@keyframes dotfill { to { transform: scaleX(1); } }

/* ---------- Discover (search / chips / toolbar) ---------- */
.discover { padding: 44px 0 8px; }
.section-title { font-size: 1.1rem; color: var(--muted); font-weight: 500; text-align: center; margin-bottom: 14px; }

.searchbox {
  position: relative; display: flex; align-items: center; gap: 12px;
  height: 66px; padding: 0 18px 0 22px; max-width: 820px; margin: 0 auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 40px -16px rgba(0, 0, 0, 0.8);
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.searchbox:focus-within {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.16), 0 0 50px -8px rgba(34, 211, 238, 0.45);
}
.searchbox .s-ico { font-size: 1.35rem; opacity: 0.8; flex: none; }
.searchbox input {
  flex: 1; min-width: 0; height: 100%; background: transparent; border: 0; outline: 0;
  color: var(--text); font: 500 1.1rem/1 var(--font-body);
}
.searchbox input::placeholder { color: #7f85ad; font-weight: 400; }
.searchbox input::-webkit-search-cancel-button { display: none; }
.kbd {
  display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 8px;
  border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface-2);
  color: var(--muted); font: 600 0.82rem/1 var(--font-head);
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.08);
}
.s-clear {
  display: none; width: 34px; height: 34px; border-radius: 50%; border: 0; flex: none;
  background: var(--surface-2); place-items: center; font-size: 0.9rem; color: var(--muted);
}
.s-clear:hover { background: rgba(255, 255, 255, 0.16); color: var(--text); }
.searchbox.has-value .s-clear { display: grid; }
.searchbox.has-value .kbd { display: none; }

.chips-wrap { position: relative; margin-top: 22px; }
.chips {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
}
.chip {
  --c: #a78bfa;
  display: inline-flex; align-items: center; gap: 7px;
  height: 40px; padding: 0 14px 0 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  color: #d5d8f3; font-size: 0.92rem; font-weight: 500; white-space: nowrap;
  transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s, box-shadow 0.25s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.chip:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 60%, transparent); background: color-mix(in srgb, var(--c) 12%, transparent); }
.chip:active { transform: scale(0.96); }
.chip .ci { font-size: 1.05rem; line-height: 1; }
.chip .cn {
  min-width: 22px; padding: 0 7px; border-radius: 999px; text-align: center;
  font-size: 0.76rem; line-height: 20px; font-weight: 600;
  background: rgba(255, 255, 255, 0.1); color: var(--muted);
}
.chip[aria-pressed="true"] {
  color: #fff;
  background: color-mix(in srgb, var(--c) 30%, transparent);
  border-color: var(--c);
  box-shadow: 0 0 22px -4px color-mix(in srgb, var(--c) 70%, transparent), inset 0 0 12px -4px color-mix(in srgb, var(--c) 60%, transparent);
}
.chip[aria-pressed="true"] .cn { background: var(--c); color: #0a0a18; }
.chip.empty { opacity: 0.38; }
.chip-all { --c: #8b5cf6; }

.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 28px 0 18px;
}
.result-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); }
.result-info b { color: var(--text); font-family: var(--font-head); font-size: 1.2rem; font-weight: 600; }
.link-btn { background: none; border: 0; padding: 4px 8px; color: var(--accent); font-weight: 500; border-radius: 8px; }
.link-btn:hover { background: rgba(34, 211, 238, 0.1); }
.tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 0.88rem; color: var(--muted); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); transition: 0.25s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #cfd2ee; transition: 0.25s var(--ease); }
.switch input:checked + i { background: var(--primary); border-color: var(--primary); }
.switch input:checked + i::after { transform: translateX(16px); background: #fff; }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.seg button {
  height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent;
  color: var(--muted); font-size: 0.88rem; font-weight: 500; white-space: nowrap; transition: 0.2s;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--grad); color: #08081a; font-weight: 600; box-shadow: 0 4px 16px -4px rgba(139, 92, 246, 0.7); }
.seg button[hidden] { display: none; }

/* ---------- Game grid + cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; padding-bottom: 24px; }

.card {
  --mx: 50%; --my: 50%;
  position: relative; display: flex; flex-direction: column;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.3s, box-shadow 0.35s;
  animation: cardin 0.6s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 45ms);
  -webkit-tap-highlight-color: transparent;
}
.card[hidden] { display: none; }
.grid.settled .card { animation: none; }
@keyframes cardin { from { opacity: 0; transform: translateY(24px) scale(0.97); } to { opacity: 1; transform: none; } }
.card::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit;
  background: radial-gradient(360px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.12), transparent 45%);
  opacity: 0; transition: opacity 0.3s;
}
.card:hover { transform: translateY(-6px); border-color: rgba(167, 139, 250, 0.6); box-shadow: 0 24px 50px -18px rgba(0, 0, 0, 0.8), 0 0 40px -12px rgba(139, 92, 246, 0.7); }
.card:hover::before { opacity: 1; }
.card:active { transform: translateY(-2px) scale(0.99); }

.card-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease), filter 0.5s; }
.card:hover .card-media img { transform: scale(1.1); filter: brightness(0.45) blur(1.5px); }
.card-flags { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; gap: 6px; z-index: 1; }
.flag {
  padding: 2px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.5px;
  background: rgba(7, 7, 15, 0.65); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid var(--border-strong);
}
.flag.new { background: linear-gradient(135deg, #f472b6, #fb923c); color: #190a1a; border-color: transparent; }
.flag.ext { margin-left: auto; }

.card-hover {
  position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px;
  padding: 14px; opacity: 0; transform: translateY(10px); transition: opacity 0.3s, transform 0.4s var(--ease);
}
.card:hover .card-hover, .card:focus-visible .card-hover { opacity: 1; transform: none; }
.card-hover p { font-size: 0.84rem; line-height: 1.5; color: #e5e7fb; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-hover .tags { display: flex; flex-wrap: wrap; gap: 5px; }
.card-hover .tags span { font-size: 0.72rem; padding: 0 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.14); color: #fff; }
.card-play {
  position: absolute; z-index: 1; top: 50%; left: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px;
  display: grid; place-items: center; border-radius: 50%; font-size: 1.4rem; padding-left: 3px;
  background: var(--grad); color: #07071a; box-shadow: 0 0 36px rgba(34, 211, 238, 0.6);
  opacity: 0; transform: scale(0.5); transition: opacity 0.3s, transform 0.45s var(--ease);
}
.card:hover .card-play { opacity: 1; transform: scale(1); }
.card:hover .card-hover { padding-top: 78px; }

.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { font-size: 1.12rem; font-weight: 600; }
.card h3 mark, .card .desc mark { background: rgba(34, 211, 238, 0.25); color: #a5f3fc; border-radius: 4px; padding: 0 2px; }
.card .desc { color: var(--muted); font-size: 0.88rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin-top: auto; padding-top: 6px; display: flex; justify-content: space-between; gap: 8px; color: #8d93bb; font-size: 0.8rem; }
.card .meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty-state { text-align: center; padding: 70px 20px 80px; color: var(--muted); }
.empty-state .big { font-size: 4rem; filter: drop-shadow(0 0 24px rgba(139, 92, 246, 0.6)); animation: floaty 3s ease-in-out infinite; }
.empty-state h3 { color: var(--text); font-size: 1.4rem; margin: 10px 0 6px; }
.empty-state .btn { margin-top: 18px; }
@keyframes floaty { 50% { transform: translateY(-10px); } }

.more-wrap { display: flex; justify-content: center; padding: 8px 0 20px; }

.skeleton { height: 330px; border-radius: var(--radius); border: 1px solid var(--border); background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%) 0 0 / 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.notice { max-width: 640px; margin: 60px auto; padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid rgba(248, 113, 113, 0.5); text-align: center; color: var(--muted); }
.notice h3 { color: #fca5a5; margin-bottom: 8px; }
.notice code { background: var(--surface-2); padding: 1px 8px; border-radius: 6px; color: var(--text); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 56px; border-top: 1px solid var(--border); background: rgba(7, 7, 15, 0.6); }
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding: 28px 0; color: var(--muted); font-size: 0.9rem; }
.site-footer a:not(.btn) { color: var(--text); border-bottom: 1px dashed var(--border-strong); }
.site-footer a:not(.btn):hover { color: var(--accent); }
.foot-links { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 200; transform: translate(-50%, 30px);
  padding: 12px 22px; border-radius: 999px; font-weight: 500; font-size: 0.95rem;
  background: rgba(20, 20, 44, 0.92); border: 1px solid var(--border-strong); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.8);
  opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.4s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   Play page
   ========================================================================== */
.play-wrap { padding: 20px 0 0; }
.crumbs { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; color: var(--muted); font-size: 0.92rem; }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { opacity: 0.4; }
.crumbs .cur { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.player {
  border-radius: 24px; border: 1px solid var(--border-strong); overflow: hidden;
  background: #04040c; box-shadow: var(--shadow), 0 0 80px -30px rgba(139, 92, 246, 0.6);
}
.stage { position: relative; width: 100%; aspect-ratio: 16 / 10; max-height: calc(100vh - 190px); min-height: 360px; background: #04040c; }
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #04040c; }
.stage:fullscreen, .stage.pseudo-fs { max-height: none; width: 100vw; height: 100vh; height: 100dvh; aspect-ratio: auto; }
.stage.pseudo-fs { position: fixed; inset: 0; z-index: 300; }
.stage:-webkit-full-screen { max-height: none; width: 100%; height: 100%; aspect-ratio: auto; }
.exit-fs {
  display: none; position: absolute; top: 12px; right: 12px; z-index: 5; height: 40px; padding: 0 16px; border-radius: 999px;
  background: rgba(7, 7, 15, 0.7); border: 1px solid var(--border-strong); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0.55;
}
.exit-fs:hover { opacity: 1; }
.stage.pseudo-fs .exit-fs { display: block; }
body.no-scroll { overflow: hidden; }

.loader { position: absolute; inset: 0; display: grid; place-items: center; background: #04040c; z-index: 2; transition: opacity 0.4s, visibility 0.4s; }
.loader.done { opacity: 0; visibility: hidden; }
.spin { width: 54px; height: 54px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, 0.1); border-top-color: var(--accent); border-right-color: var(--primary); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.no-embed { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; overflow: hidden; }
.no-embed .bg { position: absolute; inset: -30px; background-size: cover; background-position: center; filter: blur(26px) brightness(0.4) saturate(1.4); }
.no-embed .inner { position: relative; max-width: 460px; }
.no-embed .big { font-size: 3.2rem; }
.no-embed h2 { font-size: 1.5rem; margin: 6px 0; }
.no-embed p { color: var(--muted); margin-bottom: 18px; }

.player-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-top: 1px solid var(--border); background: rgba(255, 255, 255, 0.04);
}
.player-bar .now { display: flex; align-items: center; gap: 10px; min-width: 0; font-family: var(--font-head); font-weight: 500; }
.player-bar .now img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex: none; }
.player-bar .now span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.game-info { display: grid; grid-template-columns: 1fr 320px; gap: 28px; padding: 32px 0 8px; }
.game-info h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 700; margin-bottom: 12px; }
.game-info .badges { margin-bottom: 16px; }
.game-info .desc { color: #cdd0ec; font-size: 1.05rem; line-height: 1.8; }
.side-card { padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); align-self: start; }
.side-card dl { margin: 0; display: grid; gap: 14px; }
.side-card dt { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; }
.side-card dd { margin: 2px 0 0; font-weight: 500; word-break: break-word; }
.taglist { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.tag { padding: 3px 12px; border-radius: 8px; font-size: 0.84rem; background: var(--surface-2); border: 1px solid var(--border); color: #cfd2ee; transition: 0.2s; }
.tag:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

.related { padding-top: 32px; }
.related h2 { font-size: 1.4rem; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }

/* ==========================================================================
   Admin page
   ========================================================================== */
.admin { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 28px; padding: 30px 0 10px; align-items: start; }
.panel { padding: 24px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.panel h2 { font-size: 1.2rem; margin-bottom: 16px; }
.page-head { padding: 34px 0 0; }
.page-head h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
.page-head p { color: var(--muted); margin-top: 6px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > label, .field > .lbl { font-size: 0.88rem; font-weight: 500; color: #cdd0ec; }
.field .req { color: var(--pink); }
.field .hint { font-size: 0.78rem; color: #8d93bb; }
.input, .textarea {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm); background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border); color: var(--text); font: 400 1rem/1.5 var(--font-body); transition: 0.2s;
}
.textarea { min-height: 110px; resize: vertical; }
.input:focus, .textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18); }
.input.invalid { border-color: var(--danger); }
.err { color: var(--danger); font-size: 0.8rem; min-height: 0; }
.checks { display: flex; gap: 22px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }
.chips.left { justify-content: flex-start; }
.chips.left .chip { height: 36px; font-size: 0.86rem; }
.out-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.code {
  margin: 0; padding: 16px; border-radius: var(--radius-sm); background: #05050d; border: 1px solid var(--border);
  font: 0.84rem/1.6 ui-monospace, "Cascadia Code", Consolas, monospace; color: #c4f1ff; overflow: auto; max-height: 420px; white-space: pre; tab-size: 2;
}
.preview-card { max-width: 330px; margin: 0 auto 22px; }
.preview-card .card { animation: none; }
.steps { margin: 14px 0 0; padding-left: 20px; color: var(--muted); font-size: 0.9rem; }
.steps li { margin-bottom: 4px; }
.steps code { background: var(--surface-2); padding: 0 6px; border-radius: 6px; color: var(--text); }
.sticky { position: sticky; top: calc(var(--header-h) + 16px); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 960px) {
  .slide { grid-template-columns: 1fr; padding: 36px 40px 64px; gap: 0; align-content: center; }
  .slide-art { display: none; }
  .game-info { grid-template-columns: 1fr; }
  .admin { grid-template-columns: 1fr; }
  .sticky { position: static; }
}

@media (max-width: 700px) {
  :root { --header-h: 58px; }
  body { font-size: 15px; }
  .container { width: calc(100% - 24px); }
  .brand img { height: 28px; }
  .nav a:not(.btn) { display: none; }
  .intro { padding: 22px 0 16px; }
  .carousel { height: 420px; border-radius: 22px; }
  .slide { padding: 26px 22px 58px; }
  .slide-actions .btn { flex: 1; }
  .car-btn { display: none; }
  .car-dots { bottom: 16px; }
  .discover { padding-top: 32px; }
  .searchbox { height: 58px; padding: 0 12px 0 16px; }
  .searchbox input { font-size: 1rem; }
  .searchbox .kbd { display: none; }
  .chips { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scroll-snap-type: x proximity; padding: 4px 12px 10px; margin: 0 -12px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { scroll-snap-align: start; flex: none; }
  .chips.left { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
  .toolbar { margin-top: 14px; }
  .tools { width: 100%; justify-content: space-between; }
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg button { padding: 0 11px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-body { padding: 10px 11px 12px; gap: 6px; }
  .card h3 { font-size: 0.98rem; }
  .card .desc { display: none; }
  .card .badges .badge:nth-child(n + 3) { display: none; }
  .badge { font-size: 0.7rem; padding: 0 8px 0 6px; }
  .card .meta { font-size: 0.74rem; }
  .card-hover, .card-play { display: none; }
  .card:hover { transform: none; }
  .card:hover .card-media img { transform: none; filter: none; }
  .stage { aspect-ratio: auto; height: min(76svh, 760px); min-height: 380px; max-height: none; }
  .player { border-radius: 18px; }
  .player-bar .actions { width: 100%; }
  .player-bar .actions .btn { flex: 1; padding: 0 10px; }
  .player-bar .btn .lbl { display: none; }
  .player-bar .btn.keep .lbl { display: inline; }
  .form-grid { grid-template-columns: 1fr; }
  .panel { padding: 18px; border-radius: 18px; }
  .site-footer .container { flex-direction: column; text-align: center; }
}

@media (max-width: 380px) {
  .grid { grid-template-columns: 1fr; }
  .card .desc { display: -webkit-box; }
}

@media (hover: none) {
  .card:hover { transform: none; box-shadow: none; border-color: var(--border); }
  .card:hover::before { opacity: 0; }
}

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

/* ==========================================================================
   Community submissions: submit / status / admin queue
   ========================================================================== */
.nav a.nav-cta { color: #07071a; background: var(--grad); font-weight: 600; }
.nav a.nav-cta:hover { color: #07071a; filter: brightness(1.1); }
.flag-group { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; }
.flag.community { background: rgba(52, 211, 153, 0.18); border-color: rgba(52, 211, 153, 0.6); color: #a7f3d0; font-weight: 600; letter-spacing: 0; }
.community-note { margin-bottom: 14px; padding: 10px 14px; border-radius: var(--radius-sm); background: rgba(52, 211, 153, 0.08); border: 1px solid rgba(52, 211, 153, 0.35); color: #b7f5dc; font-size: 0.9rem; }

.narrow { max-width: 860px; }
.pre { white-space: pre-wrap; word-break: break-word; }

.flow-steps { list-style: none; margin: 22px 0 6px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.flow-steps li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); font-size: 0.88rem; color: var(--muted); }
.flow-steps b { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--grad); color: #07071a; font-family: var(--font-head); }
.narrow .panel { margin-top: 22px; }
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.terms { align-items: flex-start; font-size: 0.88rem; color: var(--muted); line-height: 1.55; }
.terms input { margin-top: 3px; flex: none; }
.form-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 20px; }
.btn-danger { background: rgba(248, 113, 113, 0.14); border-color: rgba(248, 113, 113, 0.5); color: #fecaca; }
.btn-danger:hover { background: rgba(248, 113, 113, 0.28); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.spin.sm { width: 16px; height: 16px; border-width: 2px; }

.timeline { list-style: none; margin: 0 0 18px; padding: 0; }
.tl-item { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 0 0 16px 0; color: var(--muted); }
.tl-item::before { content: ""; position: absolute; left: 8px; top: 20px; bottom: 0; width: 2px; background: var(--border); }
.tl-item:last-child { padding-bottom: 0; }
.tl-item:last-child::before { display: none; }
.tl-dot { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--bg-2); margin-top: 3px; }
.tl-item.done { color: var(--text); }
.tl-item.done .tl-dot { background: var(--ok); border-color: var(--ok); box-shadow: 0 0 12px rgba(52, 211, 153, 0.6); }
.tl-item.done::before { background: var(--ok); }
.tl-item.active { color: var(--text); }
.tl-item.active .tl-dot { border-color: var(--accent); border-top-color: transparent; animation: spin 0.9s linear infinite; }
.tl-item.fail .tl-dot { background: var(--danger); border-color: var(--danger); }
.tl-text { word-break: break-word; }

.result-card { padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.result-card.ok { border-color: rgba(52, 211, 153, 0.55); box-shadow: 0 0 40px -20px rgba(52, 211, 153, 0.8); }
.result-card.warn { border-color: rgba(251, 191, 36, 0.55); }
.result-card.bad { border-color: rgba(248, 113, 113, 0.6); }
.rc-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.rc-icon { font-size: 2.2rem; line-height: 1; }
.rc-head h3 { font-size: 1.25rem; }
.rc-head p { color: var(--muted); }
.rc-block { margin-top: 14px; }
.rc-block h4, .d-sec h4 { font-size: 0.82rem; color: var(--muted); letter-spacing: 0.3px; margin: 12px 0 4px; font-weight: 500; }
.rc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.meter { margin: 10px 0; }
.meter-top { display: flex; justify-content: space-between; font-size: 0.86rem; color: var(--muted); margin-bottom: 6px; }
.meter-top b { color: var(--text); font-family: var(--font-head); }
.meter-bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter-bar i { display: block; height: 100%; border-radius: inherit; background: var(--grad); }
.local-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.local-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.local-list span { color: var(--muted); font-size: 0.85rem; }

/* admin */
.tabs { display: flex; gap: 6px; margin: 22px 0 18px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab { padding: 10px 18px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-weight: 500; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tab-count { margin-left: 6px; padding: 0 8px; border-radius: 999px; background: var(--pink); color: #1a0a18; font-size: 0.75rem; font-weight: 700; }
.login-box { max-width: 560px; margin: 10px auto; }
.login-row { display: flex; gap: 10px; flex-wrap: wrap; }
.login-row .input { flex: 1; min-width: 200px; }
.queue-bar { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.queue-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
.queue-list { display: grid; gap: 8px; max-height: 80vh; overflow: auto; padding-right: 4px; align-content: start; }
.q-item { display: grid; gap: 6px; text-align: left; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); transition: 0.2s; }
.q-item:hover { border-color: var(--border-strong); background: var(--surface-2); }
.q-item.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.q-title { font-weight: 600; font-family: var(--font-head); word-break: break-word; }
.q-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.q-score { font-family: var(--font-head); font-weight: 600; color: var(--accent); }
.q-sub { color: var(--muted); font-size: 0.8rem; }
.queue-detail { min-width: 0; margin-top: 0 !important; }
.d-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.d-head h2 { margin-bottom: 4px; word-break: break-word; }
.d-sec { padding: 16px 0; border-top: 1px solid var(--border); }
.d-sec h3 { font-size: 1.05rem; margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 16px; margin-bottom: 10px; }
.kv span { display: block; font-size: 0.76rem; color: var(--muted); }
.kv b { font-weight: 500; word-break: break-word; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.plain { margin: 0; padding-left: 20px; }
.plain li { margin-bottom: 3px; }
.preview-frame { margin-top: 12px; aspect-ratio: 16 / 10; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border-strong); background: #04040c; }
.preview-frame iframe { width: 100%; height: 100%; border: 0; }
.d-actions { margin-top: 14px; }
details summary { cursor: pointer; color: var(--accent); margin: 8px 0; }
.queue-detail code { background: var(--surface-2); padding: 0 6px; border-radius: 6px; word-break: break-all; }

@media (max-width: 960px) {
  .queue-layout { grid-template-columns: 1fr; }
  .queue-list { max-height: 320px; }
  .flow-steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .nav a.nav-cta { display: inline-flex; padding: 6px 14px; }
  .two-col { grid-template-columns: 1fr; }
  .card-flags .flag.community { font-size: 0.64rem; padding: 1px 7px; }
  .rc-actions .btn { flex: 1; }
}

/* ==========================================================================
   Native promotion label · click-to-play cover · analytics dashboard
   ========================================================================== */

/* polite "แนะนำ" label: same glass pill language as the other card flags, deliberately quiet but readable */
.flag-group.right { margin-left: auto; justify-content: flex-end; }
.flag.promo {
  background: rgba(10, 10, 26, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #e6e8fb;
  font-weight: 500;
  letter-spacing: 0;
  font-size: 0.7rem;
  padding: 2px 9px;
}
.slide-tag.soft { color: #e6e8fb; background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.26); font-weight: 500; }

/* play page: the game starts when the visitor asks for it */
.cover { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; overflow: hidden; background: #04040c; }
.cover .bg { position: absolute; inset: -30px; background-size: cover; background-position: center; filter: blur(22px) brightness(0.45) saturate(1.3); }
.cover .inner { position: relative; text-align: center; }
.cover-play {
  width: 92px; height: 92px; border-radius: 50%; border: 0; display: grid; place-items: center; padding-left: 8px;
  font-size: 2.2rem; color: #07071a; background: var(--grad);
  box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.08), 0 0 60px rgba(34, 211, 238, 0.55);
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
  animation: pulse 2.4s ease-in-out infinite;
}
.cover-play:hover { transform: scale(1.08); }
.cover-play:active { transform: scale(0.96); }
.cover p { margin-top: 14px; color: #d3d6f0; font-weight: 500; }
@keyframes pulse { 50% { box-shadow: 0 0 0 18px rgba(255, 255, 255, 0.03), 0 0 70px rgba(139, 92, 246, 0.6); } }
.stage:fullscreen .cover, .stage.pseudo-fs .cover { position: absolute; }

/* ---------- analytics dashboard ---------- */
.an-controls { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.an-range { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.an-range input[type="date"] { width: auto; padding: 7px 10px; }
.an-note { color: var(--muted); font-size: 0.84rem; }
.an-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.an-card { padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.an-card .lbl { font-size: 0.8rem; color: var(--muted); }
.an-card .val { font: 600 1.9rem/1.2 var(--font-head); margin: 4px 0 6px; }
.an-card .sub { font-size: 0.78rem; color: var(--muted); }
.delta { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 0.76rem; font-weight: 600; }
.delta.up { color: #86efac; background: rgba(52, 211, 153, 0.14); }
.delta.down { color: #fca5a5; background: rgba(248, 113, 113, 0.14); }
.delta.flat { color: var(--muted); background: var(--surface-2); }
.an-panel { padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); margin-bottom: 18px; min-width: 0; }
.an-panel h3 { font-size: 1.05rem; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.an-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.an-grid > .an-panel { margin-bottom: 0; }
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: #8d93bb; font: 11px var(--font-body); }
.chart .grid line { stroke: rgba(255, 255, 255, 0.07); }
.chart .line { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { stroke: var(--bg); stroke-width: 2; }
.chart-tip { position: absolute; pointer-events: none; transform: translate(-50%, -110%); padding: 8px 12px; border-radius: 10px; background: rgba(20, 20, 44, 0.96); border: 1px solid var(--border-strong); font-size: 0.8rem; white-space: nowrap; z-index: 5; }
.chart-tip b { font-family: var(--font-head); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 8px; }
.legend label { display: inline-flex; align-items: center; gap: 6px; font-size: 0.84rem; color: var(--muted); cursor: pointer; user-select: none; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.legend input { accent-color: var(--primary); }
.tbl-wrap { overflow: auto; max-height: 460px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.tbl th, .tbl td { padding: 8px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--border); }
.tbl th:first-child, .tbl td:first-child { text-align: left; white-space: normal; min-width: 160px; }
.tbl thead th { position: sticky; top: 0; background: #12122a; color: var(--muted); font-weight: 500; cursor: pointer; user-select: none; z-index: 1; }
.tbl thead th:hover { color: var(--text); }
.tbl thead th[aria-sort="descending"]::after { content: " ▼"; font-size: 0.7em; color: var(--accent); }
.tbl thead th[aria-sort="ascending"]::after { content: " ▲"; font-size: 0.7em; color: var(--accent); }
.tbl tbody tr:hover { background: var(--surface); }
.tbl .empty { text-align: center; color: var(--muted); padding: 22px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 160px) 1fr auto; gap: 10px; align-items: center; margin: 6px 0; font-size: 0.86rem; }
.bar-row .bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar-row .bar i { display: block; height: 100%; border-radius: inherit; background: var(--grad); }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .num { color: var(--muted); font-variant-numeric: tabular-nums; }
.stack { display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: var(--surface-2); margin: 8px 0; }
.stack i { display: block; height: 100%; }
.mini-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.mini-kv div { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.mini-kv span { display: block; font-size: 0.74rem; color: var(--muted); }
.mini-kv b { font: 600 1.15rem var(--font-head); }
.tools-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tools-row .input { width: auto; min-width: 160px; padding: 7px 12px; }

/* promo tab */
.promo-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.promo-edit { position: sticky; top: calc(var(--header-h) + 16px); }
.slot-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type="range"] { flex: 1; accent-color: var(--primary); }
.range-row output { min-width: 34px; text-align: right; font-family: var(--font-head); }
.pill-on { color: #86efac; } .pill-off { color: var(--muted); } .pill-exp { color: #fcd34d; }
.preview-list { counter-reset: p; margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.preview-list li { counter-increment: p; display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); font-size: 0.86rem; }
.preview-list li::before { content: counter(p); color: var(--muted); font-family: var(--font-head); }
.preview-list li.is-promo { background: rgba(139, 92, 246, 0.16); border: 1px solid rgba(139, 92, 246, 0.4); }
.preview-list .tag-p { font-size: 0.7rem; padding: 0 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); }

@media (max-width: 960px) {
  .an-grid, .promo-layout { grid-template-columns: 1fr; }
  .promo-edit { position: static; }
}
@media (max-width: 700px) {
  .an-card .val { font-size: 1.5rem; }
  .bar-row { grid-template-columns: 90px 1fr auto; }
  .cover-play { width: 76px; height: 76px; font-size: 1.8rem; }
}

/* ---------- creators: private owner link, promotion requests ---------- */
.owner-box { margin: 0 0 16px; padding: 16px 18px; border-radius: var(--radius); background: rgba(139, 92, 246, 0.1); border: 1px solid rgba(167, 139, 250, 0.5); }
.owner-box h3 { font-size: 1.05rem; margin-bottom: 6px; }
.owner-box p { color: #d3d6f0; font-size: 0.9rem; margin-bottom: 10px; }
.owner-row { display: flex; gap: 8px; flex-wrap: wrap; }
.owner-row .input { flex: 1; min-width: 220px; font-size: 0.85rem; }
.owner-banner { margin: 22px 0 6px; padding: 10px 14px; border-radius: var(--radius-sm); background: rgba(52, 211, 153, 0.08); border: 1px solid rgba(52, 211, 153, 0.35); color: #b7f5dc; font-size: 0.88rem; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.owner-sec { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.owner-sec h3 { font-size: 1.15rem; margin-bottom: 12px; }
.req-list { display: grid; gap: 12px; margin-bottom: 14px; }
.req-card { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.req-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 6px; }
.req-results { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }
.req-results h4 { font-size: 0.9rem; margin-bottom: 8px; font-weight: 500; }
.req-form { margin-top: 12px; padding: 16px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.03); border: 1px dashed var(--border-strong); display: grid; gap: 14px; }
.req-form h4 { font-size: 1rem; }
.slot-list { display: grid; gap: 8px; }
.slot-opt { align-items: flex-start; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.slot-opt input { margin-top: 4px; flex: none; }
.slot-opt small { display: block; color: var(--muted); font-size: 0.78rem; }
.tbl-wrap .tbl th, .tbl-wrap .tbl td { cursor: default; }

/* admin promotion requests */
.req-queue { display: grid; gap: 8px; max-height: 360px; overflow: auto; }
.req-item { text-align: left; display: grid; gap: 4px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.req-item:hover { border-color: var(--border-strong); }
.req-item.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.req-item b { font-family: var(--font-head); font-weight: 500; }
.src-badge { font-size: 0.7rem; }

/* admin import / export */
.im-text { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82rem; min-height: 180px; }
.im-genres { margin-top: 12px; }
.im-genres summary { cursor: pointer; color: var(--muted); font-size: 0.88rem; }
.im-genres code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.im-radios { flex-direction: column; gap: 8px; }
.im-tbl th, .im-tbl td { text-align: left; white-space: normal; vertical-align: top; }
.im-tbl th:first-child, .im-tbl td:first-child { min-width: 0; width: 2.5em; }
.im-tbl td code { color: var(--muted); font-size: 0.78rem; word-break: break-all; }
.im-row-bad { background: rgba(248, 113, 113, 0.06); }
.im-ok { color: var(--ok); }
.im-bad { color: var(--danger); font-weight: 500; }
.im-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; font-size: 0.82rem; }
.im-err { color: #fca5a5; }
.im-err code { color: #fecaca; background: rgba(248, 113, 113, 0.14); padding: 0 5px; border-radius: 5px; }
.im-warn { color: #fcd34d; }

/* ===== games vs mini-games, development status, AI player review ===== */
.kind-tabs { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 0 0 8px; }
.kind-tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; border-radius: 16px; cursor: pointer;
  font: 600 1.05rem var(--font-head); color: var(--muted); background: var(--surface); border: 1px solid var(--border); transition: 0.25s var(--ease);
}
.kind-tab:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.kind-tab[aria-selected="true"] { color: #08081a; background: var(--grad); border-color: transparent; box-shadow: 0 8px 26px -8px rgba(139, 92, 246, 0.75); }
.kind-tab .cn { min-width: 1.6em; padding: 0 7px; border-radius: 999px; font-size: 0.8rem; line-height: 1.7; text-align: center; background: rgba(255, 255, 255, 0.12); }
.kind-tab[aria-selected="true"] .cn { background: rgba(8, 8, 26, 0.22); }
.kind-note { margin: 0 0 30px; color: var(--muted); font-size: 0.92rem; text-align: center; }
.grid.mini-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.grid.mini-grid .c-desc { display: none; }
.grid.mini-grid .card-body { padding: 12px 14px 14px; }
.grid.mini-grid .c-title { font-size: 1rem; }

.st-badge { font-weight: 600; }
.flag.mini { background: rgba(148, 163, 184, 0.2); border-color: rgba(148, 163, 184, 0.5); color: #e2e8f0; font-weight: 600; letter-spacing: 0; }
.ai-score {
  position: absolute; left: 10px; bottom: 10px; z-index: 1; display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 11px 3px 8px; border-radius: 999px; font-size: 0.78rem; font-weight: 500; color: #e9d5ff;
  background: rgba(15, 12, 40, 0.82); border: 1px solid rgba(167, 139, 250, 0.65); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.ai-score b { font: 600 0.95rem var(--font-head); color: #fff; font-variant-numeric: tabular-nums; }
.ai-score.inline { position: static; align-self: center; }

/* screenshots + lightbox */
.gallery { padding-top: 28px; }
.gallery h2, .ai-review h2 { font-size: 1.25rem; margin-bottom: 14px; }
.shots { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.shots.small { gap: 8px; }
/* every screenshot keeps its own aspect ratio (landscape and portrait side by side): nothing is cropped, no letterbox boxes */
.shot { --h: 220px; height: var(--h); max-width: 100%; padding: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--border-strong); background: #05050f; cursor: zoom-in; transition: 0.25s var(--ease); }
.shots.small .shot { --h: 200px; }
.shot img { height: 100%; width: auto; max-width: 100%; aspect-ratio: auto 16 / 9; object-fit: contain; display: block; } /* 16:9 placeholder until the real size is known (lazy images) */
.shot:hover, .shot:focus-visible { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 12px 30px -12px rgba(34, 211, 238, 0.5); }
.lightbox { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; background: rgba(4, 4, 14, 0.92); }
.lightbox figure { margin: 0; max-width: min(1100px, 100%); text-align: center; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 110px); border-radius: 12px; box-shadow: 0 30px 80px -20px #000; }
.lightbox figcaption { margin-top: 10px; color: var(--muted); font-size: 0.88rem; }
.lb-close, .lb-nav { position: absolute; width: 46px; height: 46px; border-radius: 50%; font-size: 1.1rem; color: #fff; background: rgba(255, 255, 255, 0.12); border: 1px solid var(--border-strong); cursor: pointer; }
.lb-close { top: 16px; right: 16px; }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-nav.prev { left: 14px; }
.lb-nav.next { right: 14px; }
.lb-close:hover, .lb-nav:hover, .lb-close:focus-visible, .lb-nav:focus-visible { background: var(--primary); }

/* review by the AI player */
.ai-review { margin-top: 32px; padding: 24px; border-radius: 22px; background: var(--surface); border: 1px solid rgba(167, 139, 250, 0.4); box-shadow: 0 0 40px -22px rgba(139, 92, 246, 0.8); }
.ai-review h2 .by { font-weight: 400; color: var(--muted); font-size: 0.95rem; }
.ai-review.is-empty { border-style: dashed; border-color: var(--border-strong); box-shadow: none; }
.ai-note { margin: 0 0 18px; padding: 10px 14px; border-radius: 12px; font-size: 0.88rem; color: #c9ccee; background: rgba(139, 92, 246, 0.1); border: 1px solid rgba(167, 139, 250, 0.3); }
.ai-none { margin: 0 0 8px; font-size: 1.1rem; color: var(--text); }
.ai-review.is-empty .ai-note { margin-bottom: 0; background: transparent; border-color: var(--border); }
.ai-rv-grid { display: grid; grid-template-columns: 180px 1fr; gap: 26px; align-items: center; }
.ai-overall { display: grid; justify-items: center; padding: 18px 12px; border-radius: 18px; background: linear-gradient(160deg, rgba(139, 92, 246, 0.25), rgba(34, 211, 238, 0.12)); border: 1px solid rgba(167, 139, 250, 0.5); }
.ai-overall b { font: 700 3.2rem/1 var(--font-head); font-variant-numeric: tabular-nums; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ai-overall span { color: var(--muted); font-size: 0.95rem; }
.ai-overall small { margin-top: 6px; color: #cfd2ee; font-size: 0.8rem; text-align: center; }
.ai-bars { display: grid; gap: 12px; }
.bar-line { display: grid; grid-template-columns: 110px 1fr 44px; gap: 12px; align-items: center; font-size: 0.92rem; }
.bar-line .lbl { color: #cfd2ee; }
.bar-line .bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar-line .bar i { display: block; height: 100%; border-radius: inherit; background: var(--grad); }
.bar-line .val { text-align: right; font: 600 0.95rem var(--font-head); font-variant-numeric: tabular-nums; }
.ai-summary { margin: 20px 0 4px; line-height: 1.85; color: #dcdff7; }
.ai-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 16px; }
.ai-col { padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); }
.ai-col h3 { font-size: 0.98rem; margin-bottom: 8px; }
.ai-col ul { margin: 0; padding-left: 18px; display: grid; gap: 5px; color: #cfd2ee; font-size: 0.92rem; }
.ai-col.pros { border-color: rgba(52, 211, 153, 0.35); }
.ai-col.cons { border-color: rgba(251, 191, 36, 0.35); }
.ai-col.bugs { border-color: rgba(248, 113, 113, 0.4); }
.ai-sub { margin: 18px 0 8px; font-size: 0.95rem; color: var(--muted); font-weight: 500; }
.ai-meta { margin: 16px 0 0; font-size: 0.84rem; color: var(--muted); }
@media (max-width: 700px) {
  .kind-tab { padding: 9px 16px; font-size: 0.95rem; flex: 1; justify-content: center; }
  .ai-rv-grid { grid-template-columns: 1fr; gap: 16px; }
  .ai-overall { grid-template-columns: auto auto; justify-content: center; align-items: baseline; gap: 6px 10px; }
  .ai-overall small { grid-column: 1 / -1; }
  .bar-line { grid-template-columns: 88px 1fr 38px; gap: 8px; }
  .ai-review { padding: 18px; }
  .grid.mini-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
@media (max-width: 700px) { .shot { --h: 170px; } .shots.small .shot { --h: 150px; } }

/* admin: code review and the AI player's gameplay review side by side */
.d-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 0 18px; align-items: start; }
.q-score.play { color: #e9d5ff; }
.d-sec .shots.small { margin-top: 12px; }
.d-sec .shot { --h: 90px; }
.queue-bar #ptHint { align-self: center; font-size: 0.82rem; color: #c4b5fd; }
