:root {
  --bg: #0c0c10; --card: #15151a; --red: #dc2626; --fg: #fff;
  --dim: rgba(255,255,255,.5); --dim2: rgba(255,255,255,.35); --line: rgba(255,255,255,.15); --fill: rgba(255,255,255,.1);
  --green: #16a34a; --amber: #f59e0b;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { font-family: 'Helvetica Neue', Helvetica, system-ui, sans-serif; font-size: 15px; line-height: 1.3; -webkit-font-smoothing: antialiased; min-height: 100dvh; }
#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; position: relative; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; }
input { font: 600 15px 'Helvetica Neue', Helvetica, sans-serif; color: var(--fg); background: var(--card); border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; outline: none; width: 100%; }
input::placeholder { color: var(--dim2); }
input.big { padding: 16px; border-radius: 14px; font-size: 17px; font-weight: 700; }
input.center { text-align: center; }
.hidden { display: none !important; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.pulse { animation: pulse 1.2s infinite; }
body.busy #app { opacity: .6; pointer-events: none; }

.error-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: var(--red); color: #fff; font-weight: 700; font-size: 13px; text-align: center; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top)); }

.mono { font: 700 11px ui-monospace, Menlo, monospace; letter-spacing: .08em; color: var(--dim); }
.h1 { font-size: 28px; font-weight: 800; letter-spacing: -.03em; padding-left: 4px; }
.h2 { font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
.hero { font-size: 40px; font-weight: 800; letter-spacing: -.04em; line-height: .95; }
.hint { font-size: 12px; color: var(--dim2); line-height: 1.4; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 8px; }
.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grow { flex: 1; }

.screen { flex: 1; overflow: auto; padding: 12px 20px 40px; display: flex; flex-direction: column; gap: 12px; }
.screen.login { padding-top: 56px; gap: 14px; }
form.screen, .screen form { display: flex; flex-direction: column; gap: 14px; }

.top { padding: 56px 16px 0; padding-top: max(56px, calc(16px + env(safe-area-inset-top))); display: grid; grid-template-columns: 1fr 40px; gap: 10px; align-items: center; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--red); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; justify-self: end; }
.pill { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 12px 8px 8px; border-radius: 14px; background: var(--card); min-width: 0; }
.pill .back { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 800; }
.pill-name { font-size: 15px; font-weight: 800; letter-spacing: -.02em; }
.pill-meta { font-size: 11px; font-weight: 700; color: var(--dim); }
.caret { font-size: 12px; color: var(--dim); }
.live { font-size: 10px; font-weight: 800; letter-spacing: .06em; color: var(--red); }
.done-badge { font-size: 10px; font-weight: 800; letter-spacing: .06em; color: var(--dim); }

.quick { margin: 6px 16px 0; padding: 8px; border-radius: 14px; background: var(--card); border: 1.5px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.quick-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 10px; font-weight: 700; font-size: 14px; }
.quick-row.cur { background: #fff; color: var(--bg); font-weight: 800; }
.quick-row span:last-child { font-size: 11px; font-weight: 700; color: var(--dim); }
.quick-row.cur span:last-child { color: #6b6a66; }
.quick-all { padding: 10px 12px; text-align: center; font-size: 12px; font-weight: 700; color: rgba(255,255,255,.6); }

.tabs { padding: 8px 16px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.tab { text-align: center; padding: 9px 0; border-radius: 10px; font-size: 12px; font-weight: 800; letter-spacing: .04em; background: rgba(255,255,255,.08); }
.tab.on { background: #fff; color: var(--bg); }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--card); }
.seg button { padding: 9px; border-radius: 9px; text-align: center; font-size: 13px; font-weight: 700; color: rgba(255,255,255,.6); }
.seg button.on { background: #fff; color: var(--bg); font-weight: 800; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { padding: 8px 12px; border-radius: 999px; background: var(--fill); font-size: 12px; font-weight: 700; }
.chip.on { background: #fff; color: var(--bg); font-weight: 800; }
.chip.outline { background: none; border: 1.5px solid var(--line); }
.chip.outline.on { background: var(--red); color: #fff; border-color: var(--red); }
.chip.team { padding: 10px 16px; border-radius: 10px; font-size: 15px; border: 1.5px solid rgba(255,255,255,.2); background: none; }
.chip.team.on { color: #fff; border-color: transparent; }
.chips label.chip { cursor: pointer; }
.chips label.chip:has(:checked) { background: #fff; color: var(--bg); font-weight: 800; }
.vsep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }

.card { padding: 14px 16px; border-radius: 14px; background: var(--card); display: flex; flex-direction: column; gap: 8px; border: 1.5px solid transparent; }
.card.cur { border-color: #fff; }
.cup-name { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.cup-sub { font-size: 12px; color: var(--dim); font-weight: 600; }
.cup-foot { font-size: 12px; font-weight: 700; color: rgba(255,255,255,.6); }
.cup-foot .result { color: #fff; }
.badge { font-size: 11px; font-weight: 800; letter-spacing: .06em; padding: 5px 8px; border-radius: 6px; background: var(--fill); white-space: nowrap; }
.badge.dim { font-size: 10px; background: rgba(255,255,255,.06); color: rgba(255,255,255,.6); }
.empty { padding: 24px; border-radius: 14px; border: 1.5px dashed rgba(255,255,255,.2); text-align: center; font-size: 13px; color: rgba(255,255,255,.4); }
.dashed { padding: 12px; border-radius: 14px; border: 1.5px dashed rgba(255,255,255,.2); text-align: center; font-weight: 700; font-size: 13px; color: var(--dim); }

.btn { padding: 12px; border-radius: 10px; background: #fff; color: var(--bg); text-align: center; font-weight: 800; font-size: 14px; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.btn.big { padding: 18px; border-radius: 16px; font-size: 17px; }
.btn.ghost { background: var(--fill); color: #fff; }
.btn.danger { background: none; border: 1.5px solid var(--red); color: var(--red); }
.btn.outline { background: none; border: 1.5px solid var(--line); color: rgba(255,255,255,.55); font-size: 11px; letter-spacing: .06em; padding: 9px; }
.btn small { font-size: 11px; font-weight: 700; color: #6b6a66; }
.link { text-align: center; font-size: 12px; font-weight: 700; color: var(--dim); padding: 6px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.err { color: var(--red); font-weight: 700; font-size: 13px; }

.game { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--card); border-left: 4px solid var(--red); }
.game-time { font-size: 22px; font-weight: 800; letter-spacing: -.03em; min-width: 3ch; }
.game-title { font-size: 15px; font-weight: 700; }
.game-sub { font-size: 12px; color: var(--dim); font-weight: 600; }
.game .start { font-size: 11px; font-weight: 800; letter-spacing: .06em; color: rgba(255,255,255,.6); }
.game .score { font-size: 30px; font-weight: 800; letter-spacing: -.04em; }
.game.manual { grid-template-columns: auto 1fr auto auto; }
.game .x { font-size: 18px; color: rgba(255,255,255,.35); padding: 6px 0 6px 10px; line-height: 1; }
.panel { padding: 14px; border-radius: 14px; background: var(--card); border: 1.5px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.panel input { background: var(--bg); }
.panel-title { font-size: 14px; font-weight: 800; }
.panel-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; }
.panel-head > :last-child { color: rgba(255,255,255,.6); }

.roster { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rcard { position: relative; padding: 14px 10px; border-radius: 14px; background: var(--card); text-align: center; border: 1.5px solid rgba(255,255,255,.12); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rcard.absent { background: none; border: 1.5px dashed rgba(255,255,255,.2); color: var(--dim2); }
.rcard .num { font-size: 32px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.rcard .name { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.6); }
.rcard.absent .name { color: inherit; }
.rcard .flag { font-size: 9px; font-weight: 800; letter-spacing: .04em; color: var(--red); }
.rcard .x { position: absolute; top: 2px; right: 6px; font-size: 14px; color: rgba(255,255,255,.35); padding: 2px 4px; }
.rcard input { padding: 6px; font-size: 20px; font-weight: 800; text-align: center; background: var(--bg); }
.swatches { display: flex; gap: 8px; align-items: center; }
.swatch { width: 26px; height: 26px; border-radius: 50%; }
.swatch.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #fff; }

.live-head { padding: 6px 20px 8px; display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.live-head .pbtn { padding: 10px 12px; border-radius: 10px; background: var(--card); font-size: 13px; font-weight: 800; display: flex; gap: 4px; align-items: baseline; }
.live-head .pbtn small { font-size: 10px; color: var(--dim); }
.clock { text-align: center; font: 800 34px ui-monospace, Menlo, monospace; letter-spacing: -.02em; }
.live-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.live-body .pad { padding: 0 20px 8px; }
.events { flex: 1; overflow: auto; padding: 0 20px; display: flex; flex-direction: column; min-height: 0; }
.event { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.event .tt { font: 700 12px ui-monospace, Menlo, monospace; color: var(--dim); }
.event .who { font-size: 14px; font-weight: 700; }
.event .ast { font-size: 11px; color: var(--dim); }
.event .sc { font-size: 12px; font-weight: 800; }
.no-events { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 13px; color: rgba(255,255,255,.3); text-align: center; padding: 20px; }
.pick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pcard { position: relative; padding: 10px 4px; border-radius: 12px; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1.5px solid rgba(255,255,255,.06); }
.pcard .num { font-size: 24px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.pcard .name { font-size: 10px; font-weight: 600; color: var(--dim); margin-top: 3px; max-width: 100%; }
.pcard.picked { border-width: 2.5px; }
.pcard .role { position: absolute; top: 3px; right: 3px; font-size: 9px; font-weight: 800; padding: 2px 5px; border-radius: 4px; }
.goal-row { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: stretch; }
.goal-time { display: flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: 12px; background: var(--bg); border: 1.5px solid var(--line); }
.goal-time span { font-size: 12px; font-weight: 800; color: var(--dim); }
.goal-time input { width: 76px; border: 0; background: none; font: 800 15px ui-monospace, Menlo, monospace; text-align: center; padding: 8px 0; }
.lineup-chip { padding: 8px 10px; border-radius: 8px; background: #fff; color: var(--bg); font-size: 13px; font-weight: 800; }
.lineup-chip.off { background: none; border: 1.5px dashed rgba(255,255,255,.3); color: rgba(255,255,255,.4); }
.lineup-chip.plain { background: var(--fill); color: #fff; font-weight: 700; }
.lineup-chip.plain.on { background: #fff; color: var(--bg); font-weight: 800; }
.gk-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-radius: 12px; background: var(--card); min-width: 0; }
.gk-row.none { border: 1.5px dashed rgba(255,255,255,.2); }
.gk-row .lbl { font-size: 10px; font-weight: 800; letter-spacing: .06em; color: var(--dim); }
.gk-row .val { font-size: 14px; font-weight: 800; }
.gk-row .arrow { font-size: 11px; font-weight: 700; color: var(--dim); }
.saves { display: grid; grid-template-columns: 56px 1fr 56px; gap: 8px; align-items: center; }
.saves button { height: 56px; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--fill); font-size: 24px; font-weight: 800; }
.saves button.plus { background: #fff; color: var(--bg); }
.saves .n { text-align: center; font-size: 44px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.scores { padding: 10px 20px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.score-btn { border-radius: 18px; padding: 14px 10px 12px; text-align: center; background: var(--card); border: 1.5px solid rgba(255,255,255,.12); display: flex; flex-direction: column; align-items: center; }
.score-btn .n { font-size: 64px; font-weight: 800; line-height: .9; letter-spacing: -.05em; }
.score-btn .t { font-size: 12px; font-weight: 800; letter-spacing: .04em; margin-top: 8px; text-transform: uppercase; }
.score-btn.them .t { color: rgba(255,255,255,.6); }
.spacer { height: 34px; }
.plen { display: flex; gap: 6px; }
.plen button { flex: 1; padding: 10px; border-radius: 8px; background: var(--fill); text-align: center; font-weight: 700; font-size: 13px; }
.plen button.on { background: #fff; color: var(--bg); font-weight: 800; }

.sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.6); z-index: 50; display: flex; flex-direction: column; justify-content: flex-end; }
.sheet { background: var(--card); border-radius: 24px 24px 0 0; padding: 14px 20px 40px; display: flex; flex-direction: column; gap: 14px; max-height: 85%; overflow: auto; }
.handle { width: 40px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.2); margin: 0 auto; }
.sheet .avatar.big { width: 56px; height: 56px; font-size: 18px; justify-self: start; }
.sheet .name { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.sheet .sub { font-size: 13px; color: var(--dim); font-weight: 600; }
.team-row { display: grid; grid-template-columns: 12px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--bg); }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.team-row .tn { font-size: 15px; font-weight: 700; }
.team-row .tc { font-size: 11px; color: var(--dim); }
.team-row .code { font-size: 11px; font-weight: 700; color: rgba(255,255,255,.6); margin-top: 4px; text-align: left; }
.sheet .panel { background: var(--bg); }
.sheet .panel input { background: var(--card); }
.screen.profile { gap: 14px; }
.screen.profile .team-row { background: var(--card); }
.screen.profile .btn.dark { background: var(--card); }
.screen.profile .name { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.screen.profile .sub { font-size: 13px; color: var(--dim); font-weight: 600; }
.screen.profile .avatar.big { width: 56px; height: 56px; font-size: 18px; }
.screen.profile .panel { background: var(--card); border-color: var(--line); }
.screen.profile .panel input { background: var(--bg); }
.error-bar.ok { background: var(--green); }
.team-row .remove { font-size: 12px; font-weight: 700; color: rgba(255,255,255,.4); padding: 6px 0 6px 8px; }
.sheet .btn.dark { background: var(--bg); color: #fff; font-weight: 700; font-size: 13px; }
.sheet .btn.dark.dim { color: rgba(255,255,255,.6); }
.score-card { border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.score-card .big { font-size: 56px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.score-card .mono { color: inherit; opacity: .85; }
.finish-score { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--bg); }
.finish-score .n { font-size: 40px; font-weight: 800; letter-spacing: -.04em; }
.share { padding: 14px; border-radius: 12px; background: var(--card); font: 600 13px ui-monospace, Menlo, monospace; line-height: 1.5; white-space: pre-wrap; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { padding: 12px; border-radius: 12px; background: var(--card); }
.stat .n { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.stat .l { font-size: 11px; color: var(--dim); font-weight: 700; }
.trow { display: grid; grid-template-columns: 44px 1fr 36px 36px 36px; gap: 6px; align-items: center; padding: 10px; border-radius: 10px; background: var(--card); }
.trow.head { background: none; padding: 0 10px; font: 700 11px ui-monospace, Menlo, monospace; letter-spacing: .06em; color: var(--dim); }
.trow.gk { grid-template-columns: 44px 1fr 36px 36px 56px; }
.trow .num { font-size: 18px; font-weight: 800; letter-spacing: -.03em; }
.trow .nm { font-size: 14px; font-weight: 700; }
.trow .c { text-align: center; font-size: 15px; font-weight: 700; }
.trow .c.p { font-weight: 800; }
