:root {
  color-scheme: light;
  --canvas: #f3f3e9; --paper: #fffdf5; --ink: #1b302a; --muted: #49615a;
  --line: #d2dbcc; --accent: #1d5946; --accent-ink: #fffdf4; --wash: #edf2e7;
  --gold: #f2cf87; --danger: #9e3024; --danger-back: #faece6;
  --shadow: 0 14px 35px #26352b13;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark; --canvas: #101e1a; --paper: #192d26; --ink: #f3f0dd; --muted: #b7c8bb;
  --line: #3d554a; --accent: #a5d4b9; --accent-ink: #152b22; --wash: #23382f;
  --danger: #ffad9f; --danger-back: #4b2c2c; --shadow: 0 14px 35px #0004;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark; --canvas: #101e1a; --paper: #192d26; --ink: #f3f0dd; --muted: #b7c8bb;
    --line: #3d554a; --accent: #a5d4b9; --accent-ink: #152b22; --wash: #23382f;
    --danger: #ffad9f; --danger-back: #4b2c2c; --shadow: 0 14px 35px #0004;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 270px; color: var(--ink); background: var(--canvas); }
h1, h2, h3, p { margin: 0; }
p + p { margin-top: .7rem; }
a { color: var(--accent); text-underline-offset: .22em; }
:focus-visible { outline: 3px solid #c77520; outline-offset: 3px; }
.skip { position: fixed; z-index: 5; left: 12px; top: -200px; background: var(--paper); padding: 12px; }
.skip:focus { top: 12px; }
.top { background: var(--paper); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1140px; margin: auto; min-height: 64px; padding: 8px 21px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.brand { font-weight: 750; color: var(--ink); text-decoration: none; }
.brand-symbol { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 5px; border-radius: 50%; color: #f2cf87; background: #194738; }
.top-tools, .row { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; }
.top-tools a, .tool { font-size: .86rem; }
button, input, select, textarea { font: inherit; }
button, .button {
  appearance: none; display: inline-flex; justify-content: center; align-items: center; min-height: 44px;
  border: 1px solid var(--line); border-radius: 10px; padding: .58rem .95rem; color: var(--ink);
  background: var(--paper); cursor: pointer; text-decoration: none; font-weight: 650;
}
button:disabled { opacity: .55; cursor: default; }
button:hover:not(:disabled), .button:hover { border-color: var(--accent); }
button.tool { min-height: 40px; padding: .25rem .6rem; }
.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.linklike { background: transparent; color: var(--accent); padding: .1rem .35rem; border-color: transparent; }
.quiz-shell { width: min(100% - 36px, 664px); margin: 32px auto; }
.campaign {
  position: relative; isolation: isolate; overflow: hidden;
  border: 1px solid #4c6c5a; border-radius: 24px 24px 10px 10px; padding: 30px 30px 32px;
  color: #fff7dd; background: radial-gradient(ellipse at 83% 80%, #376b52, #173c30 60%, #132c24);
}
.campaign p { color: #f4d18b; margin-bottom: .58rem; font-size: .9rem; font-weight: 650; }
.campaign h1 { position: relative; max-width: 540px; font: 500 clamp(1.9rem, 6vw, 3.15rem)/1.08 Georgia, serif; letter-spacing: -.045em; overflow-wrap: anywhere; }
.campaign-decoration { position: absolute; z-index: -1; width: 220px; height: 220px; right: -22px; top: -65px; border: 1px solid #f1cf8760; border-radius: 50%; color: #ebcb84; transform: rotate(-12deg); }
.campaign-decoration::before, .campaign-decoration::after { content: ""; position: absolute; inset: 18px; border-radius: 50%; border: 1px solid #f1cf8742; }
.campaign-decoration::after { inset: 37px; border-color: #f1cf8729; }
.campaign-decoration span { position: absolute; font-size: 38px; right: 64px; top: 78px; }
.campaign-decoration span:nth-child(2) { top: 53px; right: 35px; font-size: 29px; }
.campaign-decoration span:nth-child(3) { top: 120px; right: 112px; font-size: 26px; }
.quiz-card, .box { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.quiz-card { margin-top: 12px; padding: 25px 30px 29px; min-height: 195px; }
.quiz-card h2 { margin: .5rem 0 .7rem; font: 500 clamp(1.34rem, 4vw, 1.9rem)/1.27 Georgia, serif; }
.quiz-card h2:focus { outline: none; }
.quiz-card p { max-width: 51ch; }
.quiz-card .actions { margin-top: 1.1rem; }
.quiz-card .actions > * { flex: 1 0 145px; }
.quiz-card .meta, .eyebrow { color: var(--muted); font-size: .84rem; font-weight: 700; letter-spacing: .015em; }
.quiz-footer { padding: 12px 2px 0; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; justify-content: space-between; color: var(--muted); font-size: .83rem; }
.quiz-footer button { font-size: inherit; }
.timer-row { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: .2rem .8rem; padding: .52rem .85rem .65rem; border-radius: 12px; margin: .65rem 0 1rem; background: var(--wash); }
.timer-row .clock { font-size: 1.3rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.timer-row progress { width: 100%; grid-column: 1/-1; height: 11px; accent-color: var(--accent); }
.timer-row.warning { background: var(--danger-back); color: var(--danger); }
.timer-row.warning progress { accent-color: var(--danger); }
.answers { display: grid; gap: .57rem; margin-top: .87rem; }
.answer { width: 100%; justify-content: flex-start; gap: .72rem; text-align: left; padding: .65rem .75rem; min-height: 55px; overflow-wrap: anywhere; }
.answer span:first-child { width: 27px; height: 27px; border-radius: 7px; background: var(--wash); color: var(--ink); display: grid; flex: 0 0 27px; place-items: center; font-size: .82rem; }
.admin-shell { width: min(100% - 36px, 1100px); margin: 30px auto; }
.admin-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; margin-bottom: 15px; }
.admin-head h1 { font-family: Georgia, serif; font-size: clamp(1.9rem, 5vw, 2.85rem); font-weight: 500; }
.nav { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 12px; }
.nav a { color: var(--ink); padding: .6rem .8rem; border: 1px solid transparent; border-radius: 10px; text-decoration: none; }
.nav a[aria-current="page"] { background: var(--paper); border-color: var(--line); font-weight: 700; }
.box { padding: clamp(15px, 3.2vw, 28px); }
.box h2 { font-size: 1.42rem; margin-bottom: .4rem; }
.box h3 { font-size: 1.05rem; margin: .95rem 0 .3rem; }
.box .row { margin: .65rem 0; }
.box input:not([type="checkbox"]), .estimate-form input, select, textarea {
  width: 100%; color: var(--ink); background: var(--paper); border: 1px solid var(--line);
  border-radius: 8px; padding: .55rem .65rem; min-height: 44px;
}
textarea { min-height: 92px; resize: vertical; }
.field { display: grid; font-weight: 630; gap: 4px; margin: .4rem 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem 1rem; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; min-width: 0; margin: .7rem 0; }
.editor { border-top: 1px solid var(--line); margin-top: 15px; padding-top: 10px; }
.muted { color: var(--muted); }
.feedback { margin: 0 0 10px; border: 1px solid var(--line); background: var(--wash); border-radius: 10px; padding: .55rem .8rem; }
.feedback.error, .inline-error { color: var(--danger); }
.table-scroll { overflow-x: auto; margin: .75rem 0 1rem; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { border-bottom: 1px solid var(--line); text-align: left; padding: .51rem .6rem; vertical-align: top; }
th { background: var(--wash); white-space: nowrap; }
td.nowrap { white-space: nowrap; }
table button { min-height: 35px; padding: .3rem .52rem; }
.details { border: 1px solid var(--line); padding: .7rem .85rem; border-radius: 10px; margin-top: 10px; }
.details summary { cursor: pointer; font-weight: 700; }
.preview { padding: .75rem; background: var(--wash); border-radius: 12px; margin: .7rem 0; }
@media (max-width: 520px) {
  .top-inner { padding-inline: 14px; }
  .quiz-shell, .admin-shell { width: calc(100% - 24px); margin-top: 15px; }
  .campaign { padding: 20px 16px 23px; }
  .campaign-decoration { opacity: .53; }
  .quiz-card { padding: 17px 14px 21px; }
  .grid2 { grid-template-columns: 1fr; }
}

.estimate-form input { max-width: 240px; }
.estimate-form button { margin-top: .55rem; }

.fairplay {
  margin-top: .9rem; padding: .7rem .85rem; border-radius: 10px; background: var(--wash);
  color: var(--muted); font-size: .88rem;
}
.fairplay h3 { color: var(--ink); font-size: .98rem; margin-bottom: .25rem; }
.fairplay p + p { margin-top: .35rem; }
.estimate-card { margin-top: 1rem; padding: .8rem; border: 1px solid var(--line); border-radius: 12px; }
.estimate-card h3 { margin: 0 0 .45rem; }
.estimate-photo { display: block; width: 100%; max-width: 580px; max-height: 380px; object-fit: contain; object-position: left center; margin: .55rem 0; }
.prize-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: .6rem 0 1rem; }
.prize-card { padding: .65rem .8rem; border: 1px solid var(--line); border-top: 3px solid #ae8744; border-radius: 10px; background: var(--wash); overflow-wrap: anywhere; }
.prize-card strong { display: block; color: var(--accent); }
@media (max-width: 520px) { .prize-list { grid-template-columns: 1fr; } }

#teams-account { color: var(--muted); font-size: .84rem; overflow-wrap: anywhere; }
