:root {
  --orange: #fb4b02;
  --orange2: #ff8a4a;
  --orange-glow: rgba(251, 75, 2, 0.35);
  --orange-soft: rgba(251, 75, 2, 0.12);
  --orange-border: rgba(251, 75, 2, 0.45);
  --radius: 10px;
  --font: "Segoe UI", Inter, system-ui, sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0b0b;
  --bg2: #121212;
  --bg3: #1a1a1a;
  --border: #2a2a2a;
  --text: #f2f2f2;
  --muted: #8a8a8a;
  --main-bg:
    radial-gradient(circle at 12% 0%, rgba(251, 75, 2, 0.08), transparent 38%),
    radial-gradient(circle at 88% 100%, rgba(251, 75, 2, 0.05), transparent 42%),
    #141414;
  --ambient-bg:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(251, 75, 2, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(251, 75, 2, 0.08), transparent 50%),
    #0b0b0b;
  --auth-bg:
    radial-gradient(circle at 20% 20%, rgba(251, 75, 2, 0.12), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(251, 75, 2, 0.08), transparent 35%),
    var(--bg);
  --topbar-bg: linear-gradient(180deg, rgba(22, 22, 22, 0.98), rgba(18, 18, 18, 0.95));
  --topbar-border: rgba(251, 75, 2, 0.15);
  --surface-inset: rgba(255, 255, 255, 0.04);
  --surface-border: rgba(255, 255, 255, 0.08);
  --surface-highlight: rgba(255, 255, 255, 0.06);
  --chip-bg: rgba(255, 255, 255, 0.03);
  --chip-border: rgba(255, 255, 255, 0.08);
  --action-color: #a8a8a8;
  --action-bg: linear-gradient(160deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
  --tile-name: #ececec;
  --tile-fallback: linear-gradient(165deg, #525252 0%, #404040 45%, #343434 100%);
  --tile-badge-empty: rgba(68, 68, 68, 0.88);
  --placeholder: #777;
  --scroll-track: rgba(255, 255, 255, 0.04);
  --overlay: rgba(0, 0, 0, 0.75);
  --shadow-window: 0 24px 64px rgba(0, 0, 0, 0.55);
  --shadow-toast: 0 12px 32px rgba(0, 0, 0, 0.45);
  --skeleton-base: #1a1a1a;
  --skeleton-line: #222;
  --btn-on-primary: #111;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f3f4;
  --bg2: #ffffff;
  --bg3: #ececef;
  --border: #d4d4d8;
  --text: #18181b;
  --muted: #5c5c66;
  --ambient-bg:
    radial-gradient(ellipse 90% 55% at 50% -15%, rgba(251, 75, 2, 0.2), transparent 52%),
    radial-gradient(ellipse 45% 75% at 0% 55%, rgba(251, 75, 2, 0.14), transparent 48%),
    radial-gradient(ellipse 45% 75% at 100% 55%, rgba(251, 75, 2, 0.14), transparent 48%),
    radial-gradient(ellipse 85% 50% at 50% 115%, rgba(251, 75, 2, 0.16), transparent 52%),
    linear-gradient(180deg, #fafafa 0%, #f0f1f3 48%, #eceef1 100%);
  --edge-glow: rgba(251, 75, 2, 0.28);
  --edge-glow-soft: rgba(251, 75, 2, 0.1);
  --main-bg:
    radial-gradient(circle at 0% 0%, rgba(251, 75, 2, 0.08), transparent 32%),
    radial-gradient(circle at 100% 0%, rgba(251, 75, 2, 0.08), transparent 32%),
    radial-gradient(circle at 0% 100%, rgba(251, 75, 2, 0.06), transparent 30%),
    radial-gradient(circle at 100% 100%, rgba(251, 75, 2, 0.06), transparent 30%),
    radial-gradient(circle at 12% 0%, rgba(251, 75, 2, 0.1), transparent 38%),
    radial-gradient(circle at 88% 100%, rgba(251, 75, 2, 0.06), transparent 42%),
    #eef0f2;
  --auth-bg:
    radial-gradient(circle at 20% 20%, rgba(251, 75, 2, 0.1), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(251, 75, 2, 0.06), transparent 35%),
    var(--bg);
  --topbar-bg: linear-gradient(180deg, #ffffff 0%, #f9f9fa 100%);
  --topbar-border: rgba(251, 75, 2, 0.28);
  --surface-inset: rgba(0, 0, 0, 0.03);
  --surface-border: rgba(0, 0, 0, 0.1);
  --surface-highlight: rgba(255, 255, 255, 0.9);
  --chip-bg: rgba(0, 0, 0, 0.04);
  --chip-border: rgba(0, 0, 0, 0.1);
  --action-color: #5c5c66;
  --action-bg: linear-gradient(160deg, rgba(255, 255, 255, 0.95) 0%, rgba(0, 0, 0, 0.03) 100%);
  --tile-name: #27272a;
  --tile-fallback: linear-gradient(165deg, #d4d4d8 0%, #c4c4c8 45%, #b8b8bc 100%);
  --tile-badge-empty: rgba(113, 113, 122, 0.88);
  --placeholder: #94949e;
  --scroll-track: rgba(0, 0, 0, 0.06);
  --overlay: rgba(24, 24, 27, 0.42);
  --shadow-window: 0 24px 64px rgba(28, 25, 23, 0.12);
  --shadow-toast: 0 12px 32px rgba(28, 25, 23, 0.14);
  --skeleton-base: #e4e4e7;
  --skeleton-line: #d4d4d8;
  --btn-on-primary: #111;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  overscroll-behavior: none;
  user-select: none;
}

#app { height: 100vh; max-height: 100vh; position: relative; overflow: hidden; }

.auth[hidden],
.launcher[hidden] {
  display: none !important;
}

.logo-mark {
  display: block;
  width: auto;
  height: 40px;
  max-width: min(200px, 42vw);
  border-radius: 0;
  object-fit: contain;
  flex-shrink: 0;
}

.logo-mark--sm {
  height: 34px;
  max-width: 160px;
}

.auth__logo .logo-mark {
  width: auto;
  height: 72px;
  max-width: min(300px, 88vw);
}

.auth__logo {
  text-align: center;
  margin-bottom: 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Auth */
.auth {
  height: 100%;
  display: grid;
  place-items: center;
  background: var(--auth-bg);
}

.auth__window {
  width: min(420px, 92vw);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  box-shadow: var(--shadow-window);
  position: relative;
}

.auth__logo h1 {
  margin-top: 0.85rem;
  font-size: 1.75rem;
}

.auth__logo p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.field span { font-size: 0.85rem; color: var(--muted); }

.field input,
.field select {
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  font: inherit;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(251, 75, 2, 0.15);
}

.field--row {
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
}

.auth__hint {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  margin-top: 0.85rem;
  line-height: 1.4;
}

.auth__server { margin-top: 1rem; text-align: center; }

.server-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.75rem 0 0.25rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.server-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #888;
  flex-shrink: 0;
}
.server-status--online .server-status__dot { background: #3ddc84; box-shadow: 0 0 8px rgba(61, 220, 132, 0.5); }
.server-status--offline .server-status__dot { background: #ff6b6b; }
.server-status--unknown .server-status__dot { background: #f0ad4e; animation: zk-pulse 1.2s ease infinite; }
.server-status--demo .server-status__dot { background: #7c5cff; }
.server-status__text { opacity: 0.92; }
.auth__demo-btn { margin-top: 0.5rem; }
.btn--sm { font-size: 0.82rem; padding: 0.45rem 0.75rem; margin-top: 0.5rem; }
@keyframes zk-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
[data-theme="light"] .server-status {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}

.auth__success {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid rgba(251, 75, 2, 0.35);
  background: rgba(251, 75, 2, 0.08);
  text-align: center;
}

.auth__success-title {
  font-weight: 700;
  color: var(--orange2);
  margin-bottom: 0.35rem;
}

.auth__success-text {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.auth__success .btn + .btn {
  margin-top: 0.5rem;
}

.link-btn {
  background: none;
  border: none;
  color: var(--orange2);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
}

.server-fields { margin-top: 0.85rem; text-align: left; }

.btn {
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1.1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s;
}

.btn--primary {
  background: linear-gradient(135deg, var(--orange), #d83804);
  color: var(--btn-on-primary);
}

.btn--primary:hover { filter: brightness(1.08); }

.btn--ghost {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn--block { width: 100%; padding: 0.8rem; }

.btn--sm { padding: 0.45rem 0.7rem; font-size: 0.9rem; }

/* Launcher layout */
.launcher {
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 200px;
}

.topbar__brand strong { display: block; font-size: 1rem; }

.topbar__club {
  font-size: 0.75rem;
  color: var(--muted);
}

.topbar__search { flex: 1; }

.topbar__search input {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  font: inherit;
}

.topbar__actions { display: flex; gap: 0.4rem; align-items: center; }

.topbar-icon-btn,
.topbar-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  background: var(--action-bg);
  color: var(--action-color);
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 var(--surface-highlight);
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.topbar-icon-btn:hover,
.topbar-action-btn:hover {
  color: var(--orange2);
  border-color: rgba(251, 75, 2, 0.5);
  background: linear-gradient(160deg, rgba(251, 75, 2, 0.16) 0%, rgba(251, 75, 2, 0.06) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 14px rgba(251, 75, 2, 0.14);
}

.topbar-action-btn--refresh {
  color: var(--orange);
  border-color: rgba(251, 75, 2, 0.38);
  background: linear-gradient(160deg, rgba(251, 75, 2, 0.14) 0%, rgba(251, 75, 2, 0.05) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 10px rgba(251, 75, 2, 0.1);
}

.topbar-action-btn--refresh:hover {
  color: var(--orange2);
  border-color: rgba(251, 75, 2, 0.55);
  background: linear-gradient(160deg, rgba(251, 75, 2, 0.22) 0%, rgba(251, 75, 2, 0.08) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 16px rgba(251, 75, 2, 0.2);
}

.topbar-action-btn--exit {
  color: var(--orange);
  border-color: rgba(251, 75, 2, 0.38);
  background: linear-gradient(160deg, rgba(251, 75, 2, 0.14) 0%, rgba(251, 75, 2, 0.05) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 10px rgba(251, 75, 2, 0.1);
}

.topbar-action-btn--exit:hover {
  color: var(--orange2);
  border-color: rgba(251, 75, 2, 0.55);
  background: linear-gradient(160deg, rgba(251, 75, 2, 0.22) 0%, rgba(251, 75, 2, 0.08) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 16px rgba(251, 75, 2, 0.2);
}

.topbar-action-btn--theme {
  color: var(--orange);
  border-color: rgba(251, 75, 2, 0.38);
  background: linear-gradient(160deg, rgba(251, 75, 2, 0.14) 0%, rgba(251, 75, 2, 0.05) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 10px rgba(251, 75, 2, 0.1);
}

.topbar-action-btn--theme:hover {
  color: var(--orange2);
  border-color: rgba(251, 75, 2, 0.55);
  background: linear-gradient(160deg, rgba(251, 75, 2, 0.22) 0%, rgba(251, 75, 2, 0.08) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 16px rgba(251, 75, 2, 0.2);
}

html[data-theme="light"] .topbar-action-btn--theme {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 0 14px rgba(251, 75, 2, 0.18);
}

html[data-theme="light"] .topbar-action-btn--theme:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 0 20px rgba(251, 75, 2, 0.28);
}

.topbar-action-btn__icon--fill {
  width: 18px;
  height: 18px;
}

.client-kiosk .topbar-action-btn__icon--fill {
  width: 17px;
  height: 17px;
}

.topbar-icon-btn--danger:hover,
.topbar-action-btn--danger:hover {
  color: #ff7b7b;
  border-color: rgba(255, 107, 107, 0.45);
  background: linear-gradient(160deg, rgba(255, 80, 80, 0.14) 0%, rgba(255, 80, 80, 0.05) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 14px rgba(255, 80, 80, 0.12);
}

.topbar-icon-btn:active,
.topbar-action-btn:active {
  transform: scale(0.94);
}

.topbar-icon-btn:focus-visible,
.topbar-action-btn:focus-visible {
  outline: 2px solid rgba(251, 75, 2, 0.45);
  outline-offset: 2px;
}

.topbar-icon-btn:disabled,
.topbar-action-btn:disabled {
  opacity: 0.5;
  cursor: wait;
  transform: none;
}

.topbar-btn__icon,
.topbar-action-btn__icon {
  width: 17px;
  height: 17px;
  display: block;
  pointer-events: none;
}

.topbar-icon-btn--spin .topbar-btn__icon,
.topbar-icon-btn--spin .topbar-action-btn__icon,
.topbar-action-btn--spin .topbar-action-btn__icon {
  animation: topbar-spin 0.65s linear infinite;
}

@keyframes topbar-spin {
  to { transform: rotate(360deg); }
}

.client-kiosk .topbar-icon-btn,
.client-kiosk .topbar-action-btn {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 9px;
}

.client-kiosk .topbar-btn__icon,
.client-kiosk .topbar-action-btn__icon {
  width: 16px;
  height: 16px;
}

.launcher__body {
  display: grid;
  grid-template-columns: 200px 1fr;
  min-height: 0;
}

.sidebar {
  background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar__item {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.sidebar__item:hover { background: var(--bg3); color: var(--text); }

.sidebar__item--active {
  background: rgba(251, 75, 2, 0.12);
  color: var(--orange2);
  border: 1px solid rgba(251, 75, 2, 0.25);
}

.sidebar__stats {
  margin-top: auto;
  padding: 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.sidebar__online { color: #4ade80; margin-top: 0.35rem; }

.games-area {
  overflow-y: auto;
  padding: 1rem;
  background:
    radial-gradient(circle at 90% 10%, rgba(251, 75, 2, 0.06), transparent 30%),
    var(--bg);
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.game-card {
  position: relative;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.game-card:hover {
  transform: translateY(-3px);
  border-color: rgba(251, 75, 2, 0.45);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(251, 75, 2, 0.15);
}

.game-card__cover {
  aspect-ratio: 2 / 3;
  background: linear-gradient(160deg, var(--c1), var(--c2));
  position: relative;
  overflow: hidden;
}

.game-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.game-card__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.85));
}

.game-card__play {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: 0.15s;
  background: rgba(0, 0, 0, 0.35);
  font-size: 2rem;
  color: var(--orange);
}

.game-card:hover .game-card__play { opacity: 1; }

.game-card__gear {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.65);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
}

.game-card__gear:hover {
  color: var(--orange);
  border-color: rgba(251, 75, 2, 0.5);
}

.game-card__info {
  padding: 0.65rem 0.7rem 0.75rem;
}

.game-card__info .btn-play {
  width: 100%;
  margin-top: 0.55rem;
}

.game-card--disabled { opacity: 0.55; }

.game-card--club .game-card__tag strong { color: var(--orange2); }

.club-main {
  padding: 1.5rem 2rem;
  overflow-y: auto;
  flex: 1;
}

.games-grid--club {
  grid-template-columns: repeat(3, 1fr);
  max-width: 1100px;
}

.section-head-inline h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.section-head-inline p {
  color: var(--muted);
  margin-top: 0.3rem;
}

.credentials {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.cred-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: #0f1218;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.cred-row span { color: var(--muted); font-size: 0.88rem; }

.cred-row code {
  font-family: monospace;
  color: var(--orange2);
  font-weight: 600;
  font-size: 1rem;
}

.credentials__note {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.modal__dialog--wide { width: min(520px, 100%); }

.field--inline {
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.field--inline select {
  flex: 1;
  max-width: 320px;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
}

.field--filter .filter-club-select {
  max-width: 360px;
  min-width: 220px;
  font-weight: 600;
  color: var(--orange2);
}

@media (max-width: 900px) {
  .games-grid--club { grid-template-columns: 1fr; }
}

.game-card__title {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.game-card__tag {
  font-size: 0.68rem;
  color: var(--orange2);
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.statusbar {
  display: flex;
  justify-content: space-between;
  padding: 0.45rem 1rem;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--muted);
}

.empty {
  text-align: center;
  padding: 3rem;
  color: var(--muted);
}

/* Loading */
.loading[hidden] { display: none !important; }

.loading {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: grid;
  place-items: center;
  z-index: 100;
}

.loading__box {
  text-align: center;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem 2.5rem;
}

.loading__ring {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--orange);
  margin: 0 auto 1rem;
  animation: spin 0.9s linear infinite;
}

.loading__game {
  display: block;
  margin-top: 0.35rem;
  color: var(--orange2);
  font-size: 0.85rem;
}

.loading__cancel {
  margin-top: 1rem;
}

.toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 120;
  max-width: 360px;
  padding: 0.85rem 1rem;
  background: var(--bg2);
  border: 1px solid var(--orange-border);
  border-radius: 10px;
  box-shadow: var(--shadow-toast);
  font-size: 0.88rem;
  line-height: 1.4;
  animation: toast-in 0.2s ease;
}

.toast[hidden] { display: none !important; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Modal */
.modal[hidden] { display: none; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.modal__dialog {
  position: relative;
  width: min(440px, 100%);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.modal__head,
.modal__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}

.modal__foot {
  border-bottom: none;
  border-top: 1px solid var(--border);
  gap: 0.5rem;
  justify-content: flex-end;
}

.modal__body { padding: 1rem; }

.modal__subtitle {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.85rem;
}

.modal__close {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 7px;
  background: var(--bg2);
  color: var(--text);
  cursor: pointer;
  font-size: 1.1rem;
}

@media (max-width: 800px) {
  .launcher__body { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

/* Compact club launcher — grid tiles */
.club-compact {
  font-size: 12px;
}

.club-compact #app,
.club-compact .launcher--compact {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

.club-compact .launcher--compact {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.club-compact .topbar--compact {
  flex-shrink: 0;
}

.club-compact .statusbar--compact {
  flex-shrink: 0;
}

.club-compact .club-main--compact {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0.55rem 0.65rem;
  background: var(--main-bg);
}

.club-compact .games-toolbar {
  flex-shrink: 0;
  position: static;
  top: auto;
  z-index: auto;
  padding: 0.15rem 0 0.65rem;
  background: transparent;
}

.club-compact .games-scroll,
.club-compact .games-grid--tiles.games-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  align-content: start;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(251, 75, 2, 0.45) var(--scroll-track);
}

.club-compact .games-scroll::-webkit-scrollbar,
.club-compact .games-grid--tiles.games-scroll::-webkit-scrollbar {
  width: 8px;
}

.club-compact .games-scroll::-webkit-scrollbar-track,
.club-compact .games-grid--tiles.games-scroll::-webkit-scrollbar-track {
  background: var(--scroll-track);
  border-radius: 8px;
}

.club-compact .games-scroll::-webkit-scrollbar-thumb,
.club-compact .games-grid--tiles.games-scroll::-webkit-scrollbar-thumb {
  background: rgba(251, 75, 2, 0.4);
  border-radius: 8px;
}

.logo-mark--xs {
  height: 36px;
  width: auto;
  max-width: 140px;
}

.topbar--compact {
  padding: 0.4rem 0.5rem;
  gap: 0.35rem;
}

.topbar--compact .topbar__brand {
  min-width: 0;
  flex: 1;
  gap: 0.4rem;
}

.topbar--compact .topbar__club {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
}

.btn--xs {
  padding: 0.2rem 0.45rem;
  font-size: 0.85rem;
  min-width: 26px;
  line-height: 1.2;
}

.games-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  background: var(--surface-inset);
  box-shadow: inset 0 1px 0 var(--surface-highlight);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.games-search:focus-within {
  border-color: rgba(251, 75, 2, 0.45);
  background: rgba(251, 75, 2, 0.06);
  box-shadow: 0 0 0 3px rgba(251, 75, 2, 0.12);
}

.games-search__icon {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  pointer-events: none;
}

.games-search__input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  outline: none;
}

.games-search__input::placeholder {
  color: var(--placeholder);
}

.games-search__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  height: 14px;
  width: 14px;
  background:
    linear-gradient(45deg, transparent 46%, #888 46%, #888 54%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, #888 46%, #888 54%, transparent 54%);
  cursor: pointer;
}

.games-grid--tiles {
  --poster-min: 100px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--poster-min), 1fr));
  gap: 0.75rem 0.55rem;
  padding: 0.15rem 0.25rem 0.5rem;
  align-items: start;
}

.games-grid--tiles .game-tile {
  width: 100%;
  max-width: 148px;
  justify-self: center;
}

.games-grid--tiles .game-tile__avatar {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  border: none;
  border-radius: 12px;
  background:
    radial-gradient(ellipse at 50% 12%, rgba(251, 75, 2, 0.18), transparent 58%),
    var(--tile-fallback);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.games-grid--tiles .game-tile__avatar::before {
  border-radius: 15px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.games-grid--tiles .game-tile__avatar:hover {
  border-color: transparent;
  transform: translateY(-5px) scale(1.025);
  box-shadow:
    0 18px 42px rgba(251, 75, 2, 0.16),
    0 12px 28px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(251, 75, 2, 0.32);
}

.games-grid--tiles .game-tile__avatar:active {
  transform: translateY(-2px) scale(1.01);
}

.games-grid--tiles .game-tile__img {
  object-fit: contain;
  object-position: center;
  border-radius: 12px;
  filter: brightness(1.12) saturate(1.06) contrast(1.02);
  transition: filter 0.22s ease;
}

.games-grid--tiles .game-tile__avatar:hover .game-tile__img {
  filter: brightness(1.18) saturate(1.08) contrast(1.03);
}

.games-grid--tiles .game-tile__img--landscape {
  object-fit: contain;
  object-position: center;
  padding: 0.45rem 0.35rem;
}

.games-grid--tiles .game-tile__badge {
  right: 6px;
  bottom: 6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 0.7rem;
  line-height: 22px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(251, 75, 2, 0.92);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.games-grid--tiles .game-tile__badge--empty {
  background: var(--tile-badge-empty);
}

.games-grid--tiles .game-tile__name {
  margin-top: 0.4rem;
  max-width: 100%;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--tile-name);
  letter-spacing: 0.01em;
}

.club-compact .game-tile__avatar,
.client-kiosk .game-tile__avatar {
  width: 100%;
  height: auto;
}

.club-compact .game-tile__name,
.client-kiosk .game-tile__name {
  margin-top: 0.55rem;
  font-size: 0.8rem;
  max-width: 100%;
}

.game-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}

.game-tile__avatar {
  position: relative;
  width: 72px;
  height: 72px;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #0a0a0a;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.game-tile__avatar::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  pointer-events: none;
  z-index: 1;
}

.game-tile__avatar:hover {
  border-color: var(--orange);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(251, 75, 2, 0.25);
}

.game-tile--disabled .game-tile__avatar {
  opacity: 0.5;
}

.game-tile__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  display: block;
  pointer-events: none;
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.game-tile__img--landscape {
  object-position: center center;
  object-fit: cover;
}

.game-tile__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #1a1a1a, #2a1508);
  color: var(--orange);
  font-size: 1.4rem;
  font-weight: 800;
  text-transform: uppercase;
}

.game-tile__badge {
  position: absolute;
  right: 3px;
  bottom: 3px;
  z-index: 2;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--orange);
  color: #111;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.game-tile__badge--empty {
  background: #444;
  color: #aaa;
}

.game-tile__name {
  margin-top: 0.3rem;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
  max-width: 76px;
}

.statusbar--compact {
  padding: 0.3rem 0.5rem;
  font-size: 0.68rem;
}

.statusbar--club {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.statusbar--club #status-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-end-session {
  flex-shrink: 0;
  color: var(--orange2);
  border-color: rgba(251, 75, 2, 0.35);
}

.loading--compact .loading__box--compact {
  padding: 1rem 1.25rem;
}

.loading__ring--sm {
  width: 28px;
  height: 28px;
  margin-bottom: 0.6rem;
}

.toast--compact {
  left: 0.45rem;
  right: 0.45rem;
  bottom: 0.45rem;
  max-width: none;
  font-size: 0.75rem;
  padding: 0.55rem 0.65rem;
}

.modal__dialog--compact {
  width: min(360px, calc(100% - 0.75rem));
}

.modal__head--compact,
.modal__foot--compact {
  padding: 0.5rem 0.6rem;
}

.modal__head--compact h2 {
  font-size: 0.9rem;
  font-weight: 600;
}

.modal__body--compact {
  padding: 0.55rem 0.6rem;
}

.credentials--compact {
  gap: 0.35rem;
}

.cred-row--compact {
  padding: 0.45rem 0.55rem;
  font-size: 0.78rem;
}

.cred-row--compact code {
  font-size: 0.8rem;
  max-width: 58%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal__foot--compact {
  gap: 0.35rem;
  justify-content: flex-end;
}

@media (max-width: 420px) {
  .games-grid--tiles {
    --poster-min: 88px;
    gap: 0.65rem 0.45rem;
  }
}

/* PC club client — панель слева как на рабочем столе */
.client-kiosk {
  user-select: none;
  width: 100%;
  overflow: hidden;
}

.client-kiosk .club-main--compact {
  padding: 0.35rem 0.38rem 0.28rem;
}

.client-kiosk .games-search {
  padding: 0.35rem 0.5rem;
  gap: 0.3rem;
  border-radius: 9px;
}

.client-kiosk .games-toolbar {
  padding: 0 0 0.32rem;
}

.client-kiosk .games-grid--tiles {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem 0.32rem;
  padding: 0 0 0.35rem;
}

.games-section__grid.games-grid--tiles,
.games-scroll--flat.games-grid--tiles {
  --poster-min: 108px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.42rem 0.34rem;
  align-content: start;
}

.client-kiosk .games-section__grid.games-grid--tiles,
.client-kiosk .games-scroll--flat.games-grid--tiles {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem 0.32rem;
}

.client-kiosk .games-grid--tiles .game-tile {
  max-width: none;
  width: 100%;
  min-width: 0;
}

.client-kiosk .games-grid--tiles .game-tile__avatar {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border-radius: 8px;
  aspect-ratio: 2 / 3;
}

.client-kiosk .games-grid--tiles .game-tile__img {
  border-radius: 8px;
}

.client-kiosk .games-grid--tiles .game-tile__badge {
  right: 4px;
  bottom: 4px;
  min-width: 18px;
  height: 18px;
  font-size: 0.62rem;
  line-height: 18px;
}

.client-kiosk .game-tile__name {
  margin-top: 0.28rem;
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.15;
}

.client-kiosk .games-search__input {
  font-size: 0.74rem;
}

.client-kiosk .topbar--compact {
  padding: 0.28rem 0.35rem;
}

.client-kiosk .topbar__club {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.15;
}

.client-kiosk .logo-mark--xs {
  height: 30px;
  width: auto;
  max-width: 120px;
}

.client-kiosk .statusbar--compact {
  font-size: 0.6rem;
  padding: 0.22rem 0.35rem;
}

.client-kiosk .client-setup {
  height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(251, 75, 2, 0.1), transparent 40%),
    var(--bg);
}

.client-setup__box {
  width: min(400px, 92vw);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem;
}

.games-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}

.games-empty p {
  margin: 0.35rem 0;
}

.games-empty__hint {
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 320px;
  margin: 0.5rem auto 0;
  line-height: 1.4;
}

/* Автовход: без мигания формы входа */
html.zk-boot #auth-screen {
  display: none !important;
}

html.zk-boot #loading-overlay {
  display: grid !important;
}

.boot-splash {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg, #0d0d0f);
  z-index: 90;
}

.boot-splash[hidden] {
  display: none !important;
}

.boot-splash__box {
  text-align: center;
  color: var(--muted, #aaa);
}

.boot-splash__box p {
  margin-top: 1rem;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

/* v30 — каталог, брендинг клуба */
.games-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: var(--ambient-bg);
}

html[data-theme="light"] .games-ambient::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow:
    inset 0 0 70px var(--edge-glow-soft, rgba(251, 75, 2, 0.1)),
    inset 0 0 140px rgba(251, 75, 2, 0.05);
}

html[data-theme="light"] .games-ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 1px solid var(--edge-glow, rgba(251, 75, 2, 0.28));
  box-shadow:
    inset 0 0 24px rgba(251, 75, 2, 0.07),
    0 0 28px rgba(251, 75, 2, 0.06);
}

html[data-theme="light"] .launcher--compact {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

html[data-theme="light"] .topbar--club {
  box-shadow:
    0 1px 0 rgba(251, 75, 2, 0.12),
    0 4px 18px rgba(251, 75, 2, 0.06);
}

html[data-theme="light"] .statusbar {
  border-top-color: rgba(251, 75, 2, 0.22);
  box-shadow: inset 0 1px 0 rgba(251, 75, 2, 0.08);
}

html[data-theme="light"] .games-search:focus-within {
  border-color: rgba(251, 75, 2, 0.45);
  box-shadow:
    0 0 0 3px rgba(251, 75, 2, 0.12),
    0 0 20px rgba(251, 75, 2, 0.08);
}

html[data-theme="light"] .games-section__title {
  text-shadow: 0 0 18px rgba(251, 75, 2, 0.15);
}

#app { position: relative; z-index: 1; }

.auth__window--token {
  max-width: 360px;
}

.auth__window--token .auth__logo h1 {
  font-size: 1.35rem;
}

.topbar--club {
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
}

.topbar__meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0.1rem;
}

.topbar__city {
  font-size: 0.62rem;
  color: var(--orange2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.games-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.games-sort {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.games-sort__btn {
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  color: var(--muted);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.client-kiosk .games-sort__btn {
  font-size: 0.8rem;
  padding: 0.42rem 0.8rem;
}

.games-sort__btn:hover {
  border-color: rgba(251, 75, 2, 0.35);
  color: var(--text);
}

.games-sort__btn.is-active {
  border-color: rgba(251, 75, 2, 0.55);
  background: var(--orange-soft);
  color: var(--orange2);
}

.games-scroll--sections {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-bottom: 0.35rem;
}

.games-section__title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange2);
  margin: 0 0 0.35rem;
  padding-left: 0.15rem;
}

.game-tile {
  position: relative;
}

.game-tile__fav {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 3;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.game-tile:hover .game-tile__fav,
.game-tile__fav.is-active {
  opacity: 1;
}

.game-tile__fav.is-active {
  color: #ffc107;
  background: rgba(0, 0, 0, 0.72);
}

.games-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.42rem 0.34rem;
}

.client-kiosk .games-skeleton-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.game-tile-skeleton__poster {
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  background: linear-gradient(110deg, var(--skeleton-base) 8%, var(--skeleton-line) 18%, var(--skeleton-base) 33%);
  background-size: 200% 100%;
  animation: zk-shimmer 1.2s linear infinite;
}

.game-tile-skeleton__line {
  height: 8px;
  margin-top: 0.35rem;
  border-radius: 4px;
  width: 72%;
  background: var(--skeleton-line);
  animation: zk-shimmer 1.2s linear infinite;
}

@keyframes zk-shimmer {
  to { background-position-x: -200%; }
}

.statusbar__version {
  flex-shrink: 0;
  font-size: 0.55rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.auth__theme-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
}

.theme-icon[hidden] {
  display: none !important;
}

.loading--launch .loading__ring {
  border-top-color: var(--orange);
  animation-duration: 0.7s;
}

.loading--launch .loading__box {
  border-color: rgba(251, 75, 2, 0.35);
  box-shadow: 0 0 24px rgba(251, 75, 2, 0.15);
}
