:root,
:root[data-theme="dark"] {
  --bg-0: #06101f;
  --bg-1: #0d1d35;
  --bg-2: #132a4a;
  --surface-0: rgba(8, 21, 41, 0.84);
  --surface-1: rgba(14, 31, 58, 0.88);
  --surface-2: rgba(20, 40, 72, 0.9);
  --line-soft: rgba(123, 163, 209, 0.2);
  --line-strong: rgba(123, 163, 209, 0.42);
  --text-0: #f5fbff;
  --text-1: #d3e5f8;
  --text-2: #8eabc8;
  --accent-cyan: #22d1ee;
  --accent-lime: #81f495;
  --accent-amber: #ffc261;
  --danger: #ff6f7a;
  --ok: #39d98a;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --radius-card: 16px;
  --shadow-soft: 0 10px 30px rgba(2, 8, 18, 0.38);
  --shadow-strong: 0 20px 55px rgba(2, 8, 18, 0.52);
  --font-body: "Sora", "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --ease-ui: cubic-bezier(0.32, 0.72, 0, 1);
  --motion-fast: 150ms;
  --motion-med: 260ms;
  --motion-slow: 420ms;
  --btn-lift: -1px;
  --card-blur: 14px;
  --liquid-opacity: 0.35;
  --orb-opacity: 0.14;
  --orb-speed: 18s;
  --orb-ease: ease-in-out;
  --layer-base: 1;
  --layer-table-head: 5;
  --layer-sticky: 20;
  --layer-popover: 60;
  --layer-sidebar: 80;
  --layer-modal: 120;
  --layer-mobile-nav: 140;
  --layer-theme: 150;
  --layer-chat: 160;
  --layer-toast: 195;
  --layer-cookie: 180;
  --layer-loader: 240;
  --filters-sticky-top: 72px;
  --table-head-top: 0px;
}

:root[data-theme="light"] {
  --bg-0: #f2f5fb;
  --bg-1: #f9fbff;
  --bg-2: #e6eefc;
  --surface-0: rgba(255, 255, 255, 0.98);
  --surface-1: rgba(245, 249, 255, 0.98);
  --surface-2: rgba(236, 244, 255, 0.96);
  --line-soft: rgba(94, 124, 176, 0.2);
  --line-strong: rgba(94, 124, 176, 0.48);
  --text-0: #10233e;
  --text-1: #1d3b64;
  --text-2: #4f688e;
  --accent-cyan: #0ea5e9;
  --accent-lime: #22c55e;
  --accent-amber: #f59e0b;
  --font-body: "Sora", "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
}

:root[data-theme="white"] {
  --bg-0: #ffffff;
  --bg-1: #f8f9fa;
  --bg-2: #eef2f6;
  --surface-0: rgba(255, 255, 255, 0.98);
  --surface-1: rgba(250, 251, 252, 0.98);
  --surface-2: rgba(244, 246, 248, 0.96);
  --line-soft: rgba(16, 35, 62, 0.12);
  --line-strong: rgba(16, 35, 62, 0.22);
  --text-0: #0f172a;
  --text-1: #1d3b64;
  --text-2: #526a8b;
  --accent-cyan: #0d6efd;
  --accent-lime: #22c55e;
  --accent-amber: #f59e0b;
  --shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.14);
  --shadow-strong: 0 24px 60px rgba(15, 23, 42, 0.18);
  --btn-lift: 0px;
  --card-blur: 0px;
}

.theme-fx {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 1;
}

.theme-fx::before,
.theme-fx::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.theme-transition {
  position: fixed;
  inset: 0;
  z-index: var(--layer-theme);
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 70% 0%, rgba(34, 209, 238, 0.14), transparent 58%),
    radial-gradient(760px 560px at 20% 12%, rgba(255, 194, 97, 0.10), transparent 62%);
  mix-blend-mode: screen;
}

.theme-transition-terminal {
  background: radial-gradient(900px 520px at 50% 10%, rgba(0, 255, 102, 0.14), transparent 60%);
  mix-blend-mode: screen;
}

.theme-transition-black,
.theme-transition-cyber {
  background:
    radial-gradient(900px 520px at 70% 0%, rgba(0, 255, 255, 0.16), transparent 58%),
    radial-gradient(760px 560px at 20% 12%, rgba(57, 255, 20, 0.08), transparent 62%);
  mix-blend-mode: screen;
}

.theme-transition-sakura,
.theme-transition-femboy,
.theme-transition-femboys {
  background:
    radial-gradient(900px 520px at 70% 0%, rgba(255, 105, 180, 0.14), transparent 58%),
    radial-gradient(760px 560px at 20% 12%, rgba(152, 251, 152, 0.10), transparent 62%);
  mix-blend-mode: multiply;
}

:root[data-theme-fx="0"] .theme-fx {
  opacity: 0;
}

:root[data-theme-fx="0"] .liquid-scene {
  display: none;
}

:root[data-theme-fx="0"][data-theme="terminal"] body,
:root[data-theme-fx="0"][data-theme="terminal"] body::after {
  animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .theme-fx::before,
  .theme-fx::after {
    animation: none !important;
  }
  :root[data-theme="terminal"] body {
    animation: none !important;
  }
  :root[data-theme="femboy"] .btn,
  .btn {
    transition: none !important;
  }
}

:root[data-theme="black"] {
  --bg-0: #000000;
  --bg-1: #06060a;
  --bg-2: #0b0c12;
  --surface-0: rgba(0, 0, 0, 0.84);
  --surface-1: rgba(7, 9, 13, 0.88);
  --surface-2: rgba(11, 14, 20, 0.9);
  --line-soft: rgba(170, 198, 255, 0.14);
  --line-strong: rgba(170, 198, 255, 0.26);
  --text-0: #f5fbff;
  --text-1: #d3e5f8;
  --text-2: #8eabc8;
  --accent-cyan: #00ffff;
  --accent-lime: #39ff14;
  --accent-amber: #ffc261;
  --btn-lift: -2px;
  --liquid-opacity: 0.28;
  --orb-opacity: 0.16;
  --orb-speed: 22s;
}

:root[data-theme="black"] .btn:hover:not(:disabled) {
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.25);
}

.theme-fx-black::before {
  opacity: 0.75;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.26) 1px, transparent 1px),
    radial-gradient(rgba(0, 255, 255, 0.14) 1px, transparent 1px),
    radial-gradient(rgba(57, 255, 20, 0.1) 1px, transparent 1px);
  background-size: 220px 220px, 320px 320px, 420px 420px;
  background-position: 0 0, 40px 80px, -120px 20px;
  animation: starDrift 18s linear infinite;
}

.theme-fx-black::after {
  opacity: 0.4;
  background: radial-gradient(900px 520px at 70% 0%, rgba(0, 255, 255, 0.12), transparent 55%),
    radial-gradient(760px 560px at 20% 12%, rgba(57, 255, 20, 0.08), transparent 60%);
  filter: blur(0.2px);
}

@keyframes starDrift {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-140px, 90px, 0); }
}

:root[data-theme="black"] .card,
:root[data-theme="black"] .table-wrap,
:root[data-theme="black"] .cookie-dock,
:root[data-theme="black"] .modal-shell {
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.6);
}

:root[data-theme="black"] .nav-btn.active,
:root[data-theme="black"] .mobile-nav-btn.active {
  background: linear-gradient(90deg, rgba(0, 255, 255, 0.18), rgba(57, 255, 20, 0.14));
  border-color: rgba(0, 255, 255, 0.3);
}

:root[data-theme="terminal"] {
  --bg-0: #000000;
  --bg-1: #001100;
  --bg-2: #000000;
  --surface-0: rgba(0, 0, 0, 0.86);
  --surface-1: rgba(0, 0, 0, 0.9);
  --surface-2: rgba(0, 0, 0, 0.92);
  --line-soft: rgba(0, 255, 102, 0.14);
  --line-strong: rgba(0, 255, 102, 0.28);
  --text-0: #00ff66;
  --text-1: #00e65c;
  --text-2: rgba(0, 255, 102, 0.65);
  --accent-cyan: #00ff66;
  --accent-lime: #00ff66;
  --accent-amber: #00ff66;
  --font-body: "VT323", monospace;
  --font-display: "VT323", monospace;
  --ease-ui: steps(4, end);
  --motion-fast: 90ms;
  --motion-med: 120ms;
  --motion-slow: 200ms;
  --btn-lift: 0px;
  --card-blur: 0px;
  --liquid-opacity: 0;
  --orb-opacity: 0;
}

:root[data-theme="terminal"] body {
  background: radial-gradient(800px 500px at 50% 20%, rgba(0, 255, 102, 0.08), transparent 55%),
    linear-gradient(180deg, #000, #001100);
  text-shadow: 0 0 10px rgba(0, 255, 102, 0.14);
  animation: crtFlicker 0.14s infinite;
}

.theme-fx-terminal::before {
  opacity: 0.22;
  background: radial-gradient(800px 500px at 50% 20%, rgba(0, 255, 102, 0.14), transparent 60%),
    radial-gradient(900px 720px at 50% 120%, rgba(0, 255, 102, 0.08), transparent 55%);
  mix-blend-mode: screen;
}

:root[data-theme="terminal"] .topbar h1::after {
  content: "▌";
  margin-left: 8px;
  opacity: 0.9;
  animation: crtCaret 1s steps(2, end) infinite;
}

@keyframes crtCaret {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

:root[data-theme="terminal"] .btn,
:root[data-theme="terminal"] input:not([type="checkbox"]),
:root[data-theme="terminal"] select {
  border-color: rgba(0, 255, 102, 0.28);
  background: rgba(0, 0, 0, 0.72);
  color: var(--text-0);
}

:root[data-theme="terminal"] .btn:hover:not(:disabled) {
  box-shadow: 0 0 0 1px rgba(0, 255, 102, 0.35), 0 0 24px rgba(0, 255, 102, 0.18);
}

:root[data-theme="terminal"] body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.0) 0px,
    rgba(0, 0, 0, 0.0) 2px,
    rgba(0, 0, 0, 0.28) 3px
  );
  mix-blend-mode: multiply;
  opacity: 0.55;
}

@keyframes crtFlicker {
  0% { opacity: 0.985; }
  50% { opacity: 1; }
  100% { opacity: 0.992; }
}

:root[data-theme="femboy"] {
  --bg-0: #ffe4ef;
  --bg-1: #ffd1e4;
  --bg-2: #f6efff;
  --surface-0: rgba(255, 255, 255, 0.8);
  --surface-1: rgba(255, 255, 255, 0.86);
  --surface-2: rgba(255, 255, 255, 0.9);
  --line-soft: rgba(255, 105, 180, 0.18);
  --line-strong: rgba(255, 105, 180, 0.34);
  --text-0: #4a1f3d;
  --text-1: #5f2a4b;
  --text-2: rgba(74, 31, 61, 0.7);
  --accent-cyan: #ff69b4;
  --accent-lime: #98fb98;
  --accent-amber: #ffc0cb;
}

:root[data-theme="femboy"] .btn {
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

:root[data-theme="femboy"] body {
  background:
    radial-gradient(850px 520px at 18% 4%, rgba(255, 105, 180, 0.18), transparent 55%),
    radial-gradient(700px 520px at 88% 14%, rgba(152, 251, 152, 0.16), transparent 55%),
    linear-gradient(155deg, var(--bg-0), var(--bg-1) 42%, var(--bg-2));
}

.theme-fx-femboy::before {
  opacity: 0.5;
  background:
    radial-gradient(rgba(255, 105, 180, 0.14) 1px, transparent 1px),
    radial-gradient(rgba(152, 251, 152, 0.12) 1px, transparent 1px);
  background-size: 180px 180px, 260px 260px;
  background-position: 0 0, 40px 60px;
  animation: kawaiiDrift 16s ease-in-out infinite;
}

.theme-fx-femboy::after {
  opacity: 0.55;
  background: linear-gradient(90deg, rgba(255, 105, 180, 0.08), rgba(152, 251, 152, 0.06), rgba(255, 192, 203, 0.08));
  background-size: 220% 220%;
  animation: kawaiiSheen 10s ease-in-out infinite;
  mix-blend-mode: overlay;
}

@keyframes kawaiiDrift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(20px, -12px, 0) scale(1.03); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes kawaiiSheen {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

:root[data-theme="femboy"] .btn:active {
  transform: scale(0.98);
}

@keyframes heartFly {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-54px) scale(1.3); }
}

.heart-particle {
  position: fixed;
  z-index: var(--layer-toast);
  pointer-events: none;
  animation: heartFly 1s ease-out forwards;
  filter: drop-shadow(0 8px 16px rgba(255, 105, 180, 0.22));
}

:root[data-theme="white"] body {
  background:
    radial-gradient(900px 520px at 80% 0%, rgba(13, 110, 253, 0.10), transparent 58%),
    radial-gradient(760px 560px at 22% 14%, rgba(34, 197, 94, 0.08), transparent 60%),
    linear-gradient(155deg, var(--bg-0), var(--bg-1) 42%, var(--bg-2));
}

.theme-fx-white::before {
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.08) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: 0 0;
}

.theme-fx-white::after {
  opacity: 0.16;
  background-image: radial-gradient(rgba(15, 23, 42, 0.16) 0.8px, transparent 0.8px);
  background-size: 5px 5px;
  filter: blur(0.1px);
}

:root[data-theme="white"] .btn {
  box-shadow: none;
}

:root[data-theme="white"] .btn:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
  background: rgba(250, 251, 252, 0.98);
}

:root[data-theme="white"] .card,
:root[data-theme="white"] .table-wrap,
:root[data-theme="white"] .cookie-dock,
:root[data-theme="white"] .modal-shell {
  background: rgba(255, 255, 255, 0.98);
}

:root[data-theme="custom"] {
  --bg-0: #120b1f;
  --bg-1: #1a1434;
  --bg-2: #112640;
  --surface-0: rgba(21, 12, 38, 0.82);
  --surface-1: rgba(15, 24, 56, 0.86);
  --surface-2: rgba(31, 19, 69, 0.9);
  --line-soft: rgba(190, 126, 255, 0.24);
  --line-strong: rgba(190, 126, 255, 0.52);
  --text-0: #f8f3ff;
  --text-1: #d8c8ff;
  --text-2: #ad91d6;
  --accent-cyan: #55d7ff;
  --accent-lime: #d98cff;
  --accent-amber: #ff9f6a;
}

:root[data-theme="custom"] body {
  background:
    radial-gradient(880px 520px at 15% 10%, rgba(190, 126, 255, 0.18), transparent 58%),
    radial-gradient(760px 520px at 86% 14%, rgba(85, 215, 255, 0.14), transparent 60%),
    linear-gradient(155deg, var(--bg-0), var(--bg-1) 42%, var(--bg-2));
}

:root[data-theme="custom"] .btn.primary {
  background: linear-gradient(135deg, rgba(85, 215, 255, 0.95), rgba(217, 140, 255, 0.92));
}

:root[data-theme="femboys"] {
  --bg-0: #1d0f31;
  --bg-1: #261845;
  --bg-2: #1c3154;
  --surface-0: rgba(39, 23, 72, 0.82);
  --surface-1: rgba(28, 33, 75, 0.86);
  --surface-2: rgba(46, 20, 79, 0.9);
  --line-soft: rgba(255, 173, 214, 0.24);
  --line-strong: rgba(255, 173, 214, 0.5);
  --text-0: #fff4fb;
  --text-1: #ffd6eb;
  --text-2: #d7a9c2;
  --accent-cyan: #7dd3fc;
  --accent-lime: #f9a8d4;
  --accent-amber: #fda4af;
}

:root[data-theme="femboys"] body {
  background:
    radial-gradient(780px 520px at 22% 4%, rgba(249, 168, 212, 0.18), transparent 58%),
    radial-gradient(780px 520px at 92% 14%, rgba(125, 211, 252, 0.14), transparent 60%),
    linear-gradient(155deg, var(--bg-0), var(--bg-1) 42%, var(--bg-2));
}

:root[data-theme="cyber"] {
  --bg-0: #0a0a1f;
  --bg-1: #12002a;
  --bg-2: #1a0033;
  --accent-cyan: #00f0ff;
  --accent-lime: #39ff14;
  --accent-amber: #ff6ff2;
  --text-0: #ffffff;
  --text-1: #d9f7ff;
  --text-2: #8fd5e9;
  --font-display: "Space Grotesk", "Sora", sans-serif;
  --ease-ui: cubic-bezier(0.12, 0.86, 0.18, 1);
  --motion-fast: 120ms;
  --motion-med: 220ms;
  --motion-slow: 360ms;
  --radius-card: 12px;
  --btn-lift: -2px;
  --liquid-opacity: 0.22;
  --orb-opacity: 0.18;
  --orb-speed: 12s;
}

:root[data-theme="cyber"] body {
  background: linear-gradient(180deg, #0a0a1f, #1a0033);
}

.theme-fx-cyber::before {
  opacity: 0.35;
  background:
    linear-gradient(90deg, rgba(0, 240, 255, 0.10) 1px, transparent 1px),
    linear-gradient(rgba(57, 255, 20, 0.07) 1px, transparent 1px);
  background-size: 90px 90px;
  animation: cyberGrid 12s linear infinite;
  mix-blend-mode: screen;
}

.theme-fx-cyber::after {
  opacity: 0.22;
  background: radial-gradient(900px 540px at 70% 0%, rgba(0, 240, 255, 0.16), transparent 58%),
    radial-gradient(760px 560px at 20% 12%, rgba(57, 255, 20, 0.10), transparent 62%);
  filter: blur(0.2px);
}

@keyframes cyberGrid {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-60px, 40px, 0); }
}

:root[data-theme="cyber"].cyber-glitch .shell {
  animation: cyberGlitch 0.18s steps(2, end);
}

@keyframes cyberGlitch {
  0% { transform: translate3d(0, 0, 0); filter: hue-rotate(0deg) saturate(1); }
  40% { transform: translate3d(1px, -1px, 0); filter: hue-rotate(12deg) saturate(1.2); }
  70% { transform: translate3d(-1px, 1px, 0); filter: hue-rotate(-10deg) saturate(1.15); }
  100% { transform: translate3d(0, 0, 0); filter: hue-rotate(0deg) saturate(1); }
}

:root[data-theme="sakura"] {
  --bg-0: #fff0f5;
  --bg-1: #ffe4f0;
  --bg-2: #fff0f5;
  --accent-cyan: #ff9ed9;
  --accent-lime: #ffb3d1;
  --accent-amber: #ffcadc;
  --text-0: #4a1f3d;
  --text-1: #6a2a4f;
  --text-2: #8a4866;
  --font-display: "Sora", "Segoe UI", sans-serif;
  --ease-ui: cubic-bezier(0.2, 0.8, 0.2, 1);
  --motion-fast: 140ms;
  --motion-med: 260ms;
  --motion-slow: 420ms;
  --radius-card: 20px;
  --shadow-soft: 0 16px 40px rgba(175, 84, 130, 0.18);
  --btn-lift: -1px;
  --liquid-opacity: 0.18;
  --orb-opacity: 0.12;
  --orb-speed: 26s;
}

:root[data-theme="sakura"] body {
  background: radial-gradient(circle at 30% 20%, #ffe4f0 0%, #fff0f5 100%);
}

.theme-fx-sakura::before {
  opacity: 0.55;
  background:
    radial-gradient(rgba(255, 158, 217, 0.12) 1px, transparent 1px),
    radial-gradient(rgba(255, 179, 209, 0.10) 1px, transparent 1px);
  background-size: 140px 140px, 220px 220px;
  background-position: 0 0, 40px 60px;
  animation: sakuraDrift 14s ease-in-out infinite;
}

.theme-fx-sakura::after {
  opacity: 0.18;
  background: linear-gradient(180deg, rgba(255, 158, 217, 0.10), transparent 60%);
  mix-blend-mode: multiply;
}

@keyframes sakuraDrift {
  0% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(20px, -16px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

@keyframes sparkleFly {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-46px) scale(1.35); }
}

.sparkle-particle,
.pixel-particle,
.petal-particle {
  position: fixed;
  z-index: var(--layer-toast);
  pointer-events: none;
  animation: sparkleFly 0.9s ease-out forwards;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.18));
}

:root[data-theme="terminal"] .pixel-particle {
  color: var(--text-0);
  filter: drop-shadow(0 12px 20px rgba(0, 255, 102, 0.16));
}

:root[data-theme="black"] .sparkle-particle,
:root[data-theme="cyber"] .sparkle-particle {
  color: var(--accent-cyan);
  filter: drop-shadow(0 14px 22px rgba(0, 255, 255, 0.18));
}

:root[data-theme="sakura"] .petal-particle {
  color: rgba(255, 158, 217, 0.95);
  filter: drop-shadow(0 14px 22px rgba(255, 158, 217, 0.16));
}

:root[data-theme="femboy"] .petal-particle,
:root[data-theme="femboys"] .petal-particle {
  color: rgba(255, 105, 180, 0.95);
  filter: drop-shadow(0 14px 22px rgba(255, 105, 180, 0.16));
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text-0);
  font-family: var(--font-body);
  letter-spacing: 0.01em;
  background:
    radial-gradient(1050px 620px at 12% -12%, rgba(34, 209, 238, 0.14), transparent 52%),
    radial-gradient(720px 480px at 92% 2%, rgba(255, 194, 97, 0.12), transparent 50%),
    linear-gradient(155deg, var(--bg-0), var(--bg-1) 42%, var(--bg-2));
  overflow-x: hidden;
}

html,
body {
  scrollbar-width: thin;
  scrollbar-color: rgba(114, 166, 226, 0.72) rgba(10, 24, 45, 0.86);
}

*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

*::-webkit-scrollbar-track {
  background: rgba(10, 24, 45, 0.86);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(46, 147, 237, 0.88), rgba(79, 221, 243, 0.86));
  border: 2px solid rgba(10, 24, 45, 0.86);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(74, 170, 245, 0.95), rgba(117, 236, 255, 0.94));
}

.liquid-scene {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  filter: blur(12px);
  opacity: var(--liquid-opacity);
}

.orb {
  position: absolute;
  border-radius: var(--radius-pill);
  mix-blend-mode: normal;
  opacity: var(--orb-opacity);
  animation: orb-float var(--orb-speed) var(--orb-ease) infinite;
}

.orb-a {
  width: 440px;
  height: 440px;
  left: -70px;
  top: 12%;
  background: radial-gradient(circle at 30% 30%, rgba(34, 209, 238, 0.92), rgba(34, 209, 238, 0.12));
}

.orb-b {
  width: 360px;
  height: 360px;
  right: 6%;
  top: 4%;
  animation-delay: -4.5s;
  background: radial-gradient(circle at 60% 30%, rgba(255, 194, 97, 0.9), rgba(255, 194, 97, 0.08));
}

.orb-c {
  width: 380px;
  height: 380px;
  right: 30%;
  bottom: -70px;
  animation-delay: -8.2s;
  background: radial-gradient(circle at 50% 50%, rgba(129, 244, 149, 0.7), rgba(129, 244, 149, 0.05));
}

:root[data-theme="cyber"] .orb-a {
  background: radial-gradient(circle at 30% 30%, rgba(0, 240, 255, 0.9), rgba(0, 240, 255, 0.08));
}

:root[data-theme="cyber"] .orb-b {
  background: radial-gradient(circle at 60% 30%, rgba(57, 255, 20, 0.78), rgba(57, 255, 20, 0.06));
}

:root[data-theme="cyber"] .orb-c {
  background: radial-gradient(circle at 50% 50%, rgba(0, 240, 255, 0.55), rgba(57, 255, 20, 0.04));
}

:root[data-theme="sakura"] .orb-a {
  background: radial-gradient(circle at 30% 30%, rgba(255, 158, 217, 0.55), rgba(255, 158, 217, 0.06));
}

:root[data-theme="sakura"] .orb-b {
  background: radial-gradient(circle at 60% 30%, rgba(255, 179, 209, 0.5), rgba(255, 179, 209, 0.05));
}

:root[data-theme="sakura"] .orb-c {
  background: radial-gradient(circle at 50% 50%, rgba(255, 158, 217, 0.38), rgba(255, 179, 209, 0.04));
}

@keyframes orb-float {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(18px, -24px, 0) scale(1.1);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.06;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 0.8px, transparent 0.8px);
  background-size: 4px 4px;
}

:root[data-theme="femboys"] body {
  background:
    linear-gradient(165deg, rgba(18, 11, 34, 0.7), rgba(19, 35, 66, 0.72)),
    image-set(
      url("/static/img/femboys-wallpaper.jpg") 1x,
      url("/static/img/femboys-wallpaper@2x.jpg") 2x
    ) center/cover fixed no-repeat,
    linear-gradient(155deg, var(--bg-0), var(--bg-1) 42%, var(--bg-2));
}

:root[data-theme="light"] body::before {
  opacity: 0.08;
}

:root[data-theme="light"] html,
:root[data-theme="light"] body {
  scrollbar-color: rgba(71, 128, 202, 0.78) rgba(230, 240, 255, 0.96);
}

:root[data-theme="light"] *::-webkit-scrollbar-track {
  background: rgba(230, 240, 255, 0.96);
}

:root[data-theme="light"] *::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(40, 108, 194, 0.98), rgba(20, 156, 206, 0.94));
  border-color: rgba(230, 240, 255, 0.96);
}

:root[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, rgba(233, 241, 255, 0.98), rgba(224, 235, 252, 0.94));
}

:root[data-theme="light"] .brand,
:root[data-theme="light"] .topbar h1 {
  color: #12305a;
}

:root[data-theme="light"] .nav-btn {
  background: rgba(237, 245, 255, 0.9);
  color: #1d3f6a;
}

:root[data-theme="light"] .btn,
:root[data-theme="light"] input:not([type="checkbox"]),
:root[data-theme="light"] select {
  background: rgba(243, 248, 255, 0.95);
}

:root[data-theme="light"] .styled-select-trigger {
  background: rgba(243, 248, 255, 0.95);
  color: #17385f;
}

:root[data-theme="light"] .styled-select-trigger::after {
  border-right-color: rgba(24, 60, 106, 0.9);
  border-bottom-color: rgba(24, 60, 106, 0.9);
}

:root[data-theme="light"] .styled-select-menu {
  background: linear-gradient(165deg, rgba(246, 250, 255, 0.99), rgba(232, 241, 255, 0.98));
  border-color: rgba(94, 124, 176, 0.34);
}

:root[data-theme="light"] .styled-select-item {
  color: #183b67;
}

:root[data-theme="light"] .styled-select-item:hover,
:root[data-theme="light"] .styled-select-item.active {
  background: rgba(55, 128, 214, 0.22);
}

:root[data-theme="light"] .styled-select-native {
  background: rgba(243, 248, 255, 0.95);
  color: #17385f;
}

:root[data-theme="light"] .filters select {
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(24, 60, 106, 0.9) 50%),
    linear-gradient(135deg, rgba(24, 60, 106, 0.9) 50%, transparent 50%);
}

:root[data-theme="light"] .filters select option {
  color: #17385f;
  background: #edf5ff;
}

:root[data-theme="light"] thead th {
  background: rgba(225, 237, 255, 0.96);
}

:root[data-theme="light"] .table-wrap,
:root[data-theme="light"] .card,
:root[data-theme="light"] .admin-card,
:root[data-theme="light"] .media-card,
:root[data-theme="light"] .cookie-dock,
:root[data-theme="light"] .modal-shell {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.94));
}

:root[data-theme="light"] .brand,
:root[data-theme="light"] .topbar h1,
:root[data-theme="light"] .section-title,
:root[data-theme="light"] .user-card .id,
:root[data-theme="light"] .media-head .id {
  color: #12345f;
}

:root[data-theme="light"] .nav-btn:hover,
:root[data-theme="light"] .btn:hover:not(:disabled) {
  color: #163a67;
  background: rgba(213, 230, 252, 0.96);
}

:root[data-theme="light"] .brand::after,
:root[data-theme="light"] .kpi .label,
:root[data-theme="light"] .activity-item .time,
:root[data-theme="light"] .media-head .meta,
:root[data-theme="light"] .cookie-text {
  color: #5f7ea8;
}

:root[data-theme="light"] .btn.primary,
:root[data-theme="light"] .nav-btn.active,
:root[data-theme="light"] .mobile-nav-btn.active {
  color: #ffffff;
}

:root[data-theme="light"] .tag-chip {
  background: rgba(229, 238, 252, 0.95);
  color: #24456f;
  border-color: rgba(94, 124, 176, 0.38);
}

:root[data-theme="light"] .media-badge {
  background: rgba(239, 246, 255, 0.92);
  color: #1f3f69;
  border-color: rgba(94, 124, 176, 0.35);
}

:root[data-theme="light"] .history-card,
:root[data-theme="light"] .activity-item,
:root[data-theme="light"] .kpi {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.98), rgba(238, 246, 255, 0.95));
  border-color: rgba(94, 124, 176, 0.26);
}

:root[data-theme="light"] .bulk-toolbar {
  background: rgba(234, 243, 255, 0.96);
  border-color: rgba(94, 124, 176, 0.3);
}

:root[data-theme="light"] .bulk-count {
  color: #153a65;
}

:root[data-theme="light"] .chat-feed,
:root[data-theme="light"] .chat-msg,
:root[data-theme="light"] .media-preview {
  background: rgba(233, 242, 254, 0.86);
  border-color: rgba(94, 124, 176, 0.26);
}

:root[data-theme="light"] .autocomplete-menu {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(241, 247, 255, 0.96));
}

:root[data-theme="light"] .autocomplete-item {
  color: #17375f;
}

:root[data-theme="light"] .autocomplete-item:hover,
:root[data-theme="light"] .autocomplete-item.active {
  background: rgba(182, 210, 248, 0.5);
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 288px 1fr;
  position: relative;
  z-index: var(--layer-base);
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: var(--layer-loader);
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 20% 15%, rgba(34, 209, 238, 0.09), rgba(4, 9, 20, 0.95) 58%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  pointer-events: none;
}

.page-loader.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.loader-glass {
  width: min(420px, 86vw);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(123, 163, 209, 0.42);
  background: linear-gradient(145deg, rgba(8, 24, 47, 0.92), rgba(14, 35, 62, 0.86));
  padding: 18px;
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(14px);
}

.loader-ring {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 3px solid rgba(132, 181, 238, 0.28);
  border-top-color: var(--accent-cyan);
  animation: loader-spin 0.9s linear infinite;
}

.loader-line {
  margin-top: 14px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(34, 209, 238, 0.2), rgba(34, 209, 238, 0.95), rgba(129, 244, 149, 0.2));
  background-size: 170% 100%;
  animation: line-run 1s linear infinite;
}

.loader-text {
  margin-top: 10px;
  color: #d7eaff;
  font-size: 0.86rem;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  border-right: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(6, 16, 31, 0.98), rgba(8, 21, 40, 0.94));
  backdrop-filter: blur(12px);
  z-index: var(--layer-sidebar);
}

.sidebar-close {
  display: none;
}

.mobile-menu-toggle,
.sidebar-backdrop {
  display: none;
}

.theme-switcher {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: var(--layer-theme);
}

.theme-switcher.hidden,
.chat-root.hidden {
  display: none;
}

.theme-toggle {
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(10, 29, 53, 0.9);
  color: var(--text-0);
  font: 700 0.82rem var(--font-body);
  padding: 9px 12px;
  box-shadow: var(--shadow-soft);
}

.theme-menu {
  margin-top: 8px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(9, 25, 48, 0.94);
  padding: 8px;
  display: grid;
  gap: 6px;
}

.theme-option {
  text-align: left;
  border-radius: 10px;
  border: 1px solid rgba(123, 163, 209, 0.26);
  background: rgba(17, 39, 68, 0.72);
  color: var(--text-0);
  font: 600 0.82rem var(--font-body);
  padding: 7px 9px;
}

.theme-option.active {
  border-color: rgba(34, 209, 238, 0.6);
}

.theme-menu-sep {
  height: 1px;
  background: rgba(123, 163, 209, 0.22);
  margin: 4px 0 6px;
}

.sound-toggle {
  margin-top: 6px;
  text-align: left;
  border-radius: 10px;
  border: 1px solid rgba(123, 163, 209, 0.26);
  background: rgba(17, 39, 68, 0.72);
  color: var(--text-0);
  font: 600 0.82rem var(--font-body);
  padding: 7px 9px;
  font-size: 0.78rem;
  opacity: 0.85;
}

.sound-toggle:hover {
  opacity: 1;
}

.custom-theme-panel {
  border: 1px solid rgba(123, 163, 209, 0.22);
  background: rgba(10, 29, 53, 0.72);
  border-radius: 12px;
  padding: 8px;
  display: grid;
  gap: 6px;
}

.custom-theme-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 8px;
  color: var(--text-1);
  font: 600 0.78rem var(--font-body);
}

.custom-theme-row input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(123, 163, 209, 0.26);
  background: rgba(17, 39, 68, 0.72);
  color: var(--text-0);
  padding: 7px 9px;
  font: 600 0.82rem var(--font-body);
}

.custom-theme-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 6px;
}

.mobile-bottom-nav {
  display: none;
}

.mobile-bottom-nav.hidden {
  display: none !important;
}

.chat-root {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: var(--layer-chat);
}

.chat-fab {
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: linear-gradient(135deg, rgba(12, 36, 66, 0.96), rgba(29, 82, 132, 0.9));
  color: var(--text-0);
  font: 700 0.84rem var(--font-body);
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-soft);
  animation: chat-pulse 2.4s ease-in-out infinite;
}

.chat-fab-badge {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  background: linear-gradient(130deg, var(--accent-cyan), var(--accent-lime));
  color: #06101f;
}

.chat-mini {
  width: min(400px, calc(100vw - 20px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  height: min(560px, calc(100vh - 30px));
  border-radius: var(--radius-card);
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 94%, var(--accent-cyan) 6%) 0 56px, var(--surface-1) 56px 100%);
  box-shadow: var(--shadow-soft);
  padding: 10px;
  display: grid;
  grid-template-rows: auto auto minmax(180px, 1fr) auto auto;
  gap: 8px;
  animation: chat-rise 0.22s ease;
}

.chat-mini-header,
.chat-full-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-0);
}

.chat-mini-header {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 88%, var(--accent-cyan) 12%), color-mix(in srgb, var(--surface-2) 92%, var(--accent-cyan) 8%));
  border-radius: 12px;
  padding: 8px 10px;
}

.chat-full-header {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 86%, var(--accent-cyan) 14%), color-mix(in srgb, var(--surface-2) 92%, var(--accent-cyan) 8%));
  border-radius: 12px;
  padding: 10px 12px;
}

.chat-mini-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chat-mini-actions .btn {
  width: auto;
  min-height: 34px;
  padding: 6px 10px;
}

.chat-mini-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.chat-mini-toolbar select,
.chat-mini input,
.chat-full-main input,
.chat-full-main select {
  background: color-mix(in srgb, var(--surface-1) 90%, white 10%);
  color: var(--text-0);
  border-color: var(--line-soft);
}

.chat-full-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--layer-modal);
  background: rgba(8, 22, 40, 0.5);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 18px;
}

.chat-full {
  width: min(1180px, calc(100vw - 36px));
  height: min(840px, calc(100vh - 36px));
  border-radius: var(--radius-xl);
  border: 1px solid var(--line-soft);
  background: var(--surface-0);
  box-shadow: 0 24px 60px rgba(4, 14, 26, 0.45);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 12px;
  gap: 10px;
}

.chat-full-title {
  display: grid;
  gap: 2px;
}

.chat-full-title strong {
  color: var(--text-0);
}

.chat-full-header .meta,
.chat-mini-header .meta,
.chat-full-title .meta {
  color: var(--text-1);
}

.chat-full-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(115, 146, 176, 0.34);
}

.chat-full-sidebar {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-1) 92%, white 8%), color-mix(in srgb, var(--surface-0) 94%, var(--accent-cyan) 6%));
  padding: 10px;
  overflow: auto;
  display: grid;
  gap: 7px;
}

.chat-conv-item {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--surface-1) 92%, white 8%);
  color: var(--text-0);
  font: 600 0.83rem var(--font-body);
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  cursor: pointer;
  text-align: left;
}

.chat-conv-item.active {
  border-color: color-mix(in srgb, var(--accent-cyan) 55%, var(--line-soft) 45%);
  background: color-mix(in srgb, var(--accent-cyan) 18%, var(--surface-1) 82%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-cyan) 44%, transparent);
}

.chat-conv-unread {
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  background: rgba(34, 209, 238, 0.24);
  color: var(--text-0);
  border: 1px solid rgba(34, 209, 238, 0.4);
}

.chat-full-main {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(160px, 1fr) auto auto;
  gap: 8px;
  background: color-mix(in srgb, var(--surface-0) 94%, var(--accent-cyan) 6%);
  padding: 10px;
}

.chat-feed {
  border-radius: var(--radius-md);
  border: 1px solid var(--line-soft);
  background:
    radial-gradient(circle at 20% 18%, color-mix(in srgb, var(--line-soft) 40%, transparent) 0 2px, transparent 2px),
    radial-gradient(circle at 70% 42%, color-mix(in srgb, var(--line-soft) 36%, transparent) 0 2px, transparent 2px),
    radial-gradient(circle at 40% 75%, color-mix(in srgb, var(--line-soft) 30%, transparent) 0 2px, transparent 2px),
    linear-gradient(180deg, color-mix(in srgb, var(--surface-1) 90%, white 10%), color-mix(in srgb, var(--surface-0) 92%, var(--accent-cyan) 8%));
  background-size: 120px 120px, 140px 140px, 160px 160px, 100% 100%;
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-x: hidden;
}

.chat-mini .chat-feed {
  max-height: none;
}

.chat-full-main .chat-feed {
  max-height: none;
}

.chat-msg {
  max-width: min(78%, 680px);
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--surface-1) 90%, white 10%);
  color: var(--text-0);
  padding: 8px 10px;
  display: grid;
  gap: 3px;
  animation: chat-msg-in 0.2s ease;
  align-self: flex-start;
}

.chat-msg.mine {
  align-self: flex-end;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent-lime) 24%, var(--surface-1) 76%), color-mix(in srgb, var(--accent-lime) 15%, var(--surface-1) 85%));
  border-color: color-mix(in srgb, var(--accent-lime) 44%, var(--line-soft) 56%);
}

.chat-msg-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.chat-msg-author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.chat-msg-avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--surface-1) 90%, white 10%);
}

.chat-msg-avatar.placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 700 0.7rem var(--font-body);
  color: var(--text-0);
}

.chat-msg.pending {
  opacity: 0.72;
  border-style: dashed;
}

.chat-msg small {
  color: var(--text-2);
  font-size: 0.7rem;
}

.chat-img {
  width: min(220px, 100%);
  max-height: 160px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(123, 163, 209, 0.3);
}

.chat-file {
  color: var(--accent-cyan);
  text-decoration: none;
  font-size: 0.82rem;
}

.chat-compose {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 8px;
}

.chat-composer-wrap {
  display: grid;
  gap: 8px;
}

.chat-reply-bar,
.chat-edit-bar {
  border: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--surface-1) 92%, white 8%);
  border-radius: 10px;
  padding: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  color: var(--text-0);
}

.chat-edit-bar {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.chat-reply-preview {
  border-left: 3px solid color-mix(in srgb, var(--accent-cyan) 66%, var(--line-soft) 34%);
  background: color-mix(in srgb, var(--surface-1) 84%, var(--accent-cyan) 16%);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 0.78rem;
  color: var(--text-1);
}

.chat-upload {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
  background: rgba(17, 39, 68, 0.7);
  color: var(--text-0);
  padding: 8px 10px;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.chat-media-btn {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.chat-audio-btn {
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface-1) 88%, white 12%);
  color: var(--text-0);
  padding: 6px 8px;
  font: 600 0.8rem var(--font-body);
}

.chat-upload input {
  display: none;
}

.chat-attachment {
  color: var(--text-2);
  font-size: 0.76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-msg-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  opacity: 0.12;
  transform: translateY(2px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.chat-msg:hover .chat-msg-actions,
.chat-msg:focus-within .chat-msg-actions {
  opacity: 1;
  transform: translateY(0);
}

.chat-msg-actions .btn {
  width: auto;
  min-height: 28px;
  padding: 4px 8px;
  font-size: 0.74rem;
}

.chat-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-reaction-chip {
  border: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--surface-1) 90%, white 10%);
  color: var(--text-0);
  border-radius: 999px;
  padding: 3px 8px;
  font: 600 0.74rem var(--font-body);
}

.chat-reaction-pick {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chat-reaction-pick .btn {
  width: auto;
  min-height: 30px;
  padding: 4px 8px;
}

.chat-media-modal {
  width: min(880px, 96vw);
}

.chat-side-title {
  color: var(--text-1);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chat-side-block {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-1) 90%, white 10%);
  padding: 8px;
  display: grid;
  gap: 8px;
}

.chat-side-list {
  display: grid;
  gap: 6px;
  max-height: 140px;
  overflow: auto;
}

.chat-search-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.chat-member-row {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-1) 92%, white 8%);
  padding: 8px;
  display: grid;
  gap: 8px;
}

.chat-member-meta {
  color: var(--text-0);
  font-size: 0.79rem;
}

.chat-member-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chat-member-actions .btn {
  width: auto;
  min-height: 28px;
  padding: 4px 8px;
  font-size: 0.72rem;
}

.chat-side-item {
  border-radius: 9px;
  border: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--surface-1) 94%, white 6%);
  color: var(--text-0);
  font: 600 0.8rem var(--font-body);
  padding: 6px 8px;
  text-align: left;
  cursor: pointer;
  width: 100%;
}

.chat-invite-row {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-1) 92%, white 8%);
  padding: 8px;
  display: grid;
  gap: 8px;
}

.chat-invite-meta {
  display: grid;
  gap: 2px;
}

.chat-invite-meta strong {
  color: var(--text-0);
  font-size: 0.82rem;
}

.chat-invite-meta small {
  color: var(--text-2);
  font-size: 0.72rem;
}

.chat-invite-actions {
  display: flex;
  gap: 6px;
}

.chat-invite-actions .btn {
  width: auto;
  min-height: 28px;
  padding: 4px 8px;
  font-size: 0.72rem;
}

.chat-profile-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.chat-profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--surface-1) 90%, white 10%);
}

.chat-profile-avatar.placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 700 1.1rem var(--font-body);
  color: var(--text-0);
}

.chat-conv-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.chat-conv-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--line-soft);
}

.chat-conv-avatar.placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 700 0.72rem var(--font-body);
  color: var(--text-0);
  background: color-mix(in srgb, var(--surface-1) 90%, white 10%);
}

.chat-conv-title {
  display: inline-block;
  min-width: 0;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-typing {
  align-self: flex-start;
  border-radius: 10px;
  border: 1px dashed var(--line-soft);
  color: var(--text-2);
  background: color-mix(in srgb, var(--surface-1) 86%, transparent);
  padding: 6px 8px;
  font-size: 0.76rem;
}

.chat-context-menu {
  position: fixed;
  z-index: calc(var(--layer-modal) + 20);
  min-width: 170px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--surface-1) 95%, black 5%);
  box-shadow: var(--shadow-soft);
  padding: 6px;
  display: grid;
  gap: 4px;
}

.chat-context-item {
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--surface-1) 90%, white 10%);
  color: var(--text-0);
  text-align: left;
  font: 600 0.78rem var(--font-body);
  padding: 6px 8px;
}

.chat-context-item.danger {
  border-color: color-mix(in srgb, var(--danger) 50%, var(--line-soft) 50%);
  color: color-mix(in srgb, var(--danger) 70%, var(--text-0) 30%);
}

.chat-root.from-fab .chat-mini,
.chat-mini.from-fab {
  animation: chat-pop-in 0.24s ease both;
}

.chat-root.to-fab .chat-mini,
.chat-mini.to-fab {
  animation: chat-pop-out 0.2s ease both;
}

.chat-root.mini-to-full .chat-full,
.chat-full.mini-to-full {
  animation: chat-expand-in 0.26s ease both;
}

.chat-root.full-to-mini .chat-full,
.chat-full.full-to-mini {
  animation: chat-expand-out 0.22s ease both;
}

@keyframes chat-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 209, 238, 0.34);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(34, 209, 238, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 209, 238, 0);
  }
}

@keyframes chat-rise {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes chat-msg-in {
  from {
    opacity: 0;
    transform: translateX(6px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes chat-pop-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes chat-pop-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.9);
  }
}

@keyframes chat-expand-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes chat-expand-out {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.94) translateY(8px);
  }
}

@keyframes chat-sheen {
  0% {
    transform: rotate(18deg) translateX(-180%);
  }
  60%,
  100% {
    transform: rotate(18deg) translateX(320%);
  }
}

.brand {
  margin: 8px 10px 18px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: #ffffff;
}

.brand::after {
  content: "Realtime Ops";
  display: block;
  margin-top: 6px;
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-btn {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: rgba(18, 36, 64, 0.56);
  color: var(--text-1);
  padding: 11px 12px;
  margin: 0 0 8px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.nav-btn:hover {
  color: #ffffff;
  border-color: var(--line-strong);
  background: rgba(34, 62, 98, 0.9);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(21, 50, 84, 0.36);
}

.nav-btn.active {
  color: #06101f;
  font-weight: 800;
  border-color: transparent;
  background: linear-gradient(130deg, var(--accent-cyan), var(--accent-lime));
  box-shadow: 0 14px 28px rgba(29, 196, 220, 0.32);
}

.sidebar .meta {
  margin: 10px 10px 0;
  color: var(--text-1);
  font-size: 0.84rem;
}

.sidebar form {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.main {
  padding: 28px 24px 32px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
}

:root[data-theme="light"] .main {
  background: linear-gradient(180deg, rgba(232, 242, 255, 0.58), rgba(238, 246, 255, 0.24));
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.topbar h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.3rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: #ffffff;
}

.topbar h1::after {
  content: "";
  display: block;
  width: 38px;
  height: 2px;
  margin-top: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-amber));
  opacity: 0.45;
}

.actions,
.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.saved-views {
  margin: 0 0 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.saved-view-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.saved-view-remove {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 1px solid rgba(123, 163, 209, 0.34);
  background: rgba(14, 34, 63, 0.84);
  color: var(--text-0);
  cursor: pointer;
}

.btn,
input:not([type="checkbox"]),
select {
  border-radius: var(--radius-md);
  border: 1px solid var(--line-soft);
  background: rgba(19, 39, 70, 0.72);
  color: var(--text-0);
  padding: 9px 12px;
  font: 600 0.93rem var(--font-body);
  transition: 0.2s ease;
}

input:not([type="checkbox"]),
select {
  min-height: 40px;
}

.filters select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 34px;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(215, 234, 255, 0.95) 50%),
    linear-gradient(135deg, rgba(215, 234, 255, 0.95) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 11px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.filters select option {
  color: #e9f6ff;
  background: #15345a;
}

input:not([type="checkbox"])::placeholder {
  color: var(--text-2);
}

.date-field {
  min-width: 140px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

input:not([type="checkbox"]):focus,
select:focus,
.btn:focus-visible {
  outline: 2px solid rgba(34, 209, 238, 0.45);
  outline-offset: 1px;
  border-color: rgba(34, 209, 238, 0.7);
}

.btn {
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform var(--motion-fast) var(--ease-ui),
    box-shadow var(--motion-fast) var(--ease-ui),
    background var(--motion-fast) var(--ease-ui),
    border-color var(--motion-fast) var(--ease-ui),
    color var(--motion-fast) var(--ease-ui);
}

.btn:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: rgba(27, 56, 93, 0.96);
  color: #ffffff;
  transform: translateY(var(--btn-lift));
  box-shadow: 0 8px 18px rgba(11, 30, 54, 0.36);
}

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.btn.primary {
  color: #06101f;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-lime));
}

.btn.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #39def9, #a4f8b2);
}

.btn.warn {
  color: #241100;
  border-color: rgba(255, 194, 97, 0.62);
  background: linear-gradient(135deg, rgba(255, 194, 97, 0.96), rgba(255, 171, 70, 0.92));
}

.btn.danger {
  color: #ffd7db;
  border-color: rgba(255, 111, 122, 0.48);
  background: linear-gradient(135deg, rgba(120, 28, 42, 0.62), rgba(104, 22, 35, 0.52));
}

.card,
.table-wrap,
.list-card,
.admin-card,
.user-card,
.auth-card-react,
.cookie-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
  background: linear-gradient(160deg, var(--surface-0), var(--surface-1));
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(var(--card-blur));
  position: relative;
  overflow: hidden;
  background-size: 100% 100%;
  animation: none;
}

.card:hover,
.admin-card:hover,
.user-card:hover {
  border-color: var(--line-soft);
  box-shadow: var(--shadow-soft);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi {
  padding: 14px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.kpi:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: 0 8px 20px rgba(8, 24, 44, 0.24);
}

.kpi:focus-within {
  border-color: rgba(34, 209, 238, 0.58);
}

.kpi::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-cyan), transparent);
  opacity: 0.54;
}

.kpi:nth-child(2)::before {
  background: linear-gradient(90deg, var(--accent-amber), transparent);
}

.kpi:nth-child(3)::before {
  background: linear-gradient(90deg, #9fceff, transparent);
}

.kpi:nth-child(4)::before {
  background: linear-gradient(90deg, var(--accent-lime), transparent);
}

.kpi .label {
  color: var(--text-2);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.kpi .value {
  display: block;
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.7vw, 1.85rem);
  font-weight: 800;
  line-height: 1.2;
}

.filters {
  position: sticky;
  top: var(--filters-sticky-top);
  z-index: var(--layer-sticky);
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-soft);
  background: rgba(9, 24, 46, 0.8);
  backdrop-filter: blur(10px);
}

.autocomplete {
  position: relative;
  min-width: min(320px, 100%);
  flex: 1 1 260px;
}

.autocomplete input {
  width: 100%;
}

.autocomplete-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: var(--layer-popover);
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: linear-gradient(145deg, rgba(8, 24, 47, 0.98), rgba(14, 35, 62, 0.96));
  box-shadow: var(--shadow-soft);
  max-height: 220px;
  overflow: auto;
  padding: 4px;
  animation: chat-rise 0.16s ease;
}

.autocomplete-item {
  width: 100%;
  text-align: left;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-0);
  font: 600 0.86rem var(--font-body);
  padding: 8px 10px;
  cursor: pointer;
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background: rgba(35, 78, 126, 0.4);
}

.styled-select {
  position: relative;
  min-width: 152px;
}

.styled-select-native {
  width: 100%;
  min-height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-soft);
  background: rgba(19, 39, 70, 0.72);
  color: var(--text-0);
  padding: 9px 34px 9px 12px;
  font: 700 0.92rem var(--font-body);
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(220, 239, 255, 0.9) 50%),
    linear-gradient(135deg, rgba(220, 239, 255, 0.9) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 16px,
    calc(100% - 10px) 16px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.styled-select-trigger {
  width: 100%;
  min-height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-soft);
  background: rgba(19, 39, 70, 0.72);
  color: var(--text-0);
  padding: 9px 34px 9px 12px;
  font: 700 0.92rem var(--font-body);
  text-align: left;
  cursor: pointer;
  position: relative;
}

.styled-select-trigger::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(220, 239, 255, 0.9);
  border-bottom: 2px solid rgba(220, 239, 255, 0.9);
  transform: translateY(-60%) rotate(45deg);
}

.styled-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: var(--layer-popover);
  border-radius: 12px;
  border: 1px solid rgba(123, 163, 209, 0.34);
  background: linear-gradient(165deg, rgba(11, 28, 52, 0.98), rgba(16, 38, 67, 0.96));
  box-shadow: var(--shadow-soft);
  max-height: 280px;
  overflow: auto;
  padding: 4px;
}

.styled-select-item {
  width: 100%;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-0);
  text-align: left;
  padding: 8px 9px;
  font: 700 0.9rem var(--font-body);
  cursor: pointer;
}

.styled-select-item:hover,
.styled-select-item.active {
  background: rgba(36, 101, 180, 0.72);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 12px;
}

.table-wrap {
  overflow: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  z-index: var(--layer-base);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  position: sticky;
  top: var(--table-head-top);
  z-index: var(--layer-table-head);
  background: rgba(15, 35, 64, 0.96);
}

.user-details-page {
  --table-head-top: var(--filters-sticky-top);
}

.user-details-page .table-wrap table {
  min-width: 640px;
}

.user-details-page .table-wrap th,
.user-details-page .table-wrap td {
  white-space: nowrap;
}

th,
td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid rgba(123, 163, 209, 0.16);
  vertical-align: middle;
}

.sel-col {
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  padding-left: 10px;
  padding-right: 6px;
}

.sel-col input[type="checkbox"],
.card-select input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  min-height: 0;
  padding: 0;
  margin: 0;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(123, 163, 209, 0.48);
  background: rgba(9, 24, 46, 0.82);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(9, 24, 46, 0.28);
}

.sel-col input[type="checkbox"]::before,
.card-select input[type="checkbox"]::before {
  content: "";
  width: 10px;
  height: 10px;
  transform: scale(0);
  transition: transform 0.14s ease;
  clip-path: polygon(14% 52%, 0 66%, 40% 100%, 100% 24%, 86% 10%, 40% 70%);
  background: #041326;
}

.sel-col input[type="checkbox"]:checked,
.card-select input[type="checkbox"]:checked {
  border-color: rgba(34, 209, 238, 0.82);
  background: linear-gradient(135deg, var(--accent-cyan), #78f2ff);
}

.sel-col input[type="checkbox"]:checked::before,
.card-select input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.sel-col input[type="checkbox"]:focus-visible,
.card-select input[type="checkbox"]:focus-visible {
  outline: 2px solid rgba(34, 209, 238, 0.5);
  outline-offset: 1px;
}

th {
  color: var(--text-2);
  font-size: 0.81rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

tbody tr {
  transition: 0.16s ease;
}

tbody tr:nth-child(even) {
  background: rgba(21, 45, 78, 0.16);
}

tbody tr:nth-child(odd):hover {
  background: rgba(29, 55, 92, 0.26);
}

tbody tr:nth-child(even):hover {
  background: rgba(29, 55, 92, 0.32);
}

.inline-actions-cell {
  min-width: 290px;
}

.inline-actions {
  display: inline-flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  pointer-events: none;
}

tbody tr:hover .inline-actions,
tbody tr:focus-within .inline-actions {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.users-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.bulk-toolbar {
  margin: 0 0 10px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(123, 163, 209, 0.28);
  background: rgba(9, 24, 46, 0.84);
  backdrop-filter: blur(9px);
  padding: 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bulk-count {
  font: 700 0.84rem var(--font-display);
  letter-spacing: 0.04em;
  color: #dff1ff;
  text-transform: uppercase;
  margin-right: 2px;
}

.user-details-bulk {
  position: sticky;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 10px 18px;
  box-shadow: var(--shadow-strong);
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: min(520px, calc(100vw - 24px));
  width: fit-content;
  margin: 0 auto 10px;
}

.bulk-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(123, 163, 209, 0.28);
  background: rgba(17, 39, 68, 0.6);
  color: #e7f5ff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.status-badge.active {
  border-color: rgba(57, 217, 138, 0.52);
  background: rgba(22, 96, 63, 0.45);
  color: #d2ffe6;
}

.status-badge.idle {
  border-color: rgba(255, 194, 97, 0.52);
  background: rgba(116, 74, 15, 0.4);
  color: #ffe7bf;
}

.status-badge.new {
  border-color: rgba(34, 209, 238, 0.54);
  background: rgba(12, 73, 103, 0.44);
  color: #d8f7ff;
}

.status-badge.flagged {
  border-color: rgba(255, 111, 122, 0.54);
  background: rgba(120, 31, 43, 0.45);
  color: #ffd9de;
}

.media-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  grid-auto-rows: 1fr;
  align-content: start;
  gap: 12px;
}

.media-card {
  border-radius: var(--radius-card);
  border: 1px solid var(--line-soft);
  background: linear-gradient(150deg, rgba(8, 21, 43, 0.86), rgba(15, 35, 63, 0.85));
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background-size: 100% 100%;
  animation: none;
}

.media-card-interactive:focus-visible {
  outline: 2px solid rgba(34, 209, 238, 0.62);
  outline-offset: 2px;
}

.liquid-card {
  position: relative;
}

.media-preview {
  aspect-ratio: 16 / 10;
  min-height: 0;
  max-height: none;
  background: linear-gradient(135deg, rgba(17, 41, 71, 0.95), rgba(11, 25, 48, 0.95));
  border-bottom: 1px solid rgba(123, 163, 209, 0.22);
  position: relative;
  overflow: hidden;
}

.media-video-thumb img {
  filter: saturate(1.05) contrast(1.02);
  object-fit: cover;
  pointer-events: none;
}

.media-video-thumb video {
  position: absolute;
  inset: 0;
  opacity: 1;
  transition: opacity 0.18s ease;
  pointer-events: none;
  object-fit: cover;
}

.media-video-thumb.playing::after {
  content: "\25B6";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.58);
  color: #ffffff;
  font-size: 48px;
  opacity: 0.92;
  pointer-events: none;
  z-index: 3;
  animation: previewPulse 1.6s infinite ease-in-out;
}

@media (hover: hover) and (pointer: fine) {
  .media-video-thumb:hover img {
    opacity: 0.2;
  }
}

.media-play-hint {
  position: absolute;
  left: 10px;
  bottom: 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(4, 15, 30, 0.62);
  color: #f0f8ff;
  font: 700 0.72rem var(--font-body);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 8px;
}

.media-preview img,
.media-preview video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.media-gif-loader {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  left: -9999px;
  top: -9999px;
}

.modal-video-preview video,
.modal-media-preview .media-preview video {
  opacity: 1;
  pointer-events: auto;
}

.video-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(6, 16, 31, 0.94);
  color: var(--accent-cyan);
  font-size: 0.83rem;
  font-weight: 600;
  letter-spacing: 0.6px;
  z-index: 4;
}

.media-audio {
  display: grid;
  place-items: center;
  padding: 14px;
}

.media-audio audio {
  width: 100%;
}

.media-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(5, 16, 32, 0.68);
  color: #e5f4ff;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.media-fallback {
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
}

.media-fallback-title {
  font-family: var(--font-display);
  font-weight: 700;
}

.media-fallback-sub {
  color: var(--text-2);
  font-size: 0.8rem;
}

.media-card-body {
  padding: 11px 12px 6px;
  min-height: 128px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.media-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.media-head .id {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.id.clickable,
.id-cell-button {
  cursor: pointer;
  user-select: none;
}

.id.clickable:hover,
.id-cell-button:hover {
  color: var(--accent-cyan);
}

.id.clickable:active,
.id-cell-button:active {
  transform: translateY(1px);
}

.id-cell-button {
  font-family: var(--font-display);
  font-weight: 700;
}

.media-head .meta {
  color: var(--text-1);
  font-size: 0.78rem;
}

.tags-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 72px;
  overflow: hidden;
}

.tag-chip {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
  padding: 4px 9px;
}

.tag-chip.muted {
  opacity: 0.84;
}

.media-foot {
  margin-top: auto;
  color: var(--text-1);
  font-size: 0.76rem;
}

.media-card .actions {
  padding: 0 12px 12px;
}

.empty-state {
  border: 1px dashed rgba(123, 163, 209, 0.34);
  border-radius: var(--radius-md);
  background: rgba(13, 31, 55, 0.52);
  color: var(--text-1);
  padding: 16px 14px;
  text-align: center;
}

.empty-title {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
}

.empty-sub {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 0.82rem;
}

.media-skeleton {
  pointer-events: none;
}

.kpi-skeleton {
  display: grid;
  gap: 10px;
  align-content: center;
}

.row-skeleton td .skeleton-line {
  height: 11px;
}

.media-skeleton .media-preview,
.media-skeleton .skeleton-line {
  position: relative;
  overflow: hidden;
  background: rgba(18, 42, 73, 0.48);
}

.media-skeleton .media-preview::before,
.media-skeleton .skeleton-line::before {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0));
  animation: skeleton-shimmer 1.15s ease-in-out infinite;
}

.skeleton-line {
  height: 10px;
  border-radius: var(--radius-sm);
}

.skeleton-line.w-35 {
  width: 35%;
}

.skeleton-line.w-45 {
  width: 45%;
}

.skeleton-line.w-55 {
  width: 55%;
}

.skeleton-line.w-60 {
  width: 60%;
}

.skeleton-line.w-90 {
  width: 90%;
}

.history-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.history-card {
  border-radius: var(--radius-card);
  border: 1px solid rgba(123, 163, 209, 0.26);
  background: linear-gradient(145deg, rgba(13, 31, 57, 0.86), rgba(17, 40, 68, 0.74));
  padding: 10px;
  position: relative;
}

.detail-card-select {
  position: absolute;
  top: 12px;
  left: 12px;
  right: auto;
  z-index: 10;
  opacity: 0.9;
}

.detail-card-select input:checked {
  accent-color: var(--accent-lime);
}

.history-card .id {
  font-family: var(--font-display);
  font-weight: 700;
}

.history-card .meta {
  margin: 8px 0 10px;
  color: var(--text-1);
  font-size: 0.85rem;
  line-height: 1.35;
}

.user-card {
  padding: 12px;
  position: relative;
}

.card-select {
  position: absolute;
  top: 10px;
  right: 10px;
}

.user-card .id {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.user-card .meta {
  margin: 8px 0 9px;
  color: var(--text-1);
  font-size: 0.86rem;
  line-height: 1.4;
}

.activity {
  padding: 12px;
  max-height: 70vh;
  overflow: auto;
}

.activity h3,
.section-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 1.04rem;
  font-weight: 700;
}

.activity-item {
  margin-bottom: 9px;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(123, 163, 209, 0.2);
  background: linear-gradient(140deg, rgba(14, 34, 63, 0.82), rgba(19, 43, 77, 0.62));
}

.activity-item .time {
  display: block;
  margin-bottom: 4px;
  color: var(--text-2);
  font-size: 0.75rem;
}

.activity-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.audit-filters {
  display: grid;
  gap: 8px;
  margin-bottom: 9px;
}

.audit-list {
  display: grid;
  gap: 8px;
}

.audit-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.audit-kind {
  color: var(--text-2);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.audit-payload {
  margin-top: 8px;
  border-radius: 10px;
  border: 1px solid rgba(123, 163, 209, 0.24);
  background: rgba(9, 24, 46, 0.66);
  color: #dff0ff;
  font: 600 0.74rem/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  padding: 8px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.pagination {
  margin-top: 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-1);
  font-size: 0.9rem;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 18, 0.38);
  backdrop-filter: blur(2px);
  z-index: var(--layer-modal);
}

.dashboard-drawer {
  position: fixed;
  right: 10px;
  top: 10px;
  width: min(400px, calc(100vw - 20px));
  max-height: calc(100dvh - 20px);
  overflow: auto;
  z-index: calc(var(--layer-modal) + 1);
  border-radius: var(--radius-xl);
  border: 1px solid var(--line-soft);
  background: linear-gradient(150deg, rgba(8, 24, 47, 0.96), rgba(14, 35, 62, 0.92));
  box-shadow: var(--shadow-strong);
  padding: 12px;
  display: grid;
  gap: 10px;
  animation: modal-rise 0.2s ease;
}

.drawer-skeleton {
  border-radius: 10px;
  padding: 8px;
  display: grid;
  gap: 8px;
}

.drawer-media-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.drawer-media-card {
  border: 1px solid rgba(123, 163, 209, 0.24);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(13, 31, 55, 0.64);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.drawer-media-card:hover {
  transform: translateY(-2px);
  border-color: rgba(123, 163, 209, 0.4);
  box-shadow: 0 12px 24px rgba(2, 12, 22, 0.42);
}

.drawer-media-card .media-preview {
  aspect-ratio: 16 / 10;
}

.drawer-media-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
}

.drawer-events {
  margin-top: 8px;
  position: relative;
}

.timeline-item {
  position: relative;
  padding-left: 20px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(34, 209, 238, 0.18);
}

.timeline-item::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 18px;
  width: 2px;
  height: calc(100% + 9px);
  background: linear-gradient(180deg, rgba(34, 209, 238, 0.52), rgba(34, 209, 238, 0.06));
}

.timeline-item:last-child::after {
  display: none;
}

.dashboard-drawer header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.drawer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.drawer-grid div {
  border-radius: var(--radius-sm);
  border: 1px solid rgba(123, 163, 209, 0.24);
  background: rgba(18, 42, 73, 0.48);
  padding: 8px;
  display: grid;
  gap: 4px;
}

.drawer-grid span {
  color: var(--text-2);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.drawer-grid strong {
  font-size: 1rem;
}

.drawer-actions {
  display: grid;
  gap: 7px;
}

.charts {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
}

.chart {
  padding: 12px;
}

.chart.wide {
  grid-column: 1 / -1;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.admin-card {
  padding: 13px;
}

.admin-role-preview {
  padding: 10px;
  margin-bottom: 10px;
  min-height: 74px;
}

.admin-template-row {
  margin-top: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: flex-start;
  row-gap: 8px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.switch {
  width: 48px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(123, 163, 209, 0.34);
  background: rgba(82, 109, 145, 0.35);
  cursor: pointer;
  position: relative;
  transition: 0.2s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f2f8ff;
  box-shadow: 0 4px 10px rgba(5, 15, 30, 0.45);
  transition: transform 0.2s ease;
}

.switch.on {
  border-color: rgba(57, 217, 138, 0.58);
  background: linear-gradient(130deg, rgba(57, 217, 138, 0.48), rgba(34, 209, 238, 0.4));
}

.switch.on::after {
  transform: translateX(21px);
}

.switch.disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

.notice {
  margin-bottom: 10px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 111, 122, 0.45);
  background: rgba(115, 25, 41, 0.52);
  color: #ffd7db;
  padding: 10px;
}

.notice-ok {
  border-color: rgba(57, 217, 138, 0.42);
  background: rgba(25, 99, 66, 0.48);
  color: #c9ffdf;
}

.auth-main {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 12px;
  padding: 16px;
}

.auth-stage {
  width: min(980px, 96vw);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 12px;
}

.auth-hero {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(123, 163, 209, 0.26);
  background:
    radial-gradient(460px 220px at 12% 0%, rgba(34, 209, 238, 0.22), transparent 62%),
    radial-gradient(480px 240px at 86% 100%, rgba(255, 194, 97, 0.2), transparent 60%),
    linear-gradient(150deg, rgba(8, 22, 44, 0.92), rgba(14, 33, 58, 0.84));
  padding: 24px;
  box-shadow: var(--shadow-soft);
}

.auth-hero h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  line-height: 1;
}

.auth-hero p {
  margin: 10px 0 0;
  color: var(--text-1);
  max-width: 32ch;
}

.hero-pills {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-pills span {
  border-radius: 999px;
  border: 1px solid rgba(123, 163, 209, 0.32);
  background: rgba(16, 39, 70, 0.7);
  padding: 6px 10px;
  font-size: 0.8rem;
}

.auth-card-react,
.cookie-card {
  width: min(500px, 96vw);
  padding: 18px;
}

.auth-card-react h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  line-height: 1.05;
}

.auth-card-react p {
  margin: 7px 0 12px;
  color: var(--text-2);
}

.auth-card-react form {
  display: grid;
  gap: 10px;
}

.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-1);
  font-size: 0.9rem;
}

.switch-link {
  margin-top: 10px;
}

.switch-link .btn {
  width: 100%;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
}

a.btn {
  text-decoration: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--layer-modal);
  background: radial-gradient(circle at 20% 20%, rgba(34, 209, 238, 0.12), rgba(0, 0, 0, 0.6) 55%);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  padding: 18px;
  animation: modal-fade 0.25s ease;
}

.modal-overlay.closing {
  animation: modal-fade-out 0.18s ease forwards;
}

.modal-shell {
  width: min(760px, 96vw);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(160, 206, 255, 0.34);
  background: linear-gradient(145deg, rgba(8, 24, 47, 0.94), rgba(14, 35, 62, 0.9));
  box-shadow: 0 34px 70px rgba(2, 8, 18, 0.7);
  padding: 18px;
  position: relative;
  overflow: hidden;
  background-size: 100% 100%;
  animation: none;
}

.modal-shell.closing {
  animation: modal-drop-out 0.18s ease forwards;
}

.glass-float {
  animation: modal-rise 0.26s ease;
}

.modal-glow {
  position: absolute;
  width: 220px;
  height: 220px;
  top: -80px;
  right: -70px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 209, 238, 0.36), rgba(34, 209, 238, 0));
  filter: blur(8px);
  pointer-events: none;
}

.modal-shell h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.modal-shell p {
  margin: 8px 0 0;
  color: var(--text-2);
}

.modal-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.modal-editor textarea {
  margin-top: 12px;
  width: 100%;
  min-height: 140px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: rgba(12, 30, 56, 0.8);
  color: #f2f8ff;
  resize: vertical;
  padding: 10px 12px;
  font: 600 0.92rem var(--font-body);
}

.modal-save {
  width: min(520px, 96vw);
}

.save-view-input {
  margin-top: 12px;
  width: 100%;
}

.tags-meta {
  margin-top: 8px;
  color: var(--text-2);
  font-size: 0.82rem;
}

.modal-media {
  width: min(920px, 96vw);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.modal-media-preview {
  margin-top: 14px;
  border-radius: 16px;
  overflow: hidden;
}

.modal-media-preview .media-preview {
  min-height: min(62vh, 560px);
  max-height: none;
  background: #050d1f;
  display: grid;
  place-items: center;
}

.modal-media-preview .media-preview img,
.modal-media-preview .media-preview video {
  width: 100%;
  height: min(62vh, 560px);
  object-fit: contain;
  background: #050d1f;
}

.modal-tags {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-height: 132px;
  overflow: auto;
  padding-right: 4px;
}

.toast-host {
  position: fixed;
  right: 14px;
  top: 14px;
  z-index: var(--layer-toast);
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 24px));
}

.command-overlay {
  position: fixed;
  inset: 0;
  z-index: calc(var(--layer-loader) - 1);
  background: rgba(2, 8, 18, 0.66);
  backdrop-filter: blur(7px);
  display: grid;
  place-items: start center;
  padding: 8vh 12px 16px;
}

.command-shell {
  width: min(920px, 96vw);
  max-height: min(78vh, 780px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
  background: linear-gradient(150deg, rgba(8, 24, 47, 0.96), rgba(14, 35, 62, 0.92));
  box-shadow: var(--shadow-strong);
  display: grid;
  grid-template-rows: auto auto minmax(180px, 1fr);
  overflow: hidden;
}

.user-details-section {
  transition: opacity 0.2s ease;
}

.user-details-section.loading {
  opacity: 0.92;
}

.user-details-section.loading .media-cards,
.user-details-section.loading .history-cards {
  opacity: 0.68;
  filter: saturate(0.4);
  transition: opacity 0.4s ease;
}

.user-details-section.loaded {
  animation: sectionAppear 0.48s ease forwards;
}

@keyframes sectionAppear {
  from {
    opacity: 0.35;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes previewPulse {
  0%,
  100% {
    opacity: 0.65;
  }
  50% {
    opacity: 0.98;
  }
}

.command-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid rgba(123, 163, 209, 0.2);
}

.command-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-2);
  font-size: 0.8rem;
  padding: 0 12px 10px;
}

.command-recents {
  border: 1px solid rgba(123, 163, 209, 0.2);
  border-radius: 12px;
  padding: 8px 10px;
  display: grid;
  gap: 8px;
}

.recent-row {
  display: grid;
  gap: 6px;
}

.recent-label {
  color: var(--text-2);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.recent-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.command-list {
  overflow: auto;
  padding: 0 12px 12px;
  display: grid;
  gap: 8px;
}

.command-item {
  border: 1px solid rgba(123, 163, 209, 0.2);
  border-radius: var(--radius-md);
  background: rgba(15, 35, 64, 0.58);
  padding: 9px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.command-item.active {
  border-color: rgba(34, 209, 238, 0.64);
  box-shadow: 0 0 0 1px rgba(34, 209, 238, 0.36) inset;
}

.command-main {
  text-align: left;
  border: none;
  background: transparent;
  color: inherit;
  display: grid;
  gap: 4px;
  cursor: pointer;
}

.command-main.media-command {
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.command-main:not(.media-command) {
  grid-template-columns: minmax(0, 1fr);
}

.command-content {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.command-media-preview {
  width: 68px;
  height: 52px;
  border-radius: 10px;
  border: 1px solid rgba(123, 163, 209, 0.28);
  background: rgba(9, 24, 46, 0.7);
  overflow: hidden;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  position: relative;
}

.command-media-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.command-media-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.command-media-preview.failed::after {
  content: "MEDIA";
  color: var(--text-2);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
}

.command-kind {
  display: inline-flex;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.67rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid rgba(123, 163, 209, 0.32);
}

.kind-user {
  background: rgba(34, 209, 238, 0.14);
}

.kind-admin {
  background: rgba(247, 179, 43, 0.14);
}

.kind-media {
  background: rgba(129, 244, 149, 0.13);
}

.kind-page {
  background: rgba(126, 163, 255, 0.14);
}

.kind-event {
  background: rgba(255, 111, 122, 0.12);
}

.command-title {
  font-family: var(--font-display);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.command-sub {
  color: var(--text-2);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.command-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.toast-item {
  border-radius: var(--radius-md);
  border: 1px solid rgba(123, 163, 209, 0.3);
  background: rgba(10, 26, 47, 0.94);
  box-shadow: var(--shadow-soft);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: modal-rise 0.2s ease;
}

.toast-item.ok {
  border-color: rgba(57, 217, 138, 0.5);
}

.toast-item.error {
  border-color: rgba(255, 111, 122, 0.52);
}

.toast-close {
  border: 1px solid rgba(123, 163, 209, 0.32);
  background: rgba(17, 39, 68, 0.7);
  color: var(--text-0);
  border-radius: 10px;
  width: 24px;
  height: 24px;
  cursor: pointer;
}

.cookie-dock {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: var(--layer-cookie);
  width: min(470px, calc(100vw - 28px));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(123, 163, 209, 0.36);
  background: linear-gradient(145deg, rgba(9, 24, 47, 0.94), rgba(15, 35, 61, 0.88));
  box-shadow: var(--shadow-soft);
  padding: 14px;
}

.cookie-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.cookie-text {
  margin-top: 7px;
  color: var(--text-1);
  font-size: 0.86rem;
}

.cookie-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--text-2);
  font-size: 0.8rem;
}

.cookie-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

@keyframes modal-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-rise {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes modal-fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes modal-drop-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

@keyframes loader-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes line-run {
  from {
    background-position: 0% 0;
  }
  to {
    background-position: 180% 0;
  }
}

@keyframes glass-drift {
  0% {
    background-position: 0% 40%;
  }
  50% {
    background-position: 100% 60%;
  }
  100% {
    background-position: 0% 40%;
  }
}

@keyframes skeleton-shimmer {
  to {
    transform: translateX(100%);
  }
}

@supports not (backdrop-filter: blur(1px)) {
  .card,
  .table-wrap,
  .list-card,
  .admin-card,
  .user-card,
  .auth-card-react,
  .cookie-card,
  .loader-glass,
  .filters,
  .modal-overlay,
  .sidebar {
    background: linear-gradient(150deg, rgba(8, 22, 44, 0.96), rgba(13, 31, 56, 0.96));
  }
}

@media (prefers-reduced-motion: reduce) {
  .orb,
  .chat-fab,
  .chat-msg,
  .chat-mini,
  .chat-full,
  .loader-ring,
  .loader-line,
  .card,
  .table-wrap,
  .list-card,
  .admin-card,
  .user-card,
  .auth-card-react,
  .cookie-card,
  .media-card,
  .modal-shell {
    animation: none !important;
  }

  .media-skeleton .media-preview::before,
  .media-skeleton .skeleton-line::before {
    animation: none !important;
  }

  .nav-btn,
  .btn,
  .mobile-nav-btn {
    transition: none;
  }
}

@media (max-width: 1160px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(340px, 90vw);
    height: 100dvh;
    z-index: var(--layer-sidebar);
    border-right: none;
    border-bottom: none;
    display: block;
    padding: 18px 14px;
    transform: translateX(-100%);
    transition: transform 0.24s ease;
    box-shadow: 14px 0 36px rgba(3, 10, 20, 0.42);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .brand {
    width: auto;
    margin: 0 0 4px;
  }

  .sidebar-close {
    display: inline-flex;
    margin-bottom: 8px;
    border-radius: 10px;
    border: 1px solid var(--line-soft);
    background: rgba(16, 37, 66, 0.7);
    color: var(--text-0);
    font: 600 0.85rem var(--font-body);
    padding: 6px 10px;
    cursor: pointer;
  }

  .nav-btn {
    width: 100%;
    min-width: 0;
    margin: 0 0 8px;
  }

  .sidebar .meta,
  .sidebar form {
    width: auto;
    margin-left: 0;
    margin-right: 0;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    position: fixed;
    left: 12px;
    top: 12px;
    z-index: calc(var(--layer-sidebar) + 1);
    border-radius: 12px;
    border: 1px solid var(--line-soft);
    background: rgba(12, 31, 56, 0.92);
    color: var(--text-0);
    font: 700 0.88rem var(--font-body);
    padding: 9px 12px;
    box-shadow: var(--shadow-soft);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: calc(var(--layer-sidebar) - 1);
    border: none;
    background: rgba(2, 9, 20, 0.5);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }

  .sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .main {
    padding-top: 64px;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-drawer {
    right: 10px;
    top: 66px;
  }

  .activity {
    max-height: none;
  }

  .auth-main {
    place-content: start center;
    padding-top: 28px;
  }

  .auth-stage {
    width: min(680px, 96vw);
    grid-template-columns: 1fr;
  }

  .auth-hero {
    padding: 16px;
  }

  .auth-card-react,
  .cookie-card {
    width: 100%;
  }

  .command-overlay {
    padding-top: 8vh;
    background: rgba(2, 9, 20, 0.98);
  }
}

@media (max-width: 760px) {
  .user-details-page {
    --table-head-top: 0px;
  }

  .main {
    padding: 12px 10px calc(84px + env(safe-area-inset-bottom));
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .charts {
    grid-template-columns: 1fr;
  }

  .filters {
    position: static;
    padding: 8px;
  }

  .user-details-page .table-wrap {
    overflow-x: auto;
  }

  .btn,
  input:not([type="checkbox"]),
  select,
  .styled-select {
    width: 100%;
  }

  .inline-actions-cell {
    min-width: 240px;
  }

  .inline-actions {
    opacity: 1;
    transform: none;
    pointer-events: auto;
    flex-wrap: wrap;
  }

  .actions {
    width: 100%;
  }

  .sidebar {
    width: min(320px, 92vw);
    padding: 16px 12px;
  }

  .modal-shell {
    padding: 14px;
    border-radius: 16px;
  }

  .modal-actions .btn {
    width: auto;
  }

  .mobile-menu-toggle {
    display: none;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: var(--layer-mobile-nav);
    border-radius: 16px;
    border: 1px solid var(--line-soft);
    background: rgba(8, 24, 47, 0.94);
    box-shadow: var(--shadow-soft);
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .mobile-nav-btn {
    border-radius: 10px;
    border: 1px solid rgba(123, 163, 209, 0.28);
    background: rgba(14, 34, 63, 0.84);
    color: var(--text-1);
    font: 700 0.74rem var(--font-body);
    padding: 9px 6px;
    min-width: 52px;
  }

  .mobile-nav-btn.active {
    color: #05101f;
    border-color: transparent;
    background: linear-gradient(130deg, var(--accent-cyan), var(--accent-lime));
  }

  .chat-root {
    right: 8px;
    bottom: calc(84px + env(safe-area-inset-bottom) + 12px);
  }

  .chat-mini {
    width: min(420px, calc(100vw - 16px - env(safe-area-inset-left) - env(safe-area-inset-right)));
    height: min(68vh, 620px);
  }

  .chat-full-overlay {
    padding: 8px;
  }

  .chat-full {
    width: 100%;
    height: min(86vh, 900px);
    border-radius: 16px;
    padding: 10px;
  }

  .chat-full-body {
    grid-template-columns: 1fr;
  }

  .chat-full-sidebar {
    max-height: 160px;
  }

  .dashboard-drawer {
    top: auto;
    right: 8px;
    left: 8px;
    bottom: calc(84px + env(safe-area-inset-bottom) + 12px);
    width: auto;
  }

  .drawer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .drawer-media-grid {
    grid-template-columns: 1fr;
  }

  .command-overlay {
    place-items: start stretch;
    padding: 8px;
  }

  .command-shell {
    width: 100%;
    max-height: calc(100dvh - 140px - env(keyboard-inset-height, 0px));
    transition: max-height 0.2s ease;
  }

  .user-details-page .table-wrap::after {
    content: "→";
    position: absolute;
    right: 8px;
    bottom: 12px;
    font-size: 18px;
    color: var(--text-2);
    opacity: 0.4;
    pointer-events: none;
  }

  .command-item {
    grid-template-columns: 1fr;
  }

  .command-actions {
    justify-content: flex-start;
  }

  .toast-host {
    right: 8px;
    left: 8px;
    width: auto;
    top: auto;
    bottom: calc(84px + env(safe-area-inset-bottom) + 12px);
  }

  .cookie-dock {
    left: 8px;
    right: 8px;
    bottom: calc(84px + env(safe-area-inset-bottom) + 12px);
    width: auto;
  }

  .cookie-actions .btn {
    flex: 1 1 140px;
  }

  .auth-hero h2 {
    font-size: 1.65rem;
  }

  .auth-card-react h1 {
    font-size: 1.6rem;
  }

  .theme-switcher {
    right: 8px;
    bottom: calc(84px + env(safe-area-inset-bottom) + 12px);
  }
}

@media (max-width: 540px) {
  .main {
    padding: 10px;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .topbar h1 {
    font-size: 1.45rem;
  }

  .topbar h1::after {
    margin-top: 7px;
    width: 52px;
  }

  .filters {
    border-radius: 12px;
  }

  .modal-media-preview .media-preview,
  .modal-media-preview .media-preview img,
  .modal-media-preview .media-preview video {
    min-height: 48vh;
    height: 48vh;
  }

  .media-cards {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .media-card .actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .pagination {
    justify-content: space-between;
  }

  .chat-compose {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .command-head input {
    font-size: 1rem !important;
    padding: 14px 16px;
  }
}

@media (max-width: 400px) {
  .loader-glass {
    padding: 14px;
  }

  .cookie-text {
    font-size: 0.81rem;
  }
}

.messenger-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 320px;
  gap: 14px;
}

.messenger-col {
  min-height: 68vh;
  display: grid;
  align-content: start;
  gap: 8px;
}

.messenger-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.messenger-toolbar select,
.messenger-compose input,
.messenger-col input {
  min-height: 38px;
}

.messenger-feed {
  margin-top: 10px;
  display: grid;
  gap: 8px;
  max-height: 56vh;
  overflow: auto;
  align-content: start;
}

.messenger-compose {
  margin-top: 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
}

.messenger-search-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.messenger-search-list {
  margin-top: 8px;
  display: grid;
  gap: 6px;
  max-height: 44vh;
  overflow: auto;
  align-content: start;
}

.messenger-left .btn,
.messenger-right .btn,
.messenger-search-list .btn {
  width: 100%;
  text-align: left;
}

.messenger-left .section-title,
.messenger-right .section-title {
  margin-bottom: 2px;
}

.messenger-msg {
  display: grid;
  gap: 8px;
}

.messenger-msg.pending {
  opacity: 0.72;
  border-style: dashed;
}

.messenger-msg-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.messenger-msg-head small {
  margin-left: auto;
  color: var(--muted, #99a9ce);
  font-size: 0.75rem;
}

.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.72rem;
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.messenger-upload {
  min-width: 100px;
  justify-content: center;
}

.messenger-attachment {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(120, 156, 225, 0.35);
  background: rgba(8, 26, 56, 0.55);
}

@media (max-width: 1160px) {
  .messenger-layout {
    grid-template-columns: 1fr;
  }

  .messenger-left,
  .messenger-right {
    min-height: auto;
  }

  .messenger-feed {
    max-height: 62vh;
  }
}

/* ==================== MEDIA LOADING IMPROVEMENTS ==================== */
.media-preview img,
.media-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: var(--bg-2);
  transition: opacity 0.25s ease;
}

.media-preview img[loading="lazy"] {
  opacity: 0;
}

.media-preview img[loading="lazy"].loaded {
  opacity: 1;
}

/* Skeleton for media while it loads */
.media-card .media-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.06) 25%,
    rgba(255, 255, 255, 0.12) 50%,
    rgba(255, 255, 255, 0.06) 75%
  );
  background-size: 300% 100%;
  animation: shimmer 1.8s linear infinite;
  z-index: 2;
  opacity: 0.6;
}

@keyframes shimmer {
  0% {
    background-position: 300% 0;
  }
  100% {
    background-position: -300% 0;
  }
}

/* Video play hint */
.media-video-thumb .media-play-hint {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 999px;
  opacity: 0.85;
  transition: all 0.2s ease;
}

.media-video-thumb:hover .media-play-hint {
  opacity: 1;
  transform: scale(1.08);
}

/* ==================== LIVE & JUICY ANIMATIONS ==================== */
.media-card,
.history-card,
.admin-card,
.command-item {
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.media-card:hover,
.history-card:hover,
.admin-card:hover,
.command-item:hover {
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45) !important;
}

.user-details-section,
.card {
  animation: fadeUp 0.55s cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:active {
  transform: scale(0.94);
  filter: brightness(0.85);
}

.nav-btn {
  position: relative;
  overflow: hidden;
}

.nav-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.25) 0%, transparent 70%);
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.4s ease;
  pointer-events: none;
}

.nav-btn:hover::after {
  opacity: 1;
  transform: scale(2.2);
}

.command-item.active {
  animation: commandPop 0.4s ease;
}

@keyframes commandPop {
  0% {
    transform: scale(0.92);
  }
  100% {
    transform: scale(1);
  }
}

/* ==================== COMMAND PALETTE (Ctrl+K) ==================== */
.command-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 9, 20, 0.97);
  z-index: 9999 !important;
  display: grid;
  place-items: start center;
  padding-top: 12vh;
  backdrop-filter: blur(14px);
}

.command-shell {
  width: min(980px, 94vw);
  max-height: 80vh;
  background: var(--surface-0);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  z-index: 10000 !important;
}

.command-head-input {
  width: 100%;
  background: transparent;
  border: none;
  padding: 22px 30px;
  font-size: 1.18rem;
  color: var(--text-0);
  outline: none;
}

.command-results {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px 32px;
  scrollbar-width: thin;
}

.command-group {
  margin-bottom: 24px;
}

.command-group-title {
  font: 700 0.9rem var(--font-display);
  color: var(--accent-cyan);
  padding: 0 12px 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.command-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
  padding: 0 8px;
}

.command-media-item {
  cursor: pointer;
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--surface-1);
}

.command-media-item:hover {
  transform: translateY(-6px) scale(1.04);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.command-tags {
  padding: 6px 10px;
  font-size: 0.78rem;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  background: rgba(0, 0, 0, 0.3);
}

.command-tags .tag-chip.small {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 999px;
}


.command-overlay { position: fixed; inset: 0; background: rgba(2,9,20,0.97); z-index: 9999; display: grid; place-items: start center; padding-top: 9vh; backdrop-filter: blur(16px); }
.command-shell { width: min(1080px, 96vw); max-height: 84vh; background: var(--surface-0); border: 1px solid var(--line-strong); border-radius: 26px; overflow: hidden; box-shadow: 0 50px 140px rgba(0,0,0,0.92); display: flex; flex-direction: column; }
.command-header { padding: 16px 24px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 12px; }
.command-head-input { flex: 1; background: transparent; border: none; padding: 14px 20px; font-size: 1.12rem; color: var(--text-0); outline: none; }
.command-results { flex: 1; overflow-y: auto; padding: 16px 20px 40px; }
.command-group { margin-bottom: 32px; }
.command-group-title { font: 700 0.9rem var(--font-display); color: var(--accent-cyan); padding: 0 10px 12px; text-transform: uppercase; letter-spacing: 0.7px; }
.command-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px; }
.command-media-item { cursor: pointer; border-radius: 18px; overflow: hidden; background: var(--surface-1); transition: all 0.25s cubic-bezier(0.4,0,0.2,1); }
.command-media-item:hover { transform: translateY(-10px) scale(1.05); box-shadow: 0 30px 60px rgba(0,0,0,0.7); }
.recent-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0; }
.recent-chip { background: rgba(34,209,238,0.14); color: var(--accent-cyan); padding: 7px 16px; border-radius: 999px; font-size: 0.85rem; cursor: pointer; transition: all 0.2s; }
.recent-chip:hover { background: var(--accent-cyan); color: #06101f; }
.command-loading { text-align: center; padding: 40px; color: var(--text-2); font-size: 0.95rem; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-2); }

.command-overlay {
  position: fixed; inset: 0; background: rgba(2,9,20,0.96); z-index: 9999;
  display: grid; place-items: start center; padding-top: 8vh;
  backdrop-filter: blur(20px);
}

.command-shell {
  width: min(1100px, 96vw); max-height: 86vh;
  background: var(--surface-0); border: 1px solid var(--line-strong);
  border-radius: 28px; overflow: hidden; box-shadow: 0 50px 150px rgba(0,0,0,0.95);
  display: flex; flex-direction: column;
}

.command-header { padding: 20px 28px; border-bottom: 1px solid var(--line-soft); }
.command-head-input { flex: 1; background: transparent; border: none; font-size: 1.15rem; color: var(--text-0); outline: none; }

.command-results { flex: 1; overflow-y: auto; padding: 20px; }

.command-group { margin-bottom: 32px; }
.command-group-title { font: 700 0.9rem var(--font-display); color: var(--accent-cyan); padding-bottom: 12px; text-transform: uppercase; letter-spacing: 0.8px; }

.command-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
.command-media-item { cursor: pointer; border-radius: 18px; overflow: hidden; background: var(--surface-1); transition: all .25s; }
.command-media-item:hover { transform: translateY(-10px) scale(1.06); box-shadow: 0 30px 70px rgba(0,0,0,0.75); }

.recent-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.recent-chip { background: rgba(34,209,238,0.16); color: var(--accent-cyan); padding: 8px 18px; border-radius: 999px; font-size: 0.86rem; cursor: pointer; }
.recent-chip:hover, .recent-chip.active { background: var(--accent-cyan); color: #06101f; }

.command-item { padding: 12px 16px; border-radius: 14px; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.command-item:hover, .command-item.active { background: rgba(34,209,238,0.12); }
.command-icon { font-size: 1.4rem; width: 32px; }
.command-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 9, 20, 0.96);
  z-index: 9999;
  display: grid;
  place-items: start center;
  padding-top: 10vh;
  backdrop-filter: blur(20px);
}

.command-shell {
  width: min(1020px, 96vw);
  max-height: 82vh;
  background: var(--surface-0);
  border: 1px solid var(--line-strong);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 40px 120px rgba(0,0,0,0.92);
  display: flex;
  flex-direction: column;
}

.command-head-input {
  width: 100%;
  background: transparent;
  border: none;
  padding: 24px 32px;
  font-size: 1.22rem;
  color: var(--text-0);
  outline: none;
}

.command-results {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px 40px;
}

.command-item {
  padding: 14px 20px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.command-item:hover,
.command-item.active {
  background: rgba(34, 209, 238, 0.14);
  transform: translateX(4px);
}

.command-loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-2);
  font-size: 1.05rem;
}
/* Command Palette refresh */
.command-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(34, 209, 238, 0.12), transparent 60%), rgba(2, 9, 20, 0.95);
  z-index: 9999;
  display: grid;
  place-items: start center;
  padding-top: 8vh;
  backdrop-filter: blur(20px);
}

.command-shell {
  width: min(1080px, 96vw);
  max-height: 86vh;
  background: linear-gradient(180deg, rgba(12, 19, 33, 0.95), rgba(8, 13, 24, 0.95));
  border: 1px solid rgba(103, 128, 159, 0.35);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 42px 130px rgba(0, 0, 0, 0.86);
  display: flex;
  flex-direction: column;
}

.command-header {
  padding: 18px 22px;
  border-bottom: 1px solid rgba(103, 128, 159, 0.25);
  display: flex;
  align-items: center;
  gap: 14px;
}

.command-head-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(103, 128, 159, 0.26);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 1.06rem;
  color: var(--text-0);
  outline: none;
}

.command-head-input:focus {
  border-color: rgba(34, 209, 238, 0.58);
  box-shadow: 0 0 0 4px rgba(34, 209, 238, 0.14);
}

.command-kbd {
  color: var(--text-1);
  font: 700 0.72rem var(--font-display);
  border: 1px solid rgba(103, 128, 159, 0.32);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 9px;
  padding: 6px 9px;
  letter-spacing: 0.6px;
}

.command-results {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 26px;
}

.command-group {
  margin-bottom: 20px;
}

.command-group-title {
  font: 700 0.76rem var(--font-display);
  color: var(--accent-cyan);
  letter-spacing: 0.9px;
  text-transform: uppercase;
  margin: 0 6px 10px;
}

.command-item {
  padding: 12px 14px;
  border-radius: 12px;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
  border: 1px solid transparent;
}

.command-item:hover,
.command-item.active {
  background: rgba(34, 209, 238, 0.14);
  border-color: rgba(34, 209, 238, 0.32);
  transform: translateX(3px);
}

.command-icon {
  width: 24px;
  text-align: center;
  opacity: 0.95;
}

.command-main {
  min-width: 0;
}

.command-title {
  color: var(--text-0);
  font-weight: 650;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.command-sub {
  color: var(--text-2);
  font-size: 0.84rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.command-tags-inline {
  color: var(--accent-cyan);
  font-size: 0.75rem;
  background: rgba(34, 209, 238, 0.14);
  border-radius: 999px;
  padding: 4px 9px;
  max-width: 240px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.command-empty-row,
.empty-state {
  text-align: center;
  padding: 16px;
  color: var(--text-2);
}

.recent-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.recent-chip {
  border: 1px solid rgba(34, 209, 238, 0.3);
  background: rgba(34, 209, 238, 0.1);
  color: var(--accent-cyan);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.command-loading-skeleton {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.command-loading-skeleton span {
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(100deg, rgba(255,255,255,0.03) 0%, rgba(34,209,238,0.1) 50%, rgba(255,255,255,0.03) 100%);
  background-size: 220% 100%;
  animation: commandShimmer 1.1s linear infinite;
}

@keyframes commandShimmer {
  0% { background-position: 220% 0; }
  100% { background-position: -220% 0; }
}
/* Command Palette media cards */
.command-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.command-media-card {
  border: 1px solid rgba(103, 128, 159, 0.26);
  border-radius: 14px;
  background: rgba(9, 16, 30, 0.9);
  overflow: hidden;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.command-media-card:hover,
.command-media-card.active {
  transform: translateY(-2px);
  border-color: rgba(34, 209, 238, 0.45);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

.command-media-preview {
  aspect-ratio: 16 / 10;
  background: rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.command-media-meta {
  padding: 10px;
  display: grid;
  gap: 5px;
}

.command-media-actions {
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid rgba(103, 128, 159, 0.2);
}

.command-media-actions .btn {
  padding: 7px 10px;
  font-size: 0.78rem;
}

.command-loading {
  text-align: center;
  padding: 24px;
  color: var(--text-2);
}
/* Palette icon normalization */
.command-item {
  grid-template-columns: 42px 1fr auto;
}

.command-icon {
  font-size: 0.66rem !important;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  width: 34px;
  height: 22px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(34, 209, 238, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(34, 209, 238, 0.34);
}
/* Command palette split media card */
.command-media-card {
  overflow: hidden;
}

.command-media-layout {
  display: grid;
  grid-template-columns: minmax(200px, 48%) 1fr;
  min-height: 190px;
}

.command-media-preview {
  width: 100% !important;
  height: 100% !important;
  min-height: 190px;
  aspect-ratio: auto !important;
  border: 0;
  border-right: 1px solid rgba(103, 128, 159, 0.2);
  background: rgba(0, 0, 0, 0.32);
  display: block;
  place-items: unset;
}

.command-media-preview .media-preview {
  width: 100%;
  height: 100%;
  min-height: 190px;
  border-bottom: 0;
}

.command-media-preview .media-preview img,
.command-media-preview .media-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.command-media-side {
  display: grid;
  grid-template-rows: 1fr auto;
}

.command-media-meta {
  padding: 12px;
  align-content: start;
}

.command-media-meta .command-title,
.command-media-meta .command-sub,
.command-media-meta .command-tags-inline {
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

.command-media-actions {
  border-top: 1px solid rgba(103, 128, 159, 0.2);
  padding: 10px 12px 12px;
}

@media (max-width: 820px) {
  .command-media-layout {
    grid-template-columns: 1fr;
  }

  .command-media-preview {
    min-height: 210px;
    border-right: 0;
    border-bottom: 1px solid rgba(103, 128, 159, 0.2);
  }
}
/* Hard fix: media cards layout in command palette */
.command-media-grid {
  grid-template-columns: repeat(auto-fill, minmax(620px, 1fr)) !important;
  gap: 16px !important;
}

.command-media-card {
  min-height: 250px;
}

.command-media-layout {
  display: grid;
  grid-template-columns: 52% 48%;
  align-items: start;
  min-height: 250px;
}

.command-media-preview {
  width: 100% !important;
  min-height: 250px !important;
  max-height: 250px !important;
  height: 250px !important;
  aspect-ratio: auto !important;
  border-right: 1px solid rgba(103, 128, 159, 0.22);
}

.command-media-preview .media-preview {
  min-height: 250px !important;
  height: 250px !important;
}

.command-media-side {
  min-width: 0;
  max-width: 100%;
}

.command-media-meta {
  gap: 8px;
}

.command-media-meta .command-title {
  font-size: 1.04rem;
  line-height: 1.25;
}

.command-media-meta .command-sub {
  font-size: 0.95rem;
}

.command-media-meta .command-tags-inline {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
  max-width: 100%;
  border-radius: 10px;
}

.command-media-actions {
  gap: 10px;
}

.command-media-actions .btn {
  min-width: 84px;
}

@media (max-width: 980px) {
  .command-media-grid {
    grid-template-columns: 1fr !important;
  }

  .command-media-layout {
    grid-template-columns: 1fr;
  }

  .command-media-preview {
    height: 220px !important;
    min-height: 220px !important;
    max-height: 220px !important;
    border-right: 0;
    border-bottom: 1px solid rgba(103, 128, 159, 0.22);
  }

  .command-media-preview .media-preview {
    min-height: 220px !important;
    height: 220px !important;
  }
}

.undo-toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 86px;
  z-index: calc(var(--layer-toast) + 10);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(6, 16, 31, 0.92);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.casebattle {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  padding-bottom: 8px;
}

.balance-badge {
  margin-left: auto;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(6, 16, 31, 0.6);
  border: 1px solid var(--line-soft);
  color: var(--text-0);
  font-weight: 600;
  font-size: 12px;
}

.casebattle-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.casebattle-batch {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 16px;
}

.casebattle-batch input {
  width: 90px;
}

.batch-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.casebattle-roulette {
  display: grid;
  gap: 16px;
  position: relative;
}

.casebattle-multi-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.casebattle-multi-grid.grid-10 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.casebattle-multi-grid .case-roulette {
  height: 190px;
  padding: 10px;
}

.casebattle-multi-grid .case-roulette-item {
  min-width: 140px;
  height: 160px;
}

.casebattle-multi-grid .case-roulette-media,
.casebattle-multi-grid .media-preview {
  height: 90px;
}

.case-roulette {
  position: relative;
  overflow: hidden;
  height: 240px;
  border-radius: 20px;
  background: var(--surface-0);
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
  padding: 16px;
  mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
}

.case-roulette-track {
  display: flex;
  gap: 14px;
  height: 100%;
  align-items: center;
  will-change: transform;
  padding: 0 20px;
}

.case-roulette.spinning .case-roulette-track {
  filter: blur(4px);
  transition: filter 0.8s ease-out;
}

.case-roulette-item {
  min-width: 170px;
  height: 200px;
  border-radius: 16px;
  padding: 12px;
  background: var(--surface-1);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
  transform-style: preserve-3d;
  flex-shrink: 0;
}

.case-roulette-item:hover { transform: perspective(800px) rotateY(-6deg) translateY(-8px) scale(1.03); }

.case-roulette-media {
  height: 130px;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  object-fit: cover;
  display: block;
}

.case-roulette-item .media-preview {
  border-radius: 12px;
}

.media-preview {
  position: relative;
  width: 100%;
  height: 130px;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
}

.media-preview-img,
.media-preview-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.15s ease;
}

.media-preview-video {
  opacity: 0;
  pointer-events: none;
}

.media-preview:hover .media-preview-video {
  opacity: 1;
}

.media-preview:hover .media-preview-img {
  opacity: 0;
}

.media-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  backdrop-filter: blur(6px);
}

.media-modal {
  width: min(90vw, 900px);
  max-height: 90vh;
  background: var(--surface-1);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.media-modal-video,
.media-modal-img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 12px;
  background: #000;
}

.media-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.case-roulette-meta {
  display: grid;
  gap: 6px;
  font-size: 12px;
}

.case-roulette-meta .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 11px;
  background: rgba(34, 209, 238, 0.18);
  color: var(--text-0);
  border: 1px solid var(--line-soft);
}

.case-roulette-item.common { border: 2px solid #5b7bb0; background: linear-gradient(#4a5f8c, #2c3e5f); }
.case-roulette-item.uncommon { border: 2px solid #a55fd0; background: linear-gradient(#8c4ab0, #5c2e7a); }
.case-roulette-item.rare { border: 2px solid #d94ad9; background: linear-gradient(#b33ab3, #7a2a7a); }
.case-roulette-item.epic { border: 2px solid #f03c3c; background: linear-gradient(#c72e2e, #8a2020); }
.case-roulette-item.legendary { border: 2px solid #ffd700; background: linear-gradient(#e6c200, #b38f00); box-shadow: 0 0 40px #ffd700; animation: legendaryGlow 1.4s infinite alternate; }

.case-roulette-item.winner {
  border-color: rgba(255, 215, 0, 0.6);
  box-shadow: 0 0 22px rgba(255, 215, 0, 0.2);
  animation: glow 1.2s infinite alternate, scaleWinner 0.5s ease-in;
}

.case-roulette-empty {
  height: 120px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(10, 26, 47, 0.5);
  color: var(--text-2);
}

.case-roulette-pointer {
  position: absolute;
  left: 50%;
  top: 20px;
  width: 6px;
  height: 200px;
  background: linear-gradient(transparent, #ffd700, transparent);
  box-shadow: 0 0 30px #ffd700;
  transform: translateX(-50%);
  z-index: 10;
  animation: pointerPulse 1.2s infinite alternate;
}

.casebattle-result {
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--surface-1);
  border: 1px solid var(--line-soft);
  display: grid;
  gap: 6px;
}

.casebattle-result .result-title {
  font-weight: 700;
}

.casebattle-result .result-media {
  max-height: 380px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(255, 215, 0, 0.4);
}

.casebattle-loading {
  position: absolute;
  right: 16px;
  bottom: -10px;
  font-size: 12px;
  color: var(--text-2);
}

.inventory-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.form-grid label {
  font-size: 12px;
  color: var(--text-2);
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  background: var(--surface-1);
  color: var(--text-0);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 10px 12px;
}

@media (max-width: 860px) {
  .form-grid { grid-template-columns: 1fr; }
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 15px;
  padding: 10px 6px 20px;
}

.inventory-item {
  background: var(--surface-1);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 10px;
  text-align: center;
  display: grid;
  gap: 8px;
  transition: 0.2s;
}

.inventory-item:hover {
  transform: translateY(-5px);
  border-color: var(--accent-cyan);
}

.inventory-item .btn {
  width: 100%;
}

.inventory-media {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 10px;
  background: #000;
}

.win-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.win-modal-content {
  background: var(--bg-1);
  padding: 32px;
  border-radius: var(--radius-xl);
  text-align: center;
  border: 2px solid var(--accent-amber);
  position: relative;
  width: min(420px, 92vw);
}

.win-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  filter: blur(80px);
  opacity: 0.5;
  z-index: -1;
  background: rgba(255, 215, 0, 0.5);
}

.win-img {
  width: 250px;
  margin: 16px auto;
  filter: drop-shadow(0 0 20px rgba(255,255,255,0.2));
}

.win-actions {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.inventory-meta {
  display: grid;
  gap: 6px;
  font-size: 12px;
}

@keyframes glow {
  from { box-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
  to { box-shadow: 0 0 22px rgba(255, 215, 0, 0.8); }
}

@keyframes legendaryGlow { 0% { box-shadow: 0 0 20px #ffd700; } 100% { box-shadow: 0 0 50px #ffeb3b; } }

@keyframes scaleWinner {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes pointerPulse { from { opacity: 0.6; } to { opacity: 1; } }

@media (max-width: 860px) {
  .case-roulette-item {
    min-width: 150px;
  }
  .case-roulette {
    height: 200px;
  }
  .case-roulette-media {
    height: 100px;
  }
  .media-preview {
    height: 100px;
  }
}

@media (max-width: 860px) {
  :root {
    --motion-fast: 120ms;
    --motion-med: 200ms;
    --motion-slow: 300ms;
  }
  body {
    font-size: 16px;
  }
  .btn,
  button,
  input:not([type="checkbox"]),
  select,
  textarea {
    min-height: 48px;
  }
  .nav-btn,
  .mobile-nav-btn {
    min-height: 48px;
  }
  .card,
  .table-wrap,
  .modal-shell {
    box-shadow: var(--shadow-soft);
  }
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: -320px;
    transition: left var(--motion-med) var(--ease-ui);
  }
  .sidebar.open { left: 0; }

  .media-cards { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important; }
  .media-card { margin: 6px; }

  .topbar { padding: 12px 16px; }
  .filters { flex-direction: column; gap: 10px; }
  body { touch-action: manipulation; }
  .btn { min-height: 48px; font-size: 1.05rem; }
  .liquid-scene { display: none; }

  .mobile-bottom-nav {
    background: rgba(6,16,31,0.96);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--line-soft);
  }

  /* Mobile-first layout tweaks (no desktop impact) */
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .balance-badge {
    margin-left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
  }
  .casebattle-categories {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 6px;
  }
  .casebattle-categories .btn {
    white-space: nowrap;
  }
  .casebattle-batch {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .casebattle-batch select,
  .casebattle-batch input {
    width: 100%;
  }
  .batch-buttons {
    overflow-x: auto;
  }
  .casebattle-multi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .casebattle-multi-grid.grid-10 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .casebattle-multi-grid .case-roulette {
    height: 180px;
  }
  .casebattle-multi-grid .case-roulette-item {
    min-width: 130px;
    height: 150px;
  }
  .inventory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .inventory-media {
    height: 110px;
  }
  .inventory-page .topbar .btn {
    width: 100%;
  }
  .media-modal {
    width: 94vw;
    padding: 12px;
  }
  .media-modal-video,
  .media-modal-img {
    max-height: 60vh;
  }
}


.games-page .games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.game-card {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  padding: 16px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.game-title {
  font-size: 18px;
  font-weight: 700;
}

.game-desc {
  color: var(--text-2);
  font-size: 13px;
}

.blackjack-table {
  margin-top: 14px;
  padding: 16px;
  border-radius: 16px;
  background: #1a5b3a;
  color: #fff;
}

.bj-label {
  font-weight: 700;
  margin-bottom: 6px;
}

.bj-cards {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.bj-card {
  width: 54px;
  height: 72px;
  border-radius: 8px;
  background: #f7f7f7;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.bj-card.red {
  color: #b21f2d;
}

.blackjack-hands {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.blackjack-hands .hand {
  background: rgba(255, 255, 255, 0.08);
  padding: 8px;
  border-radius: 10px;
}

.blackjack-hands .hand.self {
  outline: 2px solid var(--accent-cyan);
}

.blackjack-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.mines-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 12px;
}

.mines-grid .tile {
  height: 52px;
  border-radius: 8px;
  background: #2a2f3a;
  border: 1px solid var(--border-2);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  position: relative;
  z-index: 1;
  user-select: none;
}

.mines-grid .tile.safe {
  background: #1f7a3a;
}

.mines-grid .tile.mine {
  background: #8a2323;
}

.roulette-page .roulette-meta,
.mines-page .mines-meta {
  margin-top: 10px;
  color: var(--text-2);
}

.roulette-wheel {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: conic-gradient(#b21f2d 0 20%, #111 20% 40%, #b21f2d 40% 60%, #111 60% 80%, #0b6d3a 80% 100%);
  display: grid;
  place-items: center;
  margin: 12px 0;
  border: 4px solid #0f0f0f;
}

.roulette-center {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #f7f7f7;
  color: #111;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.plinko-page .notice,
.roulette-page .notice {
  margin-top: 12px;
}

.plinko-board {
  position: relative;
  width: 280px;
  height: 320px;
  background: #1a1f2a;
  border-radius: 14px;
  border: 1px solid var(--border-2);
  padding: 10px;
  margin: 12px 0;
}

.plinko-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 8px 0;
}

.plinko-board .peg {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f0f0f0;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.3);
}

.plinko-ball {
  position: absolute;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f4d35e;
}


.game-result-modal {
  width: min(420px, 92vw);
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 18px;
  padding: 22px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.game-result-modal.win {
  border-color: #22c55e;
}

.game-result-modal.lose {
  border-color: #ef4444;
}

.game-result-modal .result-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.game-result-modal .result-amount {
  font-size: 22px;
  font-weight: 700;
  margin: 10px 0 14px;
}

.roulette-wheel {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  background: #0b1220;
  border: 6px solid #0f0f0f;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6), 0 10px 40px rgba(0,0,0,0.4);
}

.roulette-wheel .wheel-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    #0b6d3a 0 2.7%,
    #b21f2d 2.7% 5.4%,
    #111 5.4% 8.1%,
    #b21f2d 8.1% 10.8%,
    #111 10.8% 13.5%,
    #b21f2d 13.5% 16.2%,
    #111 16.2% 18.9%,
    #b21f2d 18.9% 21.6%,
    #111 21.6% 24.3%,
    #b21f2d 24.3% 27%,
    #111 27% 29.7%,
    #b21f2d 29.7% 32.4%,
    #111 32.4% 35.1%,
    #b21f2d 35.1% 37.8%,
    #111 37.8% 40.5%,
    #b21f2d 40.5% 43.2%,
    #111 43.2% 45.9%,
    #b21f2d 45.9% 48.6%,
    #111 48.6% 51.3%,
    #b21f2d 51.3% 54%,
    #111 54% 56.7%,
    #b21f2d 56.7% 59.4%,
    #111 59.4% 62.1%,
    #b21f2d 62.1% 64.8%,
    #111 64.8% 67.5%,
    #b21f2d 67.5% 70.2%,
    #111 70.2% 72.9%,
    #b21f2d 72.9% 75.6%,
    #111 75.6% 78.3%,
    #b21f2d 78.3% 81%,
    #111 81% 83.7%,
    #b21f2d 83.7% 86.4%,
    #111 86.4% 89.1%,
    #b21f2d 89.1% 91.8%,
    #111 91.8% 94.5%,
    #b21f2d 94.5% 97.2%,
    #111 97.2% 100%
  );
}

.roulette-center {
  position: absolute;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: #f7f7f7;
  color: #111;
  display: grid;
  place-items: center;
  font-weight: 800;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.roulette-ball {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f1f5f9;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  box-shadow: 0 0 8px rgba(255,255,255,0.7);
}

.plinko-path {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.plinko-path path {
  fill: none;
  stroke: #22d3ee;
  stroke-width: 2;
  stroke-dasharray: 4 6;
}

.casebattle-inventory {
  margin-top: 24px;
}


.casebattle-tabs {
  display: flex;
  gap: 10px;
  margin: 10px 0 16px;
}

.roulette-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  .roulette-layout {
    grid-template-columns: 1fr;
  }
}

.roulette-board {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: 14px;
  padding: 12px;
}

.roulette-zero {
  background: #0b6d3a;
  color: #fff;
  text-align: center;
  border-radius: 8px;
  padding: 8px 0;
  margin-bottom: 10px;
  font-weight: 700;
  cursor: pointer;
}

.roulette-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 6px;
}

.roulette-cell {
  height: 34px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.roulette-cell.red {
  background: #b21f2d;
  color: #fff;
}

.roulette-cell.black {
  background: #111827;
  color: #fff;
}

.roulette-cell.win {
  outline: 2px solid #22c55e;
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.6);
  animation: winPulse 0.9s ease-in-out infinite alternate;
}

@keyframes winPulse {
  from { transform: scale(1); }
  to { transform: scale(1.03); }
}

.roulette-quick {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.roulette-chips {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}

.roulette-chips .chip {
  background: #0f172a;
  border: 1px solid var(--border-2);
  color: #e2e8f0;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
}

.roulette-chips .chip.active {
  border-color: #22d3ee;
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.5);
}

.roulette-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.roulette-bets {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.bet-chip {
  background: #0b1220;
  border: 1px solid var(--border-2);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.game-result-modal.win {
  box-shadow: 0 0 40px rgba(34, 197, 94, 0.35), 0 25px 80px rgba(0,0,0,0.5);
}

.game-result-modal.lose {
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.35), 0 25px 80px rgba(0,0,0,0.5);
}

.bet-chip.win {
  border-color: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

.plinko-ball.active {
  box-shadow: 0 0 12px rgba(244, 211, 94, 0.8);
  animation: plinkoPulse 0.8s ease-in-out infinite alternate;
}

@keyframes plinkoPulse {
  from { transform: translateX(-50%) scale(1); }
  to { transform: translateX(-50%) scale(1.1); }
}

.roulette-wheel.win {
  box-shadow: 0 0 30px rgba(34, 197, 94, 0.8), inset 0 0 20px rgba(34, 197, 94, 0.5);
  animation: rouletteGlow 0.8s ease-in-out infinite alternate;
}

@keyframes rouletteGlow {
  from { transform: scale(1); }
  to { transform: scale(1.03); }
}


.plinko-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.plinko-board.luxury {
  background: radial-gradient(circle at 30% 20%, #1e2a44, #0b0f1a 70%);
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: inset 0 0 30px rgba(0,0,0,0.6), 0 20px 60px rgba(0,0,0,0.45);
}

.plinko-slots {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 6px;
}

.plinko-slots .slot {
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #e2e8f0;
  font-weight: 700;
  padding: 6px 0;
  border-radius: 8px;
  text-align: center;
  font-size: 12px;
}

.plinko-slots .slot.hit {
  border-color: #22d3ee;
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.6);
}


body {
  transition: opacity 0.18s ease;
}

body.page-leave {
  opacity: 0;
}


.roulette-ball-orbit {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
  z-index: 3;
}

.roulette-ball {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f1f5f9;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 8px rgba(255,255,255,0.7);
}


body.page-enter {
  opacity: 0.2;
  animation: pageEnter 0.25s ease forwards;
}

@keyframes pageEnter {
  from { opacity: 0.2; }
  to { opacity: 1; }
}

:root {
  --bg-0: #06101f;
  --bg-1: #08172a;
  --bg-2: rgba(11, 23, 42, 0.76);
}

body {
  background: radial-gradient(circle at 18% 14%, rgba(34, 211, 238, 0.18), transparent 45%),
              radial-gradient(circle at 84% 78%, rgba(132, 204, 22, 0.16), transparent 42%),
              linear-gradient(160deg, #040b17 0%, #06101f 45%, #071425 100%);
}

.card,
.game-card,
.roulette-board,
.blackjack-table,
.plinko-board,
.mines-grid .tile,
.topbar {
  backdrop-filter: blur(12px);
}

.btn,
.roulette-cell,
.roulette-zero,
.mines-grid .tile,
.plinko-slots .slot {
  transition: transform 0.16s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

button,
[role="button"] {
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn:hover,
.roulette-cell:hover,
.roulette-zero:hover,
.plinko-slots .slot:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 0 15px var(--accent-cyan);
}

.btn:active,
.roulette-cell:active,
.roulette-zero:active,
.mines-grid .tile:active {
  transform: scale(0.97);
}

.game-page-shell {
  position: relative;
  padding-top: 54px;
}

.back-lobby-btn {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 35;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(8, 23, 42, 0.56);
  color: #dbeafe;
  border-radius: 12px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.blackjack-table {
  background: radial-gradient(circle at 50% 0%, rgba(22, 163, 74, 0.3), rgba(5, 38, 25, 0.94) 66%);
  border: 1px solid rgba(74, 222, 128, 0.35);
  border-radius: 220px 220px 18px 18px;
}

.blackjack-hands .hand.active-turn {
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.6);
  border: 1px solid rgba(34, 211, 238, 0.65);
}

.mines-page .topbar {
  position: relative;
  z-index: 2;
}

.mines-grid {
  position: relative;
  z-index: 5;
}

.mines-grid .tile {
  perspective: 600px;
  background: linear-gradient(165deg, #172033, #0c1423);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04), inset 0 0 18px rgba(34,211,238,0.08);
}

.mines-grid .tile.revealed {
  transform: rotateY(180deg);
}

.mines-grid .tile.safe {
  background: linear-gradient(155deg, #14532d, #0f3a22);
}

.mines-grid .tile.mine {
  background: linear-gradient(155deg, #7f1d1d, #511212);
}

.mines-page.is-shaking {
  animation: gameShake 0.32s ease;
}

.mines-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: rgba(220, 38, 38, 0.24);
  z-index: 80;
  animation: mineFlash 0.22s ease;
}

@keyframes gameShake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-8px); }
  80% { transform: translateX(8px); }
  100% { transform: translateX(0); }
}

@keyframes mineFlash {
  from { opacity: 0.9; }
  to { opacity: 0; }
}

.roulette-wheel {
  box-shadow: inset 0 0 0 3px rgba(255,255,255,0.08), inset 0 18px 26px rgba(0,0,0,0.55), 0 18px 40px rgba(0,0,0,0.5);
}

.roulette-ball-orbit::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: inset 0 -4px 10px rgba(0,0,0,0.5);
}

.demo-help {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  color: #bae6fd;
  backdrop-filter: blur(12px);
}

.demo-tip {
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  color: #dbeafe;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(8, 23, 42, 0.78);
  backdrop-filter: blur(12px);
}

.plinko-board .peg.hit {
  background: #67e8f9;
  box-shadow: 0 0 16px rgba(103, 232, 249, 0.95);
  transform: scale(1.35);
}

.plinko-slots .slot.jelly {
  animation: slotJelly 0.26s ease;
}

@keyframes slotJelly {
  0% { transform: scale(1); }
  30% { transform: scale(1.1, 0.86); }
  60% { transform: scale(0.92, 1.08); }
  100% { transform: scale(1); }
}

/* ===== Casino Games V2 ===== */
:root {
  --casino-ease: cubic-bezier(0.23, 1, 0.32, 1);
  --fx-win: #22c55e;
  --fx-lose: #ef4444;
  --fx-gold: #facc15;
}

.game-busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 23, 0.44);
  backdrop-filter: blur(8px);
}
.game-busy-spinner {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: loader-spin 0.7s linear infinite;
}
.game-busy-text { margin-top: 10px; color: #dbeafe; }

.blackjack-v2 .bj2-lobby-panel { margin-top: 12px; }
.bj2-headline { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.bj2-lobby-list { margin-top: 10px; display: grid; gap: 8px; }
.bj2-lobby-item {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 8px; align-items: center;
  background: rgba(15, 23, 42, 0.65); border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px; padding: 10px; color: #e2e8f0; cursor: pointer; transition: transform .22s var(--casino-ease);
}
.bj2-lobby-item:hover { transform: translateY(-2px); }
.bj2-table {
  margin-top: 16px;
  border-radius: 220px 220px 16px 16px;
  border: 1px solid rgba(74, 222, 128, .34);
  background: radial-gradient(circle at 50% 2%, rgba(34,197,94,0.30), rgba(6,30,20,0.94) 65%);
}
.bj2-dealer { text-align: center; margin-bottom: 10px; }
.bj2-score {
  display: inline-grid; place-items: center; min-width: 44px; padding: 4px 8px; border-radius: 999px;
  font-weight: 800; font-size: 20px; color: #fef08a; background: rgba(0,0,0,0.35);
  box-shadow: 0 0 20px rgba(250, 204, 21, 0.35);
}
.bj2-players { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 10px; }
.bj2-player { background: rgba(15, 23, 42, 0.46); border: 1px solid rgba(148,163,184,0.22); border-radius: 12px; padding: 8px; }
.bj2-player.self { border-color: rgba(34, 211, 238, 0.6); }
.bj2-player.turn { box-shadow: 0 0 24px rgba(34, 211, 238, 0.5); }
.bj2-hand + .bj2-hand { margin-top: 8px; }
.bj2-cards { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.bj2-card {
  width: 54px; height: 74px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 20px;
  color: #0f172a; background: linear-gradient(180deg, #fff, #e2e8f0); border: 1px solid rgba(15,23,42,0.24);
  transform-style: preserve-3d; transition: transform .36s var(--casino-ease), box-shadow .2s var(--casino-ease);
}
.bj2-card.red { color: #b91c1c; }
.bj2-card.face-down {
  background: linear-gradient(150deg, #1e293b, #0f172a);
  color: #f8fafc;
  transform: rotateY(180deg);
}
.bj2-hand-meta { margin-top: 5px; display: flex; justify-content: space-between; color: #cbd5e1; font-size: 12px; }
.bj2-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bj2-actions input { width: 110px; }

.mines-v2 .mines-controls { margin-top: 10px; display: flex; gap: 10px; }
.mines-v2 .tile { transition: transform .28s var(--casino-ease), box-shadow .24s var(--casino-ease); }
.mines-v2 .tile.revealed { transform: rotateY(180deg) scale(1.02); }
.mines-v2 .tile.safe {
  background: linear-gradient(145deg, #16a34a, #14532d);
  box-shadow: 0 0 20px rgba(34,197,94,0.45);
}
.mines-v2 .tile.mine {
  animation: mineExplosion .32s var(--casino-ease);
  background: linear-gradient(145deg, #ef4444, #7f1d1d);
  box-shadow: 0 0 26px rgba(239,68,68,0.55);
}
.mines-combo.hot { color: var(--fx-gold); font-weight: 800; animation: commandPop .22s var(--casino-ease); }
@keyframes mineExplosion {
  0% { transform: translateY(0) scale(1); }
  20% { transform: translateY(-8px) scale(1.04); }
  55% { transform: translateY(1px) scale(1.12); }
  100% { transform: translateY(0) scale(1); }
}

.roulette-v2 .roulette-phase-badge {
  margin-top: 8px; display: inline-flex; gap: 8px; align-items: center; padding: 8px 12px;
  border-radius: 999px; border: 1px solid rgba(148,163,184,0.34); background: rgba(15,23,42,0.56); color: #e2e8f0;
}
.roulette-v2 .phase-betting { box-shadow: 0 0 20px rgba(14,165,233,0.3); }
.roulette-v2 .phase-spin { box-shadow: 0 0 22px rgba(250,204,21,0.35); }
.roulette-v2 .phase-result { box-shadow: 0 0 24px rgba(34,197,94,0.42); }
.roulette-v2 .phase-pause { box-shadow: 0 0 18px rgba(148,163,184,0.28); }
.roulette-v2 .roulette-cell.win { animation: winPulse .9s var(--casino-ease) infinite alternate; }

.plinko-v2 .plinko-shell { align-items: center; }
.plinko-v2 .plinko-board {
  width: 620px; height: 680px; border-radius: 20px; position: relative; overflow: hidden;
  background: radial-gradient(circle at 50% -10%, rgba(56,189,248,.32), rgba(15,23,42,.96) 58%);
  border: 1px solid rgba(125,211,252,0.35);
}
.plinko-v2 .plinko-board .peg {
  position: absolute; width: 10px; height: 10px; border-radius: 50%; transform: translate(-50%, -50%);
  background: #dbeafe; box-shadow: 0 0 10px rgba(186,230,253,0.42); transition: transform .1s var(--casino-ease), box-shadow .1s var(--casino-ease);
}
.plinko-v2 .plinko-board .peg.hit { transform: translate(-50%, -50%) scale(1.4); box-shadow: 0 0 20px rgba(103,232,249,.95); }
.plinko-v2 .plinko-ball {
  width: 14px; height: 14px; border-radius: 50%; background: linear-gradient(145deg, #fde68a, #f59e0b);
  box-shadow: 0 0 16px rgba(250,204,21,0.75); position: absolute; left: 50%; top: 10px;
}
.plinko-v2 .plinko-slots { width: 620px; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 6px; }
.plinko-v2 .plinko-slots .slot {
  min-height: 38px; border-radius: 10px; font-weight: 700; color: #f1f5f9;
  border: 1px solid rgba(148,163,184,0.35); background: linear-gradient(145deg, #1e293b, #0f172a);
}
.plinko-v2 .plinko-slots .slot.hit { box-shadow: 0 0 26px rgba(34,197,94,0.56); }

@media (max-width: 860px) {
  .bj2-players { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bj2-lobby-item { grid-template-columns: 1.5fr 1fr 1fr; }
  .plinko-v2 .plinko-board { width: min(96vw, 620px); height: min(72vh, 680px); }
  .plinko-v2 .plinko-slots { width: min(96vw, 620px); }
}

.game-top-actions { display: flex; gap: 10px; align-items: center; }
.quick-bets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.game-history-row { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.history-chip {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.28);
  background: rgba(15,23,42,.66);
  color: #e2e8f0;
  animation: commandPop .24s var(--casino-ease);
}
.history-chip.win { border-color: rgba(34,197,94,.55); color: #bbf7d0; }
.history-chip.lose { border-color: rgba(239,68,68,.55); color: #fecaca; }

.bj2-search {
  min-width: 280px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,.35);
  background: rgba(2,6,23,.6);
}
.bj2-controls {
  margin: 10px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.bj2-seat-picks { display: flex; gap: 8px; margin-top: 8px; }
.bj2-ready-next { margin-top: 10px; }
.bj2-ready-panel {
  margin: 10px 0;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(56,189,248,.35);
  background: rgba(2,6,23,.5);
}
.bj2-ready-text { font-weight: 700; color: #bae6fd; }
.bj2-ready-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.bj2-ready-chip {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.3);
  color: #cbd5e1;
}
.bj2-ready-chip.ready {
  border-color: rgba(34,197,94,.6);
  color: #bbf7d0;
  box-shadow: 0 0 12px rgba(34,197,94,.32);
}
.bj2-thinking-indicator {
  margin: 8px 0;
  color: #fef08a;
  font-weight: 700;
  animation: pulseGlow .9s var(--casino-ease) infinite alternate;
}
.bj2-thinking-indicator span { display: inline-block; min-width: 6px; }

.win-flyup {
  position: fixed;
  right: 20px;
  top: 24px;
  z-index: 260;
  color: #facc15;
  font-weight: 900;
  font-size: 30px;
  text-shadow: 0 0 18px rgba(250, 204, 21, 0.75);
  animation: winFlyUp .95s var(--casino-ease) forwards;
  pointer-events: none;
}
@keyframes winFlyUp {
  from { transform: translateY(10px); opacity: 0; }
  20% { opacity: 1; }
  to { transform: translateY(-42px); opacity: 0; }
}
.lose-tint {
  position: fixed;
  inset: 0;
  z-index: 245;
  pointer-events: none;
  background: rgba(239,68,68,.18);
  animation: loseTint .4s var(--casino-ease);
}
@keyframes loseTint { from { opacity: 1; } to { opacity: 0; } }
.hot-streak-overlay {
  position: fixed;
  inset: 0;
  z-index: 255;
  display: grid;
  place-items: center;
  font-size: clamp(34px, 7vw, 68px);
  font-weight: 900;
  color: #f8fafc;
  text-shadow: 0 0 22px rgba(56,189,248,.7), 0 0 42px rgba(250,204,21,.68);
  background: radial-gradient(circle, rgba(56,189,248,.22), rgba(2,6,23,.64));
  animation: hotStreakIn 1.4s var(--casino-ease);
}
@keyframes hotStreakIn {
  from { opacity: 0; transform: scale(0.9); }
  20% { opacity: 1; }
  to { opacity: 0; transform: scale(1.05); }
}

.roulette-ball-3d {
  box-shadow: inset -2px -2px 4px rgba(0,0,0,.45), inset 2px 2px 3px rgba(255,255,255,.55), 0 8px 18px rgba(0,0,0,.5);
}
.roulette-ball-orbit.spinning .roulette-ball-3d {
  filter: drop-shadow(0 6px 8px rgba(0,0,0,.55));
}
.roulette-place-bet {
  margin-top: 10px;
  width: 100%;
  min-height: 46px;
  font-size: 16px;
  font-weight: 800;
}
.roulette-bets.pending .bet-chip {
  border-color: rgba(56,189,248,.52);
  color: #bae6fd;
}

.plinko-trail {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(253,224,71,.8), rgba(56,189,248,.2));
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.plinko-v2 .plinko-ball[data-ball-id] {
  box-shadow: 0 0 16px rgba(56,189,248,.55), inset -2px -2px 4px rgba(0,0,0,.35);
}
.game-result-modal .result-actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.game-result-modal .result-flyup {
  color: #facc15;
  font-weight: 900;
  margin-top: 6px;
  animation: winFlyUp .95s var(--casino-ease) forwards;
}

@media (max-width: 860px) {
  .quick-bets .btn,
  .roulette-quick .btn,
  .bj2-actions .btn { min-height: 44px; font-size: 15px; padding: 10px 14px; }
  .bj2-search { min-width: 0; width: 100%; }
  .bj2-headline { flex-direction: column; align-items: stretch; }
  .bj2-controls { flex-direction: column; align-items: stretch; }
}
/* === Cyber Luxury V3: Blackjack + Case Battle === */
:root {
  --cyber-bg: #06101f;
  --cyber-accent: #22d1ee;
  --cyber-accent-soft: rgba(34, 209, 238, 0.28);
  --cyber-glass: rgba(10, 23, 42, 0.72);
}

@keyframes pulseNeon {
  0% { box-shadow: 0 0 0 rgba(34, 209, 238, 0.2); transform: translateY(0); }
  50% { box-shadow: 0 0 20px rgba(34, 209, 238, 0.5); transform: translateY(-1px); }
  100% { box-shadow: 0 0 0 rgba(34, 209, 238, 0.2); transform: translateY(0); }
}
@keyframes glowWin {
  0% { filter: drop-shadow(0 0 0 rgba(255, 202, 74, 0.25)); }
  50% { filter: drop-shadow(0 0 16px rgba(255, 202, 74, 0.92)); }
  100% { filter: drop-shadow(0 0 0 rgba(255, 202, 74, 0.25)); }
}
@keyframes shakeScreen {
  0% { transform: translate3d(0, 0, 0); }
  20% { transform: translate3d(-6px, 1px, 0); }
  40% { transform: translate3d(6px, -1px, 0); }
  60% { transform: translate3d(-4px, 2px, 0); }
  80% { transform: translate3d(4px, -2px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

.pulse { animation: pulseNeon 1.4s ease-in-out infinite; }
.screen-shake { animation: shakeScreen 0.32s linear; }
.cardFlip3d { transform-style: preserve-3d; }

.bjv3-shell,
.cbv3-shell {
  background: radial-gradient(1200px 500px at 10% -10%, rgba(34, 209, 238, 0.18), transparent), var(--cyber-bg);
}

.bjv3-table-wrap {
  position: relative;
  border-radius: 20px;
  padding: 18px 16px 20px;
  min-height: 500px;
  background: linear-gradient(180deg, rgba(10, 26, 42, 0.94), rgba(6, 14, 26, 0.94));
  border: 1px solid rgba(34, 209, 238, 0.22);
  backdrop-filter: blur(12px);
}
.bjv3-room-list {
  border: 1px solid rgba(34, 209, 238, 0.18);
  background: linear-gradient(180deg, rgba(10, 26, 42, 0.88), rgba(6, 14, 26, 0.88));
}
.bjv3-room-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.bjv3-room-title {
  font-size: 16px;
  font-weight: 800;
  color: #d7f8ff;
}
.bjv3-room-sub {
  font-size: 12px;
  color: #8eb7cc;
}
.bjv3-room-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.bjv3-room-item {
  text-align: left;
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(34, 209, 238, 0.2);
  background: rgba(11, 23, 35, 0.75);
  color: #d7f8ff;
  transition: border-color 0.2s ease, transform 0.18s ease, background 0.2s ease;
}
.bjv3-room-item:hover {
  border-color: rgba(34, 209, 238, 0.55);
  transform: translateY(-1px);
  background: rgba(15, 30, 46, 0.9);
}
.bjv3-room-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.bjv3-room-id {
  font-weight: 800;
  font-size: 13px;
  color: #e6fbff;
}
.bjv3-room-status {
  font-size: 11px;
  font-weight: 700;
  color: #9ef5ff;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(34, 209, 238, 0.35);
  background: rgba(34, 209, 238, 0.08);
}
.bjv3-room-meta {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 8px;
  font-size: 12px;
  color: #9cc4d9;
}
.bjv3-shoe {
  position: absolute;
  top: 22px;
  right: 28px;
  width: 72px;
  height: 96px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #d8f7ff;
  background: rgba(15, 28, 44, 0.86);
  border: 1px solid rgba(34, 209, 238, 0.4);
}
.bjv3-dealer { text-align: center; margin-top: 6px; }
.bjv3-label { color: #9ac7de; font-weight: 700; margin-bottom: 8px; }
.bjv3-cards, .bjv3-hand { display: flex; gap: 8px; align-items: center; justify-content: center; }
.bjv3-card {
  width: 42px;
  height: 62px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #06101f;
  background: linear-gradient(180deg, #f5fbff, #d8f4ff);
  border: 1px solid rgba(34, 209, 238, 0.36);
}
.bjv3-card.down {
  color: #d8f7ff;
  background: linear-gradient(180deg, #123050, #0d2239);
}
.bjv3-semicircle { position: relative; height: 280px; margin-top: 14px; }
.bjv3-seat {
  position: absolute;
  width: 23%;
  min-height: 152px;
  padding: 10px;
  border-radius: 16px;
  background: var(--cyber-glass);
  border: 1px solid rgba(34, 209, 238, 0.24);
}
.bjv3-seat.s1 { left: 0; bottom: 8px; }
.bjv3-seat.s2 { left: 25.5%; bottom: 0; }
.bjv3-seat.s3 { right: 25.5%; bottom: 0; }
.bjv3-seat.s4 { right: 0; bottom: 8px; }
.bjv3-seat.me { border-color: rgba(34, 209, 238, 0.75); }
.bjv3-seat.thinking { box-shadow: inset 0 0 0 1px rgba(34, 209, 238, 0.55); }
.bjv3-avatar { font-size: 12px; font-weight: 700; color: #d8f7ff; }
.bjv3-bet { font-size: 12px; color: #9cc4d9; margin: 4px 0 8px; }
.bjv3-ready {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #ffb5b5;
  border: 1px solid rgba(255, 120, 120, 0.4);
  border-radius: 999px;
  padding: 2px 7px;
  margin-bottom: 7px;
}
.bjv3-ready.ok {
  color: #aef8bd;
  border-color: rgba(120, 255, 170, 0.45);
}
.bjv3-thinking { width: 100%; height: 5px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, 0.12); }
.bjv3-thinking-bar { height: 100%; background: linear-gradient(90deg, #22d1ee, #8de3f7); transition: width 0.2s linear; }
.bjv3-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
  justify-content: center;
}
.bjv3-actions input {
  width: 110px;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(34, 209, 238, 0.34);
  background: rgba(11, 23, 35, 0.88);
  color: #d9f7ff;
  padding: 0 10px;
}

.cbv3-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.cbv3-head select {
  min-height: 42px;
  border-radius: 10px;
  background: rgba(11, 23, 35, 0.88);
  border: 1px solid rgba(34, 209, 238, 0.34);
  color: #d8f7ff;
  padding: 0 10px;
}
.cbv3-dual {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  grid-template-columns: 1fr;
}
.cbv3-lane {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 14px 0;
  min-height: 126px;
  background: linear-gradient(180deg, rgba(10, 26, 42, 0.94), rgba(6, 14, 26, 0.94));
  border: 1px solid rgba(34, 209, 238, 0.2);
}
.cbv3-pointer {
  position: absolute;
  left: 50%;
  top: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, #ffd56c, #ff9d2f);
  transform: translateX(-50%);
  z-index: 4;
}
.cbv3-track {
  display: flex;
  gap: 10px;
  align-items: stretch;
  width: max-content;
  padding: 0 14px;
  will-change: transform;
}
.cbv3-item {
  min-width: 120px;
  border-radius: 12px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 24, 37, 0.92);
}
.cbv3-item .cbv3-rarity { font-weight: 800; font-size: 11px; letter-spacing: 0.08em; }
.cbv3-item .cbv3-tag { margin-top: 8px; color: #c7e6f5; font-size: 12px; }
.rarity-common { box-shadow: inset 0 0 0 1px rgba(132, 145, 164, 0.4); }
.rarity-uncommon { box-shadow: 0 0 16px rgba(95, 214, 130, 0.28); }
.rarity-rare { box-shadow: 0 0 16px rgba(80, 157, 255, 0.32); }
.rarity-epic { box-shadow: 0 0 16px rgba(178, 101, 255, 0.34); }
.rarity-legendary { box-shadow: 0 0 18px rgba(255, 190, 63, 0.45); animation: glowWin 1.6s ease-in-out infinite; }
.rarity-immortal { box-shadow: 0 0 22px rgba(255, 85, 85, 0.48); animation: glowWin 1.2s ease-in-out infinite; }
.cbv3-result {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.cbv3-winner.player { color: #9effb1; font-weight: 800; }
.cbv3-winner.opponent { color: #ff9b9b; font-weight: 800; }

@media (max-width: 900px) {
  .bjv3-room-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .bjv3-room-head .btn {
    width: 100%;
  }
  .bjv3-room-grid {
    grid-template-columns: 1fr;
  }
  .bjv3-table-wrap { min-height: 580px; padding-bottom: 120px; }
  .bjv3-semicircle { height: 340px; }
  .bjv3-seat { width: 48%; }
  .bjv3-seat.s1 { left: 0; top: 0; bottom: auto; }
  .bjv3-seat.s2 { right: 0; top: 0; left: auto; bottom: auto; }
  .bjv3-seat.s3 { left: 0; bottom: 8px; right: auto; }
  .bjv3-seat.s4 { right: 0; bottom: 8px; left: auto; }
  .bjv3-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 56px;
    padding: 10px 12px;
    background: rgba(6, 16, 31, 0.93);
    border-top: 1px solid rgba(34, 209, 238, 0.2);
    justify-content: center;
    z-index: 60;
  }
  .bjv3-actions .btn,
  .bjv3-actions input {
    min-height: 44px;
  }
  .cbv3-dual {
    grid-template-rows: 1fr 1fr;
    min-height: 320px;
  }
}
/* === CaseBattle Fast Tabs === */
.cbfast-page {
  --cb-gap: 12px;
}
.cbfast-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.cbfast-cases-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: var(--cb-gap);
}
.cbfast-case-card {
  border-radius: 14px;
  border: 1px solid rgba(123, 163, 209, 0.26);
  background: linear-gradient(160deg, rgba(10, 26, 42, 0.92), rgba(8, 20, 36, 0.9));
  color: #def3ff;
  overflow: hidden;
  text-align: left;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.cbfast-case-card:hover {
  transform: translateY(-1px);
  border-color: rgba(34, 209, 238, 0.48);
}
.cbfast-case-card.active {
  border-color: rgba(34, 209, 238, 0.75);
  box-shadow: 0 0 0 1px rgba(34, 209, 238, 0.36) inset;
}
.cbfast-case-preview {
  aspect-ratio: 16 / 10;
  background: rgba(10, 22, 38, 0.8);
}
.cbfast-case-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cbfast-case-name {
  padding: 9px 10px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.03em;
}
.cbfast-case-empty {
  width: 100%;
  height: 100%;
  min-height: 84px;
  display: grid;
  place-items: center;
  color: #8db3c8;
  font-size: 12px;
}

.cbfast-open {
  margin-top: 10px;
}
.cbfast-open-top {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.cbfast-open-title {
  font-size: 15px;
  font-weight: 800;
  color: #dcf6ff;
}
.cbfast-open-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.cbfast-open-controls select,
.cbfast-open-controls input {
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(123, 163, 209, 0.28);
  background: rgba(12, 28, 46, 0.86);
  color: #e0f6ff;
  padding: 0 10px;
}
.cbfast-open-controls input {
  width: 82px;
}

.cbfast-reel-lane {
  margin-top: 12px;
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(123, 163, 209, 0.24);
  background: rgba(8, 21, 39, 0.8);
  padding: 14px 0;
  min-height: 150px;
}
.cbfast-pointer {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, #ffd16f, #ff9a2e);
  z-index: 4;
}
.cbfast-track {
  display: flex;
  gap: 10px;
  width: max-content;
  padding: 0 12px;
  will-change: transform;
}
.cbfast-reel-item {
  min-width: 130px;
  border-radius: 12px;
  border: 1px solid rgba(123, 163, 209, 0.24);
  overflow: hidden;
  background: rgba(10, 24, 41, 0.92);
}
.cbfast-reel-item img {
  width: 100%;
  height: 92px;
  object-fit: cover;
  display: block;
}
.cbfast-reel-item span {
  display: block;
  padding: 7px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #d8f3ff;
}
.cbfast-reel-item.winner {
  border-color: rgba(255, 205, 94, 0.78);
  box-shadow: 0 0 18px rgba(255, 188, 60, 0.34);
}
.cbfast-selected-preview {
  margin-top: 10px;
  width: 140px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(123, 163, 209, 0.24);
}
.cbfast-selected-preview img {
  width: 100%;
  height: 92px;
  object-fit: cover;
  display: block;
}
.cbfast-win-single {
  margin-top: 12px;
  border: 1px solid rgba(123, 163, 209, 0.24);
  border-radius: 12px;
  background: rgba(9, 23, 39, 0.8);
  padding: 10px;
}
.cbfast-win-title {
  font-weight: 800;
  font-size: 13px;
  color: #dbf6ff;
  margin-bottom: 8px;
}
.cbfast-win-media img {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 10px;
}

.pulseNeon { animation: pulseNeon 1.4s ease-in-out infinite; }

.aetherforge-card {
  background: linear-gradient(145deg, rgba(9, 24, 42, 0.9), rgba(18, 38, 58, 0.86));
  border-color: rgba(34, 211, 238, 0.35);
  box-shadow: 0 12px 30px rgba(34, 211, 238, 0.14);
}
.aetherforge-shell {
  position: relative;
  overflow: hidden;
  background: radial-gradient(1000px 460px at 12% -12%, rgba(56, 189, 248, 0.26), transparent), radial-gradient(900px 420px at 88% 120%, rgba(244, 114, 182, 0.19), transparent), linear-gradient(180deg, rgba(7, 16, 31, 0.92), rgba(4, 10, 21, 0.95));
  border: 1px solid rgba(103, 171, 220, 0.2);
}
.aether-top-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.aether-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(14, 25, 43, 0.72);
  border: 1px solid rgba(113, 180, 229, 0.3);
  font-size: 12px;
  font-weight: 700;
}
.aether-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 220px;
  gap: 12px;
  align-items: start;
}
.aether-left,
.aether-right {
  background: rgba(8, 18, 34, 0.72);
  border: 1px solid rgba(121, 176, 216, 0.25);
  border-radius: 14px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.aether-left .btn,
.aether-right .btn,
.aether-right select {
  min-height: 42px;
}
.aether-center {
  min-height: 420px;
}
.forge-reel-frame {
  position: relative;
  border-radius: 20px;
  padding: 14px;
  border: 1px solid rgba(92, 175, 230, 0.36);
  background: linear-gradient(180deg, rgba(8, 20, 39, 0.85), rgba(6, 13, 27, 0.92));
  backdrop-filter: blur(10px);
  touch-action: none;
}
.aether-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  height: 100%;
  min-height: 0;
}
.aether-grid-stage {
  --forge-rows: 3;
  --forge-symbol-h: 124px;
  --forge-row-gap: 8px;
  --forge-viewport-h: calc(var(--forge-symbol-h) * var(--forge-rows) + var(--forge-row-gap) * (var(--forge-rows) - 1));
  position: relative;
  height: var(--forge-viewport-h);
  max-height: var(--forge-viewport-h);
  overflow: hidden;
  border-radius: 14px;
}
.forge-reel {
  display: grid;
  grid-template-rows: repeat(var(--forge-rows), minmax(0, var(--forge-symbol-h)));
  gap: var(--forge-row-gap);
  min-height: 0;
  height: 100%;
}
.aether-grid.is-spinning .forge-reel {
  display: block;
  height: var(--forge-viewport-h);
  min-height: var(--forge-viewport-h);
}
.forge-symbol {
  min-height: var(--forge-symbol-h);
  height: var(--forge-symbol-h);
  border-radius: 12px;
  border: 1px solid rgba(140, 191, 232, 0.3);
  background: linear-gradient(180deg, rgba(20, 42, 67, 0.9), rgba(8, 19, 35, 0.92));
  color: #e9f7ff;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-shadow: 0 0 14px rgba(64, 215, 252, 0.4);
  transform: translate3d(0, 0, 0);
  will-change: transform, box-shadow;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
}
.forge-symbol-icon {
  font-size: 28px;
  line-height: 1;
  filter: drop-shadow(0 0 12px rgba(125, 220, 255, 0.42));
  animation: symbolFloat 2.4s ease-in-out infinite;
}
.forge-symbol-icon.mini {
  font-size: 24px;
}
.forge-symbol-name {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
}
.aether-grid.is-spinning .forge-symbol {
  filter: blur(0.8px) saturate(1.2);
}
.forge-reel-spin-window {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  height: var(--forge-viewport-h);
  max-height: var(--forge-viewport-h);
}
.aether-grid.is-spinning .forge-reel-spin-window {
  height: 100%;
  max-height: none;
}
.forge-reel-strip {
  display: grid;
  grid-auto-rows: var(--forge-symbol-h);
  gap: var(--forge-row-gap);
  will-change: transform;
}
.forge-reel-strip.blur .forge-symbol {
  filter: blur(6px) saturate(1.15);
  transform: scaleY(1.12);
  opacity: 0.72;
}
.forge-symbol.spin {
  pointer-events: none;
}
.aether-winlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 7;
  overflow: hidden;
}
.aether-winline-path {
  fill: none;
  stroke: rgba(250, 236, 159, 0.96);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 12 6;
  stroke-dashoffset: 72;
  filter: drop-shadow(0 0 4px rgba(253, 224, 71, 0.9));
  animation: winlinePulse 0.9s ease-in-out infinite alternate, winlineRun 0.95s linear infinite;
  vector-effect: non-scaling-stroke;
}
.forge-symbol.tier-common { box-shadow: inset 0 0 0 1px rgba(125, 180, 224, 0.2); }
.forge-symbol.tier-uncommon { box-shadow: inset 0 0 0 1px rgba(192, 120, 236, 0.35), 0 0 14px rgba(192, 120, 236, 0.2); }
.forge-symbol.tier-rare { box-shadow: inset 0 0 0 1px rgba(241, 130, 212, 0.45), 0 0 18px rgba(241, 130, 212, 0.22); }
.forge-symbol.tier-epic { box-shadow: inset 0 0 0 1px rgba(254, 185, 85, 0.48), 0 0 19px rgba(254, 185, 85, 0.3); }
.forge-symbol.tier-legendary { box-shadow: inset 0 0 0 1px rgba(254, 239, 138, 0.55), 0 0 24px rgba(254, 239, 138, 0.42); }
.aether-fusion-list {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fusion-particle {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(251, 205, 114, 0.38);
  background: rgba(52, 35, 7, 0.4);
  color: #fde68a;
}
.aether-history {
  margin-top: 6px;
}
.aether-history-item {
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(124, 177, 218, 0.22);
  background: rgba(10, 25, 43, 0.62);
  font-size: 12px;
}
.aether-bottom {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(114, 183, 223, 0.23);
  background: rgba(7, 16, 31, 0.78);
}
.aether-bottom input {
  width: 112px;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(111, 173, 214, 0.35);
  background: rgba(6, 16, 29, 0.86);
  color: var(--text-0);
  padding: 0 12px;
}
.aether-spin-btn {
  min-height: 56px;
  min-width: 140px;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.aether-settings {
  margin-top: 10px;
}
.aether-settings label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.aether-paytable {
  width: min(760px, calc(100vw - 24px));
}
.aether-pay-grid {
  margin: 12px 0;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px;
}
.aether-leaderboard {
  margin-top: 8px;
}
.aether-lb-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  border-bottom: 1px dashed rgba(120, 174, 212, 0.18);
  padding: 4px 0;
}
.aether-win-meta {
  font-size: 12px;
  color: var(--text-1);
}
.aether-win-meta.is-rolling {
  color: var(--accent-amber);
  text-shadow: 0 0 14px rgba(251, 191, 36, 0.55);
  animation: countShake 0.09s linear infinite alternate;
}
.symbol-win-pulse {
  animation: symbolWinPulse 0.6s ease-in-out infinite alternate;
  transform: scale(1.08) translateZ(0);
}
.aether-bigwin::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(250, 204, 21, 0.16), transparent 55%);
  pointer-events: none;
}
@keyframes reelRoll {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(0, -184px, 0); }
}
@keyframes symbolFloat {
  0% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
  100% { transform: translateY(0); }
}
@keyframes winlinePulse {
  0% { opacity: 0.62; stroke-width: 1.2; }
  100% { opacity: 1; stroke-width: 1.8; }
}
@keyframes winlineRun {
  0% { stroke-dashoffset: 72; }
  100% { stroke-dashoffset: 0; }
}
@keyframes symbolWinPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.2); }
}
@keyframes countShake {
  0% { transform: translate3d(-0.5px, 0, 0); }
  100% { transform: translate3d(0.5px, 0, 0); }
}

:root[data-theme="cyber"] .aetherforge-shell { box-shadow: inset 0 0 90px rgba(10, 126, 164, 0.22); }
:root[data-theme="femboy"] .aetherforge-shell { box-shadow: inset 0 0 90px rgba(236, 72, 153, 0.18); }
:root[data-theme="sakura"] .aetherforge-shell { box-shadow: inset 0 0 90px rgba(251, 113, 133, 0.18); }
:root[data-theme="terminal"] .aetherforge-shell { box-shadow: inset 0 0 90px rgba(34, 197, 94, 0.17); }

@media (max-width: 1023px) {
  .aether-layout {
    grid-template-columns: 1fr;
  }
  .aether-left,
  .aether-right {
    display: none;
  }
  .aether-center {
    min-height: 0;
  }
  .aether-grid-stage {
    --forge-symbol-h: 84px;
    --forge-row-gap: 8px;
  }
  .aether-grid {
    min-height: 0;
  }
  .aether-bottom {
    position: sticky;
    bottom: 0;
    z-index: 40;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
  .aether-bottom .btn,
  .aether-bottom input {
    min-height: 48px;
  }
  .aether-spin-btn {
    flex: 1 1 100%;
  }
}

.aetherforge-shell .forge-symbol {
  animation: symbolFloat 2.8s ease-in-out infinite;
}
.aetherforge-shell .is-spinning .forge-symbol,
.aether-grid.is-spinning .forge-symbol {
  animation: none;
  filter: brightness(1.3) saturate(1.6);
}
.fusion-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9;
}
.fusion-particle {
  position: absolute;
  animation: fusionExplode 0.9s forwards;
}
.aether-fusion-list .fusion-particle {
  position: relative;
  animation: none;
}
.big-win-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(36px, 8vw, 88px);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fef08a;
  background: radial-gradient(circle at center, rgba(255, 215, 80, 0.28), rgba(2, 6, 23, 0.72));
  text-shadow: 0 0 34px rgba(252, 211, 77, 0.9);
  z-index: 140;
  pointer-events: none;
  animation: bigWinFlash 1.2s ease-out forwards;
}
.big-win-overlay.jackpot {
  color: #fca5a5;
  text-shadow: 0 0 44px rgba(239, 68, 68, 0.9);
  background: radial-gradient(circle at center, rgba(239, 68, 68, 0.3), rgba(2, 6, 23, 0.8));
}
.jackpot {
  animation: jackpotPulse 0.55s ease-in-out infinite alternate;
}
.legendary-glow {
  box-shadow: 0 0 30px rgba(253, 230, 138, 0.75), inset 0 0 0 1px rgba(253, 230, 138, 0.7);
}
.reel-flash {
  animation: reelFlash 0.45s ease-out;
}
@keyframes fusionExplode {
  0% { opacity: 0.95; transform: translate3d(0, 0, 0) scale(0.75); }
  100% { opacity: 0; transform: translate3d(0, -38px, 0) scale(1.25); }
}
@keyframes bigWinFlash {
  0% { opacity: 0; transform: scale(0.8); }
  25% { opacity: 1; transform: scale(1.03); }
  100% { opacity: 0; transform: scale(1.2); }
}
@keyframes jackpotPulse {
  0% { transform: scale(1); filter: saturate(1); }
  100% { transform: scale(1.06); filter: saturate(1.2); }
}
@keyframes reelFlash {
  0% { box-shadow: 0 0 0 rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 20px rgba(255, 255, 255, 0.22); }
}

.slots-page .slots-header {
  margin-bottom: 10px;
}
.slots-page .slots-container {
  display: flex;
  gap: 10px;
  background: rgba(0, 0, 0, 0.4);
  padding: 20px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line-strong);
  overflow: hidden;
  justify-content: center;
  perspective: 1000px;
  position: relative;
}
.slots-page .reel-column {
  width: 120px;
  height: 400px;
  background: var(--surface-1);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}
.slots-page .reel-track {
  will-change: transform, filter;
  transform: translateZ(0);
}
.slots-page .symbol {
  width: 120px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 50px;
  user-select: none;
  transition: filter 0.1s linear;
}
.slots-page .reel-track.blur .symbol,
.slots-page .symbol.blur {
  filter: blur(6px) scaleY(1.2);
  opacity: 0.7;
}
.slots-page .symbol.winning {
  animation: symbol-win 0.5s infinite alternate;
  z-index: 10;
  filter: drop-shadow(0 0 15px var(--accent-amber));
}
.slots-page .win-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  pointer-events: none;
}
.slots-page .slots-controls {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  justify-content: center;
}
@keyframes symbol-win {
  from { transform: scale(1); }
  to { transform: scale(1.15); }
}

.cbfast-inventory {
  margin-top: 10px;
}
.cbfast-inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: var(--cb-gap);
}

.cbfast-win-modal {
  width: min(1050px, calc(100vw - 24px));
  max-height: min(88vh, 840px);
}
.cbfast-win-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  max-height: min(62vh, 620px);
  overflow: auto;
  padding-right: 4px;
}

@media (max-width: 980px) {
  .cbfast-cases-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cbfast-inventory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cbfast-win-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: min(65vh, 580px);
  }
  .cbfast-open-controls {
    width: 100%;
  }
  .cbfast-open-controls select,
  .cbfast-open-controls input,
  .cbfast-open-controls .btn {
    flex: 1 1 calc(50% - 8px);
  }
}
/* === CaseBattle Legacy Mobile Tune === */
@media (max-width: 900px) {
  .casebattle {
    padding-bottom: calc(74px + env(safe-area-inset-bottom));
  }

  .casebattle .topbar {
    gap: 8px;
    align-items: flex-start;
    flex-direction: column;
  }

  .casebattle-tabs {
    position: sticky;
    top: 8px;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 6px;
    border-radius: 12px;
    background: rgba(6, 18, 33, 0.92);
    border: 1px solid rgba(123, 163, 209, 0.24);
  }

  .casebattle-tabs .btn {
    min-height: 40px;
    padding: 8px 6px;
    font-size: 12px;
  }

  .casebattle-categories {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .casebattle-categories .btn {
    min-height: 42px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .casebattle-batch {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .casebattle-batch label {
    grid-column: 1 / -1;
    margin: 0;
  }

  .casebattle-batch select,
  .casebattle-batch input,
  .casebattle-batch .btn,
  .casebattle-batch .batch-buttons {
    width: 100%;
    min-height: 42px;
  }

  .batch-buttons {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    grid-column: 1 / -1;
  }

  .casebattle-roulette {
    margin-top: 8px;
    border-radius: 14px;
    overflow: hidden;
  }

  .case-roulette {
    min-height: 146px;
  }

  .case-roulette-track {
    gap: 8px;
    padding: 10px;
  }

  .case-roulette-item {
    min-width: 112px;
  }

  .case-roulette-media,
  .case-roulette-item .media-preview {
    height: 80px;
  }

  .casebattle-multi-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .inventory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .media-modal,
  .win-modal-content {
    width: calc(100vw - 18px);
    max-width: calc(100vw - 18px);
    max-height: min(84vh, 760px);
    border-radius: 14px;
    padding: 10px;
  }

  .media-modal-video,
  .media-modal-img {
    max-height: 52vh;
  }

  .media-modal-actions,
  .win-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .media-modal-actions .btn,
  .win-actions .btn {
    width: 100%;
    min-height: 42px;
  }
}
