/* Game chrome in Eplehuset's brand: Sort nyanse #231F20 on Lys Grå #F5F5F5 and white,
   SF Pro, blue (#0045DD) only on buttons and links. */

:root {
  --ink: #231f20;
  --ink2: #5b5758;
  --ink3: #8a8687;
  --paper: #f5f5f5;
  --card: #ffffff;
  --line: rgba(35, 31, 32, .12);
  --accent: #0045dd;
  --accent-press: #0036ad;
  --ok: #1f8f3a;
  --ok-bg: #e6f6ea;
  --warn: #b25a00;
  --warn-bg: #fff1dd;
  --bad: #c4291c;
  --bad-bg: #fde9e7;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", "Helvetica Neue", Inter, Roboto, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--paper); color: var(--ink); font-family: var(--font);
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
body { overflow: hidden; overscroll-behavior: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; color: inherit; }
button { -webkit-appearance: none; appearance: none; border: 0; background: none; cursor: pointer; padding: 0; }
a { color: var(--accent); }

#app { position: fixed; inset: 0; }
#app.booting { visibility: hidden; }

/* ---- shared chrome pieces ----------------------------------------------- */
.ff-chrome .logos { display: flex; align-items: center; gap: 30px; } /* brand book: min 75 px logo, partner spacing 0.4 × height */
.ff-chrome .logos img { display: block; height: 75px; width: auto; }
.ff-chrome .logos .x { display: none; }
.ff-chrome .logos .jamf { height: 34px; }
.ff-chrome .eyebrow { font-size: 13px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink2); }
.ff-chrome .h1 { font-size: 56px; line-height: 50px; font-weight: 700; letter-spacing: -1.2px; margin: 0; }
.ff-chrome .h2 { font-size: 30px; line-height: 30px; font-weight: 700; letter-spacing: -.5px; margin: 0; }
.ff-chrome .lead { font-size: 21px; line-height: 26px; font-weight: 400; letter-spacing: -.3px; color: var(--ink); margin: 0; }
.ff-chrome .body { font-size: 17px; line-height: 21px; color: var(--ink2); }
.ff-chrome .small { font-size: 14px; line-height: 18px; color: var(--ink2); }
.ff-chrome .steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ff-chrome .steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 17px; line-height: 21px; }
.ff-chrome .steps li b { flex: none; width: 26px; height: 26px; border-radius: 13px; background: var(--ink); color: #fff; display: grid; place-items: center;
  font-size: 14px; font-weight: 600; margin-top: -2px; }

.ff-chrome .btn { height: 56px; border-radius: 28px; padding: 0 28px; font-size: 19px; font-weight: 600; letter-spacing: -.3px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .12s ease, background .12s ease; }
.ff-chrome .btn:active { transform: scale(.97); }
.ff-chrome .btn-primary { background: var(--accent); color: #fff; }
.ff-chrome .btn-primary:active { background: var(--accent-press); }
.ff-chrome .btn-primary[disabled] { opacity: .5; }
.ff-chrome .btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(35, 31, 32, .22); }
.ff-chrome .btn-wide { width: 100%; }
.ff-chrome .link { color: var(--accent); font-size: 16px; font-weight: 500; text-decoration: none; padding: 8px 0; display: inline-block; }

.ff-chrome .tag { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px; font-size: 13px; font-weight: 600; }
.ff-chrome .tag-test { background: #ff9500; color: #fff; letter-spacing: .04em; }
.ff-chrome .note { border-radius: 16px; padding: 12px 14px; font-size: 15px; line-height: 20px; }
.ff-chrome .note-warn { background: var(--warn-bg); color: #6b3a00; }
.ff-chrome .note-ok { background: var(--ok-bg); color: #0e5a24; }
.ff-chrome .note-bad { background: var(--bad-bg); color: #7d1b12; }

/* ---- framed layout (iPad, desktop): drawn iPhone + panel ---------------- */
.layout-framed .stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 56px; padding: 32px 48px; }
.layout-framed.portrait .stage { flex-direction: column; gap: 28px; padding: 28px 40px; }
.layout-framed .device-wrap { position: relative; flex: none; }
.layout-framed .device-wrap .device { position: absolute; top: 0; left: 0; }
.layout-framed .panel.ff-chrome { flex: 1 1 auto; max-width: 620px; min-width: 360px; align-self: stretch; display: flex; flex-direction: column;
  justify-content: flex-start; position: relative; overflow-y: auto; }
/* Centred when there is room, top-aligned and scrollable when the content is taller (never clipped). */
.layout-framed .panel.ff-chrome > .panel-inner { margin: auto 0; }
.layout-framed.portrait .panel.ff-chrome { flex: 0 0 auto; width: 100%; max-width: 680px; min-width: 0; align-self: center; justify-content: flex-start; }
.ff-chrome .panel-inner { display: flex; flex-direction: column; gap: 22px; }
.panel.ff-chrome .top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.layout-phone .stage { display: none; }

/* HUD during a round (framed only) */
.ff-chrome .hud-round { display: flex; align-items: center; gap: 14px; }
.ff-chrome .dots { display: flex; gap: 7px; }
.ff-chrome .dots i { width: 12px; height: 12px; border-radius: 6px; background: rgba(35, 31, 32, .14); }
.ff-chrome .dots i.done { background: var(--ink); }
.ff-chrome .dots i.timeout { background: #ff9500; }
.ff-chrome .dots i.now { background: var(--accent); box-shadow: 0 0 0 4px rgba(0, 69, 221, .18); }
.ff-chrome .clock { font-size: 104px; line-height: 92px; font-weight: 700; letter-spacing: -3px; font-variant-numeric: tabular-nums; }
.ff-chrome .clock small { font-size: 40px; letter-spacing: -1px; margin-left: 6px; color: var(--ink2); font-weight: 600; }
.ff-chrome .hud-stats { display: flex; gap: 28px; }
.ff-chrome .hud-stats div { font-size: 15px; color: var(--ink2); }
.ff-chrome .hud-stats b { display: block; font-size: 26px; line-height: 30px; color: var(--ink); font-variant-numeric: tabular-nums; }
.ff-chrome .hud-stats .pen b { color: var(--bad); }
.ff-chrome .feedback { min-height: 120px; }
.ff-chrome .fb { border-radius: 22px; padding: 18px 20px; display: flex; gap: 14px; align-items: flex-start; animation: fb-in .3s ease both; }
.ff-chrome .fb .ic { flex: none; width: 34px; height: 34px; border-radius: 17px; display: grid; place-items: center; color: #fff; }
.ff-chrome .fb .ic svg { width: 18px; height: 18px; }
.ff-chrome .fb h3 { margin: 2px 0 4px; font-size: 21px; line-height: 25px; letter-spacing: -.3px; }
.ff-chrome .fb p { margin: 0; font-size: 17px; line-height: 22px; }
.ff-chrome .fb.ok { background: var(--ok-bg); } .ff-chrome .fb.ok .ic { background: #34c759; }
.ff-chrome .fb.to { background: var(--warn-bg); } .ff-chrome .fb.to .ic { background: #ff9500; }
.ff-chrome .fb.miss { background: var(--bad-bg); } .ff-chrome .fb.miss .ic { background: #ff3b30; }
@keyframes fb-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ff-chrome .flash-pen { animation: pen 0.6s ease; }
@keyframes pen { 0% { transform: scale(1); } 30% { transform: scale(1.18); color: var(--bad); } 100% { transform: scale(1); } }

/* ---- phone layout: the screen fills the display ------------------------- */
.phone-screen { position: absolute; top: 0; left: 0; transform-origin: 0 0; overflow: hidden; background: #231f20; touch-action: none;
  --sat: 0px; --sab: 16px; }
.phone-screen .screen-host { position: absolute; inset: 0; }
.layout-framed .phone-screen { display: none; }

/* Full-page views (phone start/result, and the form/thanks on all layouts) */
.page.ff-chrome { position: absolute; inset: 0; background: var(--paper); overflow-y: auto; -webkit-overflow-scrolling: touch; z-index: 50;
  padding: calc(env(safe-area-inset-top) + 24px) 20px calc(env(safe-area-inset-bottom) + 28px); touch-action: pan-y; }
.page.ff-chrome[hidden] { display: none; }
.ff-chrome .page-inner { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; min-height: 100%; }
.layout-phone .ff-chrome .h1 { font-size: 46px; line-height: 42px; }
.layout-phone .ff-chrome .clock { font-size: 84px; line-height: 76px; }
.layout-phone .ff-chrome .logos { gap: 30px; }
.ff-chrome .spacer { flex: 1; }
.layout-framed .ff-chrome .spacer { display: none; } /* no big gap above the buttons on iPad/desktop */

/* Start (phone) */
.ff-chrome .start-hero { display: flex; flex-direction: column; gap: 14px; }
.ff-chrome .prize { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 20px; padding: 14px 16px; }
.ff-chrome .prize .pic { width: 46px; height: 46px; border-radius: 12px; background: var(--paper); display: grid; place-items: center; flex: none; }
.ff-chrome .prize .pic svg { width: 30px; height: 30px; color: var(--ink); }
.ff-chrome .prize b { display: block; font-size: 17px; }
.ff-chrome .prize span { font-size: 15px; color: var(--ink2); }
.ff-chrome .qr-box { display: flex; gap: 18px; align-items: center; background: var(--card); border-radius: 22px; padding: 16px; }
.ff-chrome .qr-box img { width: 120px; height: 120px; flex: none; }
.ff-chrome .qr-box b { display: block; font-size: 19px; line-height: 23px; margin-bottom: 4px; }

/* Countdown */
.countdown.ff-chrome { position: absolute; inset: 0; display: grid; place-items: center; z-index: 40; background: rgba(35, 31, 32, .55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #fff; pointer-events: none; }
.countdown.ff-chrome span { font-size: 180px; font-weight: 700; letter-spacing: -6px; animation: cd .9s ease both; }
.countdown.ff-chrome small { position: absolute; bottom: 22%; font-size: 21px; font-weight: 600; opacity: .9; }
@keyframes cd { 0% { transform: scale(1.5); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; transform: scale(.85); } }

/* Between rounds card (phone) */
.round-card.ff-chrome { position: absolute; left: 12px; right: 12px; z-index: 45; border-radius: 26px; padding: 16px 18px; display: flex; gap: 14px;
  background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .28); animation: card-in .35s cubic-bezier(.2, .9, .3, 1.2) both; pointer-events: none; color: var(--ink); }
.round-card.ff-chrome.bottom { bottom: calc(env(safe-area-inset-bottom) + 12px); }
.round-card.ff-chrome.top { top: calc(env(safe-area-inset-top) + 12px); }
.round-card.ff-chrome .ic { flex: none; width: 34px; height: 34px; border-radius: 17px; display: grid; place-items: center; color: #fff; background: #34c759; }
.round-card.ff-chrome.to .ic { background: #ff9500; }
.round-card.ff-chrome .ic svg { width: 18px; height: 18px; }
.round-card.ff-chrome h3 { margin: 1px 0 3px; font-size: 19px; line-height: 23px; letter-spacing: -.3px; display: flex; justify-content: space-between; gap: 8px; }
.round-card.ff-chrome h3 span { color: var(--ink2); font-weight: 600; font-variant-numeric: tabular-nums; }
.round-card.ff-chrome p { margin: 0; font-size: 16px; line-height: 21px; color: var(--ink); }
.round-card.ff-chrome .prog { margin-top: 8px; }
@keyframes card-in { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }

/* Result */
.ff-chrome .result-time { display: flex; flex-direction: column; gap: 6px; }
.ff-chrome .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ff-chrome .stats div { background: var(--card); border-radius: 18px; padding: 12px 14px; font-size: 14px; color: var(--ink2); }
.ff-chrome .stats b { display: block; font-size: 24px; line-height: 28px; color: var(--ink); font-variant-numeric: tabular-nums; }
.ff-chrome .rounds { background: var(--card); border-radius: 20px; padding: 4px 16px; }
.ff-chrome .rounds div { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; font-size: 15px; border-top: 1px solid var(--line); }
.ff-chrome .rounds div:first-child { border-top: 0; }
.ff-chrome .rounds span:last-child { font-variant-numeric: tabular-nums; color: var(--ink2); white-space: nowrap; }
.ff-chrome .rounds .to { color: var(--warn); }
.ff-chrome .place { font-size: 19px; line-height: 24px; font-weight: 600; }
.ff-chrome .btn-row { display: flex; flex-direction: column; gap: 10px; }

/* Form */
.ff-chrome .form { display: flex; flex-direction: column; gap: 14px; }
.ff-chrome .field { display: flex; flex-direction: column; gap: 6px; }
.ff-chrome .field label { font-size: 15px; font-weight: 600; }
.ff-chrome .field input { width: 100%; min-width: 0; height: 52px; border-radius: 14px; border: 1.5px solid rgba(35, 31, 32, .18); background: #fff; padding: 0 14px; font-size: 18px;
  outline: none; -webkit-appearance: none; appearance: none; }
.ff-chrome .field input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(0, 69, 221, .14); }
.ff-chrome .field.bad input { border-color: var(--bad); }
.ff-chrome .field .msg { font-size: 14px; color: var(--bad); min-height: 0; }
.ff-chrome .field .hint { font-size: 14px; color: var(--warn); }
.ff-chrome .two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.ff-chrome .check { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; line-height: 21px; cursor: pointer; }
.ff-chrome .check input { position: absolute; opacity: 0; pointer-events: none; }
.ff-chrome .check .box { flex: none; width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid rgba(35, 31, 32, .3); background: #fff; display: grid; place-items: center; margin-top: -2px; }
.ff-chrome .check .box svg { width: 16px; height: 16px; color: #fff; opacity: 0; }
.ff-chrome .check input:checked + .box { background: var(--accent); border-color: var(--accent); }
.ff-chrome .check input:checked + .box svg { opacity: 1; }
.ff-chrome .check.bad .box { border-color: var(--bad); }
.ff-chrome .form-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.ff-chrome .form-head .t { font-size: 34px; line-height: 34px; font-weight: 700; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }

/* Thanks */
.ff-chrome .thanks { text-align: left; }
.ff-chrome .reset-bar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.ff-chrome .reset-bar i { display: block; height: 100%; background: var(--ink); transform-origin: 0 50%; animation: reset linear both; }
@keyframes reset { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* Sheets (rules, stand admin) */
.sheet-bg.ff-chrome { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 90; display: flex; align-items: flex-end; justify-content: center; }
.ff-chrome .sheet { background: #fff; width: min(720px, 100%); max-height: 92%; border-radius: 28px 28px 0 0; overflow: hidden; display: flex; flex-direction: column;
  animation: sheet-in .3s cubic-bezier(.2, .9, .3, 1) both; }
.layout-framed .sheet-bg.ff-chrome { align-items: center; }
.layout-framed .ff-chrome .sheet { border-radius: 28px; max-height: 88%; }
.ff-chrome .sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.ff-chrome .sheet-head b { font-size: 17px; }
.ff-chrome .sheet-body { overflow-y: auto; padding: 8px 22px calc(env(safe-area-inset-bottom) + 24px); -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.ff-chrome .close-btn { width: 36px; height: 36px; border-radius: 18px; background: var(--paper); display: grid; place-items: center; }
.ff-chrome .close-btn svg { width: 14px; height: 14px; }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.ff-chrome .rules h1 { font-size: 26px; line-height: 30px; margin: 14px 0 4px; letter-spacing: -.4px; }
.ff-chrome .rules .lead { font-size: 16px; color: var(--ink2); margin-bottom: 8px; }
.ff-chrome .rules h2 { font-size: 18px; margin: 20px 0 6px; }
.ff-chrome .rules p, .ff-chrome .rules li { font-size: 16px; line-height: 22px; color: var(--ink); }
.ff-chrome .rules ul { padding-left: 20px; margin: 6px 0; }
.ff-chrome .rules li { margin: 4px 0; }

/* Stand admin */
.ff-chrome .pin { display: flex; flex-direction: column; gap: 14px; padding: 18px 0; }
.ff-chrome .pin input { height: 56px; font-size: 28px; letter-spacing: 12px; text-align: center; border-radius: 14px; border: 1.5px solid rgba(35, 31, 32, .2); }
.ff-chrome .admin-rows { display: flex; flex-direction: column; gap: 4px; padding: 10px 0; }
.ff-chrome .admin-rows .r { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 16px; }
.ff-chrome .admin-rows .r:first-child { border-top: 0; }
.ff-chrome .toggle { width: 52px; height: 32px; border-radius: 16px; background: rgba(120, 120, 128, .24); position: relative; flex: none; }
.ff-chrome .toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 28px; height: 28px; border-radius: 14px; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: left .15s; }
.ff-chrome .toggle.on { background: #34c759; }
.ff-chrome .toggle.on::after { left: 22px; }

/* Test badge */
.test-badge.ff-chrome { position: fixed; z-index: 95; top: calc(env(safe-area-inset-top) + 10px); right: 12px; pointer-events: none; }
.layout-phone .test-badge.ff-chrome { display: none; } /* phones show test mode as a note in the page */
.ff-chrome .hidden, .ff-chrome.hidden { display: none !important; }

/* Rotate prompt for phones held sideways */
.rotate.ff-chrome { position: fixed; inset: 0; z-index: 200; background: var(--ink); color: #fff; display: none; place-items: center; text-align: center; padding: 24px; font-size: 21px; font-weight: 600; }
@media (orientation: landscape) and (max-height: 500px) { .layout-phone .rotate.ff-chrome { display: grid; } }
