/* Base: fonts, palette, buttons, inputs, modal, toasts */
@font-face { font-family: 'Rubik'; font-weight: 500; font-display: swap; src: url(../fonts/rubik-cyrillic-500-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Rubik'; font-weight: 500; font-display: swap; src: url(../fonts/rubik-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Rubik'; font-weight: 700; font-display: swap; src: url(../fonts/rubik-cyrillic-700-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Rubik'; font-weight: 700; font-display: swap; src: url(../fonts/rubik-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Rubik'; font-weight: 800; font-display: swap; src: url(../fonts/rubik-cyrillic-800-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Rubik'; font-weight: 800; font-display: swap; src: url(../fonts/rubik-latin-800-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Rubik'; font-weight: 900; font-display: swap; src: url(../fonts/rubik-cyrillic-900-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Rubik'; font-weight: 900; font-display: swap; src: url(../fonts/rubik-latin-900-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #120f2e;
  --bg2: #1b1745;
  --card: #231e55;
  --card2: #2c2668;
  --line: rgba(255, 255, 255, 0.12);
  --text: #ffffff;
  --muted: #b8b2e8;
  --pink: #ff4fa3;
  --yellow: #ffd23f;
  --cyan: #3ee6ff;
  --lime: #7cf06a;
  --orange: #ff8a3d;
  --violet: #8b6cff;
  --red: #ff5e5e;
  --radius: 18px;
  --font: 'Rubik', 'Segoe UI', system-ui, -apple-system, 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', Arial, sans-serif;
  --emoji: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji';
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 500 16px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--cyan); }
h1, h2, h3 { font-weight: 800; margin: 0 0 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 700 15px/1 var(--font);
  color: var(--text);
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.12s, background 0.15s, box-shadow 0.15s;
}
.btn:hover { background: #3a3384; }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn:focus-visible, .input:focus-visible, .tab:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.btn:disabled { opacity: 0.35; cursor: default; }
.btn.primary { background: linear-gradient(135deg, var(--pink), #ff6b6b); border-color: transparent; box-shadow: 0 6px 18px rgba(255, 79, 163, 0.35); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: #ffb3b3; }
.btn.primary.danger { background: linear-gradient(135deg, #ff5e5e, #e0306b); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 10px; font-size: 13px; border-radius: 9px; }
.btn.icon { min-width: 30px; }
.btn.big { padding: 14px 26px; font-size: 19px; }
.btn.active { background: var(--yellow); color: #221c00; }

.input {
  width: 100%;
  font: 500 15px/1.35 var(--font);
  color: var(--text);
  background: #16123a;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
}
textarea.input { resize: vertical; min-height: 64px; }
select.input { cursor: pointer; }
.input.num { width: 90px; }

.chip { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--card2); color: var(--muted); }
.chip.t-music { background: rgba(62, 230, 255, 0.18); color: var(--cyan); }
.chip.t-betting { background: rgba(255, 210, 63, 0.18); color: var(--yellow); }
.chip.t-multiple_choice { background: rgba(139, 108, 255, 0.22); color: #c9b8ff; }
.chip.t-captains { background: rgba(255, 138, 61, 0.2); color: var(--orange); }
.chip.t-jeopardy { background: rgba(124, 240, 106, 0.18); color: var(--lime); }
.chip.t-template { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.chip.t-standard { background: rgba(255, 79, 163, 0.16); color: #ff9fcd; }

.spacer { flex: 1; }

.modal-back { position: fixed; inset: 0; background: rgba(8, 6, 24, 0.7); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 1000; animation: fade 0.15s; }
.modal { background: var(--bg2); border: 1px solid var(--line); border-radius: 20px; padding: 24px; width: min(520px, 92vw); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.modal-text { font-size: 18px; margin: 0 0 16px; white-space: pre-line; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
@keyframes fade { from { opacity: 0; } }

.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 1100; pointer-events: none; }
.toast { background: var(--card2); border-left: 5px solid var(--lime); padding: 12px 16px; border-radius: 12px; max-width: 420px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); transition: opacity 0.4s, transform 0.4s; animation: toastIn 0.25s; }
.toast.warn { border-color: var(--yellow); }
.toast.err { border-color: var(--red); }
.toast.out { opacity: 0; transform: translateX(30px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
