/* Poison the Data — two worlds, one stylesheet.
   .resistance — dark, analog, neon green/purple, cobbled together.
   .human      — sterile, white, blue, suspiciously legitimate.        */

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overscroll-behavior: none;
}
#app { min-height: 100%; }
button { font: inherit; cursor: pointer; border: 0; }
img { max-width: 100%; }

/* ============================== RESISTANCE ============================== */

body.resistance {
  background: #05070a;
  color: #d8ffd0;
  font-family: 'Oswald', 'Avenir Next Condensed', sans-serif;
}

/* ------- home / Tronk's HQ (landing, name forms, lobby) ------- */

.home {
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center;
  background: url('/assets/lab-bg.jpg') center top / cover no-repeat #05070a;
  padding: max(10px, env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
}
.home-logo {
  width: min(94vw, 440px);
  margin-top: 1vh;
  mix-blend-mode: screen; /* the asset's black ground melts into the scene */
  filter: drop-shadow(0 6px 24px rgba(0,0,0,.8));
}
.home-logo.small { width: min(64vw, 280px); margin-top: 0; }
.home-flex { flex: 1 1 auto; min-height: 4vh; }
.home-flex.tiny { flex: 0 1 3vh; }

.home-actions { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; }

.btn-big {
  width: 84%; max-width: 430px; min-height: 74px;
  display: flex; align-items: center; justify-content: center; gap: 16px;
  border-radius: 16px; border: 3px solid rgba(0, 0, 0, .65);
  font-family: 'Bangers', 'Arial Black', cursive;
  font-size: 32px; letter-spacing: 1px; color: #0d0d0d;
  position: relative; padding: 10px 20px;
  transition: transform .08s ease;
}
.btn-big:active { transform: scale(.96); }
.btn-host {
  background: linear-gradient(180deg, #c3ec1e, #9fd400);
  box-shadow: 0 0 26px rgba(174, 230, 20, .55), inset 0 0 18px rgba(255,255,255,.18);
}
.btn-join {
  background: linear-gradient(180deg, #b46ef0, #9a4fd8);
  box-shadow: 0 0 26px rgba(170, 100, 235, .5), inset 0 0 18px rgba(255,255,255,.14);
}
.bicon { flex: 0 0 auto; }
.bicon.flask { height: 50px; }
.bicon.party { height: 38px; }
.btn-big .btxt small {
  display: block; font-family: 'Oswald', sans-serif; font-weight: 700;
  font-size: 13px; letter-spacing: 2px; margin-top: 2px;
}
.btn-big.waiting { filter: saturate(.92); }
.btnspin {
  position: absolute; right: 16px; width: 18px; height: 18px;
  border: 3px dotted rgba(0,0,0,.7); border-radius: 50%;
  animation: spin 1.4s linear infinite;
}

/* room-code terminal panel (hosted state / lobby) */
.codeblock { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 1vh; }
.codelabel {
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 17px;
  letter-spacing: 6px; color: #b8f000; text-shadow: 0 0 10px rgba(184,240,0,.6);
}
.codelabel::before { content: '═ '; } .codelabel::after { content: ' ═'; }
.codepanel {
  display: flex; gap: 26px; padding: 10px 30px;
  background: #040604; border: 2px solid #9be000; border-radius: 10px;
  box-shadow: 0 0 22px rgba(155,224,0,.4), inset 0 0 26px rgba(0,0,0,.95);
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 54px; line-height: 1.1;
  color: #c4ff10; text-shadow: 0 0 14px rgba(196,255,16,.75);
}
.codeshare {
  font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 14px;
  letter-spacing: 2px; color: #eef3e8; text-shadow: 0 1px 6px rgba(0,0,0,.95);
}
.qrcard.mini { width: 108px; padding: 6px; }
.lobbyhome .roster { width: 100%; max-width: 430px; margin-top: 10px; }
.lobbystatus {
  font-family: 'Oswald', sans-serif; font-weight: 700; letter-spacing: 2px;
  color: #d8e6c8; font-size: 14px; text-align: center; padding: 12px;
  text-shadow: 0 1px 4px rgba(0,0,0,.9);
}

.center-screen {
  min-height: 100dvh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 24px; gap: 14px;
}
.screen { min-height: 100dvh; padding: 20px 18px 90px; max-width: 480px; margin: 0 auto; }
.resistance-pad { display: flex; flex-direction: column; gap: 16px; }

.glitch { color: #39ff14; letter-spacing: 4px; animation: flicker 1.2s infinite; font-family: 'Oswald', sans-serif; }
@keyframes flicker { 0%,100%{opacity:1} 45%{opacity:.4} 55%{opacity:.9} }

.btn-neon, .btn-purple, .btn-ghost {
  font-family: 'Bangers', 'Arial Black', cursive; font-weight: 400; letter-spacing: 1px;
  padding: 14px 22px; border-radius: 10px; width: 100%; max-width: 320px;
}
.btn-neon { background: #39ff14; color: #06130a; box-shadow: 0 0 16px rgba(57,255,20,.45); }
.btn-neon:active { transform: scale(.97); }
.btn-purple { background: #7b2fbf; color: #f2e6ff; box-shadow: 0 0 16px rgba(178,107,255,.4); }
.btn-ghost { background: transparent; color: #7da077; }
.big { font-size: 17px; }

.joinform { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; max-width: 340px; }
.joinform label {
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 14px; letter-spacing: 3px;
  color: #b8f000; align-self: flex-start; margin-top: 8px; text-shadow: 0 1px 4px rgba(0,0,0,.9);
}
.joinform input {
  font-family: 'Oswald', sans-serif; font-size: 22px; padding: 12px; background: rgba(4,6,4,.92);
  border: 2px solid #46603a; border-radius: 10px; color: #d8ffd0; width: 100%;
}
.joinform input:focus { outline: none; border-color: #9be000; box-shadow: 0 0 14px rgba(155,224,0,.35); }
#code { text-align: center; letter-spacing: 18px; font-size: 34px; font-weight: 700; }
.formerr { color: #ff6b6b; font-family: 'Oswald', sans-serif; font-size: 14px; text-shadow: 0 1px 4px rgba(0,0,0,.9); }

/* lobby secondary controls: solid dark backings — the artwork behind
   them is busy, ghost styling was illegible (playtest screenshot) */
.option {
  text-align: center; font-family: 'Oswald', sans-serif; font-weight: 700;
  font-size: 15px; letter-spacing: 2px; color: #d8ffd0;
  background: rgba(3, 6, 3, .72); border: 1px solid #46603a; border-radius: 8px;
  padding: 10px 14px; width: 100%; max-width: 430px;
}
.muted-line { color: #b9c9ad; }
button.option { max-width: 430px; }
.copybtn {
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 16px;
  letter-spacing: 2px; color: #c4ff10; background: rgba(3, 6, 3, .85);
  border: 2px solid #9be000; border-radius: 10px; padding: 12px 22px;
  box-shadow: 0 0 14px rgba(155, 224, 0, .35);
  text-shadow: 0 0 8px rgba(196, 255, 16, .5);
}
.copybtn:active { transform: scale(.96); }

.qrblock { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.qrcard { background: #fff; padding: 10px; border-radius: 8px; width: 170px; }
.qrcard svg { display: block; width: 100%; height: auto; }
.joinurl { font-size: 12px; color: #7da077; letter-spacing: 1px; }

.roster { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.roster li {
  background: rgba(178,107,255,.08); border-left: 3px solid #b26bff;
  padding: 10px 12px; font-size: 17px; border-radius: 2px;
}
.roster li.dropped { opacity: .45; }

.tronk-line { display: flex; gap: 12px; align-items: flex-end; margin-top: 2vh; }
.tronk-line img { width: 150px; flex: 0 0 auto; filter: drop-shadow(0 0 14px rgba(57,255,20,.3)); }
.tronk-line .bubble { font-size: 17px; }
.bubble {
  background: #0f1a0f; border: 1px solid #39ff14; border-radius: 10px 10px 10px 2px;
  padding: 10px 12px; font-size: 14px; line-height: 1.5; color: #d8ffd0;
  font-family: 'Arvo', Georgia, serif;
}
.tronk-slide { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 12px; }
.tronk-slide img { width: 180px; filter: drop-shadow(0 0 14px rgba(57,255,20,.3)); }
.big-bubble { font-size: 17px; white-space: pre-line; }

.steplabel { font-size: 11px; letter-spacing: 4px; color: #b26bff; text-align: center; }

.human-frame { background: #f0f2f5; border-radius: 8px; padding: 10px; color: #050505;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  display: flex; flex-direction: column; gap: 10px; }
.popin { opacity: 0; animation: popIn .4s ease forwards; }
@keyframes popIn {
  from { opacity: 0; transform: translateY(14px) scale(.96); }
  to { opacity: 1; transform: none; }
}

.scores-title {
  color: #39ff14; text-align: center; letter-spacing: 3px; font-size: 34px;
  text-shadow: 0 0 14px rgba(57,255,20,.4);
  font-family: 'Bangers', 'Arial Black', cursive; font-weight: 400;
}
.scoreboard { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.scoreboard li { display: flex; align-items: baseline; gap: 8px; font-size: 18px; }
.scoreboard .rank { color: #7da077; }
.scoreboard .pscore { color: #39ff14; font-weight: 900; }
.dots-fill { flex: 1; border-bottom: 2px dotted #2c4a2c; }

.vipbar { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  display: flex; justify-content: center; background: linear-gradient(transparent, rgba(0,0,0,.55) 40%); z-index: 5; }
.vipbar.stack { flex-direction: column; align-items: center; gap: 6px; }
.muted-hint { color: #7da077; font-size: 13px; letter-spacing: 1px; text-align: center; }
body.human .vipbar { background: linear-gradient(transparent, rgba(240,242,245,.9) 40%); }
body.human .muted-hint { color: #65676b; }

/* ================================ HUMAN ================================ */

body.human { background: #f0f2f5; color: #050505; }

.human-app { max-width: 480px; margin: 0 auto; min-height: 100dvh; padding-bottom: 90px; }
.human-head {
  position: sticky; top: 0; z-index: 4; background: #fff; padding: 10px 14px 8px;
  border-bottom: 1px solid #dcdfe4; display: flex; align-items: baseline; gap: 10px;
}
.human-logo { font-weight: 900; font-size: 40px; color: #2B6BE4; letter-spacing: -1px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.human-logo.small { font-size: 24px; }
.human-tag { color: #65676b; font-size: 14px; }
.human-tag.tiny { font-size: 10px; flex: 1; }
.hud { display: flex; gap: 6px; }
.qbadge, .scorebadge { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.qbadge { background: #e7f0ff; color: #2B6BE4; }
.scorebadge { background: #e6f4e6; color: #1d7a1d; }

.feed { padding: 12px 12px 0; display: flex; flex-direction: column; gap: 10px; }

.card {
  background: #fff; border-radius: 10px; padding: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.1);
  color: #050505; /* cards are white in every theme — never inherit resistance green */
}
.card.reply { margin-left: 22px; }

.posthead { display: flex; gap: 9px; align-items: center; margin-bottom: 6px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 700; color: #fff; background: #8a94a6;
}
.avatar.bot { background: #dbe7ff; font-size: 22px; }
.avatar.h { background: #7b2fbf; }
.avatar.anon { background: #565b66; }
.pname { font-weight: 700; font-size: 15px; }
.verified { color: #2B6BE4; font-size: 13px; }
.ptime { color: #65676b; font-size: 12px; }
.pbody { font-size: 16px; line-height: 1.5; white-space: pre-wrap; font-family: 'Arvo', Georgia, serif; }

.likesrow { margin-top: 8px; color: #65676b; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.canonlabel { color: #1d7a1d; font-weight: 700; font-size: 11px; letter-spacing: 1px; }
.card.canon { border-left: 3px solid #2B6BE4; }

.likebtn {
  background: #e7f0ff; color: #2B6BE4; font-weight: 700; font-size: 15px;
  padding: 9px 18px; border-radius: 8px;
}
.likebtn:active { transform: scale(.95); }
.likedtag { color: #2B6BE4; font-weight: 700; }
.minetag { color: #65676b; font-style: italic; font-size: 13px; }

/* The winning answer is the resistance's moment — PtD purple & green
   breaking through HUMAN's sterile blue. */
.card.winner {
  border: 3px solid #9be000;
  box-shadow: 0 0 18px rgba(155, 224, 0, .45);
}
.pinbar { background: #7b2fbf; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 1px;
  padding: 4px 10px; border-radius: 6px; margin-bottom: 8px; display: inline-block; }
.pts { color: #4a9500; font-weight: 800; }
.card.winner .pts { color: #7b2fbf; }

.votelabel { color: #65676b; font-size: 13px; padding: 2px 4px; }
.votelabel .muted { color: #98a0ab; }
.summarylabel { text-align: center; color: #65676b; font-size: 14px; padding: 6px; }

.composer { display: flex; flex-direction: column; gap: 8px; }
.composer textarea {
  font: inherit; font-size: 16px; border: 1px solid #dcdfe4; border-radius: 8px;
  padding: 10px; resize: none; background: #f7f8fa;
}
.btn-blue { background: #2B6BE4; color: #fff; font-weight: 800; padding: 12px; border-radius: 8px; letter-spacing: 1px; }
.btn-blue:active { transform: scale(.98); }

.card.waiting { text-align: center; color: #050505; }
.card.typing { display: flex; gap: 9px; align-items: center; color: #65676b; }
.dots i { animation: blink 1.4s infinite; font-style: normal; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,100%{opacity:.2} 40%{opacity:1} }

.tronk-toast {
  display: flex; gap: 8px; align-items: flex-end;
  background: #0f1a0f; border: 1px solid #39ff14; border-radius: 10px; padding: 8px;
}
.tronk-toast img { width: 52px; }
.tronk-toast .bubble { border: 0; background: transparent; padding: 4px; color: #d8ffd0; font-size: 13px; }

/* HUMAN boot / consensus */
.human-boot { background: #f0f2f5; }
.spinner {
  width: 34px; height: 34px; border: 4px solid #dcdfe4; border-top-color: #2B6BE4;
  border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.logging { color: #65676b; }
.waitsmall { color: #98a0ab; font-size: 13px; margin-top: 18px; }
.human-boot .waitrow { justify-content: center; display: flex; flex-wrap: wrap; gap: 4px; }

.consensus-card {
  background: #fff; border: 1px solid #dcdfe4; border-radius: 12px; padding: 26px 22px;
  max-width: 340px; box-shadow: 0 4px 24px rgba(0,0,0,.12);
}
.consensus-card.inline { max-width: none; padding: 16px 18px; text-align: center; }
.ctitle.small { font-size: 19px; margin: 4px 0; }
.cbadge { color: #1d7a1d; font-weight: 800; letter-spacing: 1px; font-size: 13px; }
.ctitle { font-size: 24px; font-weight: 900; margin: 8px 0; color: #050505; }
.cbody { color: #65676b; font-size: 14px; line-height: 1.5; }
.csources { margin-top: 14px; font-size: 13px; color: #2B6BE4; font-weight: 700; }
.slogan { margin-top: 18px; letter-spacing: 4px; font-weight: 900; color: #65676b; font-size: 13px; }

/* timer */
.timerwrap { position: sticky; top: 0; z-index: 6; }
body.human .timerwrap { top: 58px; }
.timerbar { height: 4px; background: rgba(0,0,0,.12); }
.timerbar > div { height: 100%; background: #39ff14; transition: width .5s linear; }
body.human .timerbar > div { background: #2B6BE4; }
.timerbar.low > div { background: #e0245e; }

/* final credits reel */
.creditsmask {
  height: 300px; overflow: hidden; position: relative;
  border: 1px dashed #2c4a2c; border-radius: 8px;
  background: rgba(0,0,0,.3);
  -webkit-mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
}
.creditsroll {
  display: flex; flex-direction: column; gap: 12px; padding: 0 14px;
  animation: creditsroll linear infinite;
}
.creditcard .pbody { font-size: 15px; }
.creditstitle {
  text-align: center; color: #b26bff; letter-spacing: 3px; font-weight: 900;
  font-size: 13px; padding: 6px 0;
}
@keyframes creditsroll {
  from { transform: translateY(300px); }
  to { transform: translateY(-100%); }
}

/* filter settings modal — full-viewport vertical slider */
.filtermodal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(4, 8, 4, .96);
  display: flex; flex-direction: column; align-items: center;
  padding: calc(20px + env(safe-area-inset-top)) 22px calc(20px + env(safe-area-inset-bottom));
  gap: 12px;
}
.fm-title {
  font-family: 'Bangers', cursive; font-size: 30px; color: #b8f000;
  letter-spacing: 2px; text-shadow: 0 0 14px rgba(184,240,0,.5);
}
.fm-track {
  flex: 1; width: 100%; max-width: 420px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; padding: 4vh 0;
}
.fm-track::before { /* the rail */
  content: ''; position: absolute; left: 21px; top: 4vh; bottom: 4vh;
  width: 6px; border-radius: 3px;
  background: linear-gradient(180deg, #ffd400, #7b2fbf, #39ff14);
  opacity: .55;
}
.fm-stop {
  display: flex; align-items: center; gap: 18px; text-align: left;
  background: transparent; padding: 12px 6px; position: relative;
}
.fm-dot {
  flex: 0 0 auto; width: 22px; height: 22px; margin-left: 13px;
  border-radius: 50%; border: 3px solid #556; background: #10140f;
  transition: all .25s ease;
}
.fm-stop.active .fm-dot {
  width: 34px; height: 34px; margin-left: 7px;
  border-color: #fff; box-shadow: 0 0 18px rgba(255,255,255,.4);
}
.fm-strict.active .fm-dot { background: #ffd400; box-shadow: 0 0 20px rgba(255,212,0,.6); }
.fm-moderate.active .fm-dot { background: #a45de2; box-shadow: 0 0 20px rgba(164,93,226,.6); }
.fm-off.active .fm-dot { background: #39ff14; box-shadow: 0 0 20px rgba(57,255,20,.6); }
.fm-labels { display: flex; flex-direction: column; gap: 3px; }
.fm-labels b {
  font-family: 'Bangers', cursive; font-weight: 400; font-size: 24px;
  color: #eef4e6; letter-spacing: 1px; line-height: 1.1;
}
.fm-stop.active .fm-labels b { color: #fff; text-shadow: 0 0 12px rgba(255,255,255,.35); }
.fm-labels small { font-family: 'Oswald', sans-serif; font-size: 13px; letter-spacing: 2px; color: #93a08a; }
.fm-done { flex: 0 0 auto; }

/* honk */
.waitrow { color: #65676b; font-size: 14px; padding: 6px 4px 0; }
.waitname { font-weight: 700; white-space: nowrap; }
.honkbtn {
  background: #fff3cd; color: #7a5c00; border: 1px solid #e8d48b;
  font-weight: 800; font-size: 12px; padding: 4px 10px; border-radius: 999px;
}
.honkbtn:active { transform: scale(.92); }
body.resistance .honkbtn { background: #1a2410; color: #d8ffd0; border-color: #39ff14; }
/* Banners hug the top edge — never over the composer (playtest: a honk
   blocked the target mid-typing). */
.honknote {
  position: fixed; top: calc(6px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  background: #ffd400; color: #201800; font-weight: 900; font-size: 16px;
  padding: 9px 18px; border-radius: 999px; z-index: 40; text-align: center;
  box-shadow: 0 6px 22px rgba(0,0,0,.35); animation: honkshake .5s ease;
  max-width: 90%;
}
.honknote.atme { font-size: 19px; background: #ff4d00; color: #fff; animation: honkshake .5s ease 3; }
.honknote.neutral { background: #1a1f1a; color: #d8ffd0; border: 1px solid #39ff14; font-size: 14px; animation: none;
  top: calc(46px + env(safe-area-inset-top)); }
.skipbtn { background: #efe6fa; color: #5b2492; border-color: #c9a6ef; margin-left: 10px; }
.skipbtn.armed { background: #e0245e; color: #fff; border-color: #a01040; }
@keyframes honkshake {
  0%,100% { transform: translateX(-50%) rotate(0); }
  20% { transform: translateX(-54%) rotate(-3deg); }
  40% { transform: translateX(-46%) rotate(3deg); }
  60% { transform: translateX(-52%) rotate(-2deg); }
  80% { transform: translateX(-48%) rotate(2deg); }
}

/* toast + dev */
.toast {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%);
  background: #111; color: #fff; padding: 10px 16px; border-radius: 999px;
  font-size: 14px; z-index: 20; max-width: 86%; text-align: center;
}
.devgear {
  position: fixed; top: 8px; right: 8px; z-index: 30; background: transparent;
  font-size: 16px; opacity: .35; padding: 6px;
}
.mutebtn {
  position: fixed; top: 8px; right: 40px; z-index: 30; background: transparent;
  font-size: 16px; opacity: .55; padding: 6px;
}
.devpanel {
  position: fixed; top: 38px; right: 8px; z-index: 30; display: flex; flex-direction: column;
  gap: 6px; background: #111; padding: 10px; border-radius: 8px;
}
.devpanel button { background: #333; color: #eee; padding: 8px 12px; border-radius: 6px; font-size: 13px; }
