/* APEX PRIZEFIGHT — geometric sans, vivid duotone accents, broadcast chrome */

:root {
  --ink: #101216;
  --deep: #171a21;
  --paper: #f4f1ea;
  --accent-a: #ff495f;   /* red corner */
  --accent-b: #39e6c4;   /* ice */
  --gold: #ffd23e;
  --steel: #8ea3b8;
  --font-head: Futura, "Century Gothic", "URW Gothic", "Trebuchet MS", sans-serif;
  --font-body: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: #07080c; }
body {
  font-family: var(--font-body);
  color: var(--paper);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  overscroll-behavior: none;
}

#glcanvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#boot-fail {
  position: fixed; inset: auto 10% 18% 10%; z-index: 60;
  background: var(--accent-a); color: #fff; padding: 14px; border-radius: 8px;
  text-align: center; font-weight: 700;
}
.hide { display: none !important; }

/* ---------- impact flash + letterbox ---------- */
#flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; mix-blend-mode: screen; transition: opacity .05s linear; z-index: 30; }
.letterbox { position: fixed; left: 0; right: 0; height: 0; background: #000; z-index: 34; transition: height .28s cubic-bezier(.3,.7,.2,1); pointer-events: none; }
.letterbox.top { top: 0; } .letterbox.bottom { bottom: 0; }
body.letterboxed .letterbox.top, body.letterboxed .letterbox.bottom { height: 9vh; }

/* ---------- generic screens ---------- */
#ui-root { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
#screens { position: absolute; inset: 0; }
.screen {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; align-items: center;
  padding: max(24px, env(safe-area-inset-top)) 18px 40px;
  gap: 12px;
  pointer-events: auto;
  background:
    radial-gradient(1200px 700px at 50% -8%, rgba(87, 79, 140, .38), transparent 62%),
    radial-gradient(900px 500px at 84% 108%, rgba(255, 73, 95, .16), transparent 60%),
    radial-gradient(900px 520px at 12% 104%, rgba(57, 230, 196, .13), transparent 58%),
    rgba(7, 8, 12, .72);
  backdrop-filter: blur(3px);
}
.screen.bare { background: none; backdrop-filter: none; }

.eyebrow { font-family: var(--font-head); letter-spacing: .5em; font-size: 11px; color: var(--accent-b); opacity: .95; }
.logo { font-family: var(--font-head); font-style: italic; line-height: .88; text-align: center; margin-top: 6px; }
.logo .logo-a { display: block; font-size: clamp(46px, 9vw, 96px); letter-spacing: .06em; color: var(--paper); text-shadow: 0 4px 0 #23283b, 0 8px 22px rgba(0,0,0,.65); }
.logo .logo-b { display: block; font-size: clamp(20px, 4vw, 42px); letter-spacing: .34em; color: var(--accent-a); }
.tagline { color: var(--steel); font-size: 14px; max-width: 460px; text-align: center; }
.h-major, .h-big, .h-mid { font-family: var(--font-head); font-style: italic; letter-spacing: .04em; }
.h-major { font-size: clamp(24px, 4.4vw, 40px); }
.h-big { font-size: clamp(34px, 7vw, 72px); color: var(--paper); }
.h-big.win { color: var(--accent-b); } .h-big.loss { color: var(--accent-a); }
.h-mid { font-size: 17px; letter-spacing: .22em; color: var(--gold); margin-top: 10px; }
.sub { color: var(--steel); }
.note { color: var(--steel); font-size: 13px; max-width: 560px; text-align: center; line-height: 1.5; }
.micro-note { color: #6d7886; font-size: 11px; }

.menu-col { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; width: min(400px, 92vw); }
.menu-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.record-line { color: var(--gold); font-family: var(--font-head); letter-spacing: .2em; text-align: center; }

.btn {
  appearance: none; border: 1px solid rgba(142, 163, 184, .35);
  background: linear-gradient(180deg, rgba(43,48,62,.85), rgba(23,26,33,.9));
  color: var(--paper);
  font-family: var(--font-head); font-style: italic; letter-spacing: .16em;
  font-size: 15px; padding: 13px 22px; cursor: pointer; border-radius: 4px;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.btn:hover { border-color: var(--accent-b); transform: translateY(-1px); }
.btn.primary { border-color: transparent; background: linear-gradient(180deg, var(--accent-a), #c21d31); color: #fff; box-shadow: 0 6px 18px rgba(255,73,95,.32); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: rgba(16, 18, 22, .55); border-color: rgba(142,163,184,.25); }
.btn.sm { padding: 7px 12px; font-size: 12px; }
.btn.mini { padding: 4px 10px; font-size: 13px; }

/* ---------- ladder & select cards ---------- */
.ladder-wrap, .select-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px; width: min(1020px, 94vw); margin-top: 8px;
}
.ladder-card, .fighter-card {
  border: 1px solid rgba(142,163,184,.25); border-radius: 10px;
  background: linear-gradient(180deg, rgba(29,33,44,.92), rgba(17,19,26,.95));
  padding: 14px; display: flex; flex-direction: column; gap: 6px; text-align: left;
}
.ladder-card.status-next { border-color: var(--accent-b); box-shadow: 0 0 0 1px rgba(57,230,196,.4), 0 10px 30px rgba(57,230,196,.08); }
.ladder-card.status-defeated { opacity: .55; }
.ladder-card.status-locked { opacity: .35; filter: saturate(.4); }
.lc-rank { font-family: var(--font-head); letter-spacing: .3em; font-size: 10px; color: var(--gold); }
.lc-name { font-family: var(--font-head); font-style: italic; font-size: 22px; }
.lc-nick { color: var(--accent-a); font-size: 13px; letter-spacing: .12em; }
.lc-record, .lc-locked { color: var(--steel); font-size: 12px; letter-spacing: .06em; }
.lc-rivalry { color: #aab6c5; font-size: 12px; line-height: 1.45; border-left: 2px solid var(--accent-a); padding-left: 8px; }
.next-fight-note { max-width: 720px; text-align: center; color: var(--paper); background: rgba(255,73,95,.09); border: 1px solid rgba(255,73,95,.3); border-radius: 8px; padding: 10px 16px; font-size: 13px; }
.fighter-card { cursor: pointer; transition: transform .14s ease, border-color .14s ease; border-left: 4px solid var(--trunk, var(--accent-a)); }
.fighter-card:hover { transform: translateY(-2px); border-color: var(--accent-b); }
.fc-name { font-family: var(--font-head); font-style: italic; font-size: 20px; }
.fc-nick { color: var(--gold); font-size: 12px; letter-spacing: .14em; }
.fc-meta { color: var(--accent-b); font-size: 11px; letter-spacing: .18em; }
.fc-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.sb { display: inline-flex; align-items: center; gap: 2px; font-size: 10px; color: var(--steel); letter-spacing: .05em; }
.sb u { display: inline-block; width: 8px; height: 8px; margin-left: 1px; background: #2a2f3a; transform: skewX(-12deg); }
.sb u.on { background: var(--accent-b); }
.fc-tell { color: #97a3b4; font-size: 11.5px; border-top: 1px dashed rgba(142,163,184,.25); padding-top: 6px; }

/* ---------- gym bento ---------- */
.bento-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; width: min(1060px, 95vw); margin-top: 10px; }
.bento {
  background: linear-gradient(160deg, rgba(30,34,46,.95), rgba(16,18,24,.97));
  border: 1px solid rgba(142,163,184,.22); border-radius: 14px; padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 14px 34px rgba(0,0,0,.36);
}
.bento .bt-title { font-family: var(--font-head); font-style: italic; letter-spacing: .14em; color: var(--paper); font-size: 16px; }
.bento .bt-sub { color: var(--steel); font-size: 12.5px; line-height: 1.55; min-height: 54px; }
.bento .bt-status { font-family: var(--font-head); letter-spacing: .22em; font-size: 11px; color: var(--accent-a); }
.bento.done .bt-status { color: var(--accent-b); }
.bento-tips ul { padding-left: 16px; color: var(--steel); font-size: 12.5px; display: grid; gap: 6px; }
.key-table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.key-table td { padding: 5px 10px; border-bottom: 1px solid rgba(142,163,184,.14); color: #cfd7e2; }
.k-key { color: var(--gold); font-family: var(--font-head); white-space: nowrap; letter-spacing: .06em; }

.gym-panel {
  position: fixed; right: 14px; top: 50%; transform: translateY(-50%);
  width: min(320px, 86vw); z-index: 41; pointer-events: auto;
  background: linear-gradient(170deg, rgba(26,30,40,.96), rgba(14,16,22,.98));
  border: 1px solid rgba(57,230,196,.4); border-radius: 14px; padding: 14px;
  display: flex; flex-direction: column; gap: 8px; box-shadow: 0 16px 44px rgba(0,0,0,.5);
}
.gp-head { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--font-head); letter-spacing: .12em; }
.gp-step { color: var(--accent-b); font-size: 12px; }
.gp-instr { color: var(--paper); font-size: 14px; line-height: 1.5; min-height: 60px; }
.gp-prog { display: flex; gap: 5px; flex-wrap: wrap; }
.gp-prog i { width: 20px; height: 6px; background: #272c37; border-radius: 3px; }
.gp-prog i.on { background: var(--accent-b); }
.gp-quit { align-self: flex-end; }

/* ---------- create fighter form ---------- */
.create-form { display: flex; flex-direction: column; gap: 12px; width: min(560px, 94vw); background: rgba(16,18,24,.82); border: 1px solid rgba(142,163,184,.2); border-radius: 14px; padding: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-family: var(--font-head); letter-spacing: .22em; font-size: 10.5px; color: var(--steel); }
.field.row { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
input[type="text"] {
  background: #0d0f14; border: 1px solid rgba(142,163,184,.3); color: var(--paper);
  padding: 10px 12px; border-radius: 6px; font-family: var(--font-head); letter-spacing: .12em; font-size: 16px;
}
input[type="range"] { accent-color: var(--accent-b); width: 200px; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.swatch.sel { border-color: var(--paper); outline: 2px solid var(--accent-b); }
.stat-tradeoffs { display: flex; flex-direction: column; gap: 8px; }
.stat-tradeoffs h3 { font-family: var(--font-head); letter-spacing: .22em; font-size: 11px; color: var(--gold); }
.stat-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.stat-row b { color: var(--accent-b); letter-spacing: 2px; min-width: 110px; }
.pts-left { color: var(--steel); font-size: 11px; }

/* ---------- settings & dialogs ---------- */
#dialogs { position: fixed; inset: 0; z-index: 45; pointer-events: none; }
.dialog-veil { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(5,6,9,.6); pointer-events: auto; padding: 18px; }
.dialog {
  background: linear-gradient(180deg, #20242f, #12141b);
  border: 1px solid rgba(142,163,184,.3); border-radius: 14px;
  padding: 24px; max-width: min(680px, 94vw); max-height: 90vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.settings-group { display: flex; flex-direction: column; gap: 8px; }
.settings-group h3 { font-family: var(--font-head); letter-spacing: .28em; font-size: 11px; color: var(--accent-b); }
.setting-range { display: grid; grid-template-columns: 150px 1fr 52px; align-items: center; gap: 10px; font-size: 12.5px; color: var(--steel); }
.setting-range input[type=range] { width: 100%; }
select { background: #101216; color: var(--paper); border: 1px solid rgba(142,163,184,.35); padding: 8px; border-radius: 6px; font-size: 13px; }
.toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(16,18,24,.7); border: 1px solid rgba(142,163,184,.2);
  color: var(--paper); border-radius: 8px; padding: 10px 14px; cursor: pointer; font-size: 12.5px; letter-spacing: .04em;
}
.toggle .knob { width: 34px; height: 18px; border-radius: 10px; background: #333947; position: relative; transition: background .15s; flex: none; }
.toggle .knob::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #8ea3b8; transition: left .15s ease, background .15s; }
.toggle.on .knob { background: rgba(57,230,196,.5); }
.toggle.on .knob::after { left: 18px; background: var(--accent-b); }

/* ---------- HUD ---------- */
#hud-root { position: fixed; inset: 0; z-index: 38; pointer-events: none; }
.hud { position: absolute; inset: 0; display: flex; flex-direction: column; padding: max(10px, env(safe-area-inset-top)) 14px 12px; }
.hud-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.corner-card {
  width: min(250px, 36vw); background: linear-gradient(180deg, rgba(14,16,22,.82), rgba(14,16,22,.55));
  border-radius: 10px; border: 1px solid rgba(142,163,184,.22); padding: 8px 10px;
  backdrop-filter: blur(4px);
}
.cc0 { border-left: 3px solid var(--accent-a); }
.cc1 { border-right: 3px solid var(--accent-b); text-align: right; }
.cc1 .bar-labels { flex-direction: row-reverse; }
.cc-name { font-family: var(--font-head); font-style: italic; font-size: clamp(12px, 2.4vw, 16px); letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-nick { color: var(--gold); font-size: .68em; letter-spacing: .12em; margin-left: 5px; }
.cc-bars { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.bar { height: 7px; background: rgba(8,9,12,.8); border-radius: 3px; overflow: hidden; transform: skewX(-14deg); }
.bar i { display: block; height: 100%; width: 100%; border-radius: 2px; transition: width .18s ease; }
.bar.head i { background: linear-gradient(90deg, var(--accent-a), #ff8296); }
.bar.body i { background: linear-gradient(90deg, #d8862c, #ffc37a); }
.bar.wind i { background: linear-gradient(90deg, var(--accent-b), #9ff5e2); }
.bar.wind i.low { background: var(--accent-a); }
.bar.head i.hurt { animation: hpulse .8s infinite alternate; }
@keyframes hpulse { from { filter: brightness(.75); } to { filter: brightness(1.3); } }
.bar-labels { display: flex; gap: 14px; font-size: 8.5px; color: var(--steel); letter-spacing: .14em; }
.clock-block { display: flex; flex-direction: column; align-items: center; gap: 3px; background: rgba(10,11,16,.66); border-radius: 10px; padding: 6px 16px; border: 1px solid rgba(142,163,184,.2); }
.round-pips { display: flex; gap: 4px; }
.round-pips i { width: 10px; height: 4px; border-radius: 2px; background: #2c313d; }
.round-pips i.done { background: var(--gold); }
.clock-text { font-family: var(--font-head); font-size: clamp(19px, 4.4vw, 30px); font-style: italic; letter-spacing: .05em; }
.round-num { font-size: 10px; letter-spacing: .3em; color: var(--gold); font-family: var(--font-head); }
.momentum-strip { height: 4px; width: min(420px, 70vw); margin: 8px auto 0; background: rgba(10,11,16,.7); border-radius: 2px; overflow: hidden; }
.momo-fill { position: relative; left: 0; height: 100%; width: 46%; margin-left: 27%; background: linear-gradient(90deg, var(--accent-a), #dcd6c8 50%, var(--accent-b)); transform: translateX(var(--momo, 0%)); transition: transform .25s ease; border-radius: 2px; }
.plan-chips { display: flex; justify-content: center; gap: 8px; margin-top: 6px; }
.chip { font-size: 10.5px; letter-spacing: .12em; color: var(--paper); background: rgba(57,230,196,.13); border: 1px solid rgba(57,230,196,.4); padding: 3px 10px; border-radius: 999px; font-family: var(--font-head); }
.chip.hide { display: none; }
.status-icons { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.status-pill { font-size: 9px; letter-spacing: .12em; padding: 2px 7px; border-radius: 4px; font-family: var(--font-head); }
.status-pill.cut { background: rgba(164,17,35,.85); }
.status-pill.swell { background: rgba(122,48,64,.9); }
.status-pill.gas { background: rgba(216,134,44,.9); color: #14161c; }
.status-pill.down { background: rgba(57,230,196,.9); color: #14161c; }
.coach-hint {
  margin: 10vh auto 0; text-align: center; color: #dff5ee; background: rgba(10,12,17,.68);
  border: 1px solid rgba(57,230,196,.3); border-radius: 999px; padding: 7px 18px;
  font-size: 13px; letter-spacing: .08em; opacity: 0; transition: opacity .4s; max-width: 88vw;
}
.coach-hint.show { opacity: 1; }
.hud-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.count-num {
  font-family: var(--font-head); font-style: italic; font-size: clamp(70px, 17vw, 190px);
  color: var(--accent-a); text-shadow: 0 0 42px rgba(255,73,95,.5), 0 8px 0 rgba(0,0,0,.6);
}
.count-sub { font-family: var(--font-head); letter-spacing: .26em; font-size: clamp(11px, 2.4vw, 15px); color: var(--paper); background: rgba(10,11,16,.7); padding: 6px 14px; border-radius: 6px; margin-top: 4px; }
.will-meter { width: min(300px, 74vw); margin-top: 14px; background: rgba(10,11,16,.78); border: 1px solid rgba(57,230,196,.5); border-radius: 999px; overflow: hidden; position: relative; }
.will-fill { height: 16px; width: 0%; background: repeating-linear-gradient(-45deg, var(--accent-b) 0 8px, #1fb694 8px 16px); transition: width .1s linear; }
.will-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; letter-spacing: .2em; color: var(--paper); font-family: var(--font-head); }
.finish-banner { font-family: var(--font-head); font-style: italic; font-size: clamp(44px, 10vw, 110px); letter-spacing: .1em; color: var(--gold); text-shadow: 0 10px 40px rgba(0,0,0,.8); }
.finish-banner.hide, .count-num.hide, .count-sub.hide, .will-meter.hide { display: none; }
.hud-buttons { position: absolute; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 6px; pointer-events: auto; align-items: flex-end; }
@media (max-width: 760px) { .hud-buttons { top: auto; bottom: 175px; flex-direction: row; } }

.replay-badge {
  position: fixed; top: calc(10vh + 10px); left: 50%; transform: translateX(-50%); z-index: 36;
  display: flex; align-items: center; gap: 12px;
  background: rgba(10,11,16,.82); border: 1px solid rgba(255,210,62,.6); border-radius: 8px; padding: 6px 14px;
  pointer-events: auto;
}
.replay-badge b { font-family: var(--font-head); font-style: italic; letter-spacing: .3em; color: var(--gold); font-size: 14px; }
.rb-hint { color: var(--steel); font-size: 10.5px; letter-spacing: .1em; }

/* ---------- interstitial / corner palette ---------- */
.ringcard-round { font-family: var(--font-head); font-style: italic; font-size: clamp(40px, 9vw, 84px); color: var(--paper); letter-spacing: .1em; text-shadow: 0 6px 0 #23283b; }
.mini-score { border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.mini-score td { padding: 5px 16px; border-bottom: 1px solid rgba(142,163,184,.16); }
.mini-score tr.hd td { color: var(--gold); font-family: var(--font-head); letter-spacing: .14em; font-size: 11px; }
.mini-score td:first-child { color: var(--steel); }
.judge-peek { display: flex; gap: 8px; margin-top: 8px; }
.judge-chip { font-family: var(--font-head); font-size: 10.5px; letter-spacing: .14em; border: 1px solid rgba(255,210,62,.5); color: var(--gold); padding: 3px 10px; border-radius: 999px; }

.corner-palette { min-width: min(560px, 94vw); }
.cp-title { font-family: var(--font-head); font-style: italic; letter-spacing: .12em; font-size: 20px; color: var(--accent-b); }
.cp-list { display: flex; flex-direction: column; gap: 6px; }
.cp-item {
  text-align: left; display: flex; flex-direction: column; gap: 2px;
  background: rgba(16,18,24,.85); border: 1px solid rgba(142,163,184,.25); border-left: 3px solid var(--accent-b);
  border-radius: 8px; padding: 10px 14px; cursor: pointer; color: var(--paper); transition: background .12s, transform .12s;
}
.cp-item:hover { background: rgba(35,40,53,.95); transform: translateX(3px); border-left-color: var(--accent-a); }
.cp-label { font-family: var(--font-head); letter-spacing: .08em; font-size: 14.5px; }
.cp-detail { color: var(--steel); font-size: 12px; }
.cp-hint { color: #67717e; font-size: 11px; }

/* ---------- results ---------- */
.stats-table, .judge-table { border-collapse: collapse; font-size: 12.5px; width: min(640px, 92vw); }
.stats-table td, .judge-table td { padding: 6px 10px; border-bottom: 1px solid rgba(142,163,184,.14); }
.stats-table tr.hd td, .judge-table tr.hd td { color: var(--gold); font-family: var(--font-head); font-size: 10.5px; letter-spacing: .16em; }
.stats-table tr.tot td { color: var(--accent-b); font-weight: 700; }
.judge-table .win-td { color: var(--accent-b); font-weight: 800; }
.judge-cards-table { display: flex; justify-content: center; }

/* ---------- toasts + subtitles ---------- */
#toast-root { position: fixed; left: 50%; transform: translateX(-50%); bottom: 12vh; z-index: 47; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: rgba(16,18,24,.92); border: 1px solid rgba(255,210,62,.5); color: var(--paper); padding: 8px 16px; border-radius: 999px; font-size: 12.5px; letter-spacing: .06em; opacity: 0; transform: translateY(8px); transition: all .3s ease; }
.toast.in { opacity: 1; transform: translateY(0); }
#subtitle-bar {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(10px); bottom: 6vh; z-index: 46;
  background: rgba(8,9,12,.85); color: var(--paper); font-size: 14px; letter-spacing: .03em;
  border-left: 3px solid var(--accent-a); padding: 8px 18px; border-radius: 4px;
  opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; max-width: 86vw; text-align: center;
}
#subtitle-bar.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- touch UI ---------- */
#touch-root { position: fixed; inset: 0; z-index: 39; pointer-events: none; display: none; }
body.touch-ui #touch-root { display: block; }
.stick-pad { position: absolute; left: max(12px, env(safe-area-inset-left)); bottom: max(14px, env(safe-area-inset-bottom)); width: 128px; height: 128px; pointer-events: auto; touch-action: none; }
.stick-base { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, rgba(16,18,24,.55), rgba(16,18,24,.24)); border: 1.5px solid rgba(142,163,184,.5); }
.stick-nub { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(57,230,196,.5); border: 2px solid rgba(57,230,196,.8); }
.btn-cluster { position: absolute; right: max(10px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 6px; align-items: flex-end; pointer-events: auto; max-width: 62vw; }
.crow { display: flex; gap: 6px; justify-content: flex-end; }
.tbtn {
  min-width: 58px; min-height: 40px; padding: 6px 9px;
  background: rgba(20,23,30,.85); color: var(--paper); border: 1px solid rgba(142,163,184,.5);
  border-radius: 8px; font-family: var(--font-head); font-size: 11px; letter-spacing: .08em; touch-action: manipulation;
}
.tbtn.active { background: rgba(57,230,196,.4); border-color: var(--accent-b); }
.tbtn.bodymod.on { background: rgba(255,210,62,.5); color: #14161c; border-color: var(--gold); }
.tbtn.wide { min-width: 96px; }
.touch-hint { position: absolute; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 150px); left: 16px; color: #77828f; font-size: 10px; letter-spacing: .12em; }

/* ---------- responsive ---------- */
html.big-ui { font-size: 118%; }
@media (max-width: 760px) {
  .hud-top { flex-wrap: wrap; }
  .corner-card { width: 44vw; }
  .clock-text { font-size: 17px; }
  .screen { padding: 16px 10px 120px; }
  .create-form, .dialog { padding: 14px; }
  .setting-range { grid-template-columns: 116px 1fr 46px; font-size: 11.5px; }
  .ladder-wrap, .select-grid, .bento-grid { grid-template-columns: 1fr; width: 96vw; }
  .gym-panel { left: 10px; right: 10px; top: auto; bottom: 168px; transform: none; width: auto; }
}
@media (max-height: 480px) {
  .logo .logo-a { font-size: 40px; } .logo .logo-b { font-size: 16px; }
}

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