/* ==========================================================================
   MHbasfut · web simulator
   Every measurement below is in iPhone points (1 pt = 1 px at scale 1),
   taken from the SwiftUI sources: same paddings, radii, colours and weights.
   ========================================================================== */

@font-face {
  font-family: 'National Park';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/national-park-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'National Park';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/national-park-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --font: 'National Park', ui-rounded, 'SF Pro Rounded', -apple-system, system-ui, sans-serif;

  /* app palette — straight from the Swift Color(red:green:blue:) values */
  --app-bg: #202c33;
  --sheet: #1c262b;
  --ink: #e6ebee;
  --muted: #a8b0b5;
  --card: #1c242e;
  --card-deep: #121212;
  --stroke: #334052;
  --stroke-soft: #2e3847;
  --gold: #ffc40d;
  --gold-shadow: #d4a000;
  --gold-ink: #0d2638;
  --gold-off: #776319;
  --gold-off-shadow: #5e4c13;
  --gold-off-ink: #293745;
  --lime: #8cd12e;
  --lime-shadow: #6ea321;
  --lime-off: #618f24;
  --lime-off-shadow: #4a7019;
  --green: #2e9e1e;
  --sky: #34ace7;
  --orange: #ff6b00;
  --danger: #f04c4c;
  --accent: #ffc40d;

  --safe-top: 59px;
  --safe-bottom: 34px;
  --radius-sheet: 44px;

  /* page chrome */
  --page: #000;
  --page-ink: #f2f3f5;
  --page-muted: #8a8f96;
  --page-line: #202024;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--page);
  color: var(--page-ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  height: 100%;
}

body {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Page header */
.topbar {
  position: relative;
  display: flex;
  align-items: center;
  height: 64px;
  padding: 0 24px;
  flex: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #0b0c0e;
}
.brand { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; text-decoration: none; white-space: nowrap; }
.brand span { font-size: 13px; font-weight: 600; letter-spacing: 0.14em; color: var(--page-muted); }
.tabs {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 28px;
}
.tab { background: none; border: 0; font-size: 16px; font-weight: 700; color: var(--page-muted); padding: 4px 0; white-space: nowrap; }
.tab.is-active { color: #fff; box-shadow: inset 0 -2px 0 #fff; }
.tab:hover { color: #fff; }
.topbar-end { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.link {
  background: none;
  border: 0;
  padding: 4px 0;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.link--strong { font-weight: 700; }
.link:hover { opacity: 0.72; }

@media (max-width: 760px) {
  .topbar { padding: 0 12px; gap: 10px; }
  .brand { font-size: 17px; }
  .tabs { position: static; transform: none; margin: 0 auto; gap: 14px; }
  .tab, .link { font-size: 12.5px; }
  .topbar-end { gap: 12px; margin-left: 0; }
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.stagewrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 16px 24px 8px;
}

/* Web portal — the same demo data, one user, no sign-in. */
.portalwrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.console {
  width: min(1100px, 100%);
  height: min(680px, 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--ink);
  background: var(--sheet);
  border: 1px solid #26343f;
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.console__top {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #26343f;
}
.console__tag { font-size: 12px; font-weight: 600; color: var(--muted); border: 1px solid var(--stroke); border-radius: 999px; padding: 5px 10px; }
.console__body { flex: 1; min-height: 0; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.console__side { min-height: 0; overflow-y: auto; padding: 12px; border-right: 1px solid #26343f; }
.console__main { min-width: 0; overflow-y: auto; padding: 26px 30px 32px; scrollbar-width: thin; }

.user { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; background: rgba(140, 209, 46, 0.12); }
.user__av {
  width: 34px; height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--lime);
  color: #17300a;
  font-size: 12px;
  font-weight: 800;
}
.user > span:last-child { min-width: 0; }
.user b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.user small { display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--muted); }

.console h1 { margin: 0; overflow-wrap: anywhere; font-size: 32px; font-weight: 800; letter-spacing: -0.02em; }
.console__meta { margin-top: 4px; font-size: 14px; color: var(--muted); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.metric { background: #18232b; border: 1px solid #26343f; border-radius: 14px; padding: 16px; }
.metric__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.metric__top .ic { width: 17px; height: 17px; color: #5f6f7b; }
.metric strong { display: block; margin-top: 10px; font-size: 26px; font-weight: 800; }
.metric strong span { margin-left: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.metric__note { margin-top: 6px; font-size: 12px; color: #7e8b95; }

.panel { margin-top: 18px; background: #18232b; border: 1px solid #26343f; border-radius: 14px; padding: 18px 18px 12px; }
.panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.panel h2 { margin: 0; font-size: 16px; font-weight: 800; }
.panel__sub { margin-top: 4px; font-size: 12px; color: var(--muted); }
.panel__badge { font-size: 12px; font-weight: 700; color: #8cd12e; }
.chart { display: flex; align-items: flex-end; gap: 8px; height: 170px; margin-top: 18px; padding-bottom: 6px; border-bottom: 1px solid #2c3a45; }
.chart__col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; }
.chart__bar { width: 100%; min-height: 2px; border-radius: 4px 4px 0 0; background: #33424d; }
.chart__bar.is-done { background: var(--lime); }
.chart__bar.is-today { background: var(--gold); }
.chart__day { font-size: 10px; color: #6f7d87; }
.chart__empty { margin-top: 10px !important; font-size: 12px; color: #7e8b95; }

@media (max-width: 900px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .console__body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .console__side { padding: 10px 12px; border-right: 0; border-bottom: 1px solid #26343f; }
  .console__side .user { padding: 10px; }
  .console__main { padding: 20px; }
  .console h1 { font-size: 26px; }
}
@media (max-width: 560px) {
  .portalwrap { padding: 12px; }
  .console { border-radius: 16px; }
  .metric { padding: 12px; }
  .metric strong { font-size: 22px; }
  .chart { height: 130px; gap: 4px; }
}

.stage {
  position: relative;
  width: 441px;
  height: 902px;
  flex: none;
}
.device { transform-origin: top left; }

/* Device frame — the iPhone artwork in demo/assets/media, with the app
   clipped into its transparent screen aperture (24px / 72px / 393×806). */
.device {
  position: relative;
  width: 441px;
  height: 902px;
  border-radius: 68px;
  box-shadow: 0 34px 70px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.5);
}
.device__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 60;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.screen {
  position: absolute;
  left: 24px;
  top: 23px;
  width: 393px;
  height: 855px;
  border-radius: 62px;
  overflow: hidden;
  background: var(--app-bg);
  isolation: isolate;
}

/* iOS status bar + home indicator, drawn over the app and the sheets. */
.statusbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 54px;
  z-index: 450;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 30px 8px;
  color: #fff;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}
.statusbar__time {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}
.statusbar__icons { display: flex; align-items: center; gap: 5px; }
.statusbar__icons svg { display: block; }

.homebar {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 134px;
  height: 5px;
  margin-left: -67px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.92);
  z-index: 450;
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

.app, .overlay {
  position: absolute;
  inset: 0;
}
.overlay { z-index: 200; pointer-events: none; }
.overlay > * { pointer-events: auto; }

/* ==========================================================================
   App primitives
   ========================================================================== */

.app { font-size: 16px; line-height: 1.25; color: var(--ink); }
.app * { -webkit-tap-highlight-color: transparent; }
.app h1, .app h2, .app h3, .app p { margin: 0; }
.app :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.fill { position: absolute; inset: 0; }
.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.scroll::-webkit-scrollbar { display: none; }

.ic {
  width: 1em;
  height: 1em;
  display: block;
  flex: none;
}

/* 3D button — face + fixed depth edge, exactly like SubmitButtonStyle. */
.btn3d {
  --face: var(--gold);
  --edge: var(--gold-shadow);
  --ink-on: var(--gold-ink);
  position: relative;
  display: block;
  width: 100%;
  border: 0;
  background: none;
  padding: 0 0 6px;
  border-radius: 16px;
  color: var(--ink-on);
}
.btn3d__face {
  position: relative;
  display: block;
  border-radius: 16px;
  background: var(--face);
  padding: 16px 10px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
  transition: transform 0.12s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.btn3d::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 6px;
  bottom: 0;
  border-radius: 16px;
  background: var(--edge);
}
.btn3d:active:not(:disabled) .btn3d__face { transform: translateY(6px); }
.btn3d:disabled { cursor: default; }
.btn3d--off { --face: var(--gold-off); --edge: var(--gold-off-shadow); --ink-on: var(--gold-off-ink); }
.btn3d--lime { --face: var(--lime); --edge: var(--lime-shadow); --ink-on: var(--gold-ink); }
.btn3d--lime-off { --face: var(--lime-off); --edge: var(--lime-off-shadow); --ink-on: var(--gold-ink); }
.btn3d--arrow { width: 56px; flex: none; }
.btn3d--arrow .btn3d__face { padding: 16px 0; display: grid; place-items: center; }
.btn3d--arrow .ic { width: 16px; height: 16px; }

/* Option rows (OptionButton .vertical) */
.opt {
  --edge: var(--stroke-soft);
  position: relative;
  display: block;
  width: 100%;
  border: 0;
  background: none;
  padding: 0 0 6px;
  border-radius: 20px;
  text-align: left;
  color: #fff;
}
.opt::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 6px; bottom: 0;
  border-radius: 20px;
  background: var(--edge);
}
.opt__face {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  border-radius: 20px;
  background: var(--card);
  border: 2px solid var(--edge);
  padding: 18px 22px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  transition: transform 0.2s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.opt__face .ic { width: 20px; height: 20px; }
.opt:active .opt__face { transform: translateY(6px); }
.opt.is-on { --edge: var(--gold); }

/* Option cards (OptionButton .horizontal) */
.opt-h {
  --edge: var(--stroke-soft);
  position: relative;
  display: block;
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  padding: 0 0 6px;
  border-radius: 20px;
  color: #fff;
}
.opt-h::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 6px; bottom: 0;
  border-radius: 20px;
  background: var(--edge);
}
.opt-h__face {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  aspect-ratio: 0.85;
  border-radius: 20px;
  background: var(--card);
  border: 2px solid var(--edge);
  padding: 16px 12px 12px;
  transition: transform 0.2s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.opt-h:active .opt-h__face { transform: translateY(6px); }
.opt-h.is-on { --edge: var(--gold); }
.opt-h img { width: 100%; height: auto; object-fit: contain; flex: 1; min-height: 0; }
.opt-h span { font-size: 18px; font-weight: 800; }

/* Dashed separator */
.sep {
  height: 1px;
  background-image: repeating-linear-gradient(90deg, rgba(128, 128, 128, 0.45) 0 6px, transparent 6px 10px);
}

/* Pixel shapes */
.pixel-box {
  clip-path: polygon(25% 0, 75% 0, 75% 12.5%, 87.5% 12.5%, 87.5% 25%, 100% 25%,
    100% 75%, 87.5% 75%, 87.5% 87.5%, 75% 87.5%, 75% 100%, 25% 100%,
    25% 87.5%, 12.5% 87.5%, 12.5% 75%, 0 75%, 0 25%, 12.5% 25%, 12.5% 12.5%, 25% 12.5%);
}

.pixel-bar {
  position: relative;
  height: 20px;
  background: #29343d;
  clip-path: polygon(8px 0, calc(100% - 8px) 0, calc(100% - 8px) 4px, calc(100% - 4px) 4px,
    calc(100% - 4px) 8px, 100% 8px, 100% calc(100% - 8px), calc(100% - 4px) calc(100% - 8px),
    calc(100% - 4px) calc(100% - 4px), calc(100% - 8px) calc(100% - 4px), calc(100% - 8px) 100%,
    8px 100%, 8px calc(100% - 4px), 4px calc(100% - 4px), 4px calc(100% - 8px), 0 calc(100% - 8px),
    0 8px, 4px 8px, 4px 4px, 8px 4px);
}
.pixel-bar__fill {
  height: 100%;
  background: #ffa626;
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.3, 1);
}

/* ==========================================================================
   Sign in
   ========================================================================== */
.signin { display: flex; flex-direction: column; background: var(--sheet); }
.signin__head { padding: calc(var(--safe-top) + 5px) 24px 0; }
.signin__title { font-size: 28px; font-weight: 800; letter-spacing: -0.01em; }
.signin__sub { margin-top: 6px !important; font-size: 15px; font-weight: 500; color: var(--muted); }
.signin__body { padding: 28px 24px 16px; }
.signin__label { font-size: 15px; font-weight: 700; color: var(--muted); padding: 0 4px; margin-bottom: 8px; }
.signin__label + .signin__label { margin-top: 16px; }
.field {
  width: 100%;
  border-radius: 18px;
  background: #1c242e;
  border: 1.5px solid var(--stroke);
  color: #fff;
  padding: 18px 20px;
  font-size: 17px;
  font-weight: 600;
  outline: none;
}
.field::placeholder { color: #5d6b78; font-weight: 500; }
.field:focus { border-color: var(--accent); }
.signin__error { margin-top: 14px !important; color: #ff7373; font-size: 14px; font-weight: 600; }
.ghost-btn {
  width: 100%;
  border-radius: 18px;
  border: 1.5px solid #596470;
  background: #29353f;
  color: var(--ink);
  padding: 18px 16px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.ghost-btn:active { transform: translateY(1px); }
.signin__guest { padding: 0 24px 14px; }
.signin__note { margin-top: 12px !important; font-size: 13px; font-weight: 500; color: var(--muted); line-height: 1.45; }

/* Bottom slab shared by Home / Questionnaire / Sign in */
.slab {
  position: relative;
  background: var(--app-bg);
  border-radius: 28px 28px 0 0;
  padding: 28px 24px 36px;
  flex: none;
}
.slab__sub { font-size: 18px; font-weight: 600; color: var(--muted); padding: 0 4px; }
.slab__title {
  margin-top: 6px !important;
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
  padding: 0 4px;
}
.slab .btn3d { margin-top: 20px; }

/* ==========================================================================
   Home
   ========================================================================== */
.home { display: flex; flex-direction: column; background: var(--app-bg); }
.pitch-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  margin-bottom: -28px;
}
.pitch-track {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
}
.pitch-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  user-select: none;
  -webkit-user-drag: none;
}
.pitch-item { position: absolute; transform: translate(-50%, -50%); user-select: none; -webkit-user-drag: none; object-fit: contain; }
.pitch-flag { width: 44px; height: 44px; }
.pitch-char { width: 96px; height: 96px; }
.pitch-ball { width: 28px; height: 28px; }

/* Stage change: the character and camera ease to the next flag. */
.pitch-track.is-moving { animation: pitch-track-move .6s ease-in-out; }
@keyframes pitch-track-move { from { transform: translateX(var(--from-x)); } }
.pitch-char.is-moving, .pitch-ball.is-moving { animation: pitch-char-move .6s ease-in-out; }
@keyframes pitch-char-move { from { left: var(--from-x); top: var(--from-y); } }

.home-head {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--safe-top) + 16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 4;
}
.stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  color: #fff;
  padding: 0;
}
.stat img { width: 40px; height: 40px; object-fit: contain; }
.stat span { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.icon-btn { border: 0; background: none; padding: 0; color: #fff; }
.icon-btn img { width: 40px; height: 40px; object-fit: contain; }
.home .slab { z-index: 5; }

/* ==========================================================================
   Questionnaire
   ========================================================================== */
.quiz { display: flex; flex-direction: column; background: #141a1e; }
.quiz__head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: calc(var(--safe-top) + 16px) 24px 24px;
  flex: none;
}
.quiz__back {
  width: 38px; height: 38px;
  flex: none;
  border: 0;
  border-radius: 12px;
  background: #29333d;
  color: #fff;
  display: grid;
  place-items: center;
}
.quiz__back .ic { width: 16px; height: 16px; }
.quiz__progress { flex: 1; }
.quiz__scroll { flex: 1; min-height: 0; padding-bottom: 20px; }

.q-body { padding: 0 24px; }
.q-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--gold);
  background: rgba(255, 196, 13, 0.15);
  border-radius: 999px;
  padding: 6px 12px;
  margin-bottom: 14px;
}
.q-cat .ic { width: 13px; height: 13px; }
.q-rail { display: flex; gap: 10px; margin: 4px 0 14px; }
.q-rail::before {
  content: "";
  flex: none;
  width: 6px;
  border-radius: 3px;
  background: #fff;
}
.q-rail p { font-size: 16px; font-weight: 600; color: var(--muted); line-height: 1.35; }
.q-image { width: 100%; border-radius: 18px; display: block; margin: 4px 0 8px; }
.q-stack { display: flex; flex-direction: column; gap: 12px; }
.q-sport { display: flex; gap: 16px; padding: 20px 24px 0; }

.slider-card, .field-card {
  border-radius: 20px;
  background: var(--card);
  border: 1.5px solid var(--stroke);
  box-shadow: 0 4px 0 var(--stroke);
  padding: 18px;
}
.field-card.is-bad { border-color: #f04c4c; box-shadow: 0 4px 0 #f04c4c; }
.field-card.is-good { border-color: var(--gold); box-shadow: 0 4px 0 var(--gold); }
.slider-readout {
  position: relative;
  background: var(--card);
  border: 1.5px solid var(--gold);
  border-radius: 20px;
  padding: 26px 0;
  text-align: center;
  margin-bottom: 18px;
  box-shadow: 0 4px 0 var(--gold);
}
.slider-readout strong { display: block; font-size: 48px; font-weight: 800; color: var(--gold); line-height: 1; }
.slider-readout span { display: block; margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.slider-row { display: flex; align-items: center; gap: 14px; }
.slider-btn {
  width: 44px; height: 44px;
  flex: none;
  border: 0;
  border-radius: 12px;
  background: #26313a;
  color: #fff;
  display: grid;
  place-items: center;
}
.slider-btn .ic { width: 16px; height: 16px; }
.slider-row input[type="range"] {
  flex: 1;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: #3a4650;
  accent-color: var(--gold);
}
.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  border: 0;
}
.slider-row input[type="range"]::-moz-range-thumb {
  width: 26px; height: 26px; border: 0; border-radius: 50%; background: #fff;
}
.slider-bounds { display: flex; justify-content: space-between; margin-top: 14px; font-size: 13px; font-weight: 700; color: var(--muted); }

.field-card label { display: block; font-size: 15px; font-weight: 700; color: #bfc5cb; padding: 0 4px 8px; }
.field-card .field { padding: 16px 18px; font-size: 17px; border-radius: 16px; }
.field-error { margin-top: 8px !important; color: #ff8a8a; font-size: 13px; font-weight: 600; }
.field-card + .field-card { margin-top: 0; }

/* T-test diagram */
.diagram {
  border-radius: 20px;
  background: var(--card);
  border: 1.5px solid var(--stroke);
  padding: 18px;
  text-align: center;
  box-shadow: 0 4px 0 #232c35;
}
.diagram__label { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; color: var(--gold); }
.diagram svg { width: 100%; height: 200px; display: block; margin: 8px 0; }
.diagram__route { font-size: 14px; font-weight: 800; color: var(--gold); }

/* Finished screen */
.result { padding: 0 24px 32px; }
.result__emblem { display: block; width: 86px; height: 86px; margin: 12px auto 14px; }
.result__title { font-size: 26px; font-weight: 800; text-align: center; line-height: 1.15; }
.result__lead { margin-top: 12px !important; font-size: 15px; font-weight: 500; color: var(--muted); text-align: center; line-height: 1.45; padding: 0 12px; }

.score-card {
  margin-top: 22px;
  border-radius: 22px;
  background: var(--card);
  border: 1.5px solid #333f4c;
  padding: 20px;
}
.score-card__top { display: flex; justify-content: space-between; align-items: center; }
.score-card__eyebrow { font-size: 14px; font-weight: 800; color: var(--gold); }
.pill { font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, 0.7); background: #33404c; border-radius: 999px; padding: 4px 8px; }
.score-card__total { display: flex; align-items: baseline; gap: 8px; margin-top: 14px; }
.score-card__total strong { font-size: 52px; font-weight: 800; color: var(--gold); line-height: 1; }
.score-card__total span { font-size: 16px; font-weight: 700; color: #bfc5cb; }
.score-card__level { margin-top: 6px !important; font-size: 14px; font-weight: 600; }
.pillar { display: flex; align-items: center; gap: 12px; padding: 3px 0; }
.pillar .ic { width: 15px; height: 15px; color: var(--gold); }
.pillar b { font-size: 15px; font-weight: 700; }
.pillar span { margin-left: auto; font-size: 14px; font-weight: 800; color: #bfc5cb; }
.score-card__divider { height: 1px; background: #3d4954; margin: 12px 0; }
.score-card__sum { display: flex; justify-content: space-between; align-items: center; }
.score-card__sum b { font-size: 13px; font-weight: 700; color: #bfc5cb; letter-spacing: 0.04em; }
.score-card__sum span { font-size: 17px; font-weight: 800; color: var(--gold); }
.score-card__date { margin-top: 8px !important; font-size: 12px; font-weight: 500; color: var(--muted); }

.plan-card {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: 20px;
  background: var(--card);
  border: 1.5px solid var(--gold);
  box-shadow: 0 4px 0 var(--gold);
  padding: 18px;
}
.plan-card strong { font-size: 30px; font-weight: 800; color: var(--gold); white-space: nowrap; }
.plan-card em { display: block; font-style: normal; font-size: 12px; font-weight: 800; color: var(--gold); letter-spacing: 0.04em; }
.plan-card span { display: block; margin-top: 4px; font-size: 14px; font-weight: 600; }

.scale-card { margin-top: 16px; border-radius: 20px; background: var(--card); border: 1.5px solid #333f4c; padding: 18px; }
.scale-card__title { font-size: 13px; font-weight: 800; color: var(--gold); letter-spacing: 0.04em; margin-bottom: 10px; }
.scale-row { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 2px 0; }
.scale-row i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.scale-row b { width: 80px; font-weight: 800; }
.scale-row span { color: var(--muted); font-weight: 500; }

/* ==========================================================================
   Sheets
   ========================================================================== */
.sheet-layer { position: absolute; inset: 0; z-index: 10; }
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.34s ease;
}
.sheet-layer.is-open .sheet-backdrop { opacity: 1; }

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(100% - 62px);
  display: flex;
  flex-direction: column;
  background: var(--sheet);
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  transform: translateY(101%);
  transition: transform 0.44s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
  box-shadow: 0 -2px 24px rgba(0, 0, 0, 0.35);
}
.sheet-layer.is-open .sheet { transform: translateY(0); }
.sheet-layer.is-open .sheet.is-pushed { transform: translateY(-10px) scale(0.962); transform-origin: top center; }
.sheet.is-dragging { transition: none; }
.sheet__grab {
  flex: none;
  height: 22px;
  display: grid;
  place-items: center;
  touch-action: none;
}
.sheet__grab::after {
  content: "";
  width: 38px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.28);
}
.sheet__grab.is-hidden { display: none; }
.sheet__content { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sheet__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 24px 0;
  flex: none;
}
.sheet__title { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.12; }
.sheet__title--sm { font-size: 24px; }
.sheet__close {
  margin-left: auto;
  margin-top: 2px;
  border: 0;
  background: none;
  color: var(--ink);
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  flex: none;
}
.sheet__close .ic { width: 20px; height: 20px; }
.sheet__body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 24px 36px; scrollbar-width: none; }
.sheet__body::-webkit-scrollbar { display: none; }
.sheet__foot { flex: none; }

/* Settings rows */
.srow-list { display: flex; flex-direction: column; }
.srow {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  border: 0;
  background: none;
  color: var(--ink);
  padding: 18px 4px;
  text-align: left;
}
.srow .ic { width: 20px; height: 20px; color: #b4b9be; }
.srow__label { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.srow__chev { margin-left: auto; width: 16px; height: 16px; color: #b4b9be; }
.srow:active { opacity: 0.7; }
.settings-version { text-align: center; font-size: 14px; font-weight: 500; color: #8a9098; padding-top: 26px; }

/* Alerts */
.alert-wrap {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(2px);
  animation: fadeIn 0.18s ease;
}
.alert {
  width: 270px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(44, 46, 51, 0.96);
  backdrop-filter: blur(28px) saturate(160%);
  text-align: center;
  color: #fff;
  animation: alertIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.alert__body { padding: 19px 16px 15px; }
.alert__title { font-size: 17px; font-weight: 700; }
.alert__msg { margin-top: 4px !important; font-size: 13px; font-weight: 400; line-height: 1.35; color: #d6d8dc; }
.alert__actions { display: flex; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.alert__actions button {
  flex: 1;
  border: 0;
  background: none;
  color: #3f8bff;
  font-size: 17px;
  font-weight: 400;
  padding: 12px 6px;
}
.alert__actions button + button { border-left: 1px solid rgba(255, 255, 255, 0.12); }
.alert__actions button.is-strong { font-weight: 600; }
.alert__actions button.is-danger { color: #ff453a; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes alertIn { from { opacity: 0; transform: scale(0.86); } }

/* ==========================================================================
   Plan sheet
   ========================================================================== */
.plan-head { padding: 8px 24px 16px; flex: none; }
.plan-head__top { display: flex; align-items: flex-start; gap: 12px; }
.plan-head h2 { font-size: 34px; font-weight: 800; line-height: 1.06; letter-spacing: -0.02em; }
.plan-objective { display: flex; gap: 12px; margin-top: 20px; }
.plan-objective::before { content: ""; width: 5px; border-radius: 3px; background: #fff; flex: none; }
.plan-objective p { font-size: 17px; font-weight: 600; color: var(--muted); line-height: 1.4; }

.plan-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 24px 160px; scrollbar-width: none; }
.plan-scroll::-webkit-scrollbar { display: none; }

.meal-triangle { display: block; width: 56px; height: 28px; margin: 4px auto; }
img { -webkit-user-drag: none; user-drag: none; }
.meal-card img, .meal-card { -webkit-user-drag: none; }

.meal-carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  cursor: grab;
  scroll-snap-type: x mandatory;
  padding: 4px calc(50% - 130px) 12px;
  scrollbar-width: none;
}
.meal-carousel::-webkit-scrollbar { display: none; }
.meal-carousel.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.meal-carousel.is-dragging .meal-card { pointer-events: none; }
.meal-card {
  flex: none;
  width: 260px;
  height: 300px;
  border-radius: 22px;
  overflow: hidden;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  background: #2a343d;
  border: 0;
  padding: 0;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.25);
}
.meal-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.meal-card__ph { width: 100%; height: 100%; display: grid; place-items: center; color: rgba(255, 255, 255, 0.55); }
.meal-card__ph .ic { width: 48px; height: 48px; }
.meal-name { margin-top: 6px !important; font-size: 22px; font-weight: 800; text-align: center; line-height: 1.2; min-height: 66px; padding: 0 8px; }

.timeline { display: flex; flex-direction: column; }
.ex-row { display: flex; align-items: center; gap: 14px; }
.ex-num {
  width: 44px; height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  background: #364751;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}
.ex-card {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 22px;
  background: #121212;
}
.ex-thumb {
  width: 84px; height: 84px;
  flex: none;
  border-radius: 16px;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.ex-thumb img { width: 70px; height: 70px; object-fit: contain; }
.ex-thumb .ic { width: 32px; height: 32px; color: rgba(0, 0, 0, 0.75); }
.ex-copy { min-width: 0; padding-top: 2px; }
.ex-copy b { display: block; font-size: 15px; font-weight: 800; line-height: 1.25; }
.ex-copy span { display: block; margin-top: 4px; font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, 0.55); line-height: 1.3; }
.ex-link { display: flex; gap: 14px; }
.ex-link::before { content: ""; width: 44px; flex: none; display: grid; place-items: center; }
.ex-link i { display: block; width: 4px; height: 14px; margin: 0 auto; background: #3d4d5a; border-radius: 1px; }
.empty-card {
  border-radius: 22px;
  background: #121212;
  padding: 18px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
}

.plan-bar {
  flex: none;
  background: var(--app-bg);
  border-radius: 28px 28px 0 0;
  padding: 20px 24px 12px;
}
.plan-bar__day { font-size: 14px; font-weight: 500; color: rgba(255, 255, 255, 0.55); padding: 0 4px 14px; }
.plan-bar__row { display: flex; gap: 12px; align-items: flex-start; }

.chip { font-size: 16px; font-weight: 800; color: #fff; padding: 8px 16px; border-radius: 999px; }
.chip--level { background: var(--lime); }
.chip--coins { background: #f7b800; }

/* ==========================================================================
   Streak
   ========================================================================== */
.streak { padding: 8px 24px 34px; }
.streak__fire { width: 60px; height: 60px; margin-bottom: -10px; }
.streak__hero { font-size: 38px; font-weight: 800; line-height: 0.98; letter-spacing: -0.02em; }
.streak__hero em { font-style: normal; color: var(--orange); }
.streak__sub { margin-top: 14px !important; font-size: 15px; font-weight: 500; color: #8a9098; line-height: 1.4; padding-bottom: 8px; }
.cal-head { display: flex; align-items: center; }
.cal-head b { font-size: 18px; font-weight: 500; }
.cal-nav { margin-left: auto; display: flex; gap: 12px; }
.cal-nav button { border: 0; background: none; color: var(--ink); padding: 4px; }
.cal-nav button:disabled { color: rgba(128, 128, 128, 0.3); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; margin-top: 10px; }
.cal__dow { font-size: 14px; font-weight: 500; color: #8a9098; text-align: center; padding-bottom: 8px; }
.cal__day {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: #364751;
}
.cal__day.is-on { background: var(--orange); }
.cal__day.is-empty { visibility: hidden; }

/* ==========================================================================
   Intensity sheet
   ========================================================================== */
.intensity__head { padding: 8px 24px 12px; }
.intensity__title { font-size: 26px; font-weight: 800; }
.intensity__sub { margin-top: 6px !important; font-size: 15px; font-weight: 600; color: var(--muted); }
.intensity__hint { margin-top: 10px !important; font-size: 15px; font-weight: 500; color: var(--muted); }
.recovery-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.recovery-head b { font-size: 16px; font-weight: 800; color: var(--gold); }
.recovery-head button { margin-left: auto; border: 0; background: none; color: var(--muted); font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.recovery-row { display: flex; gap: 12px; padding: 14px; border-radius: 18px; background: #121212; }
.recovery-row + .recovery-row { margin-top: 12px; }
.recovery-row i {
  width: 32px; height: 32px;
  flex: none;
  border-radius: 10px;
  background: #364751;
  color: #fff;
  font-style: normal;
  font-size: 16px;
  font-weight: 800;
  display: grid;
  place-items: center;
  margin-top: 2px;
}
.recovery-row b { display: block; font-size: 16px; font-weight: 800; }
.recovery-row span { display: block; margin-top: 4px; font-size: 14px; font-weight: 500; color: rgba(255, 255, 255, 0.6); line-height: 1.35; }

/* Perfil / progreso */
.field-title { font-size: 15px; font-weight: 700; color: var(--muted); padding: 0 4px; margin-bottom: 8px; }
.profile-chips { display: flex; gap: 16px; margin-top: 18px; }
.profile-chips .chip { font-size: 14px; padding: 8px 14px; }
.empty-state { text-align: center; padding: 40px 20px; border-radius: 22px; background: var(--card); border: 1.5px solid #333f4c; }
.empty-state .ic { width: 44px; height: 44px; color: var(--gold); margin: 0 auto 12px; }
.empty-state h4 { margin: 0 0 6px; font-size: 18px; font-weight: 800; }
.empty-state p { font-size: 15px; color: var(--muted); line-height: 1.4; }
.legal-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  border: 1.5px solid var(--stroke);
  background: var(--card);
  border-radius: 20px;
  padding: 18px;
  color: #fff;
  text-decoration: none;
  margin-top: 12px;
}
.legal-row .ic { width: 20px; height: 20px; color: var(--accent); }
.legal-row b { font-size: 16px; font-weight: 800; }
.legal-row span { margin-left: auto; color: var(--muted); }
.about-copy { font-size: 15px; font-weight: 500; color: var(--muted); line-height: 1.5; }
.about-copy + .about-copy { margin-top: 12px !important; font-size: 14px; }
.center-small { text-align: center; font-size: 14px; color: var(--muted); margin-top: 18px !important; line-height: 1.5; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

@media (max-width: 560px) {
  .stagewrap { padding: 8px 12px 4px; }
}

/* --------------------------------------------------------------------------
   Small layout fixes shared by screens
   -------------------------------------------------------------------------- */
[hidden] { display: none !important; }
.stagewrap { overflow: hidden; }
.signin__body { flex: 1 1 auto; min-height: 0; }

/* ==========================================================================
   Polish pass — Apple HIG behaviours
   · 44pt minimum hit areas, keyboard focus rings, press feedback
   · reduced motion honoured, smooth contained scrolling
   · sheet chrome, page depth
   ========================================================================== */

button, .legal-row {
  -webkit-tap-highlight-color: transparent;
}

/* The simulator behaves like native UI: no text selection, no image callout. */
.screen, .screen * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.screen input, .screen textarea {
  -webkit-user-select: text;
  user-select: text;
}
button { touch-action: manipulation; }

:focus { outline: none; }
:focus-visible {
  outline: 2.5px solid #5fb0ff;
  outline-offset: 3px;
  border-radius: 8px;
}

/* Press feedback: the 3D faces sink into their edge. */
.btn3d__face { transition: transform 0.16s cubic-bezier(0.22, 0.8, 0.3, 1), filter 0.16s ease; }
.btn3d:disabled .btn3d__face { transition: none; }

.opt__face, .srow, .legal-row, .cal-nav button, .sheet__close {
  transition: transform 0.16s cubic-bezier(0.22, 0.8, 0.3, 1), background-color 0.16s ease, opacity 0.16s ease;
}
.opt:active .opt__face { transform: translateY(2px) scale(0.995); }
.srow:active, .legal-row:active, .cal-nav button:active { transform: scale(0.985); }
.sheet__close:active { transform: scale(0.9); opacity: 0.7; }

@media (hover: hover) and (pointer: fine) {
  .btn3d:not(:disabled):hover .btn3d__face { filter: brightness(1.06); }
  .opt:not(:disabled):hover .opt__face { background: #26313d; }
  .srow:hover, .legal-row:hover { background: rgba(255, 255, 255, 0.035); }
  .meal-card:hover { filter: brightness(1.04); }
}

/* Contained, momentum-preserving scroll areas. */
.sheet__body, .plan-scroll, .meal-carousel {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.sheet__body, .plan-scroll { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.12) transparent; }

/* Sheet chrome: hairline highlight, deeper shadow, room for the home bar. */
.sheet {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 -40px 70px rgba(0, 0, 0, 0.55);
}
.sheet[data-detent="auto"] { height: auto; max-height: calc(100% - 62px); }
.sheet[data-detent="auto"] .sheet__content { flex: 0 1 auto; }
.sheet__grab { height: 26px; }
.sheet__grab::after { background: rgba(255, 255, 255, 0.32); }
.plan-bar { padding-bottom: 30px; }
.sheet__foot { padding-bottom: 6px; }

/* Page depth behind the phone. */
body {
  background:
    radial-gradient(1100px 760px at 50% 8%, #15181d 0%, #0a0b0c 46%, #000 100%),
    #000;
}
.stagewrap { position: relative; }
.stagewrap::before {
  content: "";
  position: absolute;
  width: min(680px, 82vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(122, 150, 184, 0.18), transparent 64%);
  filter: blur(34px);
  pointer-events: none;
  z-index: 0;
}
.stage { z-index: 1; }

@media (prefers-reduced-motion: reduce) {
  .sheet { transition-duration: 0.001ms !important; }
  .pitch-track { transition: none !important; }
}

html, body { overscroll-behavior: none; }

/* 44pt hit targets for the small chrome icons. */
.sheet__close, .cal-nav button { position: relative; }
.sheet__close::after, .cal-nav button::after {
  content: "";
  position: absolute;
  inset: -8px;
}

.sheet__foot .btn3d { margin-top: 18px; }
.plan-bar .btn3d { margin-top: 0; }
.quiz__progress { min-width: 0; }
.opt__face span { min-width: 0; }
.ex-copy { flex: 1; }
.cal__day { font-size: 14px; }
