@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@400;500;600;700&display=swap');

:root {
  font-family: 'Comfortaa', 'Trebuchet MS', sans-serif;
  color: #000000;
  background: #ffffff;
  font-synthesis: none;
  color-scheme: light;
  --accent: #01c89d;
  --accent-dark: #00866a;
  --coral: #ff8562;
  --peach: #ffb49f;
  --muted: #000000b3;
  --border: #00000026;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}
header { max-width: none; margin: 0; padding: 24px max(24px, calc((100% - 1152px) / 2)); display: flex; justify-content: space-between; gap: 16px; align-items: center; background: var(--accent); color: #ffffff; }
header a { font-weight: 700; color: inherit; text-decoration: none; }
header .header-link { font-size: .8rem; color: #ffffff; text-decoration: underline; text-underline-offset: 4px; }
#connection { font-size: .8rem; color: #ffffff; }
main { width: 100%; max-width: 1100px; margin: 32px auto; padding: 0 24px 48px; }
.site-footer { margin-top: auto; padding: 28px 24px; border-top: 1px solid var(--border); display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; color: #000000; font-size: .8rem; line-height: 1.8; text-align: center; }
.site-footer a { overflow-wrap: anywhere; text-decoration-thickness: 1px; text-decoration-color: #00000040; text-underline-offset: 3px; transition: text-decoration-color .2s ease; }
.site-footer a:hover { text-decoration-color: var(--accent); }
h1 { font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.25; margin: 12px 0 24px; letter-spacing: -.04em; }
h2 { font-size: 1.4rem; line-height: 1.45; }
h3 { line-height: 1.5; }
p { line-height: 1.75; }
.muted { color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; line-height: 1.7; color: #000000; font-weight: 700; border-left: 4px solid var(--accent); padding-left: 12px; }
.center .eyebrow { display: inline-block; }
.card { border: 1px solid var(--border); border-radius: 24px; background: #ffffff; padding: 28px; margin: 20px 0; }
.narrow { max-width: 540px; margin: 40px auto; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
button, .button {
  font: inherit; font-weight: 700; background: var(--accent);
  color: #ffffff; border: 1px solid transparent; border-radius: 14px; padding: 15px 22px; cursor: pointer;
  display: inline-block; text-decoration: none; text-align: center; touch-action: manipulation; line-height: 1.5;
  transition: box-shadow .2s ease, transform .2s ease;
}
button:hover, .button:hover { box-shadow: 0 0 12px #01c89d40, 0 8px 24px #01c89d40; transform: translateY(-1px); }
button:disabled:hover { box-shadow: none; transform: none; }
button:disabled { opacity: .5; cursor: default; }
.secondary { background: var(--accent); color: #ffffff; border: 1px solid var(--accent); }
input, textarea, select { font: inherit; width: 100%; padding: 15px; border-radius: 12px; border: 1px solid #00000059; background: #ffffff; color: #000000; min-width: 0; line-height: 1.6; }
textarea { resize: vertical; min-height: 100px; }
input::placeholder, textarea::placeholder { color: #00000099; opacity: 1; }
label { display: block; font-weight: 600; margin: 10px 0; line-height: 1.65; }
label input, label textarea { margin-top: 8px; }
input[type=file] { font-size: .85rem; }
.error { border: 2px solid #000000; background: var(--peach); color: #000000; padding: 14px; border-radius: 12px; white-space: pre-wrap; line-height: 1.7; }
.success { color: #000000; }
.success:not(:empty) { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 6px; }
.code { font-size: clamp(3rem, 9vw, 6rem); font-weight: 700; letter-spacing: .13em; font-variant-numeric: tabular-nums; }
.timer { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.progress { height: 8px; border-radius: 8px; background: #00000014; overflow: hidden; margin: 20px 0; }
.progress>div { background: var(--accent); height: 100%; transition: width .2s linear; }
.question-image { display: block; max-width: 100%; max-height: 36vh; object-fit: contain; margin: 18px auto; border-radius: 16px; }
.answer { display: flex; align-items: center; gap: 18px; padding: 22px; border: 1px solid #00000026; border-radius: 18px; color: #000000; text-align: left; min-height: 94px; overflow-wrap: anywhere; font-size: clamp(1.25rem, 2.5vw, 1.9rem); line-height: 1.5; }
.answer b { font-size: 1.8rem; flex-shrink: 0; }
.answer span { min-width: 0; }
.answer-0 { background: var(--accent-dark); color: #ffffff; }
.answer-1 { background: var(--accent); color: #ffffff; }
.answer-2 { background: var(--coral); }
.answer-3 { background: var(--peach); }
.answer.correct { outline: none; box-shadow: none; }
.answer.wrong { opacity: .45; }
.phone-answers .answer { min-height: 145px; justify-content: center; }
.phone-answers .answer b { font-size: 3rem; }
.center { text-align: center; }
.big-symbol { font-size: 5rem; color: var(--accent); }
ol { padding: 0; list-style: none; }
.rank { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; border-bottom: 1px solid var(--border); }
.rank.self { background: var(--accent); color: #ffffff; border-radius: 10px; }
.rank:first-child { color: #ffffff; background: var(--accent-dark); border-radius: 10px; font-weight: 700; }
.rank span { overflow-wrap: anywhere; }
.pill { display: inline-block; padding: 8px 13px; margin: 4px; background: var(--accent); color: #ffffff; border-radius: 20px; }
.link { overflow-wrap: anywhere; font-size: .9rem; color: #000000; }
details { margin-top: 20px; }
summary { cursor: pointer; color: #000000; line-height: 1.7; font-weight: 700; }
summary::marker { color: #000000; }
small { line-height: 1.7; }
.qr { background: white; padding: 12px; border-radius: 16px; width: 200px; height: 200px; }
.setup code { overflow-wrap: anywhere; }
a { color: #000000; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.text-link { text-align: center; padding: 10px; text-underline-offset: 5px; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid #000000; outline-offset: 4px; }
[hidden] { display: none !important; }

/* Конструктор: тот же визуальный язык, без подключения к игровому серверу. */
.editor-intro { max-width: 740px; }
.editor-toolbar { position: sticky; top: 0; z-index: 5; padding: 14px 0; background: #ffffff; border-bottom: 2px solid var(--accent); }
.editor-toolbar .row { justify-content: space-between; }
.editor-toolbar p { margin: 6px 0 0; font-size: .78rem; }
.question-editor { scroll-margin-top: 180px; }
.question-heading { justify-content: space-between; }
.question-heading h2 { margin: 0; }
.compact { padding: 8px 12px; font-size: .8rem; }
.danger { color: #000000; background: var(--peach); border-color: var(--coral); }
.options-editor { border: 0; padding: 0; margin: 18px 0; min-width: 0; }
.options-editor legend { font-size: .9rem; line-height: 1.7; margin-bottom: 8px; }
.option-editor { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); padding: 12px; border-radius: 14px; margin: 8px 0; }
.option-editor:has(input[type=radio]:checked) { border: 1px solid var(--accent-dark); background: var(--accent); color: #ffffff; }
.option-editor:has(input[type=radio]:checked) .option-letter { color: #ffffff; }
.option-editor input[type=radio] { appearance: auto; width: 22px; height: 22px; accent-color: #000000; flex-shrink: 0; margin: 0; }
.option-editor label { margin: 0; flex: 1; min-width: 0; }
.option-letter { display: inline-block; color: #000000; font-size: .85rem; }
.option-editor input[type=text] { margin-top: 4px; padding: 10px 12px; }
.question-meta { grid-template-columns: minmax(0, 1fr) 180px; align-items: start; }
.editor-image { max-height: 200px; }
.preview-panel { border: 2px solid var(--accent); }
.preview-panel h2, .preview-panel h3 { overflow-wrap: anywhere; }
.preview-panel .answer.correct { outline: none; box-shadow: none; }
.answer-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.correct-label { display: inline-block; padding: 6px 10px; border-radius: 10px; background: #ffffff66; color: inherit; font-size: .8rem; font-weight: 700; line-height: 1.5; }
#editor-status { min-height: 1.7em; }
.editor-empty { padding: 24px; }
.question-image { cursor: zoom-in; }
.question-image:focus-visible { outline: 3px solid var(--accent-dark); outline-offset: 4px; }
.image-viewer { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 64px 24px 24px; border: 0; background: #000000ed; color: #ffffff; }
.image-viewer[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.image-viewer::backdrop { background: #000000cc; }
.image-viewer img { max-width: 100%; max-height: calc(100dvh - 180px); object-fit: contain; min-height: 0; }
.image-viewer p { font-size: .8rem; text-align: center; margin: 0; pointer-events: none; }
.image-viewer-close { position: absolute; right: 20px; top: 16px; }
.game-media { width: calc(100% - 48px); max-width: 1052px; margin: 20px auto 0; padding: 16px; border: 1px solid var(--border); border-radius: 16px; }
.game-media p { margin: 8px 0 0; font-size: .75rem; }
.volume-control { display: flex; align-items: center; gap: 12px; margin: 0; font-size: .8rem; }
.volume-control input { width: 140px; padding: 0; margin: 0; accent-color: var(--accent-dark); }
.celebration { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 20; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
@media (max-width: 600px) {
  main { margin-top: 12px; padding: 0 16px 32px; }
  header { padding: 20px 16px; flex-wrap: wrap; }
  .card { padding: 20px; }
  .grid:not(.phone-answers) { grid-template-columns: 1fr; }
  .answer { min-height: 76px; padding: 16px; }
  .phone-answers { gap: 12px; }
  h1 { font-size: 2rem; }
  .editor-toolbar .row { gap: 8px; }
  .editor-toolbar button, .editor-toolbar .button { padding: 10px 12px; font-size: .8rem; }
  .question-heading { align-items: flex-start; }
  .question-heading .row { gap: 6px; }
  .question-editor { scroll-margin-top: 220px; }
  .rank { padding: 12px 4px; font-size: .85rem; }
}
