@font-face { font-family: "Inter"; font-weight: 400; font-display: block; src: url("/fonts/inter-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Inter"; font-weight: 400; font-display: block; src: url("/fonts/inter-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-weight: 600; font-display: block; src: url("/fonts/inter-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Inter"; font-weight: 700; font-display: block; src: url("/fonts/inter-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Inter"; font-weight: 600; font-display: block; src: url("/fonts/inter-cyrillic-600-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-weight: 700; font-display: block; src: url("/fonts/inter-cyrillic-700-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif; font-weight: 600; color: #fff;
  background: linear-gradient(160deg, #2f5f26, #1b3d17); overflow: hidden;
}
kbd { display: inline-block; min-width: 28px; padding: 3px 8px; margin: 0 2px; border-radius: 6px; background: #fff; color: #234; border-bottom: 3px solid #9bb; text-align: center; }

.btn { display: inline-block; border: 0; border-radius: 14px; background: linear-gradient(#ffd23f, #f5a300); color: #3a2400; padding: 10px 26px; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; box-shadow: 0 5px 0 #b87400; }
.btn.big { font-size: 1.5rem; padding: 14px 44px; }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #b87400; }

body.home { display: grid; place-items: center; overflow: auto; }
.hero { text-align: center; padding: 20px; }
.hero h1 { font-size: clamp(2.5rem, 9vw, 6rem); margin: 0; text-shadow: 0 6px 0 #1b3d17; }
.hero h1 span { color: #ffd23f; }
.hero .tag { opacity: .85; font-size: 1.2rem; margin-bottom: 28px; }

#game-root { position: fixed; inset: 0; background: #6fa84a; }
#game-root canvas { display: block; }

#hud { position: fixed; inset: 0; pointer-events: none; }
#hud-top { position: absolute; top: 8px; left: 8px; display: flex; flex-direction: column; align-items: center; gap: 3px; width: max-content; }
.score-pill { display: flex; align-items: stretch; border-radius: 10px; overflow: hidden; border: 2px solid #3a5a2e; background: #2e4f28; font-size: clamp(16px, 2.2vw, 26px); box-shadow: 0 3px 8px rgba(0,0,0,.35); }
.score-pill > span { padding: 4px 0; box-sizing: border-box; width: 2.6em; flex: none; text-align: center; font-variant-numeric: tabular-nums; }
.score-pill > .timer { width: 3.6em; }
.timer.gg { font-size: .6em; letter-spacing: 1px; font-weight: 700; color: #ffd23f; display: flex; align-items: center; justify-content: center; }
.sc.red { background: #e8252a; font-weight: 900; text-shadow: 0 2px 0 rgba(0,0,0,.3); } .sc.blue { background: #2196f3; font-weight: 900; text-shadow: 0 2px 0 rgba(0,0,0,.3); }
.timer { background: #2e4f28; color: #f2f5ea; font-weight: 400; letter-spacing: 2px; min-width: 3.6em; }
#banner { position: absolute; top: 38%; left: 0; right: 0; text-align: center; font-size: clamp(36px, 10vw, 120px); -webkit-text-stroke: 3px #1d3b14; paint-order: stroke fill; text-shadow: 0 6px 0 rgba(0,0,0,.3); }
#banner.show { animation: pop .35s ease-out; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.overlay { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(10, 30, 8, .6); z-index: 10; }
.overlay[hidden], #hud[hidden] { display: none; }
.card { width: min(92vw, 420px); padding: 26px; border-radius: 16px; background: #2d5a24; border: 3px solid #1d3b14; box-shadow: 0 10px 30px rgba(0,0,0,.5); text-align: center; }
.card h2 { margin: 0 0 16px; font-size: 1.8rem; }
.card input { width: 100%; padding: 12px; border-radius: 10px; border: 0; font: inherit; font-size: 1.1rem; text-align: center; }
.teams { display: flex; gap: 14px; margin: 18px 0; }
.team-card { flex: 1; padding: 14px 8px; border-radius: 14px; border: 4px solid transparent; color: #fff; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 2px; opacity: .7; }
.team-card b { font-size: 1.3rem; } .team-card span { font-size: 2rem; } .team-card small { opacity: .85; }
.team-card.red { background: #e0352b; } .team-card.blue { background: #1a7fe0; }
.team-card.selected { opacity: 1; border-color: #ffe600; transform: scale(1.05); }
.error { color: #ffb3a8; min-height: 1.3em; margin-bottom: 8px; }

/* touch controls */
body.play { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; }
#touch { position: absolute; inset: 0; pointer-events: none; }
#touch[hidden] { display: none; }
#stick { position: absolute; left: max(24px, env(safe-area-inset-left)); bottom: max(24px, env(safe-area-inset-bottom)); width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.18); border: 3px solid rgba(255,255,255,.45); pointer-events: auto; touch-action: none; }
#stick-knob { position: absolute; left: 50%; top: 50%; width: 70px; height: 70px; margin: -35px 0 0 -35px; border-radius: 50%; background: rgba(255,255,255,.65); box-shadow: 0 3px 8px rgba(0,0,0,.35); }
.tbtns { position: absolute; right: max(20px, env(safe-area-inset-right)); bottom: max(24px, env(safe-area-inset-bottom)); width: 230px; height: 190px; pointer-events: none; }
.tbtn { position: absolute; border: 3px solid rgba(255,255,255,.7); border-radius: 50%; color: #fff; font: inherit; font-weight: 800; font-size: 13px; pointer-events: auto; touch-action: none; opacity: .85; }
.tbtn.active { filter: brightness(1.4); transform: scale(.93); }
.tbtn.kick { width: 96px; height: 96px; right: 0; bottom: 0; background: rgba(245,163,0,.8); font-size: 16px; }
.tbtn.power { width: 84px; height: 84px; right: 108px; bottom: 6px; background: rgba(255,59,48,.8); }
.tbtn.boost { width: 78px; height: 78px; right: 40px; bottom: 108px; background: rgba(30,144,255,.8); }
@media (max-height: 420px) { #stick { width: 130px; height: 130px; } }

#fs-btn { position: absolute; right: max(4px, env(safe-area-inset-right)); bottom: max(4px, env(safe-area-inset-bottom)); width: 34px; height: 34px; border: 0; border-radius: 8px; background: rgba(0,0,0,.35); color: #fff; font-size: 20px; line-height: 1; pointer-events: auto; z-index: 6; }
#fs-btn[hidden] { display: none; }

/* phones in landscape */
@media (max-height: 500px) and (orientation: landscape) {
  .overlay { overflow-y: auto; align-items: start; padding: 6px 0; }
  .card { padding: 12px 16px; margin: auto; }
  .card h2 { font-size: 1.2rem; margin-bottom: 8px; }
  .card input { padding: 8px; font-size: 1rem; }
  .btn { padding: 6px 18px; }
  .btn.big { font-size: 1.1rem; padding: 8px 28px; }
  .btn.small { font-size: .9rem; padding: 6px 16px; margin: 8px 4px 0; }
  .hero h1 { font-size: 2.6rem; }
  .hero .tag { font-size: 1rem; margin-bottom: 8px; }
  .hero { padding: 8px; }
  .home-form { margin: 8px auto; }
  .home-form input { padding: 10px; margin-bottom: 4px; }
  #rooms-list { max-height: 34vh; }
  #hub-content .btn.big { margin-top: 8px; font-size: 1rem; padding: 8px 24px; }
  .tab-pane { min-height: 0; }
  .set-row, .set-check { margin-bottom: 6px; }
  .set-row input, .set-row select { padding: 6px; }
  #settings-page .card, #create-room .card { max-height: calc(100vh - 12px); overflow-y: auto; }

  #hud-top { top: max(4px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); }
  .score-pill { font-size: 15px; }
  #banner { top: 30%; font-size: clamp(28px, 9vh, 64px); }
  #banner.top { top: 40px; font-size: 18px; }
  #scoreboard { top: 4px; max-height: calc(100vh - 8px); padding: 8px 12px; font-size: 13px; }
  #sb-teams { margin-top: 6px; }
  #sb-teams .pick { padding: 4px; }
  #admin-bar { margin-top: 8px; padding-top: 8px; }
  #admin-bar button { padding: 5px 10px; font-size: 12px; }
  #room-info { margin-bottom: 4px; }

  #chat { left: max(8px, env(safe-area-inset-left)); bottom: auto; top: 4px; width: min(300px, 32vw); }
  #chat-log { height: 64px; font-size: .75rem; padding: 2px 4px; }
  #chat-input { padding: 4px 8px; font-size: .8rem; }
  #chat-hint { display: none; }
  #emote-bar { bottom: auto; top: 40px; left: auto; right: max(8px, env(safe-area-inset-right)); transform: none; flex-direction: column; gap: 3px; padding: 3px; }
  .emote { width: 34px; height: 34px; font-size: 1.2rem; }
  .emote i { display: none; }
  #stick { width: 120px; height: 120px; left: max(16px, env(safe-area-inset-left)); bottom: max(14px, env(safe-area-inset-bottom)); }
  #stick-knob { width: 52px; height: 52px; margin: -26px 0 0 -26px; }
  .tbtns { width: 200px; height: 150px;   right: max(14px, env(safe-area-inset-right)); bottom: max(44px, calc(env(safe-area-inset-bottom) + 40px)); }
  .tbtn.kick { width: 80px; height: 80px; }
  .tbtn.power { width: 68px; height: 68px; right: 90px; bottom: 4px; }
  .tbtn.boost { width: 64px; height: 64px; right: 36px; bottom: 90px; }
  #debug { bottom: auto; top: 4px; right: 60px; }
}

.btn.small { font-size: 1rem; padding: 8px 22px; margin: 12px 6px 0; }
.ctl-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; }
.ctl-key { min-width: 110px; padding: 6px 12px; border-radius: 8px; border: 2px solid #1d3b14; background: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.ctl-key.listening { background: #ffd23f; }
.ctl-note { font-size: .8rem; opacity: .8; }

#chat { position: absolute; left: 12px; bottom: 12px; width: min(380px, 60vw); z-index: 5; pointer-events: none; }
#chat-log { height: 130px; overflow-y: auto; display: flex; flex-direction: column; justify-content: flex-end; padding: 6px 8px; border-radius: 8px; background: transparent; color: #fff; font-size: .9rem; text-shadow: 0 1px 2px #000, 0 0 3px #000; word-break: break-word; }
#chat.typing #chat-log { justify-content: flex-start; background: rgba(0,0,0,.25); pointer-events: auto; }
.chat-msg[hidden] { display: none; }
#chat-input { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid rgba(255,255,255,.4); border-radius: 8px; background: rgba(0,0,0,.25); color: #fff; font: inherit; outline: none; pointer-events: auto; }
#chat-input[hidden] { display: none; }
#chat-send { display: block; margin-top: 4px; padding: 8px 16px; border: 0; border-radius: 8px; background: #f5a300; color: #fff; font: inherit; font-weight: 800; pointer-events: auto; touch-action: manipulation; }
#chat-send[hidden] { display: none; }
#emote-bar { pointer-events: auto; }
#chat-hint { margin-top: 4px; padding: 6px 10px; border-radius: 8px; background: rgba(0,0,0,.25); color: rgba(255,255,255,.85); font-size: .85rem; }
#chat-hint[hidden] { display: none; }

#emote-bar { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 6px; padding: 6px; border-radius: 12px; background: rgba(0,0,0,.25); z-index: 5; }
.emote { position: relative; width: 46px; height: 46px; border: 0; border-radius: 10px; background: rgba(255,255,255,.2); font-size: 1.6rem; cursor: pointer; }
.emote:hover { background: rgba(255,255,255,.35); }
.emote i { position: absolute; top: 1px; left: 5px; font-size: .7rem; font-style: normal; color: #fff; opacity: .8; }

.tside { display: none; }
body.touch .tside { position: absolute; top: max(6px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); display: flex; flex-direction: column; gap: 6px; z-index: 8; pointer-events: none; }
.tside button { width: 40px; height: 40px; border: 0; border-radius: 10px; background: rgba(0,0,0,.4); color: #fff; font-size: 20px; line-height: 1; pointer-events: auto; touch-action: manipulation; }
body.touch #chat-hint { display: none; }
body.touch #emote-bar { display: none; }
body.touch #emote-bar.open { display: flex; position: absolute; top: max(6px, env(safe-area-inset-top)); right: calc(max(8px, env(safe-area-inset-right)) + 48px); bottom: auto; left: auto; transform: none; flex-direction: row; gap: 4px; padding: 4px; }
body.touch .emote { width: 42px; height: 42px; font-size: 1.4rem; }
body.touch .emote i { display: none; }
@media (max-height: 500px) and (orientation: landscape) {
  #chat { left: max(8px, env(safe-area-inset-left)); bottom: auto; top: 4px; width: min(300px, 32vw); }
  #chat-log { height: 64px; font-size: .75rem; padding: 2px 4px; }
  #chat-input { padding: 4px 8px; font-size: .8rem; }
  #chat-hint { display: none; }
  #emote-bar { bottom: auto; top: 40px; left: auto; right: max(8px, env(safe-area-inset-right)); transform: none; flex-direction: column; gap: 3px; padding: 3px; }
  .emote { width: 34px; height: 34px; font-size: 1.2rem; }
  .emote i { display: none; }
  body.touch #emote-bar.open { top: max(6px, env(safe-area-inset-top)); right: calc(max(8px, env(safe-area-inset-right)) + 48px); flex-direction: row; gap: 4px; padding: 4px; }
  body.touch .emote { width: 42px; height: 42px; font-size: 1.4rem; }
}
#debug { position: absolute; right: 12px; bottom: 12px; margin: 0; padding: 6px 10px; border-radius: 8px; background: rgba(0,0,0,.45); color: #fff; font: 12px/1.4 Consolas, monospace; z-index: 5; pointer-events: none; }
#debug[hidden] { display: none; }
@media (max-height: 500px) and (orientation: landscape) { #debug { bottom: auto; top: 4px; right: 60px; } }

#banner-main { display: block; }
#banner-assist { display: block; font-size: .24em; margin-top: .15em; -webkit-text-stroke: 2px #1d3b14; paint-order: stroke fill; color: #fff; }
#banner-assist .assist-ball { display: inline-block; width: 1.25em; height: 1.25em; line-height: 1.25em; margin-right: .4em; border-radius: 50%; background: #fff; border: .12em solid #222; box-sizing: border-box; color: #222; font-style: normal; font-weight: 700; font-size: .8em; line-height: 1.05em; -webkit-text-stroke: 0; vertical-align: middle; }
#banner-sub { display: block; font-size: .28em; margin-top: .2em; -webkit-text-stroke: 2px #1d3b14; paint-order: stroke fill; color: #fff; }
#scoreboard[hidden] { display: none; }
#scoreboard { position: absolute; top: 10%; left: 50%; transform: translateX(-50%); width: min(760px, 94vw); max-height: 84vh; overflow-y: auto; padding: 16px 20px; border-radius: 14px; background: rgba(15, 30, 12, .82); border: 2px solid #1d3b14; z-index: 7; font-size: 17px; }
#scoreboard .sb-team { margin-bottom: 8px; }
#scoreboard .sb-team:last-child { margin-bottom: 0; }
#scoreboard .sb-head, #scoreboard .sb-row { display: grid; grid-template-columns: 1fr 48px 40px 40px 48px 44px 40px 100px; gap: 8px; padding: 3px 6px; }
#scoreboard .sb-row.bot span:last-child { opacity: .8; }
#scoreboard .sb-x, #scoreboard .sb-add { border: 0; border-radius: 6px; background: rgba(255,255,255,.25); color: #fff; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; touch-action: manipulation; }
#scoreboard .sb-x { margin-right: 6px; padding: 0 6px; }
#scoreboard .sb-add { margin-left: 8px; padding: 1px 8px; }
#scoreboard .sb-x:hover, #scoreboard .sb-add:hover { background: rgba(255,255,255,.45); }
#scoreboard select.sb-ai { width: 100%; padding: 1px 2px; border-radius: 6px; border: 0; font: inherit; font-size: 12px; }
#admin-bar select { padding: 6px 8px; border-radius: 8px; border: 2px solid #1d3b14; background: rgba(34, 70, 26, .85); color: #fff; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
#admin-bar select[hidden] { display: none; }
#scoreboard .sb-head { font-weight: 700; border-radius: 6px; }
#scoreboard .sb-head.red { background: rgba(255, 59, 48, .75); }
#scoreboard .sb-head.blue { background: rgba(30, 144, 255, .75); }
#scoreboard .sb-row.me { background: rgba(255, 255, 255, .15); border-radius: 6px; }
#scoreboard .sb-row span:nth-child(n+2), #scoreboard .sb-head span:nth-child(n+2) { text-align: right; }
#scoreboard .sb-specs { margin-top: 8px; opacity: .75; font-size: 12px; }
#scoreboard { pointer-events: auto; }
#sb-teams { display: flex; gap: 8px; margin-top: 10px; }
#sb-teams .pick { flex: 1; padding: 8px 6px; border: 3px solid transparent; border-radius: 10px; color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
#sb-teams .pick.red { background: #e0352b; } #sb-teams .pick.blue { background: #1a7fe0; } #sb-teams .pick.spec { background: #5b6b57; }
#sb-teams .pick.cur { border-color: #ffe600; }
#sb-teams .pick:disabled { opacity: .4; cursor: not-allowed; }


#room-info { margin-bottom: 10px; font-weight: 800; font-size: 1.1em; opacity: .9; }
#scoreboard .sb-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
#scoreboard .sb-top #room-info { margin-bottom: 0; }
.sb-zoom { display: flex; align-items: center; gap: 8px; font-size: .85em; white-space: nowrap; }
.sb-zoom input { width: 110px; }
.sb-zoom b { min-width: 3em; text-align: right; font-weight: 700; }
#admin-bar button { padding: 8px 14px; border-radius: 8px; border: 2px solid #1d3b14; background: rgba(34, 70, 26, .85); color: #fff; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
#admin-bar button:hover { background: rgba(60, 110, 46, .95); }
#admin-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.2); }
#admin-bar button[hidden] { display: none; }
#admin-bar[hidden] { display: none; }
#scoreboard .sb-adm { color: #ffd54a; }
#leave-btn { margin-left: auto; }
#adm-start { background: #f5a300 !important; color: #3a2400 !important; border-color: #b87400 !important; }

#rooms-list { max-height: 48vh; overflow-y: auto; }
.room-row { display: grid; grid-template-columns: 1.6fr 1.1fr .8fr 1fr 1.6fr 90px; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; font-size: .95rem; }
.room-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-row:not(.head) { background: rgba(0,0,0,.2); margin-bottom: 6px; }
.room-row.head { opacity: .7; font-size: .8rem; text-transform: uppercase; letter-spacing: 1px; }
.room-row .btn.small { margin: 0; padding: 4px 14px; box-shadow: 0 3px 0 #b87400; }
.rooms-empty { padding: 26px; text-align: center; opacity: .8; }
#hub-content .btn.big { display: block; margin: 14px auto 0; font-size: 1.2rem; padding: 12px 34px; }
@media (max-width: 640px) { .room-row { grid-template-columns: 1.4fr 1fr 1.4fr 80px; } .room-row > span:nth-child(3), .room-row > span:nth-child(4) { display: none; } }

#settings-page, #create-room { z-index: 15; }
.set-row { display: block; margin-bottom: 12px; text-align: left; }
.set-row b { float: right; }
.set-row input, .set-row select { width: 100%; margin-top: 4px; padding: 10px; border-radius: 10px; border: 0; font: inherit; }
.set-row input[type=range] { padding: 0; }
.set-check { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; text-align: left; }
.set-check input { width: auto; }
.seg { display: flex; gap: 6px; margin-top: 6px; }
.seg button { flex: 1; padding: 10px 0; border: 0; border-radius: 10px; background: rgba(0,0,0,.25); color: #fff; font: inherit; font-weight: 800; font-size: 1.1rem; cursor: pointer; }
.seg button.on { background: #ffd23f; color: #3a2400; }

.home-form { margin: 18px auto; width: min(90vw, 320px); }
.home-form input { width: 100%; padding: 14px; border-radius: 12px; border: 0; font: inherit; font-size: 1.1rem; text-align: center; margin-bottom: 8px; }
.home-form .error { color: #ffb3a8; min-height: 1.2em; margin-bottom: 8px; }
#banner.top { top: 52px; font-size: clamp(20px, 3.2vw, 34px); -webkit-text-stroke: 2px #1d3b14; text-shadow: 0 3px 0 rgba(0,0,0,.3); }
#banner.top #banner-sub, #banner.top #banner-assist { font-size: .5em; margin-top: .3em; }
.settings-card { position: relative; width: min(94vw, 460px); }
.settings-card .x { position: absolute; top: 10px; right: 12px; width: 30px; height: 30px; border-radius: 8px; border: 0; background: rgba(0,0,0,.25); color: #fff; font-size: 16px; cursor: pointer; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tab { flex: 1; padding: 8px; border: 0; border-radius: 10px 10px 0 0; background: rgba(0,0,0,.25); color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.tab.active { background: #ffd23f; color: #3a2400; }
.tab-pane[hidden] { display: none; }
.skin-top { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 8px; }
#skin-preview { width: 108px; height: 108px; border-radius: 50%; background: rgba(0,0,0,.2); }
.skin-row { margin-bottom: 8px; font-weight: 700; }
.skin-row .seg { flex-wrap: wrap; }
.skin-row .seg button { padding: 6px 8px; font-size: .85rem; flex: 1 1 auto; }
.swatches { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.swatches button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.swatches button.on { border-color: #ffd23f; box-shadow: 0 0 0 2px #3a2400; }
.tab-pane { min-height: 210px; }
.set-actions { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.set-actions .btn.small { margin: 0; }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.5); }
#settings-page { z-index: 20; }
.home-links { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.home-links .btn { text-decoration: none; }

/* hub shell */
#hub { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; background: #2d5a24; overflow: hidden; }
#hub[hidden] { display: none; }
.hub-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; background: #1d3b14; }
.nav-badge { margin-left: 6px; padding: 0 7px; border-radius: 10px; background: #d9534f; color: #fff; font-size: .8rem; }
.friend-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; margin-bottom: 6px; border-radius: 10px; background: rgba(0,0,0,.2); }
.friend-row canvas { width: 40px; height: 40px; flex: none; }
.friend-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.friend-main small { opacity: .75; }
.friend-row.st-offline { opacity: .6; }
.friend-actions { display: flex; gap: 6px; align-items: center; }
.friend-actions .btn.small { margin: 0; padding: 4px 12px; }
.friend-search { width: 100%; box-sizing: border-box; margin: 10px 0; padding: 10px 12px; border-radius: 10px; border: 0; font: inherit; }
.friend-results { margin-bottom: 12px; }
.beta-note { font-size: 12px; opacity: .8; padding: 6px 12px; }
.beta-note b { color: #ffd23f; margin-right: 6px; }
.beta-note a { margin-left: 8px; }
.hub-footer { font-size: 11px; opacity: .5; text-align: center; padding: 8px; }
.hub-reconnect { opacity: .6; font-style: italic; margin-right: 8px; }
.hub-profile { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hub-profile canvas { width: 44px; height: 44px; border-radius: 50%; background: rgba(0,0,0,.25); flex: none; }
.hub-profile b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-profile small { opacity: .7; }
.hub-actions { display: flex; gap: 8px; }
.hub-actions .btn.small { margin: 0; padding: 6px 16px; }
#hub-nav { display: flex; gap: 4px; padding: 8px 16px; background: rgba(0,0,0,.2); overflow-x: auto; }
#hub-nav a { color: inherit; text-decoration: none; padding: 8px 16px; border-radius: 10px; font-weight: 700; white-space: nowrap; opacity: .8; }
#hub-nav a.on { background: #f5a300; color: #3a2400; opacity: 1; }
#hub-content { flex: 1; overflow-y: auto; width: min(100%, 900px); margin: 0 auto; padding: 16px; box-sizing: border-box; text-align: left; }
#hub-content h2 { margin: 0 0 12px; }
.hub-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.hub-head .btn.small { margin: 0; }
.hub-state { padding: 26px; text-align: center; opacity: .8; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 10px; }
.pager .btn.small { margin: 0; }
#hub-content #rooms-list { max-height: none; }
.clickable { cursor: pointer; }
.hub-link { color: #ffd37a; text-decoration: none; font-weight: 600; }
.hub-link:hover { text-decoration: underline; }
.hub-table { width: 100%; border-collapse: collapse; }
.hub-table th, .hub-table td { padding: 6px 8px; text-align: left; border-bottom: 1px solid rgba(255,255,255,.12); }
.hub-table th { opacity: .7; font-size: .85rem; }
.hub-table tr.clickable:hover, .hub-table tr.me { background: rgba(245,163,0,.22); }
.res-win { color: #7bdc6b; font-weight: 700; } .res-loss { color: #ff7b72; font-weight: 700; } .res-draw { color: #d6d6d6; font-weight: 700; }
.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.profile-head h2 { margin: 0; }
.profile-sub { opacity: .75; margin-bottom: 4px; }
.skin-preview { width: 96px; height: 96px; border-radius: 50%; background: rgba(0,0,0,.25); flex: none; }
.profile-head .skin-preview { width: 160px; height: 160px; }
.emblem-none { display: inline-block; width: 36px; height: 36px; line-height: 36px; text-align: center; font-size: 20px; }
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stats-block { background: rgba(0,0,0,.2); border-radius: 12px; padding: 10px 12px; }
.stats-block h3, .profile-page > h3, .team-col h3 { margin: 0 0 8px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stat-cell b { display: block; } .stat-cell small { opacity: .7; }
.teams-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-top: 12px; }
.team-score { opacity: .7; }
.badge { margin-left: 6px; padding: 1px 6px; border-radius: 6px; font-size: .7rem; font-weight: 700; background: #f5a300; color: #3a2400; }
.badge.left { background: #777; color: #fff; }
#toasts { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.toast { padding: 10px 18px; border-radius: 10px; background: #1d3b14; border: 2px solid #f5a300; font-weight: 600; }
.toast.error { border-color: #d9534f; }
.party-invites { position: fixed; top: 70px; right: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.party-invites .toast { display: flex; align-items: center; gap: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.party-invites .btn.small { margin: 0; padding: 4px 12px; box-shadow: 0 3px 0 #b87400; }
.party-card { max-width: 560px; margin: 16px auto 0; text-align: center; }
.party-create { margin: 0; }
.party-head { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 8px; }
.party-leave { background: none; border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 8px; padding: 3px 10px; font: inherit; font-size: .75rem; font-weight: 700; cursor: pointer; }
.party-leave:hover { background: rgba(217,83,79,.6); }
.party-slots { display: flex; gap: 10px; justify-content: center; }
.party-slot { flex: 1; max-width: 170px; padding: 12px 8px; border-radius: 12px; background: rgba(0,0,0,.25); border: 2px solid transparent; color: #fff; font: inherit; position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.party-slot.leader { border-color: #f5a300; }
.party-slot.away { opacity: .55; }
.party-slot.pending { opacity: .7; }
.party-slot.add { cursor: pointer; border: 2px dashed rgba(255,255,255,.35); background: transparent; }
.party-slot.add:hover { border-color: #ffd23f; background: rgba(255,210,63,.08); }
.party-avatar { position: relative; width: 56px; height: 56px; }
.party-avatar .skin-preview { width: 56px; height: 56px; }
.party-avatar.ghost { display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 2px dashed rgba(255,255,255,.35); font-size: 1.6rem; font-weight: 800; }
.party-crown { position: absolute; top: -10px; right: -8px; font-size: 1.1rem; }
.party-name { font-weight: 800; font-size: .9rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.party-elo { font-size: .75rem; opacity: .75; }
.party-mod { display: flex; gap: 4px; margin-top: 2px; }
.party-mini { border: 0; border-radius: 6px; background: rgba(255,255,255,.15); color: #fff; width: 26px; height: 22px; cursor: pointer; font-size: .75rem; }
.party-mini:hover { background: #f5a300; color: #3a2400; }
.party-picker { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.party-picker .btn.small { margin: 0; }
.confirm-overlay { z-index: 40; }
.confirm-text { margin: 0 0 12px; }
.team-emblem { flex: none; }
.pdot { width: 10px; height: 10px; border-radius: 50%; background: #777; flex: none; }
.pdot.st-online { background: #7bdc6b; } .pdot.st-in_room, .pdot.st-in_queue { background: #f5a300; } .pdot.st-in_match { background: #ff7b72; }
.team-actions { margin-top: 8px; flex-wrap: wrap; }
.inbox-section { margin-top: 12px; }
.inbox-section h3, .team-page h3 { margin: 14px 0 8px; }
.team-form { max-width: 520px; }
.form-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.form-field input, .form-field textarea { padding: 10px 12px; border-radius: 10px; border: 0; font: inherit; box-sizing: border-box; width: 100%; }
.form-field small { opacity: .7; }
.form-error { margin-bottom: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(217,83,79,.35); }
.form-error[hidden] { display: none; }
.form-actions { display: flex; gap: 8px; }
.form-actions .btn.small { margin: 0; }
.emblem-row { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.emblem-grid { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.emblem-pick { padding: 2px; border-radius: 8px; border: 2px solid transparent; background: rgba(0,0,0,.25); cursor: pointer; }
.emblem-pick.on, .color-pick.on { border-color: #ffd23f; }
.color-pick { width: 28px; height: 28px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.sb-tag { opacity: .7; font-weight: 700; }
@media (max-width: 700px) {
  #hub { flex-direction: column; }
  .hub-top { padding: 8px 10px; }
  .hub-actions .btn.small { padding: 5px 10px; font-size: .85rem; }
  #hub-content { order: 1; padding: 10px; }
  #hub-nav { order: 2; justify-content: flex-start; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
  #hub-nav a { padding: 8px 12px; }
}
#minimap { position: absolute; top: 8px; right: 8px; width: 192px; height: 108px; opacity: .8; border-radius: 4px; pointer-events: none; }
@media (max-width: 700px), (max-height: 500px) { #minimap { width: 128px; height: 72px; top: 4px; right: 52px; } }
#minimap[hidden] { display: none; }

.toast-action { margin: 0 0 0 8px; pointer-events: auto; }
.toast:has(.toast-action) { pointer-events: auto; }
.t-card { align-items: flex-start; }
.t-badge { display: inline-block; padding: 1px 8px; border-radius: 8px; background: rgba(0,0,0,.35); font-size: .8rem; font-weight: 700; text-transform: uppercase; }
.t-badge.Live, .t-badge.Running { background: #d9534f; }
.t-badge.Done, .t-badge.Finished { background: #2e7d32; }
.t-admin { margin: 10px 0; padding: 10px; border-radius: 10px; background: rgba(0,0,0,.2); }
.t-admin h4 { margin: 0 0 8px; }
.t-bracket { display: flex; gap: 18px; overflow-x: auto; padding-bottom: 10px; }
.t-round { display: flex; flex-direction: column; justify-content: space-around; gap: 10px; min-width: 230px; flex: none; }
.t-round > h4 { margin: 0; text-align: center; }
.t-match { padding: 6px; border-radius: 10px; background: rgba(0,0,0,.25); border: 2px solid transparent; }
.t-match.Live { border-color: #d9534f; }
.t-side { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: 6px; }
.t-side.win { background: rgba(255,210,63,.3); font-weight: 800; }
.t-side.lose { opacity: .55; }
.t-side .t-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-side .t-score { font-variant-numeric: tabular-nums; font-weight: 800; }
.t-meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 4px; font-size: .8rem; }
.t-meta .btn.small { margin: 0; padding: 2px 8px; font-size: .75rem; }
.t-dialog .card { text-align: left; }
.t-dialog label { display: block; margin: 8px 0; }
.t-dialog input[type=number] { width: 5em; }
#hud-sub { font-size: 1rem; font-weight: 600; text-shadow: 0 1px 2px #000; pointer-events: none; white-space: nowrap; }
#hud-period { font-size: .7rem; opacity: .85; text-shadow: 0 1px 2px #000; pointer-events: none; white-space: nowrap; }
#hud-sub[hidden], #hud-period[hidden] { display: none; }
