/* Đá's Phrasebook. The variables are the election page's names, so the shared zjt.im themes (zen.css) restyle it. */
@font-face { font-family: "xkcd Script"; src: url(/vendor/fonts/xkcd-script.ttf) format("truetype"); font-display: swap; }
:root {
  --paper: #ffffff; --ink: #111111; --ink-2: #555555; --faint: #d6d6d6; --note: #f3f3ef;
  --hope: #2f6fb3; --doom: #c0392b; --win: #2e8b57; --warn: #c9a227;
  --hand: "Shantell Sans", "Patrick Hand", "Comic Sans MS", cursive; --body: "Shantell Sans", "Patrick Hand", system-ui, sans-serif;
  --comic: "xkcd Script", "Patrick Hand", "Comic Sans MS", cursive;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-zen]) { --paper: #15171a; --ink: #ececec; --ink-2: #a8a8a8; --faint: #3a3d42; --note: #22252a;
    --hope: #78aee6; --doom: #f07a6a; --win: #6fd39a; color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; }
body { background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.45;
  min-height: 100dvh; padding-bottom: calc(68px + env(safe-area-inset-bottom)); -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { font-family: var(--hand); line-height: 1.15; margin: .4em 0 .3em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.1rem; }
a { color: var(--hope); }
button { font: inherit; color: inherit; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 16px; background: var(--paper); border-bottom: 2px solid var(--ink); }
.brand { font-family: var(--comic); font-size: 1.25rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.stats { display: flex; gap: 12px; font-weight: 600; white-space: nowrap; }
#st-hull.low { color: var(--doom); }
main { max-width: 640px; margin: 0 auto; padding: 12px 16px 24px; }
.loading { text-align: center; color: var(--ink-2); margin-top: 30vh; }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: flex; justify-content: space-around; background: var(--paper);
  border-top: 2px solid var(--ink); padding: 4px 0 calc(4px + env(safe-area-inset-bottom)); }
.tabs a { display: flex; flex-direction: column; align-items: center; font-size: .78rem; color: var(--ink-2); text-decoration: none; padding: 2px 10px; min-width: 64px; }
.tabs a span { font-size: 1.4rem; line-height: 1.2; }
.tabs a.on { color: var(--ink); font-weight: 700; }
body.lesson-on .tabs, body.lesson-on .top .stats #st-streak, body.lesson-on #zjt-bar { display: none; }
#err { position: fixed; left: 8px; right: 8px; bottom: 80px; background: var(--doom); color: #fff; padding: 8px; border-radius: 6px; z-index: 50; font-size: .85rem; }

/* buttons, hand-drawn-ish */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 10px 18px; border: 2px solid var(--ink);
  border-radius: 14px 10px 16px 9px / 9px 15px 10px 14px; background: var(--paper); cursor: pointer; font-weight: 700; text-decoration: none; color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink); transition: transform .06s, box-shadow .06s; }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.go { background: var(--win); color: var(--paper); border-color: var(--ink); }
.btn.bad { background: var(--doom); color: var(--paper); }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .45; box-shadow: none; cursor: default; }
.btn.small { min-height: 36px; padding: 4px 12px; font-size: .9rem; box-shadow: 2px 2px 0 var(--ink); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--ink-2); }
.card { border: 2px solid var(--ink); border-radius: 18px 12px 20px 10px / 12px 20px 12px 18px; padding: 14px; margin: 14px 0; background: var(--paper); }
.note { background: var(--note); border-radius: 10px; padding: 10px 12px; font-size: .95rem; }
label.f { display: block; margin: 10px 0 4px; font-weight: 700; }
select, input[type=text], textarea { font: inherit; color: var(--ink); background: var(--paper); border: 2px solid var(--ink); border-radius: 10px; padding: 8px 10px; width: 100%; }
input[type=range] { width: 100%; }

/* comic */
.comic { width: 100%; height: auto; display: block; margin: 8px 0; }
.comic text, .comic .t { font-family: var(--comic) !important; fill: var(--ink); }

/* path */
.path { position: relative; }
.path svg.trail { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.stop { position: relative; display: flex; align-items: center; gap: 14px; margin: 0 0 26px; }
.stop:nth-child(odd) { flex-direction: row; padding-left: 4%; }
.stop:nth-child(even) { flex-direction: row-reverse; padding-right: 4%; text-align: right; }
.planet { flex: none; width: 84px; height: 84px; border-radius: 50%; border: 3px solid var(--ink); display: grid; place-items: center; font-size: 2.2rem;
  background: var(--paper); cursor: pointer; position: relative; box-shadow: 4px 4px 0 var(--ink); }
.planet.done { background: color-mix(in srgb, var(--win) 22%, var(--paper)); }
.planet.next { animation: bob 2.4s ease-in-out infinite; background: color-mix(in srgb, var(--warn) 25%, var(--paper)); }
.planet.locked { filter: grayscale(1) contrast(.55) brightness(1.1); box-shadow: none; border-style: dashed; }
.planet svg { position: absolute; inset: -9px; width: 102px; height: 102px; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-3deg); } }
@media (prefers-reduced-motion: reduce) { .planet.next { animation: none; } }
.stop .lbl b { display: block; font-family: var(--hand); font-size: 1.1rem; }
.stop .lbl small { color: var(--ink-2); }
.hero { display: flex; gap: 12px; align-items: center; }
.hero svg { flex: none; }

/* lesson */
.lbar { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; }
.lbar .x { border: 0; background: none; font-size: 1.6rem; cursor: pointer; padding: 0 6px; }
.prog { flex: 1; height: 16px; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--win); transition: width .3s; }
.q { font-family: var(--hand); font-size: 1.25rem; margin: 6px 0 12px; }
.prompt { display: flex; align-items: center; gap: 12px; margin: 8px 0 16px; flex-wrap: wrap; }
.prompt .big { font-size: 1.7rem; font-weight: 700; }
.prompt .emo { font-size: 2.4rem; }
.say { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--ink); background: var(--hope); color: var(--paper); font-size: 1.5rem; cursor: pointer; box-shadow: 3px 3px 0 var(--ink); flex: none; }
.say.slow { width: 44px; height: 44px; font-size: 1.1rem; background: var(--paper); color: var(--ink); }
.say:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choices.one { grid-template-columns: 1fr; }
.choice { min-height: 64px; padding: 10px; border: 2px solid var(--ink); border-radius: 14px; background: var(--paper); cursor: pointer; font-size: 1.05rem; text-align: center;
  box-shadow: 3px 3px 0 var(--faint); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.choice .emo { font-size: 1.6rem; }
.choice.sel { border-color: var(--hope); box-shadow: 3px 3px 0 var(--hope); background: color-mix(in srgb, var(--hope) 12%, var(--paper)); }
.choice.ok { border-color: var(--win); background: color-mix(in srgb, var(--win) 18%, var(--paper)); }
.choice.no { border-color: var(--doom); background: color-mix(in srgb, var(--doom) 15%, var(--paper)); }
.choice.gone { visibility: hidden; }
.choice svg { width: 100%; height: 54px; }
.tiles { display: flex; flex-wrap: wrap; gap: 8px; min-height: 58px; padding: 8px 0; }
.tiles.ans { border-bottom: 2px dashed var(--ink-2); margin-bottom: 14px; }
.tile { padding: 8px 14px; border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); cursor: pointer; font-size: 1.1rem; box-shadow: 2px 3px 0 var(--ink); }
.tile.used { visibility: hidden; }
body.lesson-on main { padding-bottom: 200px; }
.foot { position: fixed; bottom: 0; left: 0; right: 0; z-index: 6; max-width: 640px; margin: 0 auto; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 2px solid var(--ink); }
.foot.good { background: color-mix(in srgb, var(--win) 18%, var(--paper)); }
.foot.bad { background: color-mix(in srgb, var(--doom) 14%, var(--paper)); }
.foot .verdict { font-family: var(--hand); font-size: 1.2rem; font-weight: 800; margin-bottom: 6px; }
.foot .ans { margin-bottom: 10px; }
.tone-svg { display: block; }
.mic { width: 96px; height: 96px; border-radius: 50%; border: 3px solid var(--ink); background: var(--paper); font-size: 2.4rem; cursor: pointer; box-shadow: 4px 4px 0 var(--ink); }
.mic.rec { background: var(--doom); animation: bob 1s infinite; }

/* tones */
.tones { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.tonecard { border: 2px solid var(--ink); border-radius: 14px; padding: 10px; cursor: pointer; background: var(--paper); text-align: left; }
.tonecard b { font-size: 1.5rem; }
.tonecard svg { width: 100%; height: 70px; }

/* pair */
.linkbox { word-break: break-all; font-size: .85rem; background: var(--note); padding: 8px; border-radius: 8px; }
.pair-card { text-align: center; }
.pair-card .big { font-size: 2rem; font-weight: 800; margin: 8px 0; }
.pair-card .emo { font-size: 3.2rem; }
.role { display: inline-block; padding: 2px 10px; border: 2px solid var(--ink); border-radius: 20px; font-weight: 700; font-size: .9rem; }
.teach-row { display: grid; grid-template-columns: 2.2rem 1fr 1.2fr; gap: 8px; align-items: center; margin: 6px 0; }
.teach-row .emo { font-size: 1.4rem; }

/* done */
.done-big { text-align: center; }
.done-big .num { font-size: 2.6rem; font-weight: 800; font-family: var(--hand); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.confetti i { position: absolute; top: -20px; font-style: normal; font-size: 1.4rem; animation: fall 2.2s linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } }
.small { font-size: .85rem; }
footer.fine { text-align: center; color: var(--ink-2); font-size: .8rem; margin: 30px 0 10px; }

/* call dock */
#dock { position: fixed; left: 0; right: 0; bottom: calc(60px + env(safe-area-inset-bottom)); z-index: 7; max-width: 640px; margin: 0 auto; padding: 8px 12px;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 14px 14px 0 0; box-shadow: 0 -3px 0 var(--faint); }
body.dock-on main { padding-bottom: 190px; }
.dock-top { display: flex; gap: 10px; align-items: center; }
.dock-vid { position: relative; flex: none; width: 96px; height: 72px; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; background: var(--note); display: grid; place-items: center; font-size: 2rem; }
.dock-vid video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dock-vid.nocam video { opacity: 0; }
.dock-vid .badge { position: absolute; right: 2px; bottom: 0; font-size: .9rem; }
#dock-self { width: 54px; height: 72px; transform: scaleX(-1); object-fit: cover; border-radius: 8px; border: 2px solid var(--ink); flex: none; }
.dock-st { flex: 1; font-size: .85rem; line-height: 1.3; }
.dock-ctl { display: flex; gap: 8px; justify-content: center; margin-top: 8px; flex-wrap: wrap; }
.dock-ctl button { width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--ink); background: var(--paper); font-size: 1.3rem; cursor: pointer; box-shadow: 2px 2px 0 var(--ink); }
.dock-ctl button.off { background: color-mix(in srgb, var(--doom) 22%, var(--paper)); }
.dock-ctl button.end { background: var(--doom); color: var(--paper); }
.talk .btn { margin: 4px 0; }
.privacy-line { font-size: .85rem; color: var(--ink-2); }
