:root {
  --ink: #241f5c; --accent: #ff3d68; --sun: #ffc233; --mint: #22d3a5;
  --sky: #3d7bff; --canvas: #fff6ec; --paper: #ffffff; --line: rgba(36,31,92,.12);
  --soft-ink: rgba(36,31,92,.58); --shadow: 0 9px 0 rgba(36,31,92,.06);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); font-family: "Space Grotesk", sans-serif; letter-spacing: 0; }
button, input { font: inherit; }
button, .button, .drop-zone { -webkit-tap-highlight-color: transparent; }
svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.app-shell { min-height: 100vh; display: flex; }
.control-rail { width: 300px; height: 100vh; position: sticky; top: 0; flex: 0 0 300px; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 25px; color: var(--paper); background: var(--ink); border-right: 6px solid var(--sun); }
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; flex: none; overflow: hidden; border-radius: 14px; background: var(--accent); font-family: "Fredoka", sans-serif; font-size: 21px; font-weight: 700; }
.brand-mark.has-logo { padding: 5px; background: var(--paper); }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand strong { display: block; font-family: "Fredoka", sans-serif; font-size: 20px; line-height: 1; }
.brand small { display: block; margin-top: 5px; color: rgba(255,255,255,.46); font-size: 9px; font-weight: 600; text-transform: uppercase; }
.status-row { display: flex; flex-wrap: wrap; gap: 6px; }
.status-row span { padding: 5px 9px; border-radius: 999px; background: rgba(255,255,255,.09); font-size: 10px; font-weight: 600; }
.status-row .live { color: var(--sun); background: rgba(255,194,51,.14); }
.live i { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: var(--sun); }
.rail-section { min-width: 0; }
.rounds-section { flex: 1; }
.rail-label { margin: 0 0 10px; color: rgba(255,255,255,.45); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.section-title { display: flex; align-items: center; justify-content: space-between; }
.section-title b { color: var(--sun); font-family: "Fredoka", sans-serif; font-size: 12px; }
.drop-zone { min-height: 112px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 18px; border: 2px dashed rgba(255,255,255,.25); border-radius: 14px; cursor: pointer; text-align: center; transition: border-color .2s, background .2s, transform .2s; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--sun); background: rgba(255,194,51,.07); transform: translateY(-2px); }
.drop-zone svg { width: 24px; margin-bottom: 8px; color: var(--sun); }
.drop-zone strong { font-family: "Fredoka", sans-serif; font-size: 15px; }
.drop-zone small { margin-top: 4px; color: rgba(255,255,255,.42); font-size: 10px; }
.file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.file-list { display: flex; flex-direction: column; gap: 7px; margin: 0; padding: 0; list-style: none; }
.file-list li { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 9px 9px 11px; border-radius: 10px; background: rgba(255,255,255,.06); }
.file-list li > span { min-width: 0; display: flex; align-items: center; gap: 8px; }
.file-list b { flex: none; color: var(--sun); font-family: "Fredoka", sans-serif; font-size: 11px; }
.file-list em { display: block; overflow: hidden; color: rgba(255,255,255,.68); font-size: 11px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.icon-button { width: 27px; height: 27px; padding: 0; border: 0; border-radius: 7px; color: rgba(255,255,255,.42); background: transparent; cursor: pointer; font-size: 19px; line-height: 1; }
.icon-button:hover { color: var(--paper); background: var(--accent); }
.empty-files { margin: 0; padding: 13px; border: 1px solid rgba(255,255,255,.09); border-radius: 10px; color: rgba(255,255,255,.4); font-size: 11px; }
.rail-actions { display: flex; flex-direction: column; gap: 8px; }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border: 0; border-radius: 12px; color: var(--ink); cursor: pointer; font-family: "Fredoka", sans-serif; font-size: 13px; font-weight: 600; text-decoration: none; transition: transform .15s, filter .15s; }
.button:hover { filter: brightness(.96); transform: translateY(-1px); }
.button:active { transform: translateY(1px); }
.button:disabled, .disabled-link { opacity: .4; pointer-events: none; }
.button-sun { background: var(--sun); }
.button-mint { width: 100%; background: var(--mint); }
.button-ghost { width: 100%; color: var(--paper); background: rgba(255,255,255,.09); }
.button-accent { color: var(--paper); background: var(--accent); }
.rail-foot { margin: 0; color: rgba(255,255,255,.34); font-size: 9px; line-height: 1.7; }
.standings-canvas { min-width: 0; flex: 1; padding: 42px clamp(26px, 4vw, 64px) 64px; overflow: hidden; }
.message { margin-bottom: 18px; padding: 12px 15px; border: 2px solid; border-radius: 10px; background: var(--paper); font-size: 12px; font-weight: 600; }
.message.success { border-color: var(--mint); }.message.error { border-color: var(--accent); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.event-tag { display: inline-block; margin-bottom: 10px; padding: 5px 11px; border-radius: 999px; color: var(--paper); background: var(--accent); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.page-head h1 { margin: 0; font-family: "Fredoka", sans-serif; font-size: clamp(38px, 5vw, 62px); line-height: .96; }
.page-head p { margin: 10px 0 0; color: var(--soft-ink); font-size: 12px; }
.summary { display: flex; gap: 9px; }
.summary div { min-width: 92px; padding: 11px 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--paper); text-align: center; }
.summary strong { display: block; font-family: "Fredoka", sans-serif; font-size: 23px; line-height: 1; }.summary small { display: block; margin-top: 4px; color: var(--soft-ink); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.table-scroll { width: 100%; overflow-x: auto; padding-bottom: 10px; }
.leaderboard { min-width: max(880px, calc(630px + var(--match-count) * 78px)); }
.table-grid { display: grid; grid-template-columns: 54px minmax(150px, 1.6fr) 48px 62px repeat(var(--match-count), minmax(72px, .7fr)) 60px 54px 78px; align-items: center; gap: 8px; }
.table-head { padding: 0 15px 10px; color: rgba(36,31,92,.43); font-size: 9px; font-weight: 700; text-align: center; text-transform: uppercase; }
.table-head span:nth-child(2) { text-align: left; }
.team-rows { display: flex; flex-direction: column; gap: 9px; }
.team-row { min-height: 66px; padding: 10px 15px; border: 2px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: var(--shadow); text-align: center; animation: row-in .35s ease both; }
.team-row:hover { border-color: rgba(36,31,92,.25); transform: translateY(-1px); }
.rank-badge { width: 38px; height: 38px; display: grid; place-items: center; border: 2px solid var(--line); border-radius: 11px; font-family: "Fredoka", sans-serif; font-size: 16px; font-weight: 700; }
.rank-1 .rank-badge { border-color: var(--ink); color: var(--paper); background: var(--ink); }.rank-2 .rank-badge { border-color: var(--sky); color: var(--paper); background: var(--sky); }.rank-3 .rank-badge { border-color: var(--mint); background: var(--mint); }
.team-name { min-width: 0; text-align: left; }.team-name strong { display: block; overflow: hidden; font-family: "Fredoka", sans-serif; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }.team-name small { display: block; margin-top: 3px; color: var(--soft-ink); font-size: 9px; }
.number { font-family: "Fredoka", sans-serif; font-size: 15px; font-weight: 600; }.number.muted { color: var(--soft-ink); }.number.booyah { color: var(--accent); }
.match-cell b, .match-cell small { display: block; }.match-cell b { font-family: "Fredoka", sans-serif; font-size: 13px; }.match-cell small { margin-top: 2px; color: var(--soft-ink); font-size: 8px; }
.total-score { min-width: 52px; justify-self: end; padding: 8px 9px; border-radius: 10px; color: var(--paper); background: var(--ink); font-family: "Fredoka", sans-serif; font-size: 19px; font-weight: 700; }
.rank-1 .total-score { color: var(--ink); background: var(--sun); }.rank-2 .total-score { background: var(--sky); }.rank-3 .total-score { color: var(--ink); background: var(--mint); }
.table-note { margin: 10px 3px 0; color: var(--soft-ink); font-size: 9px; line-height: 1.6; }
.team-editor { margin-top: 28px; border-top: 2px solid var(--line); border-bottom: 2px solid var(--line); }
.team-editor summary { display: flex; align-items: center; justify-content: space-between; padding: 17px 3px; cursor: pointer; list-style: none; }.team-editor summary::-webkit-details-marker { display: none; }
.team-editor summary b, .team-editor summary small { display: block; }.team-editor summary b { font-family: "Fredoka", sans-serif; font-size: 15px; }.team-editor summary small { margin-top: 3px; color: var(--soft-ink); font-size: 10px; }.team-editor summary i { font-size: 24px; font-style: normal; }
.team-editor[open] summary i { transform: rotate(45deg); }.team-editor form { padding: 2px 0 22px; }
.name-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 12px; margin-bottom: 16px; }
.name-grid label span { display: block; margin-bottom: 5px; color: var(--soft-ink); font-size: 9px; font-weight: 600; }
.name-grid input { width: 100%; padding: 10px 11px; border: 2px solid var(--line); border-radius: 9px; outline: none; color: var(--ink); background: var(--paper); font-size: 12px; }.name-grid input:focus { border-color: var(--sky); }
.empty-state { max-width: 620px; margin: 90px auto; text-align: center; }.empty-state > span { width: 56px; height: 56px; display: grid; place-items: center; overflow: hidden; margin: 0 auto 18px; border-radius: 16px; color: var(--paper); background: var(--ink); font-family: "Fredoka", sans-serif; }.empty-state > span img { width: 100%; height: 100%; object-fit: contain; padding: 6px; background: var(--paper); }.empty-state h2 { margin: 0; font-family: "Fredoka",sans-serif; font-size: 31px; }.empty-state p { max-width: 500px; margin: 10px auto 20px; color: var(--soft-ink); font-size: 13px; line-height: 1.7; }.mobile-upload { display: none; }
@keyframes row-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 820px) {
  .app-shell { display: block; }.control-rail { position: relative; width: 100%; height: auto; min-height: 0; padding: 18px; border-right: 0; border-bottom: 5px solid var(--sun); }.rounds-section, .rail-foot { display: none; }.rail-section { order: 3; }.drop-zone { min-height: 84px; }.rail-actions { display: grid; grid-template-columns: 1fr 1fr; }.rail-actions form { grid-column: 1/-1; }.standings-canvas { padding: 28px 16px 44px; }.page-head { align-items: flex-start; }.page-head h1 { font-size: 40px; }.summary { display: none; }
}
@media (max-width: 520px) { .status-row { margin-left: 55px; margin-top: -15px; }.page-head p { max-width: 290px; line-height: 1.5; }.table-note { font-size: 8px; }.empty-state { margin: 55px auto; }.mobile-upload { display: inline-flex; } }
