: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; }
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)); }
.error-bar.ok { background: var(--green); }

.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; }
.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; }
.grow { flex: 1; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: rgba(255,255,255,.8); }
.check input { width: 20px; height: 20px; accent-color: var(--red); }
.err { color: var(--red); font-weight: 700; font-size: 13px; }

.screen { flex: 1; overflow: visible; padding: 12px 20px 40px; display: flex; flex-direction: column; gap: 12px; }
#app > .screen:first-child { padding-top: calc(12px + env(safe-area-inset-top)); }
.screen.login { padding-top: calc(56px + env(safe-area-inset-top)); gap: 14px; }
form.screen, .screen form { display: flex; flex-direction: column; gap: 14px; }

.top { padding: 10px 16px 0; padding-top: calc(10px + 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; }
.avatar.big { width: 56px; height: 56px; font-size: 18px; }
.pill { display: grid; grid-template-columns: auto 1fr; 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); }

.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.dark { background: var(--card); color: #fff; font-weight: 700; font-size: 14px; border: 1.5px solid var(--line); }
.btn.dark.dim { color: rgba(255,255,255,.6); }
.btn[disabled] { opacity: .5; }
.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; }

.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; }
.team-pick { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: center; text-align: left; padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1.5px solid rgba(255,255,255,.06); }
.team-pick.on { border-color: var(--green); }
.team-pick .box { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; }
.team-pick.on .box { background: var(--green); border-color: var(--green); color: #fff; }
.team-pick .tn { font-size: 14px; font-weight: 700; }
.team-pick .tc { font-size: 11px; color: var(--dim); font-weight: 600; }
.progress { display: flex; flex-direction: column; gap: 6px; }
.progress .line { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; }
.progress .line.done { color: var(--dim); }
.progress .line.fail { color: var(--red); }

.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; }

.act-sub { font-size: 12px; color: var(--dim); font-weight: 600; }
.badge { font-size: 11px; font-weight: 800; letter-spacing: .06em; padding: 5px 8px; border-radius: 6px; background: var(--fill); white-space: nowrap; }
.badge.st1, .badge.st4 { background: rgba(22,163,74,.2); color: #4ade80; }
.badge.st2 { background: rgba(220,38,38,.2); color: #f87171; }
.badge.st5 { background: rgba(255,255,255,.06); color: rgba(255,255,255,.5); }
.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); }

.card { padding: 14px 16px; border-radius: 14px; background: var(--card); display: flex; flex-direction: column; gap: 8px; width: 100%; text-align: left; }
.card.compact { padding: 10px 12px; gap: 6px; }
.card.compact .line1 { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; min-width: 0; }
.card.compact .line2 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card.compact .cup-name { font-size: 15px; flex: 1 1 auto; min-width: 0; }
.card.compact .cup-when { display: flex; flex-direction: column; align-items: flex-end; flex: 0 0 auto; font-size: 11px; font-weight: 600; color: var(--dim); white-space: nowrap; line-height: 1.3; }
.card.compact .cup-when .badge { padding: 2px 5px; font-size: 9px; }
.card.compact .badge { padding: 3px 6px; font-size: 10px; }
.card.compact.cancelled { opacity: .6; }
.card.compact.cancelled .cup-name { text-decoration: line-through; }
.cup-name { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.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); }
.card .k { font-size: 11px; font-weight: 700; color: var(--dim); letter-spacing: .04em; }
.card .v { font-size: 14px; line-height: 1.45; white-space: pre-wrap; }
.note { background: var(--card); border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; }
.note .who { display: block; font-size: 11px; font-weight: 700; color: var(--dim); margin-bottom: 4px; }
.att-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--card); font-size: 13px; font-weight: 700; }

.team-row { display: grid; grid-template-columns: 12px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--card); }
.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 .remove { font-size: 12px; font-weight: 700; color: rgba(255,255,255,.4); padding: 6px 0 6px 8px; }
.screen.profile .name { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.screen.profile .sub { font-size: 13px; color: var(--dim); font-weight: 600; }
