* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #1b1740; color: #fff; overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overscroll-behavior: none; }
button { font: inherit; color: inherit; border: 0; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; }

#app { position: relative; display: flex; flex-direction: column; height: var(--tg-viewport-stable-height, 100dvh);
  max-width: 560px; margin: 0 auto; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }

#top { display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: linear-gradient(180deg, rgba(26,20,58,.96), rgba(17,13,40,.98)); border-bottom: 1px solid rgba(140,125,235,.22); backdrop-filter: blur(8px); flex: none; }
#turnLabel { flex: 1; min-width: 0; font-weight: 700; font-size: 13px; line-height: 1.15; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (max-width: 420px) { #top { gap: 6px; padding: 6px 8px; } #wind { min-width: 0; padding: 5px 9px; font-size: 13px; } #round { padding: 6px 8px; } .icon { width: 34px; height: 34px; } }
#wind { display: flex; align-items: center; gap: 6px; background: #2a2360; border: 1px solid rgba(140,125,235,.25); border-radius: 999px; padding: 5px 12px; font-size: 14px; min-width: 96px; justify-content: center; }
#windArrow { letter-spacing: -2px; color: #8fe3ff; }
.icon { background: #2a2360; border: 1px solid rgba(140,125,235,.25); border-radius: 10px; width: 36px; height: 36px; font-size: 18px; flex: none; }
.icon.on { background: #ffb648; color: #231a44; }

#stage { position: relative; flex: 1; min-height: 0; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#readout { position: absolute; left: 8px; bottom: 8px; background: rgba(21,17,47,.72); border-radius: 8px; padding: 4px 9px; font-size: 13px; font-variant-numeric: tabular-nums; pointer-events: none; }
#banner { position: absolute; left: 0; right: 0; top: 27%; text-align: center; font-weight: 900; font-size: 26px; letter-spacing: 1px;
  color: #ffe27a; text-shadow: 0 2px 0 #231a44, 0 0 18px rgba(255,180,90,.7); opacity: 0; transform: scale(.8); transition: opacity .2s, transform .2s; pointer-events: none; z-index: 7; }
#banner.show { opacity: 1; transform: scale(1); }

#bottom { flex: none; background: linear-gradient(180deg, rgba(26,20,58,.96), rgba(17,13,40,.98)); border-top: 1px solid rgba(140,125,235,.22); backdrop-filter: blur(8px); padding: 8px 8px 10px; display: flex; flex-direction: column; gap: 8px; }
#bottom.off { opacity: .45; pointer-events: none; }
#weapons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
#weapons button { background: #2a2360; border-radius: 10px; padding: 7px 4px; font-size: 13px; font-weight: 700; border: 2px solid rgba(140,125,235,.25); }
#weapons button small { display: block; font-weight: 400; font-size: 10.5px; opacity: .75; }
#mapRow { align-items: center; }
#mapRow > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
#mapPrev { width: 72px; height: 88px; border-radius: 8px; border: 1.5px solid #6f62c9; flex: none; }
#mapNote { font-size: 11px; opacity: .7; line-height: 1.25; }
#weapons button[data-w=grapple] { grid-column: 1 / -1; padding: 5px 4px; }
#weapons button.sel { border-color: #ffb648; background: #3a2f7a; }
#weapons button:disabled { opacity: .4; }
#ctrl { display: flex; gap: 6px; align-items: stretch; }
.grp { flex: 1; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; gap: 2px 4px; }
.grp .lbl { grid-column: 1 / 3; grid-row: 1; text-align: center; font-size: 10.5px; opacity: .7; text-transform: uppercase; letter-spacing: .5px; }
.grp button { grid-row: 2; background: #2a2360; border: 1px solid rgba(140,125,235,.25); border-radius: 9px; height: 40px; font-size: 17px; font-weight: 700; }
.grp button:active, #weapons button:active { background: #45389a; }
#fire { flex: 1.15; background: linear-gradient(#ffc75e, #ff8f3c); color: #2b1505; font-weight: 900; font-size: 17px; border-radius: 12px; letter-spacing: 1px; box-shadow: 0 4px 16px rgba(255,143,60,.4), inset 0 1px 0 rgba(255,255,255,.5); }
#fire:active { filter: brightness(.9); }

.screen { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 24px 22px; text-align: center; background: linear-gradient(#1b1740 0%, #4a3a86 55%, #d9799a 100%); overflow-y: auto; }
.screen.hidden, .hidden { display: none; }
#lobbyList { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 340px; max-height: 38vh; overflow-y: auto; }
#lobbyList button { display: flex; justify-content: space-between; gap: 10px; background: rgba(21,17,47,.7); border: 2px solid #6f62c9; border-radius: 12px; padding: 11px 14px; font-size: 15px; text-align: left; }
#lobbyList button.mine { border-color: #ffb648; }
#lobbyList .teamLine { margin: 6px 0 0; font-size: 14px; font-weight: 700; }
#lobbyList .teamLine.amber { color: #ffb648; }
#lobbyList .teamLine.blue { color: #6ecbff; }
#lobbyList .teamLine.dim { font-weight: 400; font-size: 12px; opacity: .7; margin-top: 0; }
#lobbyStart:disabled { opacity: .5; }
#board { justify-content: flex-start; padding-top: 28px; }
#boardList { display: flex; flex-direction: column; gap: 5px; width: 100%; max-width: 360px; flex: 1; min-height: 120px; overflow-y: auto; }
#boardList div { display: flex; align-items: center; gap: 10px; background: rgba(21,17,47,.7); border: 2px solid transparent; border-radius: 10px; padding: 7px 12px; font-size: 15px; text-align: left; }
#boardList div.you { border-color: #ffb648; }
#boardList div.gap { background: none; justify-content: center; padding: 0; opacity: .6; }
#boardList .rk { width: 30px; font-weight: 800; color: #ffe27a; font-variant-numeric: tabular-nums; }
#boardList .sw { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #231a44; flex: none; }
#boardList b { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#boardList i { font-style: normal; font-variant-numeric: tabular-nums; }
#boardList small { opacity: .65; font-size: 11.5px; width: 62px; text-align: right; }
#shop { justify-content: flex-start; padding-top: 28px; }
#shopChoice.hidden { display: none; }
#plus { justify-content: flex-start; padding-top: 28px; overflow-y: auto; gap: 8px; }
#plusPerks { list-style: none; margin: 0; padding: 0; width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 6px; }
#plusPerks li { background: rgba(21,17,47,.7); border: 2px solid #4b4196; border-radius: 12px; padding: 8px 12px; text-align: left; font-size: 13px; line-height: 1.35; }
#plusPerks li b { display: block; color: #9af5cf; }
#plusPerks li:last-child b { color: #ffe27a; }
#plusState { color: #9af5cf; font-weight: 700; }
#plusNote { font-size: 11.5px; opacity: .8; max-width: 340px; }
#openPlus { border-color: #9af5cf; }
#openPlus.member { background: linear-gradient(135deg, rgba(154,245,207,.28), rgba(122,92,255,.32)); }
.plusMark { color: #9af5cf; font-style: normal; }
#resPlus { border-color: #9af5cf; }
#shopList { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 360px; flex: 1; min-height: 120px; overflow-y: auto; }
#shopList h3 { margin: 10px 0 2px; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; opacity: .8; text-align: left; }
#shopList button { display: flex; align-items: center; gap: 12px; background: rgba(21,17,47,.7); border: 2px solid #4b4196; border-radius: 12px; padding: 8px 12px; font-size: 15px; text-align: left; }
#shopList button.on { border-color: #ffb648; }
#shopList button b { flex: 1; font-weight: 600; }
#shopList button i { font-style: normal; font-size: 13px; opacity: .9; white-space: nowrap; }
#shopList .sw { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #231a44; flex: none; }
#shopList .sw.skin, #boardList .sw.skin { border: 0; border-radius: 0; background: none; }
#shopList .sw.trail { height: 8px; border-radius: 4px; border-width: 1px; }
#lobbyList button i { font-style: normal; opacity: .8; font-size: 13px; white-space: nowrap; }
.screen.glass { background: rgba(21,17,47,.86); }
h1 { margin: 0; font-size: 46px; letter-spacing: 6px; color: #ffe27a; text-shadow: 0 4px 0 #231a44; }
h1.brand { margin: 0; line-height: 0; letter-spacing: 0; text-shadow: none; }
#menuLogo { display: block; width: min(290px, 80vw); max-height: 155px; object-fit: cover; border-radius: 18px; box-shadow: 0 8px 26px rgba(15,11,36,.55), 0 0 0 2px rgba(255,226,122,.25); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
h2 { margin: 0; font-size: 30px; color: #ffe27a; }
.tag { margin: 0; opacity: .88; font-size: 14.5px; max-width: 360px; line-height: 1.4; }
.how { margin: 6px 0 0; font-size: 12.5px; opacity: .75; max-width: 340px; line-height: 1.45; }
.big { width: 100%; max-width: 320px; background: linear-gradient(#ffc75e, #ff8f3c); color: #2b1505; border-radius: 14px; padding: 13px 14px; font-size: 18px; font-weight: 800; box-shadow: 0 4px 14px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.45); }
.big small { display: block; font-size: 12px; font-weight: 500; opacity: .8; margin-top: 2px; }
.big.ghost { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.18); box-shadow: none; color: #fff; }
#relicList { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 340px; }
#relicList button { background: rgba(21,17,47,.7); border: 2px solid #6f62c9; border-radius: 14px; padding: 12px 14px; text-align: left; }
#relicList button b { display: block; color: #ffe27a; font-size: 17px; margin-bottom: 3px; }
#relicList button span { font-size: 13.5px; opacity: .9; }
#resHighlights { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
/* The result: the headline first, one clear next step, everything else small beneath it. */
#resTitle { font-size: 38px; letter-spacing: 1px; text-shadow: 0 3px 0 #231a44, 0 0 26px rgba(255,200,110,.45); animation: pop .45s cubic-bezier(.2,1.5,.4,1) both; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#resHighlights span { animation: pop .35s cubic-bezier(.2,1.5,.4,1) both; animation-delay: .25s; }
#resMore .big { display: flex; flex-direction: column; justify-content: center; }
#resMore .big small { font-size: 10.5px; }
/* A lone last item in the two-column grid takes the whole row rather than leaving a hole. */
#resMore > :not(.hidden):nth-last-child(1 of :not(.hidden)):nth-child(odd of :not(.hidden)) { grid-column: 1 / -1; }
@media (prefers-reduced-motion: reduce) { #resTitle, #resHighlights span { animation: none; } }
#resHighlights span { background: #ffe27a; color: #2b1505; font-weight: 800; font-size: 12px; border-radius: 999px; padding: 4px 10px; }

#round { font-size: 12px; font-weight: 700; background: #2a2360; border: 1px solid rgba(140,125,235,.25); border-radius: 999px; padding: 6px 10px; white-space: nowrap; }
#round.warn { background: #7a2340; color: #ffd0d8; }
#round:empty { display: none; }
#windNext { font-size: 11px; opacity: .7; white-space: nowrap; }
#charge { position: absolute; right: 8px; bottom: 8px; background: rgba(21,17,47,.72); border-radius: 8px; padding: 4px 9px; font-size: 13px; letter-spacing: 2px; pointer-events: none; color: #ffe27a; }
#squadBar { position: absolute; left: 6px; right: 6px; top: 6px; display: flex; justify-content: space-between; pointer-events: none; }
.team { display: flex; gap: 4px; }
.port { position: relative; width: 46px; background: rgba(21,17,47,.72); border: 2px solid transparent; border-radius: 9px; padding: 2px 2px 4px; display: flex; flex-direction: column; align-items: center; pointer-events: auto; }
.port canvas { display: block; }
.port i { display: block; width: 36px; height: 4px; border-radius: 2px; background: #3a3170; overflow: hidden; }
.port i b { display: block; height: 100%; background: #6be38a; }
.port.cur { border-color: #ffe27a; }
.port.acted { opacity: .5; }
.port.dead { opacity: .22; filter: grayscale(1); }
.port[data-st]::after { content: attr(data-st); position: absolute; top: -5px; right: -4px; background: #ffe27a; color: #2b1505; font-size: 8.5px; font-weight: 800; border-radius: 6px; padding: 1px 3px; text-transform: uppercase; }
#pick { justify-content: flex-start; padding: 18px 14px; gap: 8px; }
#pick h2 { font-size: 24px; }
#pickGrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; width: 100%; max-width: 420px; }
#pickGrid button { background: rgba(21,17,47,.7); border: 2px solid #4b4196; border-radius: 10px; padding: 5px 1px 6px; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 10.5px; font-weight: 700; }
#pickGrid button small { font-weight: 400; font-size: 9px; opacity: .7; }
#pickGrid button.on { border-color: #ffb648; background: #3a2f7a; }
#pickGrid button.focus { box-shadow: 0 0 0 2px rgba(255,255,255,.55); }
#pickGrid button:disabled { opacity: .38; }
#pickSlots { display: flex; gap: 6px; width: 100%; max-width: 420px; }
#pickSlots:empty { display: none; }
#pickSlots button { flex: 1; background: rgba(21,17,47,.7); border: 2px dashed #6f62c9; border-radius: 10px; padding: 6px 4px; font-size: 12.5px; font-weight: 700; }
#pickSlots button.full { border-style: solid; border-color: #ffb648; }
#pickSlots button small { display: block; font-weight: 400; font-size: 10px; opacity: .75; }
#pickInfo { width: 100%; max-width: 420px; background: rgba(21,17,47,.7); border-radius: 12px; padding: 9px 12px; text-align: left; font-size: 12.5px; line-height: 1.45; }
#pickInfo b { color: #ffe27a; }
#pickInfo h3 { margin: 0 0 3px; font-size: 15px; }
#pickInfo h3 small { font-weight: 400; opacity: .75; font-size: 12px; }
#pickInfo div { opacity: .92; }
#pickGo:disabled { opacity: .45; }

#tip { position: absolute; left: 8px; right: 8px; top: 64px; margin: 0 auto; max-width: 420px; background: rgba(21,17,47,.88); border: 1.5px solid #6f62c9; border-radius: 10px; padding: 6px 10px; font-size: 12.5px; line-height: 1.35; text-align: center; pointer-events: auto; backdrop-filter: blur(10px); box-shadow: 0 8px 28px rgba(8,5,24,.55); }
#tip.solo { top: 8px; }
#tip.danger { border-color: #ff5d73; }
#card { position: absolute; left: 10px; right: 10px; bottom: 44px; margin: 0 auto; max-width: 420px; background: rgba(21,17,47,.95); border: 2px solid #ffe27a; border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.4; text-align: left; z-index: 3; backdrop-filter: blur(10px); box-shadow: 0 8px 28px rgba(8,5,24,.55); }
#card b { display: block; color: #ffe27a; font-size: 15px; margin-bottom: 3px; }
#card small { display: block; opacity: .55; font-size: 10.5px; margin-top: 4px; text-align: right; }
#ghostBtn { position: absolute; left: 50%; transform: translateX(-50%); bottom: 8px; background: rgba(21,17,47,.8); border: 1.5px solid #ffe27a; color: #ffe27a; border-radius: 8px; padding: 5px 10px; font-size: 12px; font-weight: 700; }
.row { display: flex; gap: 8px; width: 100%; max-width: 320px; }
.big.half { padding: 10px 6px; font-size: 15px; }
/* The lobby: each way to start a match is one card, with its options under its button. */
.group { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 320px; padding: 8px; border-radius: 16px; background: rgba(21,17,47,.38); border: 1.5px solid rgba(111,98,201,.55); }
.group .big { max-width: none; }
.group:not(:has(> :not(.hidden))) { display: none; }
.big.slim { padding: 8px 10px; font-size: 14px; font-weight: 700; border-radius: 10px; }
.row .half { flex: 1; }
#lobby { justify-content: flex-start; overflow-y: auto; padding-top: 18px; }
/* The menu: modes as a grid of cards, tools under them, settings folded away. */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; max-width: 320px; }
.grid2 .big { padding: 11px 6px; font-size: 16px; min-height: 62px; }
.grid2 .big small { font-size: 11px; line-height: 1.25; }
.grid2 .big.ghost { font-size: 15px; min-height: 0; padding: 10px 6px; }
.grid2 .wide { grid-column: 1 / -1; min-height: 0; }
#settings { width: 100%; max-width: 320px; }
#settings summary { list-style: none; cursor: pointer; text-align: center; padding: 9px; border-radius: 12px; background: rgba(255,255,255,.08); font-weight: 700; font-size: 14.5px; }
#settings summary::-webkit-details-marker { display: none; }
#settings summary::after { content: ' ▾'; opacity: .7; }
#settings[open] summary::after { content: ' ▴'; }
#settings .row { margin-top: 8px; }
#settings .row .half { flex: 1; }
#codex { justify-content: flex-start; padding-top: 28px; }
#codexList { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 400px; flex: 1; min-height: 120px; overflow-y: auto; text-align: left; }
#codexList div { background: rgba(21,17,47,.7); border-radius: 10px; padding: 8px 12px; font-size: 13px; line-height: 1.4; }
#codexList div b { display: block; color: #ffe27a; font-size: 14.5px; }
#codexList div.unmet { opacity: .45; }
#menu { justify-content: flex-start; }

#pickInfo .sigs { display: flex; gap: 6px; margin: 5px 0; }
#pickInfo .sigs button { flex: 1; background: rgba(42,35,96,.9); border: 2px solid #4b4196; border-radius: 9px; padding: 5px 6px; font-size: 12px; text-align: left; }
#pickInfo .sigs button.on { border-color: #ffb648; background: #3a2f7a; }
#pickInfo .sigs button small { display: block; opacity: .75; font-size: 10.5px; }
#weapons button[data-salvage] { border-color: #ffe27a; }

#resignBtn { position: absolute; right: 8px; bottom: 40px; background: rgba(21,17,47,.72); border: 1.5px solid #6f62c9; border-radius: 8px; padding: 4px 9px; font-size: 11.5px; }
#edCanvas { width: 270px; height: 330px; max-width: 78vw; border-radius: 12px; border: 2px solid #6f62c9; touch-action: none; cursor: grab; }
#edPieces { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; max-width: 340px; }
#edPieces button { background: #2a2360; border: 2px solid transparent; border-radius: 9px; padding: 5px 9px; font-size: 12.5px; }
#edPieces button.sel { border-color: #ffb648; background: #3a2f7a; }
#edSize { display: flex; flex-direction: column; gap: 3px; width: 100%; max-width: 320px; font-size: 12.5px; }
#edSize.hidden { display: none; }
#edSize label { display: flex; align-items: center; gap: 8px; }
#edSize input { flex: 1; }
#editor { justify-content: flex-start; overflow-y: auto; padding-top: 14px; gap: 8px; }
#tutBox { position: absolute; left: 10px; right: 10px; top: 8px; z-index: 4; display: flex; flex-direction: column; gap: 3px; background: rgba(21,17,47,.93); border: 2px solid #ffb648; border-radius: 12px; padding: 9px 12px; font-size: 13.5px; line-height: 1.35; backdrop-filter: blur(10px); box-shadow: 0 8px 28px rgba(8,5,24,.55); }
#tutBox.hidden { display: none; }
#tutBox.retry { border-color: #ff8a8a; }
#tutBox.low { top: 62px; }
#tutBox small { opacity: .7; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
#tutBox b { font-size: 16px; color: #ffe27a; }
#tutBox button { align-self: flex-end; background: none; text-decoration: underline; opacity: .7; font-size: 11.5px; padding: 2px 0; }
#playNow { background: linear-gradient(180deg, #ffc65c, #ff9d2e); color: #2a1a05; font-size: 21px; letter-spacing: 1px; box-shadow: 0 5px 0 #b86a12, 0 10px 22px rgba(255,157,46,.35); }
#playNow small { color: #5a3a0a; letter-spacing: 0; }
#playNow:active { transform: translateY(3px); box-shadow: 0 2px 0 #b86a12; }
#pickGrid button.locked { opacity: .42; filter: grayscale(.8); }
#pickNext { margin: 2px 0; min-height: 0; font-size: 12.5px; color: #ffe27a; }
#pickNext:empty { display: none; }
#quests { width: 100%; max-width: 320px; flex: none; background: rgba(21,17,47,.55); border: 1.5px solid rgba(111,98,201,.7); border-radius: 12px; padding: 7px 10px 8px; font-size: 12.5px; }
#quests .qhead { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 3px; }
#quests .qhead b { color: #ffe27a; font-size: 12px; letter-spacing: .6px; text-transform: uppercase; }
#quests .qhead small { color: #ffb648; font-weight: 700; }
#questList { list-style: none; margin: 0; padding: 0; }
#questList li { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
#questList li b { font-variant-numeric: tabular-nums; opacity: .85; }
#questList li.done { opacity: .55; }
#questList li.done span { text-decoration: line-through; }
#questList li.done b { color: #8dffa8; opacity: 1; }
#season { display: flex; align-items: center; gap: 8px; margin-top: 5px; padding-top: 5px; border-top: 1px solid rgba(111,98,201,.45); font-size: 11.5px; }
#season > b { white-space: nowrap; }
#season i { flex: 1; height: 6px; border-radius: 3px; background: rgba(21,17,47,.8); overflow: hidden; }
#season i b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6ecbff, #9af5cf); }
#season small { opacity: .7; white-space: nowrap; }
#seasonNext { display: block; margin-top: 3px; font-size: 11px; color: #9af5cf; }
#seasonNext:empty { display: none; }
#playTut.first { box-shadow: 0 0 0 3px #ffe27a, 0 0 22px rgba(255,226,122,.55); }
#chatBtn { position: absolute; right: 8px; bottom: 70px; background: rgba(21,17,47,.72); border: 1.5px solid #6f62c9; border-radius: 8px; padding: 4px 9px; font-size: 11.5px; }
#chatBtn.new { border-color: #ffb648; color: #ffb648; font-weight: 700; }
#chat { position: absolute; left: 8px; right: 8px; bottom: 8px; max-height: 62%; display: flex; flex-direction: column; gap: 6px; background: rgba(21,17,47,.95); border: 1.5px solid #6f62c9; border-radius: 12px; padding: 8px; z-index: 5; }
#chat.hidden { display: none; }
#chatHead { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
#chatHead button { background: none; font-size: 20px; line-height: 1; padding: 0 6px; }
#chatHead #chatMute { font-size: 12px; border: 1.5px solid #6f62c9; border-radius: 8px; padding: 3px 8px; margin-right: 6px; }
#chatLog { overflow-y: auto; min-height: 60px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
#chatLog p { margin: 0; padding: 4px 8px; border-radius: 9px; background: #2a2360; max-width: 85%; align-self: flex-start; overflow-wrap: anywhere; }
#chatLog p.me { align-self: flex-end; background: #45389a; }
#chatLog p.none { background: none; opacity: .6; align-self: center; }
#chatQuick { display: flex; flex-wrap: wrap; gap: 5px; }
#chatQuick button { background: #2a2360; border-radius: 14px; padding: 4px 9px; font-size: 12px; }
#chatForm { display: flex; gap: 6px; }
#chatForm.hidden { display: none; }
#chatForm input { flex: 1; min-width: 0; background: #15112f; color: inherit; border: 1.5px solid #6f62c9; border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 14px; }
#chatForm button { background: #ffb648; color: #231a44; border-radius: 8px; padding: 6px 12px; font-weight: 700; }
#chatNote { opacity: .65; font-size: 11px; }
#chatHead #chatUnblock { font-size: 12px; border: 1.5px solid #ffb648; color: #ffb648; border-radius: 8px; padding: 3px 8px; margin-right: 6px; }
#chatHead #chatUnblock.hidden { display: none; }
#chatLog p .more { background: none; color: inherit; opacity: .6; font-size: 13px; line-height: 1; padding: 3px 2px 3px 10px; letter-spacing: 1px; }
#chatLog .menu { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; align-self: flex-start; max-width: 100%; padding: 2px 0 4px; font-size: 11.5px; }
#chatLog .menu span { opacity: .65; }
#chatLog .menu button { background: none; border: 1.5px solid #6f62c9; border-radius: 8px; padding: 3px 8px; font-size: 11.5px; }
#chatLog .menu button.block { border-color: #ff7a7a; color: #ff9c9c; }
#resignBtn.sure { border-color: #ff5d73; color: #ffd0d8; }

#replayBar { position: absolute; left: 10px; right: 10px; bottom: 44px; margin: 0 auto; max-width: 420px; background: rgba(21,17,47,.94); border: 2px solid #ffe27a; border-radius: 12px; padding: 10px 12px; text-align: center; font-size: 13.5px; z-index: 2; backdrop-filter: blur(10px); box-shadow: 0 8px 28px rgba(8,5,24,.55); }
#replayBtns { display: flex; gap: 6px; margin-top: 8px; }
#replayBtns button { flex: 1; background: #2a2360; border-radius: 9px; padding: 8px 4px; font-size: 13px; font-weight: 700; }
#replayBtns button.go { background: linear-gradient(#ffc75e, #ff8f3c); color: #2b1505; }
#replayBar.live #replayText::before { content: 'LIVE'; background: #ff5d73; color: #fff; font-weight: 800; font-size: 11px; letter-spacing: .06em; border-radius: 5px; padding: 1px 6px; margin-right: 7px; }
#lobbyList button.watch { justify-content: center; margin-top: -4px; padding: 6px 14px; font-size: 13px; border-style: dashed; }
#lobbyMeta:empty, #shopRefs:empty { display: none; }
#lobbyMeta { font-size: 12.5px; opacity: .8; }

/* Progress: the level bar on the menu, the achievements screen, and what a match earned on the result screen. */
#lvl { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 320px; font-size: 13px; flex: none; }
#lvl > b { color: #ffe27a; white-space: nowrap; }
#lvl i { flex: 1; height: 8px; border-radius: 4px; background: rgba(21,17,47,.7); overflow: hidden; }
#lvl i b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffc75e, #ffe27a); }
#lvl small { opacity: .75; font-size: 11.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
#progress { justify-content: flex-start; padding-top: 28px; }
#progressList { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 400px; flex: 1; min-height: 120px; overflow-y: auto; text-align: left; }
#progressList div { background: rgba(21,17,47,.7); border: 2px solid transparent; border-radius: 10px; padding: 8px 12px; font-size: 13px; line-height: 1.4; opacity: .6; }
#progressList div b { display: block; font-size: 14.5px; }
#progressList div small { display: block; opacity: .7; font-size: 11px; }
#progressList div.got { opacity: 1; border-color: #ffb648; }
#progressList div.got b { color: #ffe27a; }
#resHighlights span.xp { background: #2a2360; color: #ffe27a; border: 1.5px solid #ffe27a; }
/* Every button gives under the finger. */
button { transition: transform .06s ease-out, filter .06s ease-out; }
button:not(:disabled):active { transform: scale(.96); filter: brightness(1.12); }
@media (prefers-reduced-motion: reduce) { button { transition: none; } button:not(:disabled):active { transform: none; } }
