/* Groom Training Camp – design tokens
   ink #17352C  field #1F5C46  flag #FF5A1F  chalk #F7F6F1  tape #E3DECE */
:root {
  --ink: #17352C;
  --field: #1F5C46;
  --flag: #FF5A1F;
  --chalk: #F7F6F1;
  --tape: #E3DECE;
  --card: #FFFFFF;
  --display: "Bebas Neue", "Arial Narrow", sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --hand: "Caveat", cursive;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--chalk);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
}
.wrap { max-width: 640px; margin: 0 auto; padding: 20px 16px 64px; }

/* ------- masthead ------- */
.mast { text-align: center; padding: 20px 0 8px; }
.mast .eyebrow {
  display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .18em;
  text-transform: uppercase; color: var(--field);
  border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink); padding: 4px 10px;
}
.mast h1 {
  font-family: var(--display); font-size: clamp(52px, 14vw, 84px);
  line-height: .92; margin: 14px 0 6px; letter-spacing: .01em;
}
.mast .sub { color: var(--field); font-weight: 600; margin: 0; }
.countdown {
  display: inline-block; margin-top: 12px; background: var(--ink); color: var(--chalk);
  font-family: var(--display); font-size: 22px; letter-spacing: .06em;
  padding: 6px 16px; transform: rotate(-1.2deg);
}
.countdown b { color: var(--flag); }

/* ------- module cards ------- */
.modules { margin-top: 24px; display: grid; gap: 14px; }
.module {
  position: relative; display: block; background: var(--card); text-decoration: none;
  color: inherit; border: 2px solid var(--ink); border-radius: 10px;
  padding: 16px 16px 16px 74px; box-shadow: 4px 4px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
}
.module:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.module .no {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  font-family: var(--display); font-size: 40px; color: var(--field);
  border-right: 2px solid var(--tape); padding-right: 12px; line-height: 1;
}
.module h2 { font-family: var(--display); font-size: 28px; margin: 0; letter-spacing: .02em; }
.module p { margin: 2px 0 0; color: #4c5a53; font-size: 14px; }
.module .mins {
  position: absolute; right: 12px; top: 10px; font-size: 11px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase; color: var(--field);
}
.stamp {
  position: absolute; right: 10px; bottom: 10px;
  font-family: var(--display); font-size: 20px; letter-spacing: .12em;
  color: var(--flag); border: 3px solid var(--flag); border-radius: 6px;
  padding: 0 8px; transform: rotate(-8deg); opacity: .9;
}
.module.done { background: #F2EFE4; }

/* ------- generic ------- */
.btn {
  display: inline-block; width: 100%; text-align: center; cursor: pointer;
  background: var(--flag); color: #fff; border: 2px solid var(--ink);
  border-radius: 10px; box-shadow: 4px 4px 0 var(--ink);
  font-family: var(--display); font-size: 26px; letter-spacing: .06em;
  padding: 12px 20px; text-decoration: none;
}
.btn:active { transform: translate(2px,2px); box-shadow: 2px 2px 0 var(--ink); }
.btn.ghost { background: var(--card); color: var(--ink); font-size: 20px; }
.btn + .btn { margin-top: 10px; }
.backlink { display: inline-block; margin-bottom: 12px; font-weight: 600; color: var(--field); text-decoration: none; }
.gamehead h1 { font-family: var(--display); font-size: clamp(40px, 11vw, 60px); margin: 0; line-height: .95; }
.gamehead .sub { color: var(--field); font-weight: 600; margin: 4px 0 18px; }

.card {
  background: var(--card); border: 2px solid var(--ink); border-radius: 10px;
  box-shadow: 4px 4px 0 var(--ink); padding: 16px; margin-bottom: 16px;
}
.card h3 { font-family: var(--display); font-size: 24px; margin: 0 0 8px; letter-spacing: .03em; }
label.q { display: block; font-weight: 600; margin: 14px 0 6px; }
label.q small { display: block; font-weight: 400; color: #6b776f; }
input[type=text], textarea {
  width: 100%; font: inherit; color: inherit; background: #FCFBF7;
  border: 2px solid var(--tape); border-radius: 8px; padding: 10px 12px;
}
input[type=text]:focus, textarea:focus, .btn:focus-visible, a:focus-visible {
  outline: 3px solid var(--flag); outline-offset: 2px; border-color: var(--ink);
}
textarea { min-height: 88px; resize: vertical; }
.footnote { text-align: center; color: #6b776f; font-size: 13px; margin-top: 28px; }

/* ------- rapid fire ------- */
.rf-stage { text-align: center; }
.rf-count { font-family: var(--display); font-size: 20px; color: var(--field); letter-spacing: .1em; }
.rf-timer { height: 10px; background: var(--tape); border-radius: 6px; margin: 12px 0 20px; overflow: hidden; }
.rf-timer b { display: block; height: 100%; background: var(--flag); width: 100%; }
@media (prefers-reduced-motion: no-preference) {
  .rf-timer b { transition: width .1s linear; }
}
.rf-vs { font-family: var(--display); font-size: 22px; color: #9aa39c; margin: 10px 0; }
.rf-btn {
  display: block; width: 100%; background: var(--card); border: 2px solid var(--ink);
  border-radius: 12px; box-shadow: 4px 4px 0 var(--ink); cursor: pointer;
  font-family: var(--display); font-size: 30px; letter-spacing: .03em; color: var(--ink);
  padding: 18px 12px;
}
.rf-btn:active { transform: translate(2px,2px); box-shadow: 2px 2px 0 var(--ink); }
.rf-result h2 { font-family: var(--display); font-size: 44px; margin: 8px 0; color: var(--field); }
.bigstamp {
  display: inline-block; font-family: var(--display); font-size: 34px; letter-spacing: .14em;
  color: var(--flag); border: 4px solid var(--flag); border-radius: 8px;
  padding: 4px 18px; transform: rotate(-6deg); margin: 14px 0;
}

/* ------- exam ------- */
.exam .card { border-radius: 2px; box-shadow: 4px 4px 0 var(--ink); }
.exam-rules { font-size: 13px; color: #6b776f; border: 1px dashed var(--tape); padding: 10px 12px; border-radius: 6px; }
.qno { font-family: var(--display); color: var(--field); font-size: 20px; margin-right: 6px; }

/* ------- sliders ------- */
.slider-row { margin: 18px 0; }
.slider-row .lab { display: flex; justify-content: space-between; font-weight: 600; }
.slider-row output { font-family: var(--display); font-size: 22px; color: var(--flag); min-width: 34px; text-align: right; }
input[type=range] { width: 100%; accent-color: var(--flag); height: 32px; }
.radar-wrap { text-align: center; }

/* ------- postcard ------- */
.postcard {
  background: #FFFDF6; border: 2px solid var(--ink); border-radius: 6px;
  box-shadow: 4px 4px 0 var(--ink); padding: 14px;
  background-image: repeating-linear-gradient(#FFFDF6, #FFFDF6 30px, #EDE7D4 31px);
}
.postcard textarea {
  border: none; background: transparent; min-height: 180px; line-height: 31px;
  font-family: var(--hand); font-size: 22px; padding: 0;
}
.postcard textarea:focus { outline: none; }

/* ------- certificate ------- */
.cert {
  background: #FFFDF4; border: 3px double var(--ink); border-radius: 6px;
  padding: 28px 20px; text-align: center; box-shadow: 6px 6px 0 var(--ink);
}
.cert .small { letter-spacing: .2em; text-transform: uppercase; font-size: 11px; font-weight: 800; color: var(--field); }
.cert h1 { font-family: var(--display); font-size: clamp(44px, 12vw, 64px); margin: 10px 0; line-height: .95; }
.cert .name { font-family: var(--hand); font-size: 40px; color: var(--field); margin: 6px 0; }
.cert .seal {
  width: 92px; height: 92px; border-radius: 50%; margin: 16px auto 6px;
  background: var(--flag); color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 15px; letter-spacing: .08em; text-align: center;
  border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); transform: rotate(-8deg);
  padding: 8px;
}
.cert .sig { margin-top: 18px; font-family: var(--hand); font-size: 26px; }
.cert .sigline { border-top: 2px solid var(--ink); width: 200px; margin: 2px auto 0; font-size: 11px; font-family: var(--body); letter-spacing: .1em; text-transform: uppercase; padding-top: 4px; }

/* ------- vittoria ------- */
.secret-banner {
  background: var(--ink); color: var(--chalk); text-align: center;
  font-family: var(--display); letter-spacing: .14em; font-size: 18px; padding: 8px 12px;
}
.secret-banner b { color: var(--flag); }

/* ------- admin ------- */
.admin body, body.admin { background: #F1F2EE; }
.admin .wrap { max-width: 860px; }
.admin h1 { font-family: var(--display); font-size: 44px; margin: 8px 0 16px; }
.admin h2 { font-family: var(--display); font-size: 26px; margin: 24px 0 8px; }
.linkbox { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.linkbox code { background: #fff; border: 1px solid var(--tape); padding: 6px 10px; border-radius: 6px; word-break: break-all; flex: 1; min-width: 220px; }
.chip { display: inline-block; border: 2px solid var(--ink); border-radius: 999px; padding: 2px 12px; font-weight: 600; font-size: 13px; margin: 2px 4px 2px 0; background: #fff; }
.chip.on { background: var(--field); color: #fff; border-color: var(--field); }
table.cmp { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
table.cmp th, table.cmp td { border: 1px solid var(--tape); padding: 8px 10px; vertical-align: top; text-align: left; }
table.cmp th { background: var(--ink); color: #fff; }
table.cmp td.q { font-weight: 600; width: 32%; }
details { background: #fff; border: 1px solid var(--tape); border-radius: 8px; padding: 10px 14px; margin: 8px 0; }
details summary { cursor: pointer; font-weight: 600; }
.answer-line { border-bottom: 1px dashed var(--tape); padding: 8px 0; }
.answer-line .k { font-size: 13px; color: #6b776f; }
.btn.mini { width: auto; font-size: 18px; padding: 8px 16px; }
.error { color: #B3261E; font-weight: 600; }
.flash { background: var(--field); color: #fff; padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; }

/* ------- save pill ------- */
#save-pill {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%) translateY(60px);
  background: var(--ink); color: var(--chalk); font-weight: 600; font-size: 13px;
  padding: 6px 14px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
#save-pill.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (prefers-reduced-motion: reduce) {
  #save-pill, .rf-timer b { transition: none; }
}

/* ------- numbers ------- */
.num-row { display: flex; align-items: flex-end; gap: 12px; }
.num-row label.q { flex: 1; }
.num-input {
  width: 92px; text-align: center; font-family: var(--display); font-size: 28px;
  border: 2px solid var(--ink); border-radius: 8px; background: #FCFBF7;
  padding: 6px 8px; flex-shrink: 0;
}

/* ------- option buttons (drills, two truths) ------- */
.opts { display: grid; gap: 8px; margin-top: 10px; }
.opt-input { position: absolute; opacity: 0; pointer-events: none; }
.opt {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  background: #FCFBF7; border: 2px solid var(--tape); border-radius: 10px;
  padding: 10px 12px; font-weight: 600; line-height: 1.35;
}
.opt-letter {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 17px;
  border: 2px solid var(--ink); background: #fff;
}
.opt-input:checked + .opt {
  border-color: var(--flag); background: #FFF1E9; box-shadow: 3px 3px 0 var(--ink);
}
.opt-input:checked + .opt .opt-letter { background: var(--flag); color: #fff; border-color: var(--flag); }
.opt-input:focus-visible + .opt { outline: 3px solid var(--flag); outline-offset: 2px; }
.lie-opts { grid-template-columns: repeat(3, 1fr); }
.opt.lie { justify-content: center; }

/* ------- soundtrack ------- */
.side-label {
  font-family: var(--display); letter-spacing: .12em; font-size: 18px;
  color: var(--field); border-bottom: 2px solid var(--ink); padding-bottom: 6px;
}
.track { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--tape); }
.track:last-child { border-bottom: none; }
.track-no {
  font-family: var(--display); font-size: 26px; color: #9aa39c;
  flex-shrink: 0; padding-top: 12px;
}
.track-body { flex: 1; }
.track-body label.q { margin-top: 0; }

/* ------- v3: completeness gate, progress, misc ------- */
.missing { border-color: #B3261E !important; background: #FDF1F0 !important; }
.opts.missing { outline: 2px solid #B3261E; outline-offset: 3px; border-radius: 12px; }
#warn-pill {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%) translateY(60px);
  background: #B3261E; color: #fff; font-weight: 600; font-size: 13px;
  padding: 8px 16px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease; max-width: 88vw; text-align: center;
  z-index: 20;
}
#warn-pill.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.progress-tag {
  position: absolute; right: 12px; bottom: 10px; font-size: 11px; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; color: var(--field);
  border: 2px solid var(--field); border-radius: 999px; padding: 1px 8px;
}
.overall {
  display: inline-block; margin-top: 10px; font-weight: 800; font-size: 12px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--field);
}
.quiet-link { color: #9aa39c; text-decoration: underline; }
.card.danger { border-color: #B3261E; box-shadow: 4px 4px 0 #B3261E; }
.card.danger h3 { color: #B3261E; }
.btn.danger { background: #B3261E; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input[type=text] { max-width: 140px; }
@media (prefers-reduced-motion: reduce) { #warn-pill { transition: none; } }

/* ------- v4: photo evidence ------- */
.photo-slot {
  border: 2px dashed var(--tape); border-radius: 10px; padding: 14px;
  text-align: center; background: #FCFBF7; margin-bottom: 6px;
}
.photo-slot.has-photo { border-style: solid; border-color: var(--ink); }
.photo-preview { max-width: 100%; max-height: 320px; border-radius: 6px; display: inline-block; }
.photo-empty { color: #6b776f; margin: 6px 0 10px; }
.file-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.file-input:focus-visible + label { outline: 3px solid var(--flag); outline-offset: 2px; }
.photo-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.photo-actions .btn.mini { width: auto; }
.admin-photos { display: flex; gap: 12px; flex-wrap: wrap; margin: 10px 0; }
.admin-photos figure { margin: 0; text-align: center; }
.admin-photos img { width: 120px; height: 120px; object-fit: cover; border-radius: 8px; border: 2px solid var(--ink); }
.admin-photo-empty {
  width: 120px; height: 120px; border: 2px dashed var(--tape); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; color: #9aa39c; font-size: 12px;
}
.admin-photos figcaption { font-size: 11px; font-weight: 800; letter-spacing: .08em; margin-top: 4px; }
