/* Palette from the game's rewards/decorate menu (rewards.js): browns, creams, piss yellow. */
:root {
  --room: #1e1510; --dark: #2b1d16; --brown: #3b2c24; --brownL: #4b392e; --brownLL: #5a4638;
  --cream: #f4ecd8; --panel: #f0f0e0; --ink: #35231a; --soft: #6b5a4e; --muted: #8b7a6c;
  --creamText: #f0e6d0; --creamSoft: #cdbda3;
  --piss: #d6c230; --pissL: #ece07a; --pissD: #a8961e; --pissText: #857412;
  --red: #ff3333; --good: #5d7a3a; --bad: #a33a2a;
  --pixel: "Pixelify Sans", ui-monospace, "Courier New", monospace;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, sans-serif;
  /* the one-screen budget: header + phone + chip + belt must fit in 100svh */
  --topH: 56px;
  --beltH: clamp(72px, 14svh, 150px);
  --phoneW: min(50vw, 860px, calc((100svh - var(--topH) - var(--beltH) - 110px) * 19.5 / 9));
}
* { box-sizing: border-box; margin: 0; padding: 0 }
[hidden] { display: none !important }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth }
body { background: var(--room); color: var(--creamText); font-family: var(--font); font-size: 17px; line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: hidden }
a { color: inherit }
img, canvas, iframe { display: block; max-width: 100% }
.px { image-rendering: pixelated; image-rendering: crisp-edges }
.wrap { max-width: 1180px; margin: 0 auto; padding-inline: 20px }
.sr-only { position: absolute !important; left: 0; top: 0; width: 1px !important; height: 1px !important; padding: 0 !important; margin: 0 !important; border: 0 !important; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }
h1, h2, h3 { font-family: var(--pixel); font-weight: 700; letter-spacing: .01em; line-height: 1.05 }

/* ---------- buttons ---------- */
.btn { font: 600 17px var(--pixel); letter-spacing: .03em; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 20px; border-radius: 10px; border: 2px solid var(--brownLL); background: var(--brownL); color: var(--creamText); text-decoration: none; cursor: pointer; box-shadow: 0 4px 0 #120c08; transition: transform .08s, box-shadow .08s, background .15s }
.btn:hover { background: var(--brownLL) }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #120c08 }
.btn.primary { background: var(--piss); border-color: var(--pissD); color: #2b1d16; box-shadow: 0 4px 0 #6d6010 }
.btn.primary:hover { background: var(--pissL) }
.btn.primary:active { box-shadow: 0 1px 0 #6d6010 }
.btn.small { font-size: 15px; padding: 9px 16px; margin-top: 12px }
.btn:disabled { opacity: .6; cursor: default }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px }
.chip { font: 600 14px var(--pixel); letter-spacing: .04em; padding: 7px 14px; border-radius: 8px; border: 2px solid var(--brownLL); background: var(--brown); color: var(--creamText); cursor: pointer }
.chip:hover { border-color: var(--piss); color: var(--pissL) }

/* ---------- the one screen ---------- */
.screen1 { position: relative; height: 100svh; min-height: 560px; display: flex; flex-direction: column; overflow: hidden;
  background: radial-gradient(ellipse 60% 70% at 68% 42%, #3a2a1c 0%, var(--room) 70%) }
.motes { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; image-rendering: pixelated }
.top { position: relative; height: var(--topH); display: flex; align-items: center; padding-inline: clamp(16px, 3vw, 40px) }
.brand { display: flex; align-items: center; gap: 10px; font: 700 19px var(--pixel); letter-spacing: .04em; text-decoration: none }
.brand img { width: 30px; height: 30px; border-radius: 8px }

.hero-grid { position: relative; flex: 1; min-height: 0; width: 100%; max-width: 1640px; margin: 0 auto; padding-inline: clamp(16px, 3vw, 40px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(24px, 4vw, 64px); align-items: center }
.side { display: flex; flex-direction: column; gap: clamp(16px, 4svh, 40px); min-width: 0 }
.hero-copy { display: flex; flex-direction: column; gap: clamp(10px, 2svh, 18px) }
h1 { font-family: var(--headFont, "Rubik Distressed", var(--pixel)); font-weight: 400; font-size: clamp(26px, 6.4svh, 64px); text-transform: uppercase }
/* two fixed lines; main.js scales the size so the longer line fills the column */
h1[data-fit] span { display: block; white-space: nowrap; width: max-content }
.pitch { font-size: clamp(15px, 2.1svh, 18px); color: var(--creamSoft); max-width: 30em }

/* the portrait: small frame on the wall, the game's HUD slider beside it */
.portrait { display: flex; align-items: center; gap: clamp(16px, 2vw, 28px) }
.frame-wrap { position: relative; flex: 0 0 auto; padding-top: 10px }
.portrait canvas { width: clamp(92px, 19svh, 170px); height: auto; transform: rotate(var(--tilt, 0deg)); transform-origin: 50% -14px; transition: transform .25s;
  filter: drop-shadow(0 12px 14px rgba(0,0,0,.55)) }
.nail { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #bbb, #444 70%); z-index: 1; box-shadow: 0 2px 3px rgba(0,0,0,.5) }
.hud { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font: 600 14px var(--pixel); letter-spacing: .06em; color: #fff; width: min(260px, 100%) }
.hud span { flex: 1 1 100% }
.hud b { min-width: 3em; text-align: right }
.hud input { flex: 1; -webkit-appearance: none; appearance: none; height: 5px; border-radius: 0; background: linear-gradient(90deg, #fff, var(--red)); outline-offset: 6px; box-shadow: 0 0 0 2px #333; cursor: pointer }
.hud input::-webkit-slider-thumb { -webkit-appearance: none; width: 7px; height: 22px; background: #fff; border: 2px solid #111; cursor: grab }
.hud input::-moz-range-thumb { width: 7px; height: 22px; background: #fff; border: 2px solid #111; border-radius: 0; cursor: grab }

/* the phone: landscape, CSS-only bezel */
.stage { display: flex; flex-direction: column; align-items: center; gap: 12px }
.phone { --w: var(--phoneW); width: var(--w); aspect-ratio: 19.5 / 9; padding: 11px; border-radius: 42px; background: #0b0c0e; position: relative;
  box-shadow: 0 0 0 2px #2d2f35, 0 0 0 5px #121316, 0 34px 80px rgba(0,0,0,.6), 0 0 120px rgba(214,194,48,.06) }
.phone::before { content: ""; position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 20px; height: 26%; border-radius: 12px; background: #0b0c0e; z-index: 3 }
.phone::after { content: ""; position: absolute; top: -5px; right: 22%; width: 60px; height: 4px; border-radius: 3px 3px 0 0; background: #2d2f35 }
.screen { position: relative; width: 100%; height: 100%; border-radius: 32px; overflow: hidden; background: #000 }
.screen iframe { width: 100%; height: 100%; border: 0; background: #000 }
/* fast taps / long holds on the embedded game must not zoom the page or pop the select/copy callout */
.phone { touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent }
.poster { position: absolute; inset: 0; border: 0; padding: 0; background: #000; cursor: pointer; display: grid; place-items: center; overflow: hidden }
.poster video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .85; transition: opacity .2s }
.poster:hover video { opacity: 1 }
/* centred on the screen, over the gameplay loop */
.play-chip { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.75);display: inline-flex; align-items: center; gap: 12px; font: 700 22px var(--pixel); letter-spacing: .08em; text-transform: uppercase; color: #2b1d16; background: var(--piss); padding: 12px 26px 12px 20px; border-radius: 12px; border: 2px solid var(--pissD); box-shadow: 0 5px 0 #6d6010 }
.play-chip i { width: 0; height: 0; border-left: 14px solid #2b1d16; border-top: 9px solid transparent; border-bottom: 9px solid transparent }
.phone.playing .poster { display: none }
/* phones: the frame is only a video loop, nothing to tap */
.phone.loop-only .poster { cursor: default; pointer-events: none }
.phone.loop-only .poster video { opacity: 1 }
.phone.loop-only .play-chip { display: none }

/* big mode: the phone takes 80% of the width, everything else steps aside below it */
.screen1.big { height: auto; min-height: 100svh; overflow: visible }
.screen1.big .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 34px; padding-block: 4px 40px }
.screen1.big .stage { order: -1 }
.screen1.big .phone { --w: min(80vw, calc((100svh - var(--topH) - 70px) * 19.5 / 9)) }
.screen1.big .side { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; gap: 40px }
.screen1.big .hero-copy { max-width: 560px }
.side.enter { animation: enter .5s ease both }
@keyframes enter { from { opacity: 0; transform: translateY(18px) } }

/* ---------- belt ---------- */
.belt { position: relative; flex: 0 0 auto; padding-block: 8px clamp(12px, 2.4svh, 24px); overflow: hidden;
  -webkit-mask: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); mask: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent) }
.belt-track { display: flex; column-gap: 14px; width: max-content; will-change: transform }
.tile { margin: 0; flex: 0 0 auto }
.tile canvas { height: var(--beltH); width: auto; border-radius: 8px; border: 2px solid #0c0906; box-shadow: 0 10px 26px rgba(0,0,0,.45); background: #000 }

/* ---------- phone section ---------- */
.phone-sec { background: var(--brown); padding-block: clamp(56px, 10svh, 96px); min-height: 100svh; display: flex; align-items: center }
.phone-sec > .wrap { width: 100% }
.phone-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 50px; align-items: center }
.phone-sec h2 { font-size: clamp(30px, 4vw, 46px); margin-bottom: 12px }
.lede { font-size: 17.5px; color: var(--creamSoft); max-width: 34em }
.tabs { display: inline-flex; gap: 4px; margin-top: 26px; padding: 4px; border-radius: 12px; background: var(--dark) }
.tabs button { font: 600 16px var(--pixel); letter-spacing: .03em; padding: 9px 20px; border: 0; border-radius: 9px; background: none; color: var(--creamSoft); cursor: pointer }
.tabs button[aria-selected="true"] { background: var(--piss); color: #2b1d16 }
.steps { list-style: none; counter-reset: s; display: grid; gap: 12px; margin-top: 20px; max-width: 560px }
.steps li { counter-increment: s; background: var(--brownL); border: 2px solid var(--brownLL); border-radius: 14px; padding: 14px 16px 14px 60px; position: relative; font-size: 16.5px; color: var(--creamSoft) }
.steps li::before { content: counter(s); position: absolute; left: 14px; top: 12px; width: 32px; height: 32px; border-radius: 9px; background: var(--piss); color: #2b1d16; font: 700 19px/32px var(--pixel); text-align: center }
.steps b { color: var(--creamText); font-weight: 600 }
.steps small { display: block; font-size: 14px; color: var(--muted); margin-top: 4px }
.ico { display: inline-grid; place-items: center; vertical-align: -6px; width: 26px; height: 26px; border-radius: 7px; background: #fff; color: #0a84ff; margin: 0 2px }
.ico svg { width: 17px; height: 17px }
.warn { margin-top: 18px; padding: 12px 14px; border-radius: 12px; border: 2px dashed var(--pissD); color: var(--pissL); font-size: 15px; max-width: 560px }
.just-play { display: inline-block; margin-top: 22px; font: 600 16px var(--pixel); color: var(--pissL); text-decoration: none }
.qr-card { justify-self: center; background: var(--cream); color: var(--ink); padding: 20px 20px 14px; border-radius: 16px; text-align: center; box-shadow: 0 6px 0 #1a120d; font: 600 14px var(--pixel); max-width: 280px }
.qr svg { width: 220px; height: 220px; margin: 0 auto 8px }
.qr-url { font: 12px var(--font); word-break: break-all; color: var(--soft); margin-bottom: 8px }

/* ---------- feedback dialog ---------- */
.sheet { margin: auto; width: min(460px, 92vw); border: 2px solid var(--brownLL); border-radius: 16px; background: var(--brown); color: var(--creamText); padding: 24px; box-shadow: 0 30px 80px rgba(0,0,0,.6) }
.sheet::backdrop { background: rgba(10,6,4,.72) }
.sheet h3 { font-size: 24px; margin-bottom: 14px }
.sheet .x { position: absolute; top: 10px; right: 14px; background: none; border: 0; color: var(--creamSoft); font-size: 26px; cursor: pointer }
.fb { position: relative; display: grid; gap: 8px }
.fb label { font: 600 14px var(--pixel); color: var(--creamSoft) }
.fb label span { font: 13px var(--font); color: var(--muted) }
.fb textarea, .fb input { font: 16px var(--font); color: var(--ink); background: #fffdf6; border: 2px solid #cfc6b8; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; width: 100% }
.fb textarea { resize: vertical; min-height: 120px }
.fb textarea:focus, .fb input:focus { outline: none; border-color: var(--piss) }
.fb .btn { justify-self: start }
.form-msg { font-size: 15px; margin-top: 4px }
.form-msg.ok { color: #b3c974 }
.form-msg.err { color: #e2876a }

/* ---------- narrow or short windows: stack and let it scroll ---------- */
@media (max-width: 900px), (max-height: 540px) {
  :root { --phoneW: calc(100vw - 32px); --beltH: 110px }
  .screen1 { height: auto; min-height: 0 }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-block: 8px 24px }
  .stage { order: -1 }
  .stage [data-big] { display: none }
  .phone { padding: 7px; border-radius: 28px }
  .screen { border-radius: 22px }
  .phone::before { left: 9px; width: 13px }
  .phone-grid { grid-template-columns: minmax(0, 1fr); gap: 30px }
}
@media (max-width: 520px) {
  .cta-row .btn { flex: 1 1 100% }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto }
  * { animation: none !important; transition: none !important }
}
.nw { white-space: nowrap }
