* { box-sizing: border-box; }
body { margin: 0; overflow: hidden; font-family: system-ui, sans-serif; color: #fff; background: #111; }
canvas { display: block; }
#ui { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
#ui[hidden], #hud[hidden] { display: none; }
.panel { pointer-events: auto; background: rgba(10, 20, 40, .88); border-radius: 18px; padding: 24px 30px; max-width: 880px; max-height: 92vh; overflow: auto; text-align: center; box-shadow: 0 10px 40px #0008; }
.panel.overlay { position: fixed; bottom: 20px; background: rgba(10, 20, 40, .75); max-width: 640px; }
h1, h2 { margin: 0 0 10px; }
h1.gold { color: #ffc21a; text-shadow: 0 2px 10px #000; }
p { margin: 6px 0 14px; }
.err { color: #ff8a8a; min-height: 1.2em; margin: 4px 0; }
input { font-size: 20px; padding: 10px 14px; border-radius: 10px; border: 0; text-align: center; width: 260px; }
.cards { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 14px 0; }
.cards.teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.card { background: #22345a; color: #fff; border: 2px solid transparent; border-radius: 14px; padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; align-items: center; font-size: 15px; }
.card:hover { border-color: #ffc21a; transform: translateY(-2px); }
.card.big { width: 230px; padding: 26px 12px; font-size: 22px; }
.card small { opacity: .85; color: #ffd45a; }
.kit { width: 54px; height: 34px; border-radius: 8px 8px 4px 4px; border: 2px solid #fff6; }
.btn { background: #ffc21a; color: #222; font-weight: 800; font-size: 18px; border: 0; border-radius: 12px; padding: 12px 22px; cursor: pointer; margin: 4px; }
.btn:hover { background: #ffd45a; }
.btn.ghost { background: #ffffff22; color: #fff; font-size: 15px; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; }
.bracket { display: grid; gap: 6px; margin: 10px 0 16px; min-width: min(440px, 80vw); }
.row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; background: #ffffff14; padding: 6px 12px; border-radius: 8px; }
.row.mine { background: #ffc21a33; outline: 2px solid #ffc21a; }
.row span:first-child { text-align: right; } .row span:last-child { text-align: left; }
.win { color: #8dff9a; font-weight: 700; }
#hud { position: fixed; inset: 0; pointer-events: none; }
#scoreboard { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 12px; align-items: center; background: #000b; padding: 8px 18px; border-radius: 12px; font-size: 20px; }
#scoreboard b { font-size: 28px; min-width: 24px; text-align: center; }
#hn, #an { border-bottom: 4px solid; padding: 0 4px; }
#clock { position: absolute; top: 74px; left: 50%; transform: translateX(-50%); background: #000a; padding: 3px 12px; border-radius: 8px; }
#round { position: absolute; top: 74px; left: 14px; background: #000a; padding: 6px 12px; border-radius: 8px; font-size: 14px; }
#msg { position: absolute; top: 38%; width: 100%; text-align: center; font-size: 56px; font-weight: 900; text-shadow: 0 4px 14px #000; }
#charge { position: absolute; bottom: 60px; left: 50%; width: 220px; margin-left: -110px; height: 14px; background: #0008; border-radius: 8px; overflow: hidden; opacity: 0; }
#charge i { display: block; height: 100%; background: linear-gradient(90deg, #6f6, #fd3, #f44); }
#help { position: absolute; bottom: 14px; width: 100%; text-align: center; font-size: 14px; text-shadow: 0 1px 4px #000; }
