* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; color: #fff; overscroll-behavior: none;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: none; }
button { font: inherit; color: inherit; cursor: pointer; }
kbd { font: 700 11px/1 ui-monospace, monospace; padding: 2px 5px; border: 1px solid currentColor; border-radius: 4px; opacity: 0.6; }
body[data-input="touch"] kbd, body[data-input="pad"] kbd { display: none; }
.block { font-family: "Anton", Impact, sans-serif; font-weight: 400; letter-spacing: 0.02em; }

#flash { position: fixed; inset: 0; pointer-events: none; background: #fff; opacity: 0; }
#flash.go { animation: flash 0.35s ease-out; }
@keyframes flash { from { opacity: 0.35; } to { opacity: 0; } }

/* Chat: Mara from Halcyon, and later "?" (red). Top of the screen on a phone, a column on the left on desktop. */
#chat { position: fixed; left: 10px; right: 128px; top: calc(10px + env(safe-area-inset-top)); display: flex; flex-direction: column; gap: 6px; pointer-events: none; z-index: 5; }
.msg { background: rgba(244, 247, 251, 0.94); color: #16324f; border-radius: 14px 14px 14px 4px; padding: 7px 11px; font-size: 14px; line-height: 1.3;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25); opacity: 0; transform: translateY(-6px); transition: opacity 0.3s, transform 0.3s; }
.msg.in { opacity: 1; transform: none; }
.msg b { display: block; font-size: 10px; letter-spacing: 0.12em; color: #3FA9F5; font-weight: 900; }
.msg.r { background: #000; color: #fff; border: 1.5px solid #FF2A2A; border-radius: 2px; font-family: "Anton", Impact, sans-serif; font-weight: 400; letter-spacing: 0.02em; font-size: 15px; }
.msg.r b { color: #FF2A2A; }
body.wide #chat { right: auto; width: 300px; left: 24px; top: 24px; }
body.wide .msg { font-size: 16px; padding: 10px 14px; }

#corner { position: fixed; right: 10px; top: calc(10px + env(safe-area-inset-top)); display: flex; gap: 8px; z-index: 6; }
#corner button { min-width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid rgba(255, 255, 255, 0.8); background: rgba(0, 0, 0, 0.72); display: grid; place-items: center; padding: 0 8px; }
#caseBtn { line-height: 1; } #caseBtn small { font-size: 9px; letter-spacing: 0.15em; opacity: 0.8; } #caseBtn b { font: 400 18px "Anton", Impact, sans-serif; }
#muteBtn .x { display: none; } #muteBtn.off .x { display: inline; } #muteBtn.off .w { display: none; }
#mark { position: fixed; left: 12px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 4; opacity: 0.8; transition: opacity 0.6s; font-size: 12px; }
#mark.gone { opacity: 0; pointer-events: none; }

.nav { position: fixed; z-index: 5; border: 0; background: rgba(0, 0, 0, 0.6); border-radius: 22px; min-width: 44px; height: 44px; display: flex; align-items: center; gap: 6px; padding: 0 12px;
  font-weight: 900; font-size: 13px; border: 1.5px solid rgba(255, 255, 255, 0.7); }
.nav i { width: 12px; height: 12px; border: solid #fff; border-width: 3px 3px 0 0; transform: rotate(45deg); }
#prev i { transform: rotate(-135deg); }
#prev { left: 8px; top: 50%; } #next { right: 8px; top: 50%; }
body[data-axis="y"] #prev { left: 50%; top: auto; bottom: calc(150px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: none; }
body[data-axis="y"] #next { right: 50%; top: auto; bottom: calc(58px + env(safe-area-inset-bottom)); transform: translateX(50%); }
body[data-axis="y"] #next i { transform: rotate(135deg); }
#next span:empty { display: none; }
#next.pulse { background: #FF2A2A; border-color: #FF2A2A; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(255, 42, 42, 0.2); } }
.nav[hidden] { display: none !important; }

#postbar { position: fixed; left: 0; right: 0; bottom: calc(8px + env(safe-area-inset-bottom)); display: flex; justify-content: center; gap: 8px; z-index: 5; }
#postbar button { height: 44px; border-radius: 22px; border: 1.5px solid rgba(255, 255, 255, 0.85); background: rgba(0, 0, 0, 0.72); padding: 0 14px; font-weight: 900; font-size: 14px; display: flex; gap: 6px; align-items: center; }
#postbar button.on { background: #fff; color: #000; }
#flagBtn.on { background: #FF2A2A !important; color: #fff !important; border-color: #FF2A2A !important; }
#postbar[hidden] { display: none; }
body[data-axis="y"] #next { bottom: calc(60px + env(safe-area-inset-bottom)); }

#timer { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); width: min(420px, 86vw); z-index: 5; background: #000; border: 1.5px solid #fff; padding: 8px 12px; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
#timer small { grid-column: 1 / -1; font: 400 13px "Anton", Impact, sans-serif; letter-spacing: 0.08em; }
#timer div { height: 8px; background: #333; } #timer i { display: block; height: 100%; background: #fff; transform-origin: left; }
#timer b { font: 400 22px "Anton", Impact, sans-serif; min-width: 3ch; text-align: right; }
#timer.urgent i, #timer.urgent b { background: #FF2A2A; color: #FF2A2A; } #timer.urgent b { background: none; }
#timer.urgent { border-color: #FF2A2A; animation: pulse 0.5s infinite; }
#timer[hidden] { display: none; }

#campaign { position: fixed; left: 50%; top: 34%; transform: translate(-50%, -50%); width: min(340px, 88vw); z-index: 6; text-align: center;
  background: linear-gradient(#ffffff, #dff0ff); color: #16324f; border-radius: 22px; padding: 16px; box-shadow: 0 10px 40px rgba(63, 169, 245, 0.5); border: 2px solid #fff; }
#campaign small { font-size: 11px; letter-spacing: 0.12em; color: #3FA9F5; font-weight: 900; }
#campaign b { display: block; font-size: 22px; font-weight: 900; margin: 4px 0; }
#campaign p { margin: 0 0 10px; font-style: italic; color: #a63b6f; font-weight: 800; }
#campaign .stat { background: #16324f; color: #fff; border-radius: 14px; padding: 10px; font-weight: 800; }
#campaign .stat i { font-style: normal; font-size: 34px; color: #9BE7C4; font-weight: 900; }
#campaign .stat em { color: #FFD84D; font-size: 13px; }

#choices { position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(440px, 94vw); z-index: 7;
  background: rgba(244, 247, 251, 0.97); color: #16324f; border-radius: 20px; padding: 12px; box-shadow: 0 -6px 30px rgba(0, 0, 0, 0.4); display: grid; gap: 7px; }
#choices[hidden] { display: none; }
#choices h3 { margin: 2px 4px 2px; font-size: 15px; font-weight: 900; }
.choice { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 10px; text-align: left; min-height: 46px; border-radius: 14px; border: 2px solid #cfe2f2; background: linear-gradient(#fff, #eaf4fc); padding: 7px 12px; color: #16324f; }
.choice b { font-weight: 900; font-size: 16px; } .choice small { grid-column: 2; font-size: 12px; color: #a63b6f; font-weight: 800; }
.choice small:empty { display: none; }
.choice kbd { grid-row: span 2; color: #3FA9F5; }
.choice:hover, .choice.focus { border-color: #3FA9F5; box-shadow: 0 0 0 3px rgba(63, 169, 245, 0.3); }
.choice.go { grid-template-columns: 1fr; text-align: center; background: #16324f; color: #fff; border-color: #16324f; }
body.night #choices { background: #000; color: #fff; border: 1.5px solid #FF2A2A; border-radius: 2px; }
body.night .choice.go { background: #FF2A2A; border-color: #FF2A2A; border-radius: 2px; font-family: "Anton", Impact, sans-serif; letter-spacing: 0.04em; }
body.night .choice.go b { font-weight: 400; font-size: 18px; }

#toast { position: fixed; left: 50%; top: 72%; transform: translate(-50%, -50%) scale(0.9); z-index: 8; pointer-events: none; background: #000; color: #fff; border: 1.5px solid #fff;
  font: 400 18px "Anton", Impact, sans-serif; letter-spacing: 0.04em; padding: 8px 14px; opacity: 0; transition: opacity 0.2s, transform 0.2s; white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis; }
#toast.show { opacity: 1; transform: translate(-50%, -50%); }
#toast.lever { border-color: #FF2A2A; color: #fff; background: #FF2A2A; }
#toast.bad { border-color: #FF2A2A; color: #FF2A2A; }

#hint { position: fixed; left: 0; right: 0; bottom: calc(2px + env(safe-area-inset-bottom)); text-align: center; margin: 0; font-size: 11px; opacity: 0.55; pointer-events: none; z-index: 3; }
#hint span { display: none; }
body[data-input="touch"] #hint .t, body[data-input="mouse"] #hint .m, body[data-input="pad"] #hint .p { display: inline; }
body:has(#postbar:not([hidden])) #hint, body:has(#timer:not([hidden])) #hint, body:has(#choices:not([hidden])) #hint { display: none; }

#board, #pause { position: fixed; inset: 0; z-index: 9; background: rgba(0, 0, 0, 0.8); display: grid; place-items: center; }
#board[hidden], #pause[hidden], #dossier[hidden] { display: none; }
.sheet { background: #000; border: 1.5px solid #fff; padding: 18px 20px; width: min(380px, 92vw); max-height: 88vh; overflow: auto; }
.sheet h2 { margin: 0; font: 400 30px "Anton", Impact, sans-serif; letter-spacing: 0.04em; }
.sheet .sub { margin: 0 0 10px; opacity: 0.7; font-size: 13px; }
#caseList { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
#caseList li { font: 400 18px "Anton", Impact, sans-serif; letter-spacing: 0.04em; border-left: 4px solid #444; padding: 2px 0 2px 10px; color: #777; }
#caseList li.f { color: #fff; border-color: #FF2A2A; }
#caseList small { display: block; font: 700 11px "Nunito", sans-serif; letter-spacing: 0; opacity: 0.7; }
#caseDeadline { font-weight: 800; margin: 12px 0; }
.sheet .close { height: 44px; width: 100%; border: 1.5px solid #fff; background: none; font-weight: 900; }

#dossier { position: fixed; inset: 0; z-index: 10; overflow-y: auto; background: #000; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.file { max-width: 560px; margin: 0 auto; padding: calc(22px + env(safe-area-inset-top)) 18px 40px; }
.file .hdr { letter-spacing: 0.16em; color: #FF2A2A; font-weight: 900; font-size: 11px; }
.file h2 { font: 400 22px "Anton", Impact, sans-serif; letter-spacing: 0.06em; margin: 10px 0 0; opacity: 0.8; }
.file h1 { font: 400 54px/1 "Anton", Impact, sans-serif; letter-spacing: 0.02em; margin: 4px 0; }
#dVerdict { font: 400 22px "Anton", Impact, sans-serif; letter-spacing: 0.08em; margin: 0 0 12px; display: inline-block; padding: 2px 10px; }
#dVerdict.bad { background: #FF2A2A; } #dVerdict.ok { background: #fff; color: #000; }
.file table { width: 100%; border-collapse: collapse; font-size: 14px; }
.file th { text-align: left; font-weight: 700; color: #9aa; padding: 6px 10px 6px 0; vertical-align: top; width: 42%; border-top: 1px solid #222; }
.file td { font-weight: 800; padding: 6px 0; border-top: 1px solid #222; }
.file .actions { margin: 16px 0; display: grid; gap: 6px; }
.file button { min-height: 48px; border: 1.5px solid #fff; background: #000; font-weight: 900; font-size: 16px; padding: 0 16px; }
.file button.primary { background: #fff; color: #000; }
.file .actions small { opacity: 0.7; }
.file h3 { font: 400 20px "Anton", Impact, sans-serif; letter-spacing: 0.08em; margin: 18px 0 8px; }
#cardCanvas { width: 100%; max-width: 230px; display: block; margin: 0 auto; border: 1px solid #333; }
#friendLine { font-size: 13px; opacity: 0.75; text-align: center; }
#cardCanvas[hidden] { display: none; }
.cardBtns { display: flex; gap: 6px; } .cardBtns button { flex: 1; }
.tease { margin: 14px 0 10px; border: 1.5px solid #FF2A2A; padding: 12px 14px; }
.tease small { color: #FF2A2A; font: 400 16px "Anton", Impact, sans-serif; letter-spacing: 0.08em; }
.tease p { margin: 6px 0 10px; } .tease a { color: #9BE7C4; }
#door { width: 100%; border-color: #FF2A2A !important; }
#vote p { font-weight: 900; margin: 10px 0 6px; }
#vote .opts { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
#vote .opts button { white-space: nowrap; min-height: 44px; font-size: 13px; flex: none; }
#vote .thanks { color: #9BE7C4; }
#dMore { display: none; }
/* Phones: the four rows about you, the rest behind "Full file", and tighter type, so the wefav row is one short scroll. */
@media (max-width: 600px) {
  .file { padding-top: calc(14px + env(safe-area-inset-top)); padding-bottom: 24px; }
  .file h2 { font-size: 18px; margin-top: 6px; }
  .file h1 { font-size: 42px; }
  #dVerdict { font-size: 18px; margin-bottom: 8px; }
  .file table { font-size: 13px; }
  .file th, .file td { padding-top: 4px; padding-bottom: 4px; }
  #dRows:not(.all) tr.more { display: none; }
  #dMore:not([hidden]) { display: block; min-height: 36px; width: 100%; margin-top: 6px; font-size: 13px; border-color: #444; }
  .file .actions { margin: 10px 0; }
  .file h3 { margin: 12px 0 6px; font-size: 18px; }
  #friendLine { margin: 4px 0 8px; }
  .tease { margin: 10px 0 6px; padding: 10px 12px; }
  .tease p { margin: 4px 0 8px; font-size: 14px; }
}
[data-wefav-row] { margin-top: 14px; } [data-wefav-row] a { color: #9BE7C4; }

body.wide .nav { height: 52px; }
