:root { --c: #B33F40; --c2: #E8C07D; --bg: #1E1414; --ink: #2a1414; --mut: #6b5048; --paper: #fff8ec; --sat: env(safe-area-inset-top, 0px); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); font-family: "Be Vietnam Pro", system-ui, sans-serif; color: var(--ink); overscroll-behavior: none; }
canvas#c { position: fixed; inset: 0; touch-action: none; display: block; }
#menu { position: fixed; inset: 0; z-index: 20; display: none; overflow-y: auto; -webkit-overflow-scrolling: touch; }
#menu.on { display: block; }
button { font: inherit; cursor: pointer; color: inherit; }
button:disabled { cursor: default; opacity: .5; }

.home { min-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: calc(var(--sat) + 70px) 16px 32px; max-width: 520px; margin: 0 auto;
  background: linear-gradient(180deg, rgba(30,10,10,0) 0%, rgba(30,10,10,0) 30%, rgba(30,10,10,.55) 52%, rgba(30,10,10,.82) 100%); }
.logo { text-align: center; color: #fff; text-shadow: 0 4px 18px rgba(60,0,0,.45); margin-bottom: 30vh; }
.logo h1 { margin: 0; font-size: clamp(48px, 14vw, 72px); font-weight: 900; letter-spacing: -1px; line-height: 1; color: #fff7e0; -webkit-text-stroke: 2px rgba(120,20,20,.55); }
.logo p { margin: 6px 0 0; font-weight: 800; font-size: 17px; }
.me { width: 100%; background: var(--paper); border-radius: 18px; padding: 12px 16px; border-left: 8px solid var(--z); box-shadow: 0 6px 18px rgba(0,0,0,.2); display: flex; flex-direction: column; }
.me b { font-size: 17px; }
.me span { color: var(--mut); font-weight: 700; font-size: 14px; }
.me em { font-style: normal; color: var(--c); font-weight: 900; }
.btn { display: block; width: 100%; min-height: 52px; border: 0; border-radius: 18px; background: var(--paper); font-weight: 800; font-size: 17px; margin: 6px 0; box-shadow: 0 6px 18px rgba(0,0,0,.2); padding: 8px 14px; }
.btn.main { background: linear-gradient(180deg, #d9534f, var(--c)); color: #fff; box-shadow: 0 8px 22px rgba(179,63,64,.45); }
.btn.big { min-height: 76px; font-size: 25px; font-weight: 900; }
.btn.big small { display: block; font-size: 14px; font-weight: 700; opacity: .92; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.tile { border: 0; border-radius: 18px; background: rgba(255,248,236,.95); padding: 12px; text-align: left; min-height: 88px; box-shadow: 0 6px 18px rgba(0,0,0,.18); display: flex; flex-direction: column; gap: 3px; border-top: 5px solid var(--c2); }
.tile b { font-size: 16px; }
.tile small { color: var(--mut); font-weight: 700; font-size: 13px; }
.link { border: 0; background: rgba(255,248,236,.86); border-radius: 14px; min-height: 48px; padding: 10px 16px; font-weight: 800; width: 100%; }
.foot { color: #fff; font-size: 13px; text-align: center; opacity: .85; }
.foot a { color: #fff; }

.page { max-width: 640px; margin: 0 auto; padding: calc(var(--sat) + 70px) 16px 40px; min-height: 100%; background: rgba(255,246,232,.97); }
.top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.top h2 { margin: 0; font-size: 25px; font-weight: 900; }
.back { border: 0; background: #fff; border-radius: 14px; min-height: 44px; padding: 0 14px; font-weight: 800; box-shadow: 0 3px 10px rgba(0,0,0,.1); white-space: nowrap; }
.mut { color: var(--mut); font-size: 14px; font-weight: 600; margin: 4px 0 12px; line-height: 1.5; }
h3 { margin: 18px 0 8px; font-size: 18px; }
.por { width: 96px; height: 96px; border-radius: 22px; flex: none; background: #f3e3cc; }
.por.sm { width: 64px; height: 64px; border-radius: 16px; }
.schs { display: flex; flex-direction: column; gap: 12px; }
.sch { display: flex; gap: 12px; background: #fff; border-radius: 22px; padding: 12px; border-left: 8px solid var(--z); box-shadow: 0 6px 18px rgba(60,20,10,.08); align-items: flex-start; }
.sch > div { flex: 1; min-width: 0; }
.sch b { font-size: 19px; color: var(--z); display: block; }
.sch small { color: var(--mut); font-weight: 800; font-size: 13px; display: block; }
.sch p { margin: 6px 0; font-size: 14px; font-weight: 600; line-height: 1.45; }
.sch p.pas { background: #fff6e3; border-radius: 12px; padding: 6px 10px; color: #7a4a20; font-size: 13px; }
.sch .btn { margin-top: 8px; min-height: 48px; }
.stages { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.stg { border: 0; background: #fff; border-radius: 18px; padding: 10px; display: flex; gap: 10px; align-items: center; text-align: left; box-shadow: 0 4px 12px rgba(60,20,10,.07); min-height: 84px; }
.stg.now { outline: 3px solid var(--c); }
.stg.lock { opacity: .55; }
.stg span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.stg small { color: var(--c); font-weight: 900; font-size: 12px; }
.stg b { font-size: 17px; }
.stg i { font-style: normal; color: var(--mut); font-weight: 700; font-size: 13px; }
.stg em { font-style: normal; font-size: 12px; color: #7a5a40; font-weight: 600; margin-top: 2px; }
.stg strong { color: #d79400; font-size: 18px; letter-spacing: 1px; white-space: nowrap; }
.tabs { display: flex; gap: 6px; margin: 4px 0 10px; overflow-x: auto; }
.tab { border: 2px solid var(--z); background: #fff; color: var(--z); border-radius: 14px; min-height: 44px; padding: 0 4px; font-weight: 900; font-size: 15px; flex: 1 1 0; min-width: 0; white-space: nowrap; }
.tab.on { background: var(--z); color: #fff; }
.ups { display: flex; flex-direction: column; gap: 8px; }
.up { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 18px; padding: 10px 12px; box-shadow: 0 4px 12px rgba(60,20,10,.06); }
.up > i { font-style: normal; color: #fff; font-weight: 900; font-size: 12px; min-width: 64px; text-align: center; border-radius: 12px; padding: 8px 4px; }
.up > div { flex: 1; min-width: 0; }
.up b { display: block; font-size: 16px; }
.up small { display: block; color: var(--mut); font-weight: 600; font-size: 13px; line-height: 1.4; }
.up .btn { width: auto; min-width: 100px; margin: 0; min-height: 46px; font-size: 14px; padding: 6px 10px; }
.up .ok { color: #1f8f55; font-weight: 900; font-size: 14px; white-space: nowrap; }
.up .nd { color: var(--mut); font-weight: 800; font-size: 13px; white-space: nowrap; }
.pips { display: flex; gap: 4px; margin-top: 4px; }
.pips u { width: 18px; height: 8px; border-radius: 4px; background: #eadbc6; }
.pips u.on { background: #f0a020; }
.opps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.opps > div { display: flex; flex-direction: column; align-items: center; text-align: center; }
.opps .por.sm { width: 100%; height: auto; aspect-ratio: 1; }
.opps small { color: var(--c); font-weight: 900; font-size: 11px; margin-top: 3px; }
.opps b { font-size: 12px; line-height: 1.2; }
.triad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 12px; }
.triad > div { background: #fff; border-radius: 16px; padding: 10px 8px; border-top: 6px solid var(--z); text-align: center; box-shadow: 0 4px 12px rgba(60,20,10,.06); }
.triad b { display: block; color: var(--z); font-size: 16px; }
.triad small { color: var(--mut); font-weight: 700; font-size: 12px; line-height: 1.35; display: block; margin-top: 2px; }
.help { padding-left: 20px; }
.help li { margin: 8px 0; line-height: 1.5; font-weight: 600; color: #4a2e28; }
.ov { min-height: 100%; display: grid; place-items: center; padding: 16px; background: rgba(30,10,10,.55); backdrop-filter: blur(3px); }
.panel { width: 100%; max-width: 440px; background: var(--paper); border-radius: 26px; padding: 20px; text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.4); }
.panel h2 { margin: 0 0 4px; font-size: 26px; font-weight: 900; }
