/* SEX ED - classroom chalkboard look */
/* fonts are bundled in /fonts (SIL Open Font Licence) so the game never depends on Google */
@font-face { font-family: 'Caveat Brush'; src: url('/fonts/caveat-brush-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Permanent Marker'; src: url('/fonts/permanent-marker-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Fredoka'; src: url('/fonts/fredoka-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Fredoka'; src: url('/fonts/fredoka-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Fredoka'; src: url('/fonts/fredoka-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --board: #1d3b2f;
  --board2: #16302a;
  --frame: #8a5a2b;
  --chalk: #f4f1e8;
  --chalk2: #cfd8cf;
  --pink: #ff3d7f;
  --pink2: #ff7aa8;
  --yellow: #ffe066;
  --truth: #39d98a;
  --lie: #ff4d4d;
  --paper: #fdfbf4;
  --ink: #23334d;
  --line: #a9c6ea;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Fredoka', system-ui, sans-serif;
  color: var(--chalk);
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,255,255,.06), transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(255,255,255,.04), transparent 50%),
    repeating-linear-gradient(115deg, rgba(255,255,255,.012) 0 3px, transparent 3px 9px),
    linear-gradient(160deg, var(--board), var(--board2));
  min-height: 100%;
  -webkit-tap-highlight-color: transparent;
}
.chalk { font-family: 'Caveat Brush', cursive; letter-spacing: .5px; }
.marker { font-family: 'Permanent Marker', cursive; }
a { color: var(--yellow); }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: center; gap: .25em; font-family: 'Permanent Marker', cursive; line-height: 1; position: relative; }
.logo .sex { color: var(--chalk); text-shadow: 0 0 1px #fff, 2px 2px 0 rgba(0,0,0,.25); }
.logo .ed { color: var(--pink); text-shadow: 2px 2px 0 rgba(0,0,0,.3); }
.logo .apple { font-size: .7em; transform: rotate(-12deg); }
.badge18 { display: inline-block; background: var(--lie); color: #fff; font-family: 'Fredoka'; font-weight: 700; border-radius: 50%; width: 2.2em; height: 2.2em; line-height: 2.2em; text-align: center; font-size: .32em; transform: rotate(12deg); box-shadow: 0 2px 0 rgba(0,0,0,.3); border: 2px solid #fff; vertical-align: top; }
.tagline { font-family: 'Caveat Brush'; color: var(--chalk2); }

/* ---------- buttons ---------- */
.btn { border: 0; border-radius: 14px; padding: 14px 22px; font-size: 1.1rem; font-weight: 700; color: #1a1a1a; background: var(--yellow); box-shadow: 0 4px 0 rgba(0,0,0,.35); transition: transform .08s; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.btn.pink { background: var(--pink); color: #fff; }
.btn.ghost { background: transparent; color: var(--chalk); border: 2px dashed rgba(244,241,232,.5); box-shadow: none; }
.btn.small { padding: 8px 14px; font-size: .9rem; border-radius: 10px; }
.btn:disabled { opacity: .45; }

/* ---------- paper card (phones, forms) ---------- */
.paper {
  background:
    linear-gradient(90deg, transparent 38px, rgba(255,77,77,.45) 38px 40px, transparent 40px),
    repeating-linear-gradient(transparent 0 31px, var(--line) 31px 32px),
    var(--paper);
  color: var(--ink);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  padding: 18px 18px 18px 52px;
  position: relative;
}
.paper h2, .paper h3 { font-family: 'Permanent Marker'; margin: 0 0 8px; color: var(--ink); }

/* ---------- stamps ---------- */
.stamp { display: inline-block; font-family: 'Permanent Marker'; text-transform: uppercase; border: 4px solid currentColor; border-radius: 10px; padding: 2px 12px; transform: rotate(-8deg); letter-spacing: 1px; opacity: .92; }
.stamp.truth { color: var(--truth); }
.stamp.lie { color: var(--lie); }

/* ---------- home ---------- */
.home { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }
.home header { text-align: center; padding: 18px 0 8px; }
.home header .logo { font-size: clamp(64px, 12vw, 140px); }
.home .tagline { font-size: clamp(22px, 3vw, 34px); margin-top: 6px; }
.home .grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; margin-top: 26px; }
@media (max-width: 860px) { .home .grid { grid-template-columns: 1fr; } }
.lesson { list-style: none; padding: 0; margin: 0; font-size: 1.15rem; }
.lesson li { display: flex; gap: 14px; align-items: flex-start; margin: 0 0 16px; }
.lesson .n { font-family: 'Permanent Marker'; color: var(--pink); font-size: 2rem; line-height: 1; min-width: 32px; }
.lesson b { color: var(--yellow); }
.form .row { margin: 0 0 14px; }
.form label.t { display: block; font-weight: 700; margin-bottom: 6px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg input { display: none; }
.seg label { padding: 8px 14px; border-radius: 999px; border: 2px solid var(--ink); font-weight: 600; cursor: pointer; background: #fff; }
.seg input:checked + label { background: var(--ink); color: #fff; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.check input { width: 24px; height: 24px; margin-top: 2px; }
.doodle { position: fixed; font-family: 'Caveat Brush'; color: rgba(244,241,232,.18); pointer-events: none; user-select: none; z-index: 0; }
.home > * { position: relative; z-index: 1; }
.footer { text-align: center; color: var(--chalk2); margin-top: 30px; font-size: .95rem; }

/* ---------- TV ---------- */
.tv { height: 100vh; display: grid; grid-template-columns: 1fr 360px; grid-template-rows: auto 1fr; gap: 0; overflow: hidden; border: 18px solid var(--frame); border-image: linear-gradient(135deg,#a0692f,#6b4220,#a0692f) 1; }
.tv .top { grid-column: 1 / 3; display: flex; align-items: center; justify-content: space-between; padding: 10px 26px; border-bottom: 2px dashed rgba(244,241,232,.25); }
.tv .top .logo { font-size: 48px; }
.tv .top .info { font-size: 1.2rem; color: var(--chalk2); text-align: right; }
.tv .top .info b { color: var(--yellow); font-size: 1.6rem; letter-spacing: 3px; }
.tv .stage { padding: 26px 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; position: relative; overflow: hidden; }
.tv .side { border-left: 2px dashed rgba(244,241,232,.25); padding: 16px 18px; overflow: hidden; display: flex; flex-direction: column; }
.tv .side h3 { font-family: 'Caveat Brush'; font-size: 2rem; margin: 0 0 4px; color: var(--yellow); }
.tv .side .sub { color: var(--chalk2); font-size: .95rem; margin-bottom: 10px; }
.register { list-style: none; margin: 0; padding: 0; overflow: hidden; flex: 1; }
.register li { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 10px; margin-bottom: 4px; font-size: 1.15rem; transition: background .3s; }
.register li.hot { background: rgba(255,61,127,.22); }
.register li.off { opacity: .4; }
.register .av { font-size: 1.7rem; text-align: center; }
.register .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.register .nm small { display: block; font-size: .8rem; color: var(--chalk2); }
.register .pc { font-family: 'Permanent Marker'; font-size: 1.2rem; }
.register .tick { color: var(--truth); font-size: 1.3rem; }
.meter { height: 6px; background: rgba(255,255,255,.15); border-radius: 3px; margin-top: 3px; overflow: hidden; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--lie), var(--yellow), var(--truth)); }

.hotseat { font-size: 1.6rem; color: var(--chalk2); margin-bottom: 8px; }
.hotseat .who { font-family: 'Permanent Marker'; font-size: 3.2rem; display: block; margin-top: 4px; }
.question { font-family: 'Caveat Brush'; font-size: clamp(42px, 4.6vw, 84px); line-height: 1.08; max-width: 1200px; margin: 10px auto 18px; text-shadow: 0 0 2px rgba(255,255,255,.35); }
.instr { font-size: 1.5rem; color: var(--yellow); }
.timer { position: absolute; top: 18px; right: 26px; font-family: 'Permanent Marker'; font-size: 2.6rem; color: var(--yellow); }
.timer.low { color: var(--lie); animation: pulse .6s infinite alternate; }
@keyframes pulse { to { transform: scale(1.12); } }
.votes-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.votes-row span { font-size: 2.2rem; opacity: .3; transition: all .3s; }
.votes-row span.in { opacity: 1; transform: translateY(-4px); }
.result-big { font-family: 'Permanent Marker'; font-size: 4.2rem; color: var(--yellow); }
.result-sub { font-size: 1.6rem; color: var(--chalk2); margin-top: 8px; }
.secret { margin-top: 18px; font-size: 1.2rem; color: var(--chalk2); }
.qr { background: #fff; padding: 12px; border-radius: 12px; display: inline-block; }
.lobby-code { font-family: 'Permanent Marker'; font-size: 5.5rem; letter-spacing: 10px; color: var(--yellow); line-height: 1; }
.lobby-grid { display: flex; gap: 46px; align-items: center; justify-content: center; }
.lobby-url { font-size: 1.6rem; margin: 6px 0 14px; }
.settings-line { margin-top: 22px; color: var(--chalk2); font-size: 1.15rem; }
.settings-line b { color: var(--chalk); }
.hostbar { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; gap: 10px; justify-content: center; }
.flash { position: absolute; top: 40%; left: 50%; transform: translate(-50%,-50%) rotate(-6deg); font-family: 'Permanent Marker'; font-size: 4rem; color: var(--pink); background: rgba(0,0,0,.4); padding: 10px 30px; border-radius: 16px; animation: pop 2s forwards; z-index: 5; }
@keyframes pop { 0% { transform: translate(-50%,-50%) scale(.3) rotate(-6deg); opacity: 0; } 15% { transform: translate(-50%,-50%) scale(1.1) rotate(-6deg); opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }

/* reveal */
.reveal-card { width: min(1150px, 100%); }
.reveal-head { display: flex; align-items: center; gap: 22px; justify-content: center; }
.reveal-head .av { font-size: 5rem; }
.reveal-head .nm { font-family: 'Permanent Marker'; font-size: 4rem; }
.reveal-stats { font-family: 'Caveat Brush'; font-size: 2.6rem; line-height: 1.25; margin: 10px 0 14px; }
.reveal-stats b { color: var(--yellow); }
.reveal-stats .l { color: var(--lie); }
.reveal-stats .t { color: var(--truth); }
.answers { list-style: none; padding: 0; margin: 0 auto; text-align: left; columns: 2; column-gap: 26px; max-height: 46vh; overflow: hidden; }
.answers li { break-inside: avoid; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px dashed rgba(244,241,232,.2); font-size: 1.05rem; opacity: 0; animation: fadein .4s forwards; }
.answers li .stamp { font-size: .85rem; border-width: 3px; padding: 0 8px; }
.answers li small { color: var(--chalk2); display: block; }
@keyframes fadein { to { opacity: 1; } }
.award { text-align: center; }
.award .icon { font-size: 7rem; }
.award .title { font-family: 'Permanent Marker'; font-size: 4rem; color: var(--yellow); }
.award .who { font-family: 'Caveat Brush'; font-size: 4rem; margin-top: 4px; }
.award .line { font-size: 1.7rem; color: var(--chalk2); margin-top: 6px; }
.award .q { font-family: 'Caveat Brush'; font-size: 2.4rem; margin-top: 14px; color: var(--chalk); }
.finaltable { width: min(1100px, 100%); border-collapse: collapse; font-size: 1.25rem; }
.finaltable th { font-family: 'Caveat Brush'; font-size: 1.6rem; color: var(--yellow); font-weight: 400; text-align: center; padding: 4px 8px; }
.finaltable td { padding: 6px 8px; border-top: 1px dashed rgba(244,241,232,.2); text-align: center; }
.finaltable td.nm { text-align: left; font-weight: 700; }
.finaltable .gr { font-family: 'Permanent Marker'; font-size: 1.5rem; }
.finaltable tr:first-child td { color: var(--yellow); }

/* ---------- phone ---------- */
.phone { max-width: 520px; margin: 0 auto; min-height: 100vh; padding: 12px 14px 26px; display: flex; flex-direction: column; }
.phone .bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.phone .bar .logo { font-size: 30px; }
.phone .bar .me { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.phone .bar .me .av { font-size: 1.6rem; }
.phone .main { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.phone .q { font-family: 'Caveat Brush'; font-size: 2rem; line-height: 1.12; color: var(--ink); }
.phone .bigbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bigbtn { border: 0; border-radius: 22px; padding: 26px 8px; font-family: 'Permanent Marker'; font-size: 1.7rem; color: #fff; box-shadow: 0 6px 0 rgba(0,0,0,.35); line-height: 1.05; }
.bigbtn small { display: block; font-family: 'Fredoka'; font-size: .85rem; font-weight: 600; margin-top: 6px; opacity: .9; }
.bigbtn.truth { background: linear-gradient(160deg, #3ee597, #1fa865); }
.bigbtn.lie { background: linear-gradient(160deg, #ff6b6b, #d92f2f); }
.bigbtn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.35); }
.bigbtn.picked { outline: 5px solid var(--yellow); }
.bigbtn:disabled { opacity: .35; }
.phone .status { text-align: center; font-size: 1.15rem; color: var(--chalk2); }
.phone .status b { color: var(--yellow); }
.phone .ptimer { text-align: center; font-family: 'Permanent Marker'; font-size: 1.8rem; color: var(--yellow); }
.orders { background: var(--lie); color: #fff; border-radius: 14px; padding: 12px 14px; font-weight: 700; text-align: center; transform: rotate(-1deg); box-shadow: 0 4px 0 rgba(0,0,0,.3); }
.orders .marker { font-size: 1.5rem; display: block; }
.avatars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.avatars button { font-size: 1.8rem; background: #fff; border: 2px solid transparent; border-radius: 12px; padding: 6px 0; }
.avatars button.on { border-color: var(--pink); background: #ffe3ee; }
.inp { width: 100%; font: inherit; font-size: 1.3rem; padding: 10px 12px; border-radius: 10px; border: 2px solid var(--ink); background: #fff; color: var(--ink); }
.err { color: var(--lie); font-weight: 700; min-height: 1.2em; }
.mini-register { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mini-register li { background: rgba(255,255,255,.08); border-radius: 10px; padding: 6px 8px; font-size: .95rem; display: flex; justify-content: space-between; gap: 6px; }
.report-link { background: none; border: 0; color: var(--chalk2); text-decoration: underline; font-size: .85rem; }
.reportcard { background: var(--paper); color: var(--ink); border-radius: 8px; padding: 14px 16px; box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.reportcard h3 { font-family: 'Permanent Marker'; margin: 0 0 6px; text-align: center; border-bottom: 2px solid var(--ink); padding-bottom: 6px; }
.reportcard table { width: 100%; border-collapse: collapse; }
.reportcard td { padding: 5px 4px; border-bottom: 1px dotted #aab; }
.reportcard td.g { font-family: 'Permanent Marker'; font-size: 1.5rem; text-align: right; color: var(--lie); }
.reportcard .comment { font-family: 'Caveat Brush'; font-size: 1.35rem; color: #b0233f; margin-top: 8px; }
.gate { text-align: center; padding-top: 10vh; }
.gate .logo { font-size: 72px; }
