:root {
  --bg: #0b1411;
  --surface: #13201b;
  --surface-2: #1a2b24;
  --line: #24382f;
  --text: #ecf3ee;
  --muted: #8ea79a;
  --accent: #d4ff3a;
  --accent-ink: #18210a;
  --good: #3ddc84;
  --bad: #ff6b5b;
  --warn: #ffc24b;
  --radius: 16px;
  --display: 'Barlow Condensed', system-ui, sans-serif;
  --body: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 16px; -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.boot { display: grid; place-items: center; min-height: 100dvh; color: var(--muted); }

/* --- layout --- */
.shell { max-width: 560px; margin: 0 auto; padding: calc(var(--safe-t) + 0px) 16px calc(96px + var(--safe-b)); }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: calc(var(--safe-t) + 12px) 0 12px; background: linear-gradient(var(--bg) 75%, transparent); }
.brand { font-family: var(--display); font-weight: 800; font-style: italic; font-size: 24px; line-height: .9; letter-spacing: .5px; text-transform: uppercase; }
.brand small { display: block; font-size: 12px; font-style: normal; font-weight: 700; color: var(--accent); letter-spacing: 3px; }
.top .spacer { flex: 1; }
.chip-money { font-family: var(--display); font-weight: 700; font-size: 17px; padding: 6px 12px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); }
.icon-btn { border: 0; background: none; padding: 0; cursor: pointer; text-decoration: none; }

.nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; background: rgba(13, 22, 19, .94); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.nav-in { max-width: 560px; margin: 0 auto; display: flex; }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 0 9px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; letter-spacing: .3px; position: relative; }
.nav a svg { width: 22px; height: 22px; }
.nav a.on { color: var(--accent); }
.nav .dot { position: absolute; top: 7px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }

/* --- type --- */
h1, h2, h3 { font-family: var(--display); text-transform: uppercase; margin: 0; line-height: 1; }
h1 { font-size: 34px; font-weight: 800; font-style: italic; }
h2 { font-size: 22px; font-weight: 700; letter-spacing: .3px; margin: 26px 0 10px; }
h3 { font-size: 18px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--good); } .neg { color: var(--bad); }

/* --- cards --- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card.hero { background: radial-gradient(120% 140% at 100% 0%, #24412f 0%, var(--surface) 55%); }
.card.cta { background: var(--accent); color: var(--accent-ink); border: 0; }
.card.cta .muted { color: #43521a; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }
.grow { flex: 1; min-width: 0; }
.ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.versus { font-family: var(--display); font-weight: 800; font-style: italic; text-transform: uppercase; font-size: 30px; line-height: 1; margin: 6px 0 8px; }
.score { font-family: var(--display); font-weight: 800; font-size: 44px; letter-spacing: 1px; white-space: nowrap; flex: none; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.tag.accent { background: var(--accent); color: var(--accent-ink); }
.tag.good { background: rgba(61,220,132,.15); color: var(--good); }
.tag.bad { background: rgba(255,107,91,.15); color: var(--bad); }
.tag.warn { background: rgba(255,194,75,.15); color: var(--warn); }

/* --- avatars --- */
.av { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 15px; color: #0b1411; }
.av.lg { width: 56px; height: 56px; font-size: 22px; }
.av.sm { width: 28px; height: 28px; font-size: 12px; }
.av.xl { width: 104px; height: 104px; font-size: 38px; }
img.av { object-fit: cover; background: var(--surface-2); }
.pcard img.av, .hero img.av { box-shadow: 0 0 0 2px var(--accent); }
.people { display: flex; flex-wrap: wrap; gap: 6px; }
.person { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 99px; background: var(--surface-2); font-size: 14px; font-weight: 600; }

/* --- buttons & forms --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 13px 18px; font-weight: 700; font-size: 16px; cursor: pointer; background: var(--accent); color: var(--accent-ink); text-decoration: none; transition: transform .08s; }
.btn:active { transform: scale(.97); }
.btn.block { width: 100%; }
.btn.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.btn.dark { background: var(--accent-ink); color: var(--accent); }
.btn.danger { background: rgba(255,107,91,.14); color: var(--bad); }
.btn.sm { padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; background: var(--surface-2); padding: 4px; border-radius: 14px; }
.seg button { border: 0; background: none; padding: 11px 6px; border-radius: 10px; font-weight: 700; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.seg button.on.no { background: var(--bad); color: #2a0b07; }
.seg button.on.duda { background: var(--warn); color: #2a1d02; }
label.f { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
label.f > input, label.f > select, label.f > textarea { display: block; width: 100%; margin-top: 6px; }
input, select, textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 16px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { min-height: 200px; resize: vertical; line-height: 1.5; }
input[type=number] { width: 64px; padding: 8px; text-align: center; }
input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); }

.stepper { display: flex; align-items: center; gap: 14px; }
.stepper button { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-size: 22px; font-weight: 700; cursor: pointer; }
.stepper .num { font-size: 32px; min-width: 34px; text-align: center; }

.rate { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin-top: 8px; }
.rate button { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 9px 0; font-family: var(--display); font-weight: 700; font-size: 17px; cursor: pointer; color: var(--muted); }
.rate button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* --- player cards (equipo) --- */
.pcard { position: relative; overflow: hidden; background: linear-gradient(160deg, #1e3a2c, var(--surface) 70%); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.pcard .price { font-family: var(--display); font-weight: 800; font-size: 26px; }
.pcard .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.pcard .stats div { background: rgba(0,0,0,.2); border-radius: 10px; padding: 8px; text-align: center; }
.pcard .stats b { display: block; font-family: var(--display); font-size: 22px; }
.pcard .stats span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.pcard.empty { background: none; border-style: dashed; text-align: center; color: var(--muted); padding: 26px 16px; }
.slots { display: grid; gap: 10px; }
.reveal { animation: reveal .5s both; }
@keyframes reveal { from { opacity: 0; transform: translateY(16px) scale(.96); } }

/* --- lists / tables --- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.li + .li { border-top: 1px solid var(--line); }
.li .rank { width: 22px; font-family: var(--display); font-weight: 800; font-size: 20px; color: var(--muted); text-align: center; }
.li.me { background: rgba(212,255,58,.06); }
.li .pts { font-family: var(--display); font-weight: 800; font-size: 22px; text-align: right; }
.copies { display: flex; gap: 3px; margin-top: 4px; }
.copies i { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.copies i.taken { background: var(--line); }
.tbl-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 8px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; }
td:first-child, th:first-child { text-align: left; padding-left: 14px; }
tr:last-child td { border-bottom: 0; }
tr.me td { background: rgba(212,255,58,.06); }
td.b { font-family: var(--display); font-weight: 800; font-size: 17px; }
details.round { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; }
details.round summary { list-style: none; padding: 14px 16px; cursor: pointer; }
details.round summary::-webkit-details-marker { display: none; }
details.round[open] summary { border-bottom: 1px solid var(--line); }
.feed .li { font-size: 14px; }
.warnbox { background: rgba(255,194,75,.1); border: 1px solid rgba(255,194,75,.3); color: var(--warn); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin-bottom: 10px; }
.infobox { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; font-size: 14px; color: var(--muted); }

/* --- auth --- */
.auth { max-width: 460px; margin: 0 auto; padding: calc(var(--safe-t) + 40px) 20px 40px; }
.auth .logo { text-align: center; margin-bottom: 28px; }
.auth .logo .ball { width: 72px; height: 72px; margin: 0 auto 14px; }
.auth .logo h1 { font-size: 44px; }
.auth .logo p { margin: 6px 0 0; color: var(--accent); font-family: var(--display); font-weight: 700; letter-spacing: 4px; text-transform: uppercase; }
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.pick button { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; font-weight: 600; }
.pick button.on { border-color: var(--accent); background: var(--surface-2); }
.pick button .new { display: block; font-size: 11px; color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }

#toast { position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); transform: translate(-50%, 20px); opacity: 0; background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 15px; max-width: calc(100% - 32px); transition: .25s; z-index: 50; pointer-events: none; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--bad); color: #fff; }
.mt0 { margin-top: 0; }

table.review th, table.review td { padding: 8px 4px; }
table.review td:first-child, table.review th:first-child { padding-left: 12px; white-space: normal; }
table.review .tag { font-size: 10px; padding: 2px 5px; }
input.mini { width: 40px; padding: 7px 2px; border-radius: 8px; }
.hero .versus { overflow-wrap: anywhere; }
