/* Jacket Run — all page styling: landing screen, in-game HUD, results card.
   One layout that adapts: wide screens put the title on the left of the scene,
   phones stack title on top and controls at the bottom. */
:root {
  --g: #7dff2e;      /* neon green */
  --v: #8b5cf6;      /* violet */
  --hot: #ff3d7f;    /* danger pink */
  --ink: #07080c;    /* graphite black */
  --disp: "Avenir Next Condensed", "HelveticaNeue-CondensedBlack", "Roboto Condensed", "Arial Narrow", Impact, sans-serif;
  /* phone notch / home-bar space; --psat/--psab let the preview page imitate them */
  --sat: max(env(safe-area-inset-top, 0px), var(--psat, 0px));
  --sab: max(env(safe-area-inset-bottom, 0px), var(--psab, 0px));
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--ink); overflow: hidden; overscroll-behavior: none; }
body {
  font-family: var(--disp); color: #fff;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%;
}
button { font: inherit; color: inherit; border: 0; cursor: pointer; }
[hidden] { display: none !important; }

#app { position: fixed; inset: 0; overflow: hidden; touch-action: none; }
#game, #fx { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#fx { pointer-events: none; }
.vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(3, 2, 10, .6) 100%);
}

/* ---------- buttons ---------- */
.btn-go {
  display: block; width: 100%; padding: 15px 20px;
  font-size: clamp(22px, 6vw, 30px); font-style: italic; font-weight: 900; letter-spacing: .04em;
  color: var(--ink); background: linear-gradient(180deg, #b6ff7a, var(--g));
  border-radius: 14px; transform: skewX(-6deg);
  box-shadow: 0 0 0 2px #d8ffb8 inset, 0 0 28px rgba(125, 255, 46, .55), 0 8px 0 #2f7d06;
  animation: pulse 1.6s ease-in-out infinite;
}
.btn-go:active { transform: skewX(-6deg) translateY(5px); box-shadow: 0 0 0 2px #d8ffb8 inset, 0 0 18px rgba(125, 255, 46, .5), 0 3px 0 #2f7d06; }
.btn-alt {
  padding: 12px 10px; font-size: 17px; font-weight: 900; font-style: italic; letter-spacing: .06em;
  background: rgba(139, 92, 246, .22); border: 2px solid var(--v); border-radius: 12px;
}
.btn-alt:active { background: rgba(139, 92, 246, .5); }
@keyframes pulse { 50% { box-shadow: 0 0 0 2px #d8ffb8 inset, 0 0 46px rgba(125, 255, 46, .9), 0 8px 0 #2f7d06; } }

#mute {
  position: absolute; left: 12px; bottom: calc(var(--sab) + 12px); z-index: 5;
  width: 38px; height: 38px; border-radius: 50%; font-size: 18px; line-height: 1;
  background: rgba(7, 8, 12, .7); border: 1.5px solid rgba(255, 255, 255, .35);
}
#mute.off { color: #666; text-decoration: line-through; }
#app[data-mode=card] #mute { display: none; }

/* ---------- screens ---------- */
.screen {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  padding: calc(var(--sat) + 16px) 20px calc(var(--sab) + 14px);
}

/* ---------- landing ---------- */
#landing { justify-content: space-between; align-items: center; text-align: center; transition: opacity .35s, transform .35s; }
#app:not([data-mode=attract]) #landing { opacity: 0; pointer-events: none; transform: scale(1.05); }
h1 {
  font-size: clamp(58px, 18vw, 98px); font-style: italic; font-weight: 900;
  line-height: .82; letter-spacing: -.02em; transform: skewX(-5deg);
}
h1 span { display: block; }
h1 .j {
  background: linear-gradient(180deg, #fff 20%, #c3c9d8 55%, #6d7488 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 #1a1140) drop-shadow(0 0 22px rgba(139, 92, 246, .6));
}
h1 .r { color: var(--g); text-shadow: 0 4px 0 #1f5c00, 0 0 34px rgba(125, 255, 46, .75); }
.op {
  display: inline-block; margin-top: 10px; padding: 4px 12px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: clamp(15px, 4.6vw, 22px); font-weight: 800; letter-spacing: .12em;
  color: var(--ink); background: var(--hot); transform: skewX(-8deg);
}
.tag { margin-top: 10px; font-size: clamp(15px, 4.2vw, 21px); font-weight: 700; letter-spacing: .04em; text-shadow: 0 2px 10px #000, 0 0 2px #000; }
.tag em { color: var(--g); font-style: italic; }
.panel {
  width: 100%; max-width: 430px; margin-top: auto; padding: 14px 16px 12px;
  background: rgba(9, 9, 16, .74); border: 1.5px solid rgba(139, 92, 246, .55); border-radius: 22px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .6);
}
.dare { margin-bottom: 14px; font-size: clamp(17px, 4.8vw, 22px); font-style: italic; font-weight: 900; line-height: 1.1; letter-spacing: .02em; }
.dare b { color: var(--g); }
.meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; font-size: 13px; font-weight: 700; letter-spacing: .1em; color: #c4b5fd; }
.meta .best b { color: #fff; font-size: 17px; margin-left: 4px; }
.keys.touch { display: none; }
@media (pointer: coarse) { .keys.desk { display: none; } .keys.touch { display: inline; } }
.fine { margin-top: 8px; padding: 0 44px; font-family: system-ui, -apple-system, sans-serif; font-size: 11px; color: rgba(255, 255, 255, .55); }
#loading { position: absolute; left: 0; right: 0; top: 46%; font-family: system-ui, sans-serif; font-size: 14px; color: #c4b5fd; text-align: center; }
#loading small { color: rgba(255, 255, 255, .5); }
#app.ready #loading { display: none; }

/* wide screens: title + controls sit left, the CEO is framed on the right */
@media (min-width: 900px) and (min-aspect-ratio: 6/5) {
  #landing { width: 50%; justify-content: center; align-items: flex-start; gap: 26px; text-align: left; padding-left: 6.5vw; }
  h1 { font-size: clamp(96px, 11.5vw, 190px); transform-origin: left center; }
  .fine { padding: 0; margin: 0; }
  .panel { margin-top: 0; }
  #loading { left: 50%; }
}
/* very short screens (phone on its side): tighten the landing page */
@media (max-height: 560px) {
  h1 { font-size: 50px; } h1 span { display: inline; margin-right: 12px; }
  .tag, .fine { display: none; }
}

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s; }
#app[data-mode=play] #hud, #app[data-mode=over] #hud { opacity: 1; }
.hud-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 10px; padding: calc(var(--sat) + 8px) 14px 0; }
.hud-box { display: flex; flex-direction: column; text-shadow: 0 2px 6px #000; }
.hud-box.right { align-items: flex-end; }
.hud-box.mid { align-items: center; padding-top: 4px; }
.lbl { font-size: 10px; font-weight: 700; letter-spacing: .18em; color: #c4b5fd; }
.lbl b { color: #fff; font-size: 14px; letter-spacing: .02em; }
#score { font-size: clamp(26px, 7.4vw, 40px); font-style: italic; font-weight: 900; line-height: 1; color: var(--g); text-shadow: 0 0 18px rgba(125, 255, 46, .6), 0 2px 0 #000; }
.bar { position: relative; width: clamp(110px, 32vw, 280px); height: 8px; margin-bottom: 5px; background: rgba(255, 255, 255, .18); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--v), var(--g)); }
/* tick marks where each sequence begins (12s, 25s, 37s of 45s) */
.bar u { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(7, 8, 12, .85); }
.bar u:nth-of-type(1) { left: 26.7%; } .bar u:nth-of-type(2) { left: 55.6%; } .bar u:nth-of-type(3) { left: 82.2%; }
#lives { display: flex; gap: 5px; margin-top: 4px; }
/* each life is a little green GPU chip; a leaked one goes dark and pink */
#lives i { width: 19px; height: 19px; border-radius: 4px; border: 2px solid var(--hot); background: rgba(255, 61, 127, .18); }
#lives i.on { border-color: #d8ffb8; background: var(--g); box-shadow: 0 0 12px rgba(125, 255, 46, .8); }

#camRow { display: flex; align-items: flex-start; gap: 8px; margin: 8px 14px 0; }
#camBox { position: relative; flex: none; width: clamp(74px, 20vw, 112px); border: 2.5px solid #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 4px 18px rgba(0, 0, 0, .55); }
#camBox.alert { border-color: var(--hot); box-shadow: 0 0 20px rgba(255, 61, 127, .7); }
#cam { width: 100%; aspect-ratio: 1; }
#camBox span { position: absolute; left: 0; right: 0; bottom: 0; padding: 1px 0; font-size: 9px; font-weight: 800; letter-spacing: .14em; text-align: center; background: rgba(7, 8, 12, .7); }
#camBox span::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: #ff3b3b; }
/* PR team's messages look like a chat bubble next to his face */
#pr { max-width: min(72%, 420px); margin-top: 6px; padding: 7px 12px 8px; opacity: 0; transform-origin: left top; background: #fff; color: #14151c; border-radius: 4px 16px 16px 16px; box-shadow: 0 6px 20px rgba(0, 0, 0, .5); }
#pr b { display: block; font-size: 10px; letter-spacing: .16em; color: var(--hot); }
#pr span { font-size: clamp(15px, 4.3vw, 21px); font-style: italic; font-weight: 900; line-height: 1.08; }
#powers { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 14px 0; }
#powers span {
  display: none; position: relative; padding: 4px 10px 7px; overflow: hidden;
  font-size: 12px; font-weight: 900; font-style: italic; letter-spacing: .1em;
  color: var(--ink); background: var(--g); border-radius: 8px;
}
#powers span.on { display: block; }
#powers span::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: calc(var(--f, 1) * 100%); background: var(--ink); }
#pwTurbo { background: #ffd166 !important; }
#banner { position: absolute; left: 0; right: 0; top: 27%; text-align: center; opacity: 0; }
#banner span { display: block; font-size: clamp(13px, 3.6vw, 20px); font-weight: 900; letter-spacing: .4em; color: #c4b5fd; text-shadow: 0 2px 8px #000; }
#banner b { display: block; padding: 0 12px; font-size: clamp(30px, 8.6vw, 76px); font-style: italic; line-height: .95; text-shadow: 0 4px 0 #3b1a8a, 0 0 30px rgba(139, 92, 246, .9); }
#toast {
  position: absolute; left: 50%; bottom: calc(var(--sab) + 18px); width: max-content; max-width: 86%; margin-left: 0; translate: -50% 0;
  padding: 7px 14px; text-align: center; opacity: 0; font-size: clamp(14px, 3.8vw, 18px); font-style: italic; font-weight: 900;
  color: var(--ink); background: var(--g); border-radius: 10px;
}
/* speech bubbles are positioned every frame by director.js */
.bub {
  position: absolute; left: 0; top: 0; width: max-content; max-width: min(64vw, 330px); padding: 8px 13px 9px; opacity: 0;
  font-size: clamp(15px, 4.2vw, 21px); font-style: italic; font-weight: 900; line-height: 1.08; text-align: center;
  color: #14151c; background: #fff; border-radius: 16px; box-shadow: 0 6px 22px rgba(0, 0, 0, .55); will-change: transform;
}
.bub::after { content: ""; position: absolute; left: 50%; bottom: -9px; margin-left: -9px; border: 9px solid transparent; border-top-color: #fff; border-bottom: 0; }
.bub.npc { background: #ffe1ee; color: #7a0c45; } .bub.npc::after { border-top-color: #ffe1ee; }
.bub.ceo { background: var(--g); } .bub.ceo::after { border-top-color: var(--g); }

/* ---------- escape report ---------- */
#over { align-items: center; justify-content: center; gap: 12px; overflow-y: auto; background: rgba(4, 3, 10, .7); animation: fadein .3s ease both; }
@keyframes fadein { from { opacity: 0; } }
#newbest { padding: 3px 14px; font-size: 15px; font-weight: 900; font-style: italic; letter-spacing: .2em; color: var(--ink); background: var(--g); transform: skewX(-8deg); }
#card {
  width: 100%; max-width: 430px; padding: 12px 16px 12px; flex: none;
  background: linear-gradient(180deg, #1a0d3d, #0b0b14 55%, #07080c);
  border: 2px solid var(--g); border-radius: 18px;
  box-shadow: 0 0 40px rgba(125, 255, 46, .28), 0 24px 60px rgba(0, 0, 0, .7);
  animation: cardin .45s cubic-bezier(.2, 1.3, .3, 1) both;
}
@keyframes cardin { from { transform: translateY(40px) rotate(-2deg) scale(.94); opacity: 0; } }
.mast { display: flex; justify-content: space-between; align-items: center; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; font-weight: 800; letter-spacing: .1em; color: #c4b5fd; }
.mast i { padding: 1px 6px; font-style: normal; color: var(--hot); border: 1.5px solid var(--hot); }
.photo { position: relative; margin-top: 9px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 8px; overflow: hidden; }
.photo canvas { display: block; width: 100%; height: auto; }
#stamp { position: absolute; right: 10px; bottom: 10px; padding: 1px 10px; font-size: clamp(20px, 6vw, 28px); font-style: italic; font-weight: 900; letter-spacing: .06em; color: var(--hot); border: 3px solid var(--hot); background: rgba(7, 8, 12, .78); transform: rotate(-7deg); }
#stamp.good { color: var(--g); border-color: var(--g); }
#headline { margin-top: 11px; font-size: clamp(22px, 6.2vw, 29px); font-style: italic; font-weight: 900; line-height: 1.02; }
.rows { margin-top: 9px; }
.rows div { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 0; border-top: 1px solid rgba(255, 255, 255, .15); }
.rows dt { font-size: 15px; font-weight: 800; letter-spacing: .1em; color: #c9cde0; }
.rows dd { font-size: 25px; font-style: italic; font-weight: 900; color: var(--g); }
.rows .leak dd { color: var(--hot); }
#verdict { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, .15); font-size: clamp(16px, 4.5vw, 19px); font-style: italic; font-weight: 900; color: var(--g); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; margin-top: 9px; font-size: 11px; font-weight: 700; letter-spacing: .08em; color: #c9cde0; }
.foot span, .foot i { white-space: nowrap; }
.foot b { color: #fff; font-size: 14px; }
.foot i { color: #c4b5fd; font-weight: 900; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 10px; width: 100%; max-width: 430px; flex: none; padding-bottom: 8px; }
.actions .btn-go { grid-column: 1 / 3; padding: 12px; }
.actions .btn-alt { font-size: 14px; letter-spacing: .02em; white-space: nowrap; }
#combo { margin-top: 6px; font-size: clamp(14px, 3.9vw, 19px); font-style: italic; font-weight: 900; letter-spacing: .04em; color: #fff; text-shadow: 0 0 12px rgba(125, 255, 46, .9), 0 2px 0 #000; }
/* on the landing page the sound button moves up, clear of the disclaimer */
#app[data-mode=attract] #mute { left: auto; bottom: auto; right: 12px; top: calc(var(--sat) + 12px); }
/* ---------- level select + next-level flow ---------- */
#levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.lv { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 7px; text-align: center; background: rgba(139, 92, 246, .16); border: 2px solid rgba(139, 92, 246, .6); border-radius: 12px; }
.lv i { font-style: italic; font-weight: 900; font-size: 22px; line-height: 1; color: #c4b5fd; }
.lv b { font-size: 13px; font-style: italic; font-weight: 900; letter-spacing: .03em; line-height: 1.05; }
.lv span { font-size: 10px; font-weight: 700; letter-spacing: .1em; color: #c4b5fd; }
.lv.on { background: rgba(125, 255, 46, .16); border-color: var(--g); box-shadow: 0 0 16px rgba(125, 255, 46, .45); }
.lv.on i { color: var(--g); }
.lv:disabled { opacity: .45; cursor: default; border-style: dashed; }
#lvName { font-style: normal; }
/* CHALLENGE A FRIEND is the second-loudest button on the report, in the game's pink */
.btn-share {
  grid-column: 1 / 3; padding: 11px 12px; font-size: clamp(18px, 5vw, 23px); font-style: italic; font-weight: 900; letter-spacing: .04em;
  color: #fff; background: linear-gradient(180deg, #ff6aa0, var(--hot)); border-radius: 13px; transform: skewX(-6deg);
  box-shadow: 0 0 0 2px #ffc2d8 inset, 0 0 22px rgba(255, 61, 127, .5), 0 6px 0 #9c1147;
}
.btn-share:active { transform: skewX(-6deg) translateY(4px); box-shadow: 0 0 0 2px #ffc2d8 inset, 0 2px 0 #9c1147; }
/* after a win with another level waiting: NEXT LEVEL, CHALLENGE, then PLAY AGAIN + LEVELS, then SAVE */
.actions.hasnext #share { order: 1; } .actions.hasnext #again { order: 2; } .actions.hasnext #home { order: 3; }
.actions.hasnext #save { order: 4; grid-column: 1 / 3; }
.actions { gap: 12px 10px; }
.actions .btn-alt { padding: 10px 8px; }
.mast span, .mast i { white-space: nowrap; font-size: 11px; }
