/* Hood Valley 2 · una sola hoja de estilo */
:root {
  --bg: #121214; --ground: #18191d; --panel: #1f2026; --panel2: #2a2b33; --line: #34363f;
  --text: #f4f1ea; --muted: #9a9ca6; --mine: #ffd23f; --enemy: #ff4f4f; --free: #2b2d35; --good: #6bff8a; --bad: #ff6b6b;
  --r: 16px; --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Arial Black", "Helvetica Neue", Arial, system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow: hidden; overscroll-behavior: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input { font: inherit; }
h1, h2, h3, .logo, .btn, .pill, .goal small, .tabs button { font-family: var(--font); letter-spacing: .02em; }
h1 { font-size: 24px; margin: 0 0 8px; text-transform: uppercase; }
h2 { font-size: 18px; margin: 0 0 10px; text-transform: uppercase; }
.muted { color: var(--muted); }
.error { color: var(--bad); min-height: 1.4em; margin: 6px 0 0; font-size: 14px; }
[hidden] { display: none !important; }

.screen { position: fixed; inset: 0; }
.screen.center { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; text-align: center; gap: 12px; overflow-y: auto; }
.logo { font-size: 54px; line-height: .9; color: var(--mine); text-shadow: 4px 4px 0 #000; transform: rotate(-3deg); }
.tagline { max-width: 320px; color: var(--muted); margin: 4px 0 8px; }
.card { background: var(--panel); border-radius: var(--r); padding: 16px; border: 1px solid var(--line); }
.form { width: 100%; max-width: 360px; text-align: left; display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 13px; }
.form input { background: var(--bg); border: 2px solid var(--line); border-radius: 12px; padding: 12px; color: var(--text); font-size: 17px; }
.form input:focus { outline: none; border-color: var(--mine); }
.seg { display: flex; background: var(--bg); border-radius: 12px; padding: 4px; }
.seg button { flex: 1; padding: 10px; border-radius: 9px; color: var(--muted); font-weight: 700; }
.seg button.on { background: var(--panel2); color: var(--text); }
.list { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 360px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 14px; background: var(--panel2); color: var(--text); text-transform: uppercase; font-size: 15px; box-shadow: 0 4px 0 #0008; transition: transform .08s; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #0008; }
.btn.primary { background: var(--mine); color: #1a1400; }
.btn.big { width: 100%; max-width: 360px; padding: 16px; font-size: 19px; }
.btn:disabled { opacity: .45; pointer-events: none; }

/* HUD: solo tres cosas */
.hud { position: absolute; top: calc(8px + var(--safe-t)); left: 12px; right: 12px; display: flex; gap: 8px; z-index: 5; pointer-events: none; }
.pill { pointer-events: auto; display: flex; align-items: center; gap: 6px; background: #000c; border: 1px solid var(--line); padding: 7px 12px; border-radius: 999px; font-size: 15px; backdrop-filter: blur(6px); }
.pill b { color: var(--mine); }
.pill.div { margin-left: auto; color: var(--mine); }
.goal { position: absolute; top: calc(52px + var(--safe-t)); left: 12px; right: 12px; z-index: 5; display: flex; align-items: center; gap: 10px; text-align: left; background: #000c; border: 1px solid var(--line); border-left: 4px solid var(--mine); padding: 9px 12px; border-radius: 12px; backdrop-filter: blur(6px); }
.goal small { color: var(--mine); font-size: 11px; }
.goal span { flex: 1; font-size: 14px; }

.tab { position: absolute; inset: 0 0 calc(64px + var(--safe-b)) 0; }
.tab.scroll { overflow-y: auto; padding: calc(100px + var(--safe-t)) 16px 24px; }
#map { width: 100%; height: 100%; display: block; touch-action: none; background: #141518; }
.map-buttons { position: absolute; right: 12px; bottom: 16px; display: flex; flex-direction: column; gap: 10px; }
.round { width: 48px; height: 48px; border-radius: 50%; background: #000c; border: 1px solid var(--line); font-size: 22px; }

.tabs { position: absolute; left: 0; right: 0; bottom: 0; height: calc(64px + var(--safe-b)); padding-bottom: var(--safe-b); display: flex; background: #0b0b0d; border-top: 1px solid var(--line); z-index: 6; }
.tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; color: var(--muted); text-transform: uppercase; }
.tabs button i { font-style: normal; font-size: 18px; }
.tabs button.on { color: var(--mine); }

/* ficha de manzana */
.sheet { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 4; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 16px; box-shadow: 0 -10px 30px #0009; animation: up .18s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet .owner { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.chip { display: inline-block; width: 14px; height: 14px; border-radius: 4px; flex: none; }
.sheet h2 { margin: 0; font-size: 17px; }
.sheet .hint { color: var(--muted); margin: 6px 0 12px; font-size: 14px; }
.sheet .row { display: flex; gap: 8px; }
.sheet .row .btn { flex: 1; }
.sheet .close { position: absolute; top: 10px; right: 12px; font-size: 22px; color: var(--muted); padding: 4px 8px; }
.tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--panel2); color: var(--muted); margin-left: 4px; }
.tag.warn { background: #4a2a10; color: #ffb35c; }

/* ventanas */
.modal { position: fixed; inset: 0; z-index: 20; background: #000b; display: flex; align-items: flex-end; justify-content: center; padding: 12px; padding-bottom: calc(12px + var(--safe-b)); animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal .card { width: 100%; max-width: 420px; max-height: 85vh; overflow-y: auto; padding: 20px; }
.feed { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 8px; }
.feed li { background: var(--bg); border-radius: 12px; padding: 10px 12px; border-left: 4px solid var(--line); font-size: 14px; }
.feed li.bad { border-color: var(--bad); } .feed li.good { border-color: var(--good); }
.feed time { display: block; color: var(--muted); font-size: 12px; }
.tactics { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.tactic { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--bg); border: 2px solid var(--line); border-radius: 14px; padding: 12px; }
.tactic:active, .tactic.on { border-color: var(--mine); }
.tactic .ico { font-size: 28px; width: 40px; text-align: center; }
.tactic b { font-family: var(--font); text-transform: uppercase; display: block; }
.tactic small { color: var(--muted); }

/* pelea */
.fight { position: fixed; inset: 0; z-index: 30; background: radial-gradient(ellipse at 50% 70%, #3a2a12 0%, #121214 70%); display: flex; flex-direction: column; padding: calc(16px + var(--safe-t)) 16px calc(16px + var(--safe-b)); }
.fight .bars { display: flex; gap: 12px; align-items: flex-start; }
.fight .side { flex: 1; }
.fight .side.right { text-align: right; }
.fight .name { font-family: var(--font); text-transform: uppercase; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fight .you { color: var(--mine); }
.fight .bar { height: 14px; background: #000; border-radius: 7px; overflow: hidden; border: 2px solid #000; margin: 6px 0 4px; }
.fight .bar i { display: block; height: 100%; background: var(--good); transition: width .25s; }
.fight .side.right .bar i { margin-left: auto; background: var(--enemy); }
.fight .vs { font-family: var(--font); color: var(--mine); font-size: 22px; padding-top: 8px; }
.fight .tchip { font-size: 12px; color: var(--muted); }
.arena { flex: 1; position: relative; display: flex; align-items: flex-end; justify-content: space-around; padding-bottom: 12vh; }
.fighter { width: 120px; height: 170px; transition: transform .14s ease-out; }
.fighter.flip svg { transform: scaleX(-1); }
.fighter.lunge-r { transform: translateX(60px); } .fighter.lunge-l { transform: translateX(-60px); }
.fighter.hurt { animation: hurt .3s; } .fighter.dodge { transform: translateY(-40px); }
@keyframes hurt { 25% { transform: translateX(-8px); filter: brightness(2) saturate(0); } 75% { transform: translateX(8px); } }
.pop { position: absolute; font-family: var(--font); font-size: 34px; color: #fff; text-shadow: 3px 3px 0 #000; animation: pop .8s ease-out forwards; pointer-events: none; }
.pop.crit { color: var(--mine); font-size: 44px; } .pop.word { font-size: 22px; color: var(--mine); }
@keyframes pop { from { transform: translateY(0) scale(.6); opacity: 0; } 20% { transform: translateY(-10px) scale(1.15); opacity: 1; } to { transform: translateY(-70px) scale(1); opacity: 0; } }
.fight .skip { align-self: center; }
.result { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; margin: auto 0; animation: up .25s; }
.result .headline { font-family: var(--font); font-size: 40px; line-height: 1; text-shadow: 4px 4px 0 #000; transform: rotate(-2deg); }
.result .headline.win { color: var(--mine); } .result .headline.lose { color: var(--bad); }
.result .gains { display: flex; gap: 10px; }
.result .gains div { background: #000a; border-radius: 12px; padding: 10px 16px; font-family: var(--font); }

/* liga y perfil */
.division { text-align: center; margin-bottom: 18px; }
.division .badge { font-family: var(--font); font-size: 34px; color: var(--mine); text-transform: uppercase; text-shadow: 3px 3px 0 #000; }
.progress { height: 10px; background: var(--panel2); border-radius: 5px; overflow: hidden; margin: 8px auto 4px; max-width: 320px; }
.progress i { display: block; height: 100%; background: var(--mine); }
table { width: 100%; border-collapse: collapse; }
td, th { padding: 10px 6px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
td.n, th.n { text-align: right; }
tr.me td { color: var(--mine); font-weight: 700; }
.section { margin: 22px 0 10px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.stat b { display: block; font-family: var(--font); font-size: 22px; }
.stat small { color: var(--muted); }
.train { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.train .btn { padding: 8px 12px; font-size: 13px; }
.hero { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.hero svg { width: 80px; height: 112px; }
.toast { position: fixed; left: 50%; top: calc(100px + var(--safe-t)); transform: translateX(-50%); z-index: 40; background: #000e; border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; max-width: calc(100% - 32px); text-align: center; animation: fade .2s; }
.toast.bad { border-color: var(--bad); } .toast.good { border-color: var(--good); }
