/* Source Code Pro - шрифт заголовков в оригинальной презентации.
   Лежит локально: на выездном мероприятии интернета может не быть,
   а CSP всё равно запрещает внешние источники. */
@font-face {
  font-family: "Source Code Pro";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/source-code-pro-cyrillic-600.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Source Code Pro";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/source-code-pro-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2122, U+2191, U+2193, U+2212, U+2215;
}

@font-face {
  font-family: "Source Code Pro";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/source-code-pro-cyrillic-700.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Source Code Pro";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/source-code-pro-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2122, U+2191, U+2193, U+2212, U+2215;
}

/* Тема «Ночь» - по умолчанию. Чёрный фон и тёплый акцент, как в исходной
   презентации: на проекторе тёмный фон не слепит и не крадёт контраст у фото. */
:root {
  --bg: #08080c;
  --bg-2: #12121a;
  --panel: #16161f;
  --panel-2: #1f1f2b;
  --line: #2b2b39;
  --text: #f6f3ec;
  --muted: #a6a2b4;
  --accent: #d9a441;
  --accent-2: #e8c98a;
  --accent-text: #1b1405;
  --danger: #c8453f;
  --ok: #3f9463;
  --warn: #d99a2b;
  --opt-1: #c2453f;
  --opt-2: #2f6fb5;
  --opt-3: #d99a2b;
  --opt-4: #3f9463;
  --opt-5: #8a5fa8;
  --opt-6: #2f8f86;
  --opt-7: #bf5f86;
  --opt-8: #5b6472;
  --stage-bg: radial-gradient(ellipse at 50% 0%, #16161f 0%, #07070a 68%);
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

/* «Свадебная» - тёплый графит и шампань, приглушённые пыльные цвета вариантов */
[data-theme="wedding"] {
  --bg: #14100e;
  --bg-2: #1d1815;
  --panel: #211b17;
  --panel-2: #2b241f;
  --line: #3a312a;
  --text: #f7efe4;
  --muted: #bcae9d;
  --accent: #d8b98c;
  --accent-2: #eadcc6;
  --accent-text: #241a10;
  --danger: #b5544a;
  --ok: #7f9a6a;
  --warn: #d1a15c;
  --opt-1: #b5715e;
  --opt-2: #5d7d94;
  --opt-3: #c9a15e;
  --opt-4: #7f9a6a;
  --opt-5: #9a7b93;
  --opt-6: #6f9089;
  --opt-7: #bd8296;
  --opt-8: #7d7367;
  --stage-bg: radial-gradient(ellipse at 50% 0%, #241d18 0%, #100d0b 70%);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* Светлая - для дневного зала и проектора со слабой лампой */
[data-theme="daylight"] {
  --bg: #f6f4ef;
  --bg-2: #ffffff;
  --panel: #ffffff;
  --panel-2: #efece4;
  --line: #ddd8cd;
  --text: #201d19;
  --muted: #6d675d;
  --accent: #a8762c;
  --accent-2: #7a5a22;
  --accent-text: #ffffff;
  --danger: #b23b35;
  --ok: #2f7d52;
  --warn: #b9832a;
  --opt-1: #c04a44;
  --opt-2: #2f6fb5;
  --opt-3: #c98a1f;
  --opt-4: #2f8558;
  --opt-5: #7d5aa0;
  --opt-6: #2a8079;
  --opt-7: #b45079;
  --opt-8: #64707f;
  --stage-bg: linear-gradient(180deg, #ffffff 0%, #f1eee7 100%);
  --shadow: 0 8px 24px rgba(40, 32, 20, 0.12);
}

/* Прежняя фиолетовая - осталась как один из вариантов */
[data-theme="violet"] {
  --bg: #150e28;
  --bg-2: #1e1440;
  --panel: #241a4d;
  --panel-2: #2d2160;
  --line: #3b2d75;
  --text: #f4f1ff;
  --muted: #a99fd4;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --accent-text: #ffffff;
  --danger: #e5484d;
  --ok: #22c55e;
  --warn: #f59e0b;
  --opt-1: #e5484d;
  --opt-2: #3b82f6;
  --opt-3: #f59e0b;
  --opt-4: #22c55e;
  --opt-5: #a855f7;
  --opt-6: #14b8a6;
  --opt-7: #ec4899;
  --opt-8: #64748b;
  --stage-bg: radial-gradient(ellipse at 50% 0%, #1e1440 0%, #120c22 70%);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--stage-bg);
  color: var(--text);
  font-family: system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

h1,
h2,
h3 {
  margin: 0 0 12px;
  line-height: 1.2;
}

a {
  color: var(--accent-2);
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

.wrap-narrow {
  max-width: 460px;
}

.center-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card + .card {
  margin-top: 16px;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.row-between {
  justify-content: space-between;
}

.grow {
  flex: 1 1 auto;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 14px;
}

.mt {
  margin-top: 16px;
}

.hidden {
  display: none !important;
}

label {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  font: inherit;
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.25);
}

textarea {
  min-height: 90px;
  resize: vertical;
}

.field + .field {
  margin-top: 14px;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 12px;
  padding: 13px 18px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  transition: filter 0.15s ease, transform 0.05s ease;
}

button:hover:not(:disabled) {
  filter: brightness(1.1);
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}

button.subtle {
  background: var(--panel-2);
}

button.danger {
  background: var(--danger);
}

button.wide {
  width: 100%;
}

button.small {
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 10px;
}

.error {
  color: #ffb4b4;
  background: rgba(229, 72, 77, 0.14);
  border: 1px solid rgba(229, 72, 77, 0.4);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 12px;
}

.notice {
  color: #bdf5d0;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 12px;
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 13px;
}

.code-display {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 6px;
  text-align: center;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-item {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.options {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 560px) {
  .options {
    grid-template-columns: 1fr;
  }
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 74px;
  padding: 14px 16px;
  border-radius: var(--radius);
  color: #fff;
  font-weight: 600;
  text-align: left;
  font-size: 17px;
  background: var(--opt-1);
}

.option[data-i="1"] { background: var(--opt-2); }
.option[data-i="2"] { background: var(--opt-3); }
.option[data-i="3"] { background: var(--opt-4); }
.option[data-i="4"] { background: var(--opt-5); }
.option[data-i="5"] { background: var(--opt-6); }
.option[data-i="6"] { background: var(--opt-7); }
.option[data-i="7"] { background: var(--opt-8); }

.option:disabled {
  opacity: 1;
  cursor: default;
}

.option.picked {
  outline: 4px solid #fff;
  outline-offset: -4px;
}

.option.correct {
  outline: 4px solid var(--ok);
  outline-offset: -4px;
}

.option.dim {
  opacity: 0.3;
}

.option .mark {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.35);
}

.timer-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--panel-2);
  overflow: hidden;
  margin: 14px 0;
}

.timer-bar > div {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  width: 100%;
  transition: width 0.25s linear;
}

.bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.bar-track {
  position: relative;
  height: 46px;
  background: var(--panel-2);
  border-radius: 10px;
  overflow: hidden;
}

.bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--accent);
  transition: width 0.4s ease;
}

.bar-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-weight: 600;
  gap: 8px;
}

.bar-row.correct .bar-fill {
  background: var(--ok);
}

.cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: baseline;
  justify-content: center;
  padding: 10px 0;
}

.cloud span {
  font-weight: 700;
  line-height: 1.1;
}

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

.text-card {
  background: var(--panel-2);
  border-radius: 12px;
  padding: 12px 14px;
}

.text-card .who {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px;
}

table.board {
  width: 100%;
  border-collapse: collapse;
}

table.board td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 18px;
}

table.board td.place {
  width: 48px;
  color: var(--muted);
}

table.board td.score {
  text-align: right;
  font-weight: 700;
}

table.board tr:first-child td {
  font-size: 22px;
}
