/* Fonts ship with the game (site/fonts). Jersey 10 for headings, buttons and labels; VT323 for story text. */
@font-face { font-family: "Jersey 10"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/jersey-10.woff2") format("woff2"); }
@font-face { font-family: "VT323"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/vt323.woff2") format("woff2"); }
:root {
  --night: #160b2b;
  --panel: #2a1650;
  --panel2: #3a2168;
  --ink: #f7ebd5;
  --pink: #ff3d9a;
  --cyan: #4de8e0;
  --gold: #ffd84d;
  --blood: #e0263c;
  --bone: #f3e6c8;
  --display: "Jersey 10", "Courier New", monospace;
  --body: "VT323", "Courier New", monospace;
}
* { box-sizing: border-box; }
:root { --hdr: 75px; --stage: clamp(120px, 22vh, 220px); }
html, body { margin: 0; height: 100%; }
html { touch-action: manipulation; overscroll-behavior-y: contain; scroll-padding-top: calc(var(--hdr) + var(--stage) + 8px); }
body { overscroll-behavior-y: contain; }
body {
  background: var(--night);
  background-image: radial-gradient(circle at 50% -10%, #3a1a66 0, var(--night) 60%);
  color: var(--ink);
  font-family: var(--body);
  font-synthesis: none;   /* pixel fonts have one weight; faked bold smears them */
  font-size: 23px;
  line-height: 1.15;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, #dlg:focus-visible, input:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

#app {
  max-width: 560px; min-height: 100%; margin: 0 auto;
  display: flex; flex-direction: column;
  border-left: 4px solid var(--panel); border-right: 4px solid var(--panel);
  position: relative;
}

/* ---- Menu bar, in the manner of an old adventure game ---- */
#bar {
  display: flex; align-items: center; gap: 2px;
  background: var(--bone); color: #1b0f2e;
  font-family: var(--display); font-size: 19px;
  padding: 3px 4px;
}
#top { position: sticky; top: 0; z-index: 5; }
#bar button { background: none; border: 0; padding: 7px 9px; color: #1b0f2e; font-family: var(--display); font-size: 19px; }
#bar button:active, #bar button:hover { background: #1b0f2e; color: var(--bone); }
#who { margin-left: auto; font-family: var(--body); font-size: 19px; opacity: .85; padding-right: 4px; white-space: nowrap; }
#stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; background: #0d0619; padding: 5px 8px 6px; border-bottom: 3px solid var(--panel); font-family: var(--display); font-size: 17px; }
#stats div { display: flex; flex-direction: column; gap: 2px; }
#stats span { display: flex; justify-content: flex-start; align-items: baseline; gap: 6px; }
#stats i { display: block; height: 8px; background: #2a1650; }
#stats i b { display: block; height: 100%; transition: width .35s steps(8); }
#stats .rizz i b { background: var(--pink); } #stats .looks i b { background: var(--gold); } #stats .smarts i b { background: var(--cyan); } #stats .wallet i b { background: #8fd14f; }
#stats .tim i b { background: #8fd14f; } #stats .tim em { color: #8fd14f; }
#stats em { font-style: normal; opacity: .8; } #stats span b { font-family: var(--body); font-size: 21px; line-height: .8; font-weight: 400; }
#stats .up { animation: flashup .7s steps(3); } #stats .down { animation: flashdown .7s steps(3); }
@keyframes flashup { 50% { color: #8fd14f; } } @keyframes flashdown { 50% { color: var(--blood); } }

#screen { flex: 1; display: flex; flex-direction: column; }
.scr { flex: 1; display: flex; flex-direction: column; padding: 14px; gap: 12px; }

.big {
  background: var(--pink); color: #1b0f2e; border: 0;
  font-family: var(--display); font-weight: 400; font-size: 26px;
  padding: 14px 18px; box-shadow: 4px 4px 0 #000;
}
.big:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 #000; }

/* ---- Boot ---- */
#boot { gap: 10px; }
#logo { font-family: var(--display); font-weight: 400; font-size: 49px; line-height: .95; margin: 8px 0 2px; color: var(--pink); text-shadow: 4px 4px 0 #000; }
#intro p { margin: 0 0 6px; font-size: 25px; }
#intro p:first-child { color: var(--gold); }
#title { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
#title .tpic { position: relative; flex: none; width: 92px; height: 92px; }
#title .tpic canvas, #title .tpic img { width: 92px; height: 92px; image-rendering: pixelated; object-fit: contain; }
#title .tpic img { position: absolute; inset: 0; display: none; }
#title .tpic.hasimg img { display: block; } #title .tpic.hasimg canvas { visibility: hidden; }
/* the loading log scrolls inside a fixed box like a terminal, so it can never push the start button off screen */
#bootlog { font-size: 21px; color: var(--cyan); height: 6.6em; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end;  -webkit-mask-image: linear-gradient(transparent 0, #000 1.6em); mask-image: linear-gradient(transparent 0, #000 1.6em); }
#bootlog div { flex: none; }
#bootlog div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dotted rgba(77, 232, 224, .3); }
#bootlog div b { font-weight: 400; color: var(--ink); text-align: right; }
#suitor { margin: 0; font-family: var(--display); font-size: 24px; color: var(--gold); }
#bootbtns { position: sticky; bottom: 0; margin: 0 -14px -14px; padding: 10px 14px 14px; background: var(--night); display: flex; gap: 10px; flex-wrap: wrap; z-index: 3; }
#bootbtns button { flex: 1 1 auto; }
#bootgo { animation: blink 1s steps(2) infinite; }
#bootbtns .alt { background: none; color: var(--ink); border: 3px solid var(--ink); box-shadow: none; animation: none; font-family: var(--display); font-size: 23px; padding: 11px 14px; }
#bootcont { animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* ---- Strandr: sign-up, deck, match ---- */
.appname { font-family: var(--display); font-weight: 400; font-size: 41px; color: var(--pink); margin: 4px 0 0; text-shadow: 3px 3px 0 #000; line-height: 1; }
.appsub { margin: 0; color: var(--cyan); }
#sbar { height: 8px; background: var(--panel); margin-top: 6px; }
#sbar b { display: block; height: 100%; background: var(--pink); transition: width .3s steps(5); }
#sstep { margin: 0; font-family: var(--display); font-size: 18px; color: var(--cyan); }
#sq { font-family: var(--display); font-size: 39px; line-height: 1.05; margin: 0; color: var(--gold); }
#ssub { margin: 0 0 4px; }
#sopts { display: flex; flex-direction: column; gap: 8px; }
.opt { text-align: left; background: #000; border: 3px solid var(--bone); padding: 10px 12px; }
.opt:hover, .opt:active { background: var(--panel2); border-color: var(--pink); }
.opt b { display: block; font-family: var(--display); font-size: 26px; color: var(--ink); }
.opt small { display: block; font-size: 20px; color: #c9b8e8; }
.opt .odds { display: inline-block; font-family: var(--display); font-size: 17px; color: #1b0f2e; background: var(--gold); padding: 1px 6px; margin-top: 5px; }
.inrow { display: flex; gap: 8px; }
.inrow input { flex: 1; min-width: 0; font: inherit; font-size: 24px; background: #000; color: var(--ink); border: 3px solid var(--bone); padding: 10px; }
.inrow button { padding: 10px 14px; font-size: 18px; box-shadow: 3px 3px 0 #000; }

#deckhelp { margin: 0; color: var(--cyan); }
#cards { position: relative; min-height: 300px; }
.pcard { position: absolute; inset: 0 0 auto 0; background: var(--bone); color: #1b0f2e; padding: 0 0 12px; box-shadow: 6px 6px 0 var(--pink); touch-action: pan-y; user-select: none; cursor: grab; transition: transform .25s ease-out; }
.pcard.back { transform: rotate(-3deg) translateY(8px); opacity: .55; box-shadow: none; height: calc(100% - 20px); cursor: default; }
.pcard .photo { position: relative; height: min(270px, 34vh); overflow: hidden; display: flex; justify-content: center; align-items: flex-end; }
.pcard .photo canvas, .pcard .photo img { height: min(260px, 33vh); width: min(260px, 33vh); image-rendering: pixelated; object-fit: contain; pointer-events: none; }
.pcard .photo img { position: absolute; bottom: 0; display: none; }
.pcard .photo.hasimg img { display: block; } .pcard .photo.hasimg canvas { visibility: hidden; }
.pcard .dots { position: absolute; top: 6px; left: 8px; right: 8px; display: flex; gap: 4px; }
.pcard .dots i { flex: 1; height: 4px; background: rgba(255,255,255,.4); }
.pcard .dots i.on { background: #fff; }
.pcard .taphint { position: absolute; top: 16px; right: 8px; font-family: var(--display); font-size: 17px; background: rgba(0,0,0,.55); color: #fff; padding: 2px 6px; }
.stamp { position: absolute; top: 34px; font-family: var(--display); font-weight: 400; font-size: 41px; padding: 2px 10px; border: 4px solid; opacity: 0; pointer-events: none; }
.stamp.yes { left: 14px; color: #8fd14f; border-color: #8fd14f; transform: rotate(-14deg); }
.stamp.no { right: 14px; color: var(--blood); border-color: var(--blood); transform: rotate(14deg); }
.pcard h2 { font-family: var(--display); font-size: 39px; margin: 8px 12px 0; line-height: 1; }
.pcard h2 small { font-family: var(--body); font-size: 22px; font-weight: 400; opacity: .8; }
.pcard .meta { margin: 2px 12px 6px; opacity: .7; }
.pcard .bio { margin: 0 12px 8px; font-size: 23px; }
.pcard .tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 12px; }
.pcard .tags span { font-family: var(--display); font-size: 17px; background: #1b0f2e; color: var(--cyan); padding: 2px 8px; }
.swipe { display: flex; gap: 12px; }
.swipe button { flex: 1; }
.swipe button:not(.big) { background: none; border: 3px solid var(--ink); font-family: var(--display); font-size: 23px; padding: 12px; }

#match { text-align: left; }
#matchh { font-family: var(--display); font-size: 54px; color: var(--pink); margin: 6px 0 0; text-shadow: 4px 4px 0 #000; text-align: center; }
.bubble { align-self: flex-start; background: var(--pink); color: #1b0f2e; padding: 8px 12px; margin: 0; font-size: 25px; }
.bubble b { font-family: var(--display); font-size: 18px; display: block; }
#matchnote { margin: 0; color: var(--gold); }
#match h3 { font-family: var(--display); font-size: 28px; margin: 6px 0 0; color: var(--cyan); }
#howlist { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
#howlist li.gc { color: var(--gold); }
#begin { margin-top: 6px; }

.cardpic { position: relative; height: 200px; overflow: hidden; display: flex; justify-content: center; align-items: flex-end; }
.cardpic canvas, .cardpic img { height: 190px; width: 190px; image-rendering: pixelated; object-fit: contain; }
.cardpic img { position: absolute; bottom: 0; display: none; }
.cardpic.hasimg img { display: block; } .cardpic.hasimg canvas { visibility: hidden; }

/* ---- Act card ---- */
#actcard { justify-content: center; align-items: center; text-align: center; }
#actn { font-family: var(--display); color: var(--cyan); margin: 0; font-size: 28px; }
#actleg { margin: 0 0 20px; max-width: 22em; color: var(--ink); }
#actleg::before { content: "Em fact: "; color: var(--pink); }
#actt { font-family: var(--display); font-size: 49px; line-height: 1.05; margin: 0 0 14px; color: var(--gold); text-shadow: 4px 4px 0 var(--pink); }

/* ---- Play ---- */
#play { padding: 0; gap: 0; }
/* the art stays pinned under the header, so it's still on screen when the choices appear */
#stage {
  position: sticky; top: var(--hdr); z-index: 4; height: var(--stage); min-height: 0; max-height: none; cursor: pointer; user-select: none;
  display: flex; justify-content: center; align-items: flex-end; overflow: hidden;
  border-bottom: 4px solid var(--bone);
  background-size: cover; background-position: center; image-rendering: pixelated;
}
#bgc, #bgi { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
#bgi { display: none; } #stage.hasbg #bgi { display: block; }
#pc, #pi { position: relative; height: 96%; aspect-ratio: 1; image-rendering: pixelated; object-fit: contain; }
#pi { position: absolute; bottom: 0; display: none; }
#stage.hasimg #pi { display: block; } #stage.hasimg #pc { visibility: hidden; }
#stage.dim #pc, #stage.dim #pi { filter: brightness(.5) saturate(.6); }
#stage.nobody #pc, #stage.nobody #pi { visibility: hidden; }
#timer { position: absolute; left: 0; right: 0; bottom: 0; height: 10px; background: #000; z-index: 3; }
/* which strand is talking: gold bar on the left, red bar on the right */
#stage::after { content: ""; position: absolute; top: 0; bottom: 0; width: 8px; z-index: 2; display: none; }
#stage[data-who="L"]::after { display: block; left: 0; background: var(--gold); box-shadow: 0 0 12px var(--gold); }
#stage[data-who="R"]::after { display: block; right: 0; background: var(--blood); box-shadow: 0 0 12px var(--blood); }
#timer b { display: block; height: 100%; width: 100%; background: var(--blood); }

.bg-castle { background-image: repeating-linear-gradient(90deg, rgba(0,0,0,.18) 0 4px, transparent 4px 46px), linear-gradient(#5b2a86 0 72%, #ff3d9a 72% 74%, #3a1a5c 74%); }

#log { padding: 10px 12px 4px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; user-select: none; -webkit-user-select: none; }
#log .ln { margin: 0; font-size: 24px; }
#log .ln-n { color: var(--gold); }
#log .ln .who { display: inline-block; font-family: var(--display); font-size: 18px; font-weight: 400; color: #1b0f2e; background: var(--pink); padding: 1px 7px; margin-right: 6px; vertical-align: 2px; }
#log .ln-tim .who { background: #8fd14f; } #log .ln-sys .who { background: var(--cyan); } #log .ln-R .who { background: var(--blood); color: #fff; } #log .ln-L .who { background: var(--gold); }
#log .ln-f1 .who, #log .ln-f2 .who, #log .ln-f3 .who { background: #c9b8e8; } #log .ln-bar .who, #log .ln-srv .who { background: var(--bone); }
#log .ln-sys { color: var(--cyan); }
#prompt { margin: 6px 12px 6px; font-family: var(--display); font-size: 19px; color: var(--cyan); }

#choices { display: flex; flex-direction: column; gap: 8px; padding: 0 10px 18px; }
#choices button.ch {
  user-select: none; -webkit-user-select: none; text-align: left; background: #000; border: 3px solid var(--bone); padding: 11px 12px; min-height: 50px; font-size: 23px; position: relative;
}
#choices button.ch::before { content: "> "; color: var(--pink); }
#choices button.ch:hover, #choices button.ch:active { background: var(--panel2); border-color: var(--pink); }
#choices small { display: block; color: var(--cyan); font-size: 19px; }
#choices .timsays { position: absolute; right: -3px; top: -11px; background: #8fd14f; color: #10210a; font-family: var(--display); font-size: 17px; font-weight: 400; padding: 1px 6px; transform: rotate(3deg); }
#choices input { flex: 1; min-width: 0; font: inherit; font-size: 24px; background: #000; color: var(--ink); border: 3px solid var(--bone); padding: 10px; }
#choices .inrow button { padding: 10px 14px; font-size: 18px; box-shadow: 3px 3px 0 #000; }

/* ---- Win ---- */
#winscreen h2 { font-family: var(--display); font-size: 41px; color: var(--gold); margin: 0; text-shadow: 3px 3px 0 var(--pink); line-height: 1.05; }
#winlines p { margin: 0 0 6px; }
#cert { background: var(--bone); color: #1b0f2e; padding: 12px; border: 4px double #1b0f2e; text-align: center; }
#cert b { font-family: var(--display); display: block; font-size: 28px; }
#prize { font-family: var(--body); font-size: 46px; color: var(--cyan); margin: 0; text-align: center; letter-spacing: 2px; }
#fine { font-size: 19px; opacity: .85; margin: 0; text-align: center; }
#winscreen .cardpic { height: 200px; }
#winscreen .cardpic canvas { width: 176px; height: 176px; image-rendering: pixelated; border: 4px solid var(--gold); box-shadow: 4px 4px 0 var(--pink); background: #000; }
#share { align-self: stretch; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
#confetti i { position: absolute; top: -12px; width: 8px; height: 8px; animation: fall linear forwards; }
#confetti i:nth-child(3n) { width: 6px; height: 10px; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }

/* ---- Modal: deaths, Tim, stuff, morgue ---- */
#modal { position: fixed; inset: 0; background: rgba(8, 3, 16, .82); z-index: 20; display: flex; align-items: center; justify-content: center; padding: 14px; }
#mbox { width: 100%; max-width: 500px; max-height: 92vh; overflow: auto; background: var(--bone); color: #1b0f2e; padding: 16px; border: 4px solid #1b0f2e; box-shadow: 0 0 0 4px var(--bone), 8px 8px 0 4px #000; }
#mbox.death { box-shadow: 0 0 0 4px var(--blood), 8px 8px 0 4px #000; animation: shake .35s steps(4); }
@keyframes shake { 25% { transform: translate(-6px, 3px); } 50% { transform: translate(5px, -4px); } 75% { transform: translate(-3px, 2px); } }
#mkick { font-family: var(--display); font-size: 19px; margin: 0; color: var(--blood); }
#mtitle { font-family: var(--display); font-size: 34px; line-height: 1.05; margin: 2px 0 10px; }
#mbody { font-size: 23px; }
#mbody p { margin: 0 0 10px; }
#mbody ul { list-style: none; padding: 0; margin: 0; }
#mbody li { border-top: 2px dashed rgba(27, 15, 46, .35); padding: 7px 0; }
#mbody li.locked { opacity: .4; }
#mbody li b { font-family: var(--display); font-size: 22px; display: block; }
#mbody li button { background: #1b0f2e; color: var(--bone); border: 0; font-family: var(--display); font-size: 17px; padding: 4px 8px; margin-top: 4px; }
/* death card tombstone */
.unmatch { float: right; margin: 2px 0 8px 12px; padding: 5px 8px 4px; text-align: center; color: var(--blood); border: 3px solid var(--blood); transform: rotate(6deg); font-family: var(--display); line-height: 1; max-width: 46%; }
.unmatch b { display: block; font-size: 22px; font-weight: 400; letter-spacing: 1px; }
.unmatch span { display: block; font-size: 20px; color: #1b0f2e; margin-top: 2px; word-break: break-word; }
.unmatch i { display: block; font-style: normal; font-size: 17px; margin-top: 1px; }
/* what you picked before */
.was { display: table; margin-top: 6px; padding: 1px 8px 2px; background: #1b0f2e; font-family: var(--display); font-size: 18px; line-height: 1.1; text-align: left; }
.was.bad { color: #ff96a4; border-left: 5px solid var(--blood); }
.was.ok { color: #a9ec74; border-left: 5px solid #8fd14f; }
.swipe .was { margin-left: auto; margin-right: auto; }
#mbody canvas { width: 96px; height: 96px; image-rendering: pixelated; float: left; margin: 0 10px 4px 0; background: #8fd14f; }
#mbtns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; clear: both; }
#mbtns button { flex: 1; background: #1b0f2e; color: var(--bone); border: 0; font-family: var(--display); font-size: 22px; padding: 12px 10px; box-shadow: 3px 3px 0 var(--pink); }
#mbtns button.alt { background: none; color: #1b0f2e; border: 3px solid #1b0f2e; box-shadow: none; }

#toast { position: fixed; left: 50%; top: calc(var(--hdr) + 6px); transform: translateX(-50%); background: var(--gold); color: #1b0f2e; font-family: var(--display); font-size: 19px; padding: 5px 12px; z-index: 8; white-space: nowrap; box-shadow: 3px 3px 0 #000; }

@media (max-width: 360px) { #logo { font-size: 33px; } #intro p { font-size: 21px; } #title .tpic, #title .tpic canvas, #title .tpic img { width: 72px; height: 72px; } }
@media (min-width: 600px) { body { font-size: 25px; } #app { margin-top: 18px; min-height: calc(100% - 36px); border: 4px solid var(--panel); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---- Random event cards ---- */
#mbox.event { box-shadow: 0 0 0 4px var(--cyan), 8px 8px 0 4px #000; }
#mbox.event #mkick { color: #1b6f6a; }
#mbox.event #mbtns { flex-direction: column; }
#mbox.event #mbtns button { text-align: left; }
.delta { font-family: var(--display); font-size: 19px; display: inline-block; padding: 2px 8px; margin: 0 6px 6px 0; background: #1b0f2e; color: #8fd14f; }
.delta.neg { color: #ff7b8a; }
#choices button.ch .odds { display: inline-block; font-family: var(--display); font-size: 17px; color: #1b0f2e; background: var(--gold); padding: 1px 6px; margin-left: 8px; vertical-align: middle; }
#mbody p.buildtag { opacity: .55; font-size: 15px; margin: 0; }
