@font-face { font-family: 'Teko'; src: url('fonts/Teko.woff2') format('woff2'); font-weight: 300 700; font-display: block; }
@font-face { font-family: 'Rajdhani'; src: url('fonts/Rajdhani-Medium.woff2') format('woff2'); font-weight: 500; font-display: block; }
@font-face { font-family: 'Rajdhani'; src: url('fonts/Rajdhani-Bold.woff2') format('woff2'); font-weight: 700; font-display: block; }

:root {
  --steel: #14171c; --steel2: #1d2128; --steel3: #2a2f38; --line: #3b424e;
  --yellow: #ffc21a; --orange: #ff6a13; --teal: #1fd6c2; --red: #ff3b30; --white: #eef2f5; --dim: #9aa4b1;
  --sat: env(safe-area-inset-top, 0px); --sar: env(safe-area-inset-right, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--steel); color: var(--white); font-family: 'Rajdhani', system-ui, sans-serif; font-weight: 500; touch-action: none; user-select: none; -webkit-user-select: none; overscroll-behavior: none; }
canvas#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
h1, h2, h3, .teko { font-family: 'Teko', sans-serif; font-weight: 600; margin: 0; line-height: 1; letter-spacing: 0.02em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }

#boot { position: fixed; inset: 0; z-index: 60; background: var(--steel); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; transition: opacity 0.35s; }
.boot-title { font-family: 'Teko', sans-serif; font-weight: 700; font-size: clamp(40px, 9vw, 96px); color: var(--white); letter-spacing: 0.03em; line-height: 1; }
.boot-bar { width: min(420px, 70vw); height: 10px; background: var(--steel3); border-radius: 2px; overflow: hidden; }
#boot-fill { height: 100%; width: 0; background: var(--orange); transition: width 0.2s; }

#ui { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
#ui > * { pointer-events: auto; }
.screen { position: absolute; inset: 0; padding: calc(16px + var(--sat)) calc(18px + var(--sar)) calc(16px + var(--sab)) calc(18px + var(--sal)); display: flex; flex-direction: column; }
.screen.pass { pointer-events: none; }
.screen.pass > * { pointer-events: auto; }

button { font-family: 'Teko', sans-serif; font-weight: 600; font-size: 24px; line-height: 1; letter-spacing: 0.04em; color: var(--white); background: var(--steel3); border: 1px solid var(--line); border-radius: 4px; padding: 11px 18px 8px; cursor: pointer; touch-action: manipulation; min-height: 44px; transition: background 0.12s, transform 0.08s, border-color 0.12s; text-transform: uppercase; }
button:hover { background: #363d48; border-color: #566070; }
button:active { transform: translateY(1px); }
button:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
button:disabled { opacity: 0.42; cursor: default; }
button.primary { background: var(--orange); border-color: #ff8a44; color: #16100b; }
button.primary:hover { background: #ff7f33; }
button.yellow { background: var(--yellow); border-color: #ffd65c; color: #16130a; }
button.yellow:hover { background: #ffd04d; }
button.small { font-size: 19px; padding: 8px 12px 5px; min-height: 38px; white-space: nowrap; }
button.icon { width: 44px; height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: rgba(20, 23, 28, 0.72); }
button svg { display: block; }

.panel { background: rgba(20, 23, 28, 0.93); border: 1px solid var(--line); border-radius: 6px; }
.scrap { font-family: 'Teko', sans-serif; font-weight: 600; font-size: 28px; color: var(--yellow); display: inline-flex; align-items: center; gap: 6px; line-height: 1; white-space: nowrap; }

/* Title */
.title { align-items: flex-start; justify-content: flex-end; background: linear-gradient(90deg, rgba(10, 11, 14, 0.82) 0%, rgba(10, 11, 14, 0.25) 46%, rgba(10, 11, 14, 0) 62%); }
.logo { font-family: 'Teko', sans-serif; font-weight: 700; font-size: clamp(64px, 11vw, 132px); line-height: 0.82; color: var(--white); margin: 0; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.6); }
.logo em { display: block; font-style: normal; color: var(--orange); }
.tag { font-size: clamp(17px, 2.2vw, 24px); color: var(--dim); font-weight: 700; margin: 8px 0 20px; }
.menu { display: flex; flex-direction: column; gap: 8px; width: min(320px, 44vw); }
.menu button { width: 100%; text-align: left; font-size: 28px; }

.title { padding-bottom: calc(38px + var(--sab)); }
.corner { position: absolute; bottom: calc(8px + var(--sab)); font-size: 15px; font-weight: 700; color: var(--dim); text-decoration: none; padding: 4px 6px; touch-action: manipulation; text-shadow: 0 1px 2px #000; }
.corner:hover { color: var(--white); }
.corner.left { left: calc(14px + var(--sal)); }
.corner.right { right: calc(14px + var(--sar)); }

/* Modal */
.modal { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(6, 7, 9, 0.7); padding: calc(10px + var(--sat)) calc(10px + var(--sar)) calc(10px + var(--sab)) calc(10px + var(--sal)); z-index: 30; }
.modal .box { width: min(720px, 100%); max-height: 100%; overflow-y: auto; touch-action: pan-y; padding: 20px 24px; display: flex; flex-direction: column; gap: 12px; background: rgba(20, 23, 28, 0.985); }
.modal h2 { font-size: 44px; color: var(--yellow); }
.modal h3 { font-size: 27px; color: var(--white); margin-top: 6px; }
.modal p, .modal li { font-size: 18px; line-height: 1.3; color: #d7dde3; }
.modal ul { margin: 0; padding-left: 20px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.keys span { text-wrap: balance; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; font-size: 18px; }
.keys b { font-family: 'Teko', sans-serif; font-weight: 600; font-size: 21px; color: var(--yellow); line-height: 1.2; }
.setrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--steel3); font-size: 19px; font-weight: 700; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: var(--steel2); font-size: 19px; padding: 8px 12px 5px; min-height: 38px; }
.seg button.on { background: var(--orange); color: #16100b; }

/* Contract */
.contract { align-items: center; justify-content: center; background: rgba(6, 7, 9, 0.62); }
.contract .box { width: min(560px, 100%); padding: 20px 24px; display: flex; flex-direction: column; gap: 10px; max-height: 100%; overflow-y: auto; touch-action: pan-y; background: rgba(20, 23, 28, 0.985); }
.contract h2 { font-size: 46px; color: var(--yellow); }
.contract p { font-size: 19px; line-height: 1.28; }
.contract label { font-weight: 700; color: var(--dim); font-size: 16px; text-transform: uppercase; letter-spacing: 0.06em; }
input[type=text] { font-family: 'Teko', sans-serif; font-weight: 600; font-size: 30px; color: var(--white); background: var(--steel); border: 1px solid var(--line); border-radius: 4px; padding: 6px 10px 2px; width: 100%; outline: none; text-transform: uppercase; user-select: text; -webkit-user-select: text; touch-action: manipulation; }
input[type=text]:focus { border-color: var(--yellow); }

/* Garage */
.garage { padding: 0; }
.g-top { position: absolute; top: calc(10px + var(--sat)); left: calc(14px + var(--sal)); right: calc(14px + var(--sar)); display: flex; justify-content: space-between; align-items: center; gap: 8px; pointer-events: none; }
.g-top > * { pointer-events: auto; }
.g-side { position: absolute; top: calc(62px + var(--sat)); bottom: calc(12px + var(--sab)); left: calc(14px + var(--sal)); width: min(470px, 52vw); display: flex; flex-direction: column; }
.tabs { display: flex; gap: 4px; flex: 0 0 auto; padding: 6px 6px 0; }
.tabs button { flex: 1; font-size: 22px; padding: 8px 4px 5px; border-radius: 4px 4px 0 0; background: var(--steel2); border-color: var(--steel3); min-height: 40px; position: relative; }
.tabs button.on { background: var(--orange); color: #16100b; border-color: var(--orange); }
.tabs button.pulse::after { content: ''; position: absolute; top: 5px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--yellow); animation: pulse 0.9s infinite; }
@keyframes pulse { 50% { opacity: 0.25; transform: scale(0.7); } }
.tabbody { flex: 1 1 auto; min-height: 0; overflow-y: auto; touch-action: pan-y; padding: 8px 10px 10px; -webkit-overflow-scrolling: touch; }
.g-stats { position: absolute; top: calc(62px + var(--sat)); right: calc(14px + var(--sar)); width: min(240px, 28vw); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.g-stats h3 { font-size: 25px; color: var(--white); white-space: nowrap; }
.bar-row { font-size: 15px; font-weight: 700; color: var(--dim); display: flex; flex-direction: column; gap: 1px; }
.bar-row .lab { display: flex; justify-content: space-between; }
.bar-row .lab b { color: var(--white); font-weight: 700; }
.bar-row .lab b.up { color: var(--teal); }
.bar-row .lab b.down { color: var(--red); }
.bar { height: 6px; background: var(--steel3); border-radius: 1px; overflow: hidden; position: relative; }
.bar i { display: block; height: 100%; background: var(--orange); }
.bar.over i { background: var(--red); }
.g-go { position: absolute; bottom: calc(12px + var(--sab)); right: calc(14px + var(--sar)); display: flex; flex-direction: column; align-items: flex-end; gap: 4px; max-width: 42vw; }
.g-go .next { font-weight: 700; font-size: 17px; text-align: right; background: rgba(20, 23, 28, 0.85); padding: 3px 8px; border-radius: 3px; }
.g-go .next b { color: var(--yellow); font-weight: 700; }
.g-go button { font-size: 34px; padding: 13px 26px 9px; }

.slot, .item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; background: var(--steel2); border: 1px solid var(--steel3); border-radius: 5px; margin-bottom: 5px; cursor: pointer; width: 100%; text-align: left; font-family: 'Rajdhani', sans-serif; font-size: 17px; font-weight: 500; text-transform: none; letter-spacing: 0; min-height: 56px; line-height: 1.1; }
.slot:hover, .item:hover { background: var(--steel3); }
.slot.new { border-color: var(--teal); }
.thumb { width: 46px; height: 46px; flex: 0 0 46px; object-fit: contain; background: #0c0e11; border-radius: 3px; display: block; }
.thumb.empty { display: flex; align-items: center; justify-content: center; color: #4a5260; }
.info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.info .kind { font-size: 13px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: 0.06em; }
.info .nm { font-family: 'Teko', sans-serif; font-weight: 600; font-size: 22px; color: var(--white); line-height: 1; }
.info .sub { font-size: 15px; color: var(--dim); line-height: 1.1; text-wrap: balance; }
.mk { font-family: 'Teko', sans-serif; font-weight: 600; font-size: 17px; padding: 1px 5px 0; border-radius: 2px; background: var(--steel3); color: var(--dim); line-height: 1.15; display: inline-block; white-space: nowrap; }
.mk.m2 { background: #123f3b; color: var(--teal); }
.mk.m3 { background: linear-gradient(120deg, #cfd4db, #ffffff 45%, #9aa3ad); color: #14171c; }
.tagnew { font-family: 'Teko', sans-serif; font-weight: 600; font-size: 16px; background: var(--teal); color: #052320; padding: 1px 5px 0; border-radius: 2px; line-height: 1.15; display: inline-block; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { display: flex; align-items: center; gap: 6px; width: calc(50% - 3px); padding: 4px 6px; background: var(--steel2); border: 1px solid var(--steel3); border-radius: 5px; font-family: 'Rajdhani', sans-serif; font-size: 14px; text-transform: none; letter-spacing: 0; text-align: left; font-weight: 500; line-height: 1.05; min-height: 52px; }
.chip.on { border-color: var(--yellow); background: #2d2916; }
.chip img { width: 36px; height: 36px; flex: 0 0 36px; }
.chip b { display: block; font-family: 'Teko', sans-serif; font-weight: 600; font-size: 19px; line-height: 1; color: var(--white); }
.sec { font-family: 'Teko', sans-serif; font-weight: 600; font-size: 23px; color: var(--yellow); margin: 8px 0 4px; line-height: 1; }
.note { font-size: 15px; color: var(--dim); line-height: 1.18; text-wrap: balance; }
.price { font-family: 'Teko', sans-serif; font-weight: 600; font-size: 22px; color: var(--yellow); white-space: nowrap; }
.price.cant { color: #7f6a2f; }
.subtabs { display: flex; gap: 4px; margin-bottom: 6px; }
.subtabs button { font-size: 19px; padding: 7px 14px 4px; min-height: 36px; }
.subtabs button.on { background: var(--white); color: var(--steel); }
.swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.swatch { width: 100%; height: 32px; min-height: 32px; padding: 0; border-radius: 4px; border: 1px solid #66707e; }
.swatch:hover { border-color: #66707e; }
.swatch.on, .swatch.on:hover { border: 3px solid var(--white); box-shadow: 0 0 0 1px #000 inset; }
.opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.opts button { font-size: 18px; padding: 7px 10px 4px; min-height: 36px; }
.opts button.on { background: var(--yellow); color: #16130a; }
.ladder-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; background: var(--steel2); border: 1px solid var(--steel3); border-radius: 5px; margin-bottom: 4px; min-height: 50px; }
.ladder-row.cur { border-color: var(--yellow); }
.ladder-row.locked { opacity: 0.5; }
.ladder-row .nm { font-family: 'Teko', sans-serif; font-weight: 600; font-size: 22px; line-height: 1; }
.ladder-row .drv { font-size: 15px; color: var(--dim); line-height: 1.1; }
.ladder-row .num { font-family: 'Teko', sans-serif; font-weight: 600; font-size: 22px; color: var(--dim); width: 24px; text-align: center; }
.ladder-row .fill { flex: 1; min-width: 0; }

/* Pre-fight */
.prefight { justify-content: flex-end; background: linear-gradient(0deg, rgba(8, 9, 11, 0.92) 0%, rgba(8, 9, 11, 0.4) 32%, rgba(8, 9, 11, 0) 50%); }
.pf-top { position: absolute; top: calc(12px + var(--sat)); left: 0; right: 0; text-align: center; pointer-events: none; }
.pf-top .arena { font-family: 'Teko', sans-serif; font-weight: 600; font-size: clamp(30px, 6vw, 56px); line-height: 1; text-shadow: 0 2px 8px #000; }
.pf-top .lg { font-weight: 700; color: var(--yellow); font-size: clamp(14px, 2.3vw, 19px); text-transform: uppercase; letter-spacing: 0.08em; text-shadow: 0 1px 4px #000; }
.pf-bot { display: flex; gap: 14px; align-items: flex-end; flex-wrap: nowrap; background: rgba(10, 11, 14, 0.86); padding: 8px 10px; border-radius: 6px; }
.pf-bot .port { width: clamp(70px, 13vw, 128px); height: clamp(70px, 13vw, 128px); flex: 0 0 auto; border-radius: 4px; border: 2px solid var(--line); object-fit: cover; }
.pf-bot .who { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.who .rname { font-family: 'Teko', sans-serif; font-weight: 700; font-size: clamp(30px, 5.5vw, 54px); line-height: 0.95; color: var(--red); }
.who .rdrv { font-size: clamp(14px, 2vw, 18px); color: var(--dim); font-weight: 700; }
.who .talk { font-size: clamp(16px, 2.3vw, 22px); font-style: italic; line-height: 1.1; text-wrap: balance; }
.who .hint { font-size: clamp(14px, 2vw, 18px); color: var(--teal); line-height: 1.1; font-weight: 700; text-wrap: balance; }
.pf-btn { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
.pf-btn button.yellow { font-size: 38px; padding: 12px 34px 8px; }

/* HUD */
#hud { background: linear-gradient(180deg, rgba(8,9,11,0.55), rgba(8,9,11,0)); padding-bottom: 8px !important; position: fixed; left: 0; right: 0; top: 0; z-index: 10; pointer-events: none; padding: calc(8px + var(--sat)) calc(12px + var(--sar)) 0 calc(12px + var(--sal)); }
.hudrow { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: start; }
.hp { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hp.right { align-items: flex-end; }
.hp .nm { font-family: 'Teko', sans-serif; font-weight: 600; font-size: 22px; line-height: 1; text-shadow: 0 1px 3px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.hpbar { width: 100%; height: 13px; background: rgba(10, 11, 14, 0.8); border: 1px solid #4b5360; border-radius: 2px; overflow: hidden; position: relative; }
.hpbar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(180deg, #ffd65c, #ff9b1a); }
.hpbar u { position: absolute; left: 0; top: 0; bottom: 0; background: #fff; opacity: 0.55; }
.hp.right .hpbar i, .hp.right .hpbar u { left: auto; right: 0; }
.hp.right .hpbar i { background: linear-gradient(180deg, #ff6a5e, #d81e2c); }
.timer { font-family: 'Teko', sans-serif; font-weight: 700; font-size: 44px; line-height: 1; padding-top: 4px; text-align: center; min-width: 72px; text-shadow: 0 2px 4px #000; }
.timer.low { color: var(--red); }
.signal { display: flex; gap: 2px; justify-content: center; align-items: flex-end; height: 11px; margin-top: 1px; }
.signal i { width: 4px; background: var(--teal); }
.gauges { display: flex; gap: 8px; margin-top: 4px; align-items: center; font-weight: 700; font-size: 15px; flex-wrap: wrap; }
.gauge { display: flex; align-items: center; gap: 5px; text-shadow: 0 1px 2px #000; white-space: nowrap; }
.gauge .g { width: 70px; height: 7px; background: rgba(10, 11, 14, 0.8); border: 1px solid #4b5360; border-radius: 1px; overflow: hidden; }
.gauge .g i { display: block; height: 100%; background: var(--teal); }
.gauge .g i.hot { background: var(--orange); }
.hud-btns { position: absolute; top: calc(52px + var(--sat)); right: calc(12px + var(--sar)); display: flex; gap: 8px; pointer-events: auto; }
#prompt { position: fixed; left: 50%; bottom: calc(14px + var(--sab)); transform: translateX(-50%); z-index: 12; font-family: 'Teko', sans-serif; font-weight: 600; font-size: clamp(22px, 3.4vw, 34px); line-height: 1.05; color: var(--yellow); background: rgba(10, 11, 14, 0.86); padding: 7px 14px 3px; border-radius: 5px; pointer-events: none; text-align: center; max-width: 60vw; width: max-content; text-wrap: balance; }
#prompt:empty { display: none; }
.big { position: fixed; inset: 0; z-index: 14; display: flex; align-items: center; justify-content: center; pointer-events: none; font-family: 'Teko', sans-serif; font-weight: 700; font-size: clamp(70px, 18vw, 190px); color: var(--white); text-shadow: 0 5px 0 rgba(0, 0, 0, 0.7), 0 0 40px rgba(255, 106, 19, 0.5); }
.big.pop { animation: pop 0.7s ease-out both; }
@keyframes pop { 0% { transform: scale(1.5); opacity: 0; } 18% { transform: scale(1); opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
.callout { position: fixed; left: 50%; top: 18%; transform: translateX(-50%); z-index: 13; font-family: 'Teko', sans-serif; font-weight: 700; font-size: clamp(30px, 6vw, 58px); color: var(--orange); text-shadow: 0 3px 0 #000; animation: callout 0.9s ease-out both; pointer-events: none; white-space: nowrap; }
@keyframes callout { 0% { transform: translateX(-50%) scale(1.4); opacity: 0; } 15% { transform: translateX(-50%) scale(1); opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }
#numbers { position: fixed; inset: 0; z-index: 9; pointer-events: none; overflow: hidden; }
.num { position: absolute; font-family: 'Teko', sans-serif; font-weight: 700; font-size: 28px; color: var(--white); text-shadow: 0 2px 0 #000; animation: num 0.75s ease-out both; line-height: 1; will-change: transform; }
.num.big { position: absolute; inset: auto; display: block; font-size: 44px; color: var(--yellow); }
.num.me { color: #ff8f85; }
@keyframes num { 0% { transform: translate(-50%, 0) scale(1.3); opacity: 1; } 100% { transform: translate(-50%, -46px) scale(1); opacity: 0; } }
#static { position: fixed; inset: 0; z-index: 8; pointer-events: none; opacity: 0; background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.14) 0 2px, rgba(0, 0, 0, 0.25) 2px 4px); mix-blend-mode: normal; display: flex; align-items: center; justify-content: center; font-family: 'Teko', sans-serif; font-weight: 700; font-size: clamp(40px, 9vw, 90px); color: var(--red); text-shadow: 0 2px 0 #000; }
#static.on { opacity: 1; animation: jit 0.12s steps(2) infinite; }
@keyframes jit { 50% { background-position: 0 3px; } }
.arrow { position: fixed; z-index: 9; width: 0; height: 0; border-left: 11px solid transparent; border-right: 11px solid transparent; border-bottom: 20px solid var(--red); pointer-events: none; filter: drop-shadow(0 1px 1px #000); }

/* Touch */
#touch { position: fixed; inset: 0; z-index: 11; pointer-events: none; }
.tbtn { position: absolute; border-radius: 50%; background: rgba(20, 23, 28, 0.45); border: 2px solid rgba(238, 242, 245, 0.5); display: flex; align-items: center; justify-content: center; color: var(--white); pointer-events: auto; font-family: 'Teko', sans-serif; font-weight: 600; touch-action: none; text-align: center; line-height: 0.95; }
.tbtn.on { background: var(--orange); border-color: #fff; color: #16100b; }
.tbtn.cool { opacity: 0.5; }
.tbtn.fire { width: 96px; height: 96px; right: calc(76px - 48px + var(--sar)); bottom: calc(76px - 48px + var(--sab)); font-size: 25px; background: rgba(255, 106, 19, 0.38); }
.tbtn.top { width: 72px; height: 72px; right: calc(176px - 36px + var(--sar)); bottom: calc(76px - 36px + var(--sab)); font-size: 20px; }
.tbtn.lock { width: 64px; height: 64px; right: calc(147px - 32px + var(--sar)); bottom: calc(147px - 32px + var(--sab)); font-size: 20px; }
.tbtn.power { width: 72px; height: 72px; right: calc(76px - 36px + var(--sar)); bottom: calc(176px - 36px + var(--sab)); font-size: 20px; }
.stickzone { position: absolute; left: 0; top: 56px; bottom: 0; width: 40%; pointer-events: auto; touch-action: none; }
.stick { position: absolute; width: 130px; height: 130px; border-radius: 50%; border: 2px solid rgba(238, 242, 245, 0.45); background: rgba(20, 23, 28, 0.25); transform: translate(-50%, -50%); pointer-events: none; opacity: 0.35; transition: opacity 0.15s; }
.stick.on { opacity: 0.9; }
.knob { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: rgba(238, 242, 245, 0.6); }

/* Result, Salvage, Promotion, Victory */
.center { align-items: center; justify-content: center; text-align: center; background: rgba(6, 7, 9, 0.66); gap: 10px; }
.center h2 { font-size: clamp(48px, 10vw, 96px); }
.center h2.lost { color: var(--red); }
.center h2.won { color: var(--yellow); }
.center p { font-size: clamp(16px, 2.3vw, 22px); }
.salvage { padding-top: calc(10px + var(--sat)); background: linear-gradient(0deg, rgba(8, 9, 11, 0.9) 0%, rgba(8, 9, 11, 0.55) 55%, rgba(8, 9, 11, 0.05) 100%); justify-content: flex-end; }
.sv-head { position: absolute; top: calc(10px + var(--sat)); left: calc(18px + var(--sal)); right: calc(18px + var(--sar)); display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; pointer-events: none; }
.sv-head h2 { padding-top: 6px; font-size: clamp(38px, 7vw, 64px); color: var(--yellow); text-shadow: 0 2px 6px #000; }
.sv-head .note { font-size: clamp(15px, 2vw, 19px); color: var(--white); font-weight: 700; text-shadow: 0 1px 4px #000; }
.sv-side { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; font-size: 16px; font-weight: 700; text-shadow: 0 1px 3px #000; text-align: right; flex-shrink: 0; white-space: nowrap; }
.cards { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 6px; touch-action: pan-x; flex: 0 0 auto; }
.cards.more { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.card { flex: 0 0 auto; width: 176px; background: rgba(29, 33, 40, 0.97); border: 1px solid var(--line); border-radius: 6px; padding: 7px 8px 8px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; font-family: 'Rajdhani', sans-serif; text-transform: none; letter-spacing: 0; text-align: left; font-weight: 500; font-size: 15px; line-height: 1.08; color: var(--white); }
.card:hover { background: var(--steel3); }
.card.fresh { border-color: var(--teal); }
.card.picked { border-color: var(--yellow); background: #2d2916; }
.card .head { display: flex; gap: 6px; align-items: center; }
.card .nm { font-family: 'Teko', sans-serif; font-weight: 600; font-size: 21px; line-height: 1; }
.card .cdesc { font-size: 13px; color: #cfd6dd; line-height: 1.08; text-wrap: balance; }
.card .stat { font-size: 14px; color: var(--dim); font-weight: 700; display: flex; justify-content: space-between; gap: 6px; }
.card .stat b { color: var(--white); font-weight: 700; }
.card .stat b.up { color: var(--teal); }
.card .stat b.down { color: #ff8f85; }
.sv-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex: 0 0 auto; flex-wrap: wrap; }
.badge { width: clamp(80px, 16vw, 130px); height: clamp(80px, 16vw, 130px); }
.spoils { font-size: 16px; line-height: 1.2; max-height: 34vh; overflow-y: auto; touch-action: pan-y; width: min(560px, 90vw); text-align: left; columns: 2; column-gap: 18px; }
.spoils div { break-inside: avoid; }
.spoils b { color: var(--yellow); font-weight: 700; }

#rotate { position: fixed; inset: 0; z-index: 70; background: var(--steel); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; padding: 30px; font-size: 22px; font-weight: 700; }

/* Short phone screens */
@media (max-height: 460px) {
  .logo { font-size: clamp(42px, 15.5vh, 76px); }
  .title { justify-content: center; padding-bottom: calc(24px + var(--sab)); }
  .corner { font-size: 13px; bottom: calc(1px + var(--sab)); }
  .tag { margin: 4px 0 8px; font-size: 16px; }
  .title .menu { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; width: min(390px, 56vw); }
  .menu { gap: 5px; }
  .menu button { font-size: 21px; padding: 7px 10px 4px; min-height: 38px; }
  .modal .menu { display: grid; grid-template-columns: 1fr 1fr; }
  #prompt { max-width: 44vw; }
  .sv-side { display: grid; grid-template-columns: auto auto; column-gap: 10px; font-size: 13px; }
  .sv-side .scrap { grid-column: 1 / -1; justify-self: end; font-size: 22px; }
  .g-side { top: calc(52px + var(--sat)); bottom: calc(6px + var(--sab)); width: 50vw; }
  .g-top { top: calc(5px + var(--sat)); }
  .g-stats { top: calc(52px + var(--sat)); padding: 6px 8px; gap: 3px; width: 24vw; }
  .g-stats h3 { font-size: 20px; }
  .bar-row { font-size: 13px; }
  .g-go { bottom: calc(6px + var(--sab)); }
  .g-go button { font-size: 26px; padding: 10px 16px 6px; }
  .g-go .next { font-size: 14px; }
  .tabs button { font-size: 19px; min-height: 34px; padding: 6px 2px 3px; }
  .modal .box { padding: 10px 16px; gap: 5px; width: 100%; max-width: 820px; }
  .modal .box.wide { display: block; columns: 2; column-gap: 24px; }
  .modal .box.wide > * { break-inside: avoid; margin-bottom: 6px; }
  .setrow { padding: 2px 0; font-size: 17px; }
  .seg button { min-height: 34px; padding: 6px 10px 3px; font-size: 18px; }
  .modal h2 { font-size: 34px; }
  .modal h3 { font-size: 23px; }
  .modal p, .modal li { font-size: 16px; }
  .keys { font-size: 15px; } .keys b { font-size: 18px; }
  .contract .box { padding: 12px 16px; gap: 6px; }
  .contract h2 { font-size: 34px; }
  .contract p { font-size: 16px; }
  .card { width: calc((100vw - 56px) / 3.5); max-width: 176px; padding: 5px 6px; }
  .card .cdesc { font-size: 12px; }
  .tab-paint .g-stats { display: none; }
  .card .nm { font-size: 18px; }
  .card .stat { font-size: 13px; }
  .card .thumb { width: 34px; height: 34px; flex-basis: 34px; }
  .sv-head h2 { font-size: 32px; }
  .timer { font-size: 34px; }
  .hp .nm { font-size: 18px; }
  .hpbar { height: 10px; }
  .gauges { margin-top: 2px; font-size: 13px; gap: 6px; }
  .gauge .g { width: 48px; height: 6px; }
  .pf-btn button.yellow { font-size: 30px; padding: 9px 22px 5px; }
  .center { gap: 5px; }
  .center h2 { font-size: 54px; }
}
