:root {
  --team0: #d6302c; --team1: #3a6ed6;
  --team0-t: color-mix(in srgb, var(--team0), #fff 35%); --team1-t: color-mix(in srgb, var(--team1), #fff 35%);
  --accent: #e28e2c; --accent-t: #f2a856;
  --ink: #f4f1ea; --dim: #b9b4a8;
  --pan: rgba(12, 15, 20, .58); --line: rgba(255, 255, 255, .14);
  --edge: 0 1px 0 #000, 0 -1px 0 #000, 1px 0 0 #000, -1px 0 0 #000;
  --hi: #58c456; --mid: #f0b429; --lo: #e5412f;
}
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; }
body { font: 14px/1.25 system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--ink); user-select: none; -webkit-user-select: none; }
[hidden] { display: none !important; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.ov { position: fixed; inset: 0; pointer-events: none; font-variant-numeric: tabular-nums; }
b { font-weight: 700; }
.t0 { color: var(--team0-t); } .t1 { color: var(--team1-t); }
/* health's three tones (sappers_core::health::Tone), for our own bar and the bars over heads alike */
.hi { --tone: var(--hi); } .mid { --tone: var(--mid); } .lo { --tone: var(--lo); }

/* names over heads: each tag's foot is placed by the game each frame (hud/tags.rs), the name centred over it.
   The sizes are rows (sappers_core::data::tags), set on #tags as variables; the edge is the dark outline
   drawn in eight directions, --tag-edge wide, with a soft shadow round it. */
#tags .tag { --e: var(--tag-edge); --n: calc(-1 * var(--tag-edge)); position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; padding-bottom: 2px; white-space: nowrap; font-size: var(--tag-px); font-weight: var(--tag-weight); text-shadow: var(--e) 0 0 #000, var(--n) 0 0 #000, 0 var(--e) 0 #000, 0 var(--n) 0 #000, var(--e) var(--e) 0 #000, var(--n) var(--e) 0 #000, var(--e) var(--n) 0 #000, var(--n) var(--n) 0 #000, 0 0 5px rgba(0, 0, 0, .6); }
/* the health bar under a name: the white lag under the fill; `cut` makes a write jump (another player's, a bar shown again, healing). */
#tags .hb { position: relative; display: block; width: var(--bar-w); height: var(--bar-h); margin-top: var(--bar-gap); background: rgba(12, 15, 20, .8); box-shadow: 0 0 0 var(--tag-edge) #000; overflow: hidden; }
#tags .hb i { position: absolute; inset: 0; transform-origin: left; }
#tags .hb i:first-child { background: #fff; transition: transform .45s ease-in .35s; }
#tags .hb i:last-child { background: var(--tone); }
#tags .hb.cut i { transition: none; }
/* crosshair and hit marker. --g is the cross's gap, the middle to its arms' inner ends: the cone of
   the next shot on the screen, which the game sets each frame (hud/cross.rs). */
#cross, #hitm { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
#cross { --g: 4px; }
#cross i, #hitm i { position: absolute; display: block; background: var(--ink); box-shadow: 0 0 0 1px rgba(0, 0, 0, .7); }
#cross i { width: 2px; height: 7px; left: -1px; top: -1px; }
#cross i:nth-child(1) { transform: translateY(calc(-6px - var(--g))); }
#cross i:nth-child(2) { transform: translateY(calc(1px + var(--g))); }
#cross i:nth-child(3) { width: 7px; height: 2px; left: -1px; transform: translateX(calc(-6px - var(--g))); }
#cross i:nth-child(4) { width: 7px; height: 2px; left: -1px; transform: translateX(calc(1px + var(--g))); }
#hitm { display: none; }
#hitm i { width: 2px; height: 7px; left: -1px; top: -3px; background: #fff; }
#hitm i:nth-child(1) { transform: rotate(45deg) translateY(-9px); }
#hitm i:nth-child(2) { transform: rotate(135deg) translateY(-9px); }
#hitm i:nth-child(3) { transform: rotate(225deg) translateY(-9px); }
#hitm i:nth-child(4) { transform: rotate(315deg) translateY(-9px); }
#hitm.f0 { display: block; animation: hA .22s ease-out forwards; }
#hitm.f1 { display: block; animation: hB .22s ease-out forwards; }
@keyframes hA { from { opacity: 1; transform: scale(1.25); } to { opacity: 0; transform: scale(1); } }
@keyframes hB { from { opacity: 1; transform: scale(1.25); } to { opacity: 0; transform: scale(1); } }

/* damage vignette */
#vig { position: absolute; inset: 0; display: none; background: radial-gradient(ellipse at center, transparent 55%, rgba(190, 20, 16, .55) 100%); }
#vig.f0 { display: block; animation: vA .5s ease-out forwards; }
#vig.f1 { display: block; animation: vB .5s ease-out forwards; }
@keyframes vA { from { opacity: 1; } to { opacity: 0; } }
@keyframes vB { from { opacity: 1; } to { opacity: 0; } }
/* low health: a steady red frame at the edge, and on sinking into it four double beats (hud/health.rs) */
#low { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 62%, rgba(190, 20, 16, .38) 100%); }
#beat { position: absolute; inset: 0; display: none; opacity: 0; background: radial-gradient(ellipse at center, transparent 62%, rgba(190, 20, 16, .5) 100%); }
#beat.b0 { display: block; animation: bA 2.4s linear forwards; } #beat.b1 { display: block; animation: bB 2.4s linear forwards; }
@keyframes bA { 0%, 25%, 50%, 75% { opacity: 0; } 2.5%, 27.5%, 52.5%, 77.5% { opacity: 1; } 6%, 31%, 56%, 81% { opacity: .35; } 8.5%, 33.5%, 58.5%, 83.5% { opacity: .7; } 18%, 43%, 68%, 93%, 100% { opacity: 0; } }
@keyframes bB { 0%, 25%, 50%, 75% { opacity: 0; } 2.5%, 27.5%, 52.5%, 77.5% { opacity: 1; } 6%, 31%, 56%, 81% { opacity: .35; } 8.5%, 33.5%, 58.5%, 83.5% { opacity: .7; } 18%, 43%, 68%, 93%, 100% { opacity: 0; } }

/* score and jewel */
#top { position: absolute; top: 10px; left: 50%; width: 360px; margin-left: -180px; text-align: center; }
#caps { display: inline-flex; align-items: center; gap: 8px; padding: 4px; background: var(--pan); border-radius: 4px; }
#caps span { width: 44px; font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.cap { width: 44px; height: 34px; line-height: 34px; font-size: 24px; color: #fff; border-radius: 3px; text-shadow: 0 1px 0 rgba(0, 0, 0, .5); }
.cap.t0 { background: var(--team0); } .cap.t1 { background: var(--team1); }
.cap.mine { box-shadow: 0 0 0 2px var(--ink); }
#clock { display: table; margin: 4px auto 0; padding: 2px 8px; background: var(--pan); border-radius: 3px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
#clock.warn { color: #ff8a78; }
#jewel { display: table; margin-left: auto; margin-right: auto; margin-top: 5px; padding: 3px 10px; background: var(--pan); border-radius: 3px; font-size: 13px; max-width: 340px; white-space: pre; overflow: hidden; text-overflow: ellipsis; }

/* kill feed */
#feed { position: absolute; top: 10px; right: 12px; width: 330px; }
.kf { height: 22px; line-height: 22px; margin-bottom: 3px; padding: 0 8px; background: var(--pan); border-radius: 3px; font-size: 13px; white-space: nowrap; overflow: hidden; text-align: right; }
.kf b { display: inline-block; max-width: 130px; overflow: hidden; text-overflow: ellipsis; vertical-align: top; }
.kf i { font-style: normal; color: var(--dim); margin: 0 7px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.kf.a0 { animation: kA 6s linear forwards; } .kf.a1 { animation: kB 6s linear forwards; }
@keyframes kA { 0% { opacity: 0; transform: translateX(12px); } 4% { opacity: 1; transform: none; } 88% { opacity: 1; } 100% { opacity: 0; } }
@keyframes kB { 0% { opacity: 0; transform: translateX(12px); } 4% { opacity: 1; transform: none; } 88% { opacity: 1; } 100% { opacity: 0; } }

/* announcement and respawn */
#ann { position: absolute; left: 0; right: 0; top: 26%; text-align: center; font-size: 30px; font-weight: 700; letter-spacing: .02em; text-shadow: var(--edge), 0 2px 0 rgba(0, 0, 0, .5); opacity: 0; white-space: nowrap; }
#ann.a0 { animation: aA 2.6s ease-out forwards; } #ann.a1 { animation: aB 2.6s ease-out forwards; }
@keyframes aA { 0% { opacity: 0; transform: scale(.94); } 8% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes aB { 0% { opacity: 0; transform: scale(.94); } 8% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }
#resp { position: absolute; left: 50%; top: 46%; width: 260px; margin-left: -130px; padding: 8px 0; text-align: center; font-size: 18px; background: var(--pan); border-radius: 4px; }
#resp b { display: inline-block; width: 1.4em; font-size: 22px; }

/* the pick's cards: on the Play page; over the match while dead or at the pad. The Play page's mode
   cards and side buttons are cards of the same kind. */
#pick, #modes, #sides, #inmatch { display: flex; gap: 6px; }
#card #pick, #modes, #sides { margin-top: 10px; }
#hud #pick { position: absolute; left: 50%; top: 55%; width: 520px; margin-left: -260px; }
.pc { flex: 1; min-width: 0; padding: 8px 4px 7px; font-family: inherit; background: var(--pan); border-radius: 3px; text-align: center; font-size: 13px; color: var(--dim); cursor: pointer; box-shadow: inset 0 -3px 0 transparent; }
#card .pc { background: #0a0c10; border: 1px solid #3a3f4a; }
.pc kbd { display: block; font: inherit; font-size: 11px; opacity: .7; margin-bottom: 2px; }
.pc span { display: block; font-weight: 700; color: var(--ink); text-transform: capitalize; }
.pc i { display: block; font-style: normal; font-size: 11px; margin-top: 2px; }
.pc.on { color: var(--ink); background: rgba(12, 15, 20, .8); box-shadow: inset 0 -3px 0 var(--ink); }
#card .pc.on { border-color: var(--accent-t); box-shadow: inset 0 -3px 0 var(--accent); }
.pc.t0 span { color: var(--team0-t); } .pc.t1 span { color: var(--team1-t); }
#card .pc.full { opacity: .45; }
#modes .pc span { text-transform: none; }

/* bottom panels */
.pan { position: absolute; bottom: 14px; background: var(--pan); border-radius: 4px; padding: 8px 12px; }
.lbl { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
/* our health: the box is the bar, filled from the left in its tone (hud/health.rs). Going down the fill jumps and the
   white lag follows; going up the pale lag jumps and the fill follows. */
#hpbox { position: absolute; left: 14px; bottom: 14px; width: 176px; height: 48px; background: var(--pan); border-radius: 4px; overflow: hidden; box-shadow: 0 0 0 3px rgba(8, 10, 14, .85); }
#hpbar { position: absolute; inset: 0; }
/* low, the fill is a stub: a ring in its colour keeps the whole box red. */
#hpbar.lo::before { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 4px; box-shadow: inset 0 0 0 2px var(--lo); }
#hplag, #hpfill { position: absolute; inset: 0; transform-origin: left; }
#hpfill { background: var(--tone); }
.dn #hplag { background: #fff; opacity: .9; transition: transform .45s ease-in .35s; }
.up #hplag { background: color-mix(in srgb, var(--tone), #fff 55%); }
.up #hpfill { transition: transform .5s ease-out; }
#hpbar::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 133px; background: repeating-linear-gradient(to right, transparent 0 43px, rgba(0, 0, 0, .5) 43px 44px); }
#hpsign { position: absolute; left: 10px; top: 13px; width: 22px; height: 22px; background: #fff; clip-path: polygon(35% 0, 65% 0, 65% 35%, 100% 35%, 100% 65%, 65% 65%, 65% 100%, 35% 100%, 35% 65%, 0 65%, 0 35%, 35% 35%); }
#hp { position: absolute; left: 42px; top: 0; line-height: 48px; font-size: 30px; font-weight: 700; color: #fff; text-shadow: var(--edge), 0 2px 3px rgba(0, 0, 0, .6); }
/* the jolt of a hit: the box swells and a white outline fades (transform and opacity only) */
#hpbox::before { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 4px; box-shadow: inset 0 0 0 2px #fff; opacity: 0; }
#hpbox.f0 { animation: jA .2s ease-out; } #hpbox.f1 { animation: jB .2s ease-out; }
#hpbox.f0::before { animation: jO .2s ease-out; } #hpbox.f1::before { animation: jP .2s ease-out; }
@keyframes jA { from { transform: scale(1.07); } to { transform: none; } }
@keyframes jB { from { transform: scale(1.07); } to { transform: none; } }
@keyframes jO { from { opacity: 1; } to { opacity: 0; } }
@keyframes jP { from { opacity: 1; } to { opacity: 0; } }
#ammobox { right: 14px; min-width: 176px; height: 72px; box-sizing: border-box; }
#ammo { display: flex; align-items: baseline; height: 30px; white-space: nowrap; }
#mag { font-size: 28px; line-height: 30px; }
#res { display: inline-block; width: 46px; text-align: left; margin-left: 4px; color: var(--dim); font-size: 15px; }
#gun { flex: 1; min-width: 84px; margin-right: 10px; }
#ammobox.bare #mag, #ammobox.bare #res { display: none; }
#rl { position: absolute; left: 12px; top: 13px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-t); visibility: hidden; }
#ammobox.rl #rl { visibility: visible; }
#ammobox.rl #gun { visibility: hidden; }
#ammobox.rl #ammo { opacity: .45; }
#ammobox.dry #mag { color: #ff8a78; }

/* The chat (SPEC-chat): over the health panel, the newest line at the bottom, a box a line; closed, the
   last five fade ten seconds after the newest came; open, ten that scroll, over the line typed in with
   its channel's tag before it, the team's in the team's colour. A long word breaks anywhere. */
#chat { position: absolute; left: 14px; bottom: 72px; width: min(440px, calc(100vw - 28px)); display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
#chatlog { width: 100%; max-height: 105px; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.cl { flex: none; max-width: 100%; box-sizing: border-box; padding: 2px 7px; font-size: 13px; line-height: 17px; background: rgba(12, 15, 20, .5); border-radius: 3px; overflow-wrap: anywhere; text-shadow: 0 1px 1px #000; }
.cl i { font-style: normal; color: var(--dim); margin-right: 5px; }
.cl b { margin-right: 5px; } .cl b::after { content: ":"; color: var(--ink); }
.cl.tm0 { background-image: linear-gradient(rgba(214, 48, 44, .26), rgba(214, 48, 44, .26)); box-shadow: inset 2px 0 0 var(--team0); }
.cl.tm1 { background-image: linear-gradient(rgba(58, 110, 214, .3), rgba(58, 110, 214, .3)); box-shadow: inset 2px 0 0 var(--team1); }
.cl.tm0 i { color: var(--team0-t); } .cl.tm1 i { color: var(--team1-t); }
.cl.note { color: var(--accent-t); }
#chatlog.a0 { animation: cA 11s linear forwards; } #chatlog.a1 { animation: cB 11s linear forwards; }
@keyframes cA { 0%, 90.9% { opacity: 1; } 100% { opacity: 0; } }
@keyframes cB { 0%, 90.9% { opacity: 1; } 100% { opacity: 0; } }
#chat.open #chatlog { max-height: 210px; overflow-y: auto; pointer-events: auto; animation: none; opacity: 1; }
#chatin { display: none; width: 100%; box-sizing: border-box; align-items: center; gap: 6px; padding: 0 0 0 8px; background: rgba(12, 15, 20, .78); border-radius: 3px; box-shadow: inset 0 0 0 1px var(--line); }
#chat.open #chatin { display: flex; pointer-events: auto; }
#chatch { flex: none; font-size: 13px; color: var(--ink); }
#hud.tm0 #chat.team #chatch { color: var(--team0-t); } #hud.tm1 #chat.team #chatch { color: var(--team1-t); }
#chatline { flex: 1; min-width: 0; height: 28px; padding: 0 8px 0 0; font: inherit; font-size: 14px; color: var(--ink); background: none; border: 0; outline: none; user-select: text; -webkit-user-select: text; }
#chatbtn { display: none; height: 30px; padding: 0 14px; font: inherit; font-weight: 600; color: var(--ink); background: var(--pan); border: 1px solid var(--line); border-radius: 3px; pointer-events: auto; }
/* A phone: a button opens the line, whose text is large enough that the browser does not zoom to it. */
@media (pointer: coarse), (max-width: 600px) { #chatbtn { display: block; } #chat.open #chatbtn { display: none; } #chatline { font-size: 16px; } }

/* The inventory (design 5.4): nine slots of one size on the bar, and the panel's three rows of nine over
   it, slot over slot; the row nearest the bar is the first. A slot is as wide as the page leaves between
   the two side panels, from 26 px (640 wide) to 76. */
#hud { --slot: clamp(26px, calc((100vw - 408px) / 9), 76px); --gap: 6px; --rise: 14px; --sign: 20px; }
#tools, #panel { position: absolute; left: 50%; width: calc(9 * var(--slot) + 8 * var(--gap) + 1px); margin-left: calc(-4.5 * var(--slot) - 4 * var(--gap)); display: flex; flex-wrap: wrap-reverse; gap: var(--gap); }
#tools { bottom: var(--rise); }
#panel { bottom: calc(var(--rise) + min(var(--slot), 56px) + var(--gap) + 6px); background: var(--pan); box-shadow: 0 0 0 6px var(--pan); border-radius: 1px; }
.tool { position: relative; box-sizing: border-box; width: var(--slot); height: min(var(--slot), 56px); display: flex; flex-wrap: wrap; align-content: center; justify-content: center; align-items: center; gap: 3px 6px; background: var(--pan); border-radius: 3px; box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; line-height: 1.2; color: var(--dim); white-space: nowrap; pointer-events: auto; }
.tool kbd { position: absolute; left: 5px; top: 3px; z-index: 1; font: inherit; font-size: 11px; opacity: .7; }
.tool i { width: 14px; height: 14px; border-radius: 2px; box-shadow: 0 0 0 1px var(--line); }
/* A tool's sign: its outline, cut from a square of the ink's colour. */
.tool .sign { width: var(--sign); height: var(--sign); border-radius: 0; box-shadow: none; background: var(--ink); }
.spade { clip-path: polygon(40% 0, 60% 0, 60% 8%, 55% 8%, 55% 52%, 78% 52%, 78% 82%, 50% 100%, 22% 82%, 22% 52%, 45% 52%, 45% 8%, 40% 8%); }
.main { clip-path: polygon(0 36%, 100% 36%, 100% 47%, 62% 47%, 62% 56%, 50% 56%, 46% 80%, 33% 80%, 37% 56%, 20% 56%, 12% 72%, 0 72%); }
.pistol { clip-path: polygon(12% 26%, 88% 26%, 88% 46%, 46% 46%, 40% 82%, 16% 82%, 22% 46%, 12% 46%); }
.knife { clip-path: polygon(8% 78%, 22% 92%, 40% 74%, 48% 82%, 58% 72%, 50% 64%, 100% 0, 36% 50%, 28% 42%, 18% 52%, 26% 60%); }
.grenade { clip-path: polygon(38% 0, 62% 0, 62% 14%, 74% 20%, 90% 40%, 90% 68%, 74% 92%, 50% 100%, 26% 92%, 10% 68%, 10% 40%, 26% 20%, 38% 14%); }
/* The fruit, told apart by outline as on the ground: the apple's dip, stem and leaf; the orange's ball and calyx. */
.apple { clip-path: polygon(46% 26%, 48% 8%, 53% 6%, 53% 20%, 62% 10%, 78% 6%, 72% 18%, 58% 24%, 66% 22%, 80% 22%, 91% 32%, 95% 50%, 90% 72%, 78% 90%, 64% 95%, 50% 91%, 36% 95%, 22% 90%, 10% 72%, 5% 50%, 9% 32%, 20% 22%, 34% 22%); }
.orange { clip-path: polygon(44% 11%, 44% 4%, 56% 4%, 56% 11%, 67% 13%, 81% 23%, 91% 37%, 94% 54%, 91% 71%, 81% 85%, 67% 95%, 50% 98%, 33% 95%, 19% 85%, 9% 71%, 6% 54%, 9% 37%, 19% 23%, 33% 13%); }
.tool span { order: -1; flex-basis: 100%; text-align: center; overflow: hidden; text-overflow: ellipsis; }
.tool span:empty, .tool b:empty { display: none; }
.tool b { color: var(--ink); }
/* The doll's card: at the left of the rows, a window the game draws the player's own figure in (the
   page leaves it clear) and the player's name under it. */
#doll { position: absolute; right: calc(100% + 18px); bottom: -6px; width: 20vh; height: 34vh; display: flex; flex-direction: column; border-radius: 3px; box-shadow: 0 0 0 1px var(--line); }
#dollwin { flex: 1; }
/* A pack's card (packs spec 2.1): every slot of the pack open, in rows of nine over the panel's rows, laid as
   the dead's slots lay, the bar's nine nearest them. */
#pack { position: absolute; left: 0; right: 0; bottom: calc(100% + 18px); display: flex; flex-wrap: wrap-reverse; gap: var(--gap); background: var(--pan); box-shadow: 0 0 0 6px var(--pan); border-radius: 1px; }
/* Its title row, over its slots (the controller, 12-04): it names itself, so it does not read as a second inventory. */
#packname { order: 1; flex-basis: 100%; padding: 1px 4px 3px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
#dollname { padding: 2px 4px; background: rgba(12, 15, 20, .85); text-align: center; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A slot a carried stack is being dragged over: some of it goes there when it is let go. */
.tool.drag { outline: 2px solid; }
/* The stack on the pointer: one line over it that follows it, clear of the count under it; a press goes through to the slot under it. */
.tool.carry { position: fixed; left: 0; top: 0; z-index: 3; width: auto; height: auto; margin: -30px 0 0 14px; padding: 3px 8px; flex-wrap: nowrap; pointer-events: none; background: rgba(12, 15, 20, .85); box-shadow: 0 0 0 1px var(--ink); color: var(--ink); }
.tool.carry i, .tool.carry b { position: static; }
.tool.carry i { width: 12px; height: 12px; }
.tool.carry span { order: 0; flex-basis: auto; display: block; }
/* A narrow page (design 5.8: from 640 x 360): a slot is its mark (swatch or sign) with the key and the count over it;
   the name is one line over the slot under the pointer. */
@media (max-width: 1150px) {
  #hud { --gap: 2px; --sign: min(var(--slot) - 8px, 30px); }
  #doll { bottom: 22px; }
  .tool { text-shadow: 0 1px 2px #000; }
  .tool kbd { left: 2px; top: 0; font-size: 9px; opacity: 1; }
  .tool i { position: absolute; inset: 4px; width: auto; height: auto; }
  .tool .sign { inset: auto; }
  .tool b { position: absolute; right: 2px; bottom: 0; font-size: 10px; }
  .tool span { display: none; }
  .tool:hover span:not(:empty) { display: block; position: absolute; left: 50%; bottom: calc(100% + 3px); z-index: 2; transform: translateX(-50%); padding: 1px 6px; background: rgba(12, 15, 20, .9); border-radius: 3px; color: var(--ink); font-size: 11px; overflow: visible; }
}
/* An upright phone: the bar takes the page's width, over the two side panels; the feed goes under
   the minimap and the line under the score keeps clear of it. */
@media (max-width: 600px) {
  #hud { --slot: calc((100vw - 48px) / 9); --gap: 3.5px; --rise: 92px; }
  #mini.on ~ #feed { top: calc(var(--mini) + 22px); }
  #mini.on ~ #top #jewel { max-width: calc(100vw - 2 * var(--mini) - 56px); }
  #doll { right: auto; left: -6px; bottom: calc(100% + 12px); width: 15vh; height: 26vh; }
  #pack:not([hidden]) ~ #doll { bottom: calc(100% + 52px + 4 * min(var(--slot), 56px) + 4 * var(--gap)); }
  #chat { bottom: calc(var(--rise) + min(var(--slot), 56px) + 8px); }
}
.tool.on { color: var(--ink); background: rgba(12, 15, 20, .8); box-shadow: inset 0 -3px 0 var(--ink); font-weight: 700; }
#hud.tm0 .tool.on { box-shadow: inset 0 -3px 0 var(--team0); }
#hud.tm1 .tool.on { box-shadow: inset 0 -3px 0 var(--team1); }

/* scoreboard */
#board { position: absolute; top: 96px; left: 50%; width: 660px; margin-left: -330px; display: flex; gap: 12px; }
.sbcol { flex: 1; background: rgba(12, 15, 20, .78); border-radius: 4px; padding: 8px 10px 10px; }
.sbcol h2 { margin: 0 0 6px; font-size: 16px; text-transform: uppercase; letter-spacing: .1em; }
.sbcol:first-child { border-top: 3px solid var(--team0); } .sbcol:last-child { border-top: 3px solid var(--team1); }
/* a great map's 64 a side scroll inside the board; the limit is 26 rows on a 768-pixel screen */
#sbr0, #sbr1 { max-height: calc(100vh - 220px); overflow: hidden auto; pointer-events: auto; }
.sbr { display: flex; height: 21px; line-height: 21px; padding: 0 6px; font-size: 13px; }
.sbr span { width: 36px; text-align: right; }
.sbr span:first-child { flex: 1; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sbh { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--line); }
.sbr.me { background: rgba(255, 255, 255, .13); font-weight: 700; }
.sbr.bot span:first-child::after { content: "BOT"; margin-left: 6px; font-size: 9px; font-weight: 700; color: var(--dim); border: 1px solid var(--dim); border-radius: 2px; padding: 0 3px; vertical-align: 1px; }

/* map: hidden rather than taken out of the layout, so opening it lays nothing out; its side
   (--side) is set by the game; the land is the sea's colour until its picture has come */
#map { visibility: hidden; position: absolute; left: 50%; top: 56px; margin-left: calc(var(--side) / -2 - 10px); padding: 5px 10px 8px; background: rgba(12, 15, 20, .8); border-radius: 4px; border-top: 3px solid var(--ink); }
#map.open { visibility: visible; }
#hud.tm0 #map { border-top-color: var(--team0); } #hud.tm1 #map { border-top-color: var(--team1); }
#maphead { display: flex; justify-content: space-between; height: 18px; line-height: 18px; }
#maphead kbd { font: inherit; color: var(--ink); margin: 0 5px 0 12px; }
#mapview { position: relative; width: var(--side); height: var(--side); margin-top: 4px; overflow: hidden; background: rgb(22, 58, 88); border-radius: 2px; }
#mapland { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
#mapview.zoom #mapland { image-rendering: pixelated; }
#mapmarks { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
#mapme { position: absolute; left: 0; top: 0; width: 32px; height: 32px; margin: -16px 0 0 -16px; }
#mapme svg, #minime svg { display: block; width: 100%; height: 100%; overflow: visible; }
#mapme circle, #minime circle { fill: none; stroke: var(--ink); stroke-width: 1.6; }
#mapme circle.rim, #minime circle.rim { stroke: #06080c; stroke-width: 4; opacity: .75; }
#mapme path, #minime path { fill: var(--ink); stroke: #06080c; stroke-width: 2; stroke-linejoin: round; }
/* minimap: the map's land and marks round the player, north up, its side (--mini, on #hud) set by the game;
   the canvas (--wide) overhangs it on each side and slides between two drawings */
#mini { visibility: hidden; position: absolute; top: 10px; left: 12px; width: var(--mini); height: var(--mini); overflow: hidden; background: rgb(22, 58, 88); border-radius: 4px; box-shadow: 0 0 0 2px rgba(12, 15, 20, .8); }
#mini.on { visibility: visible; }
#miniland { position: absolute; left: calc((var(--mini) - var(--wide)) / 2); top: calc((var(--mini) - var(--wide)) / 2); width: var(--wide); height: var(--wide); }
#minime { position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px; }
#mapfoot { display: flex; align-items: center; height: 20px; margin-top: 6px; font-size: 12px; color: var(--dim); white-space: nowrap; }
.mk { display: inline-block; flex: none; width: 9px; height: 9px; margin: 0 6px 0 14px; box-sizing: border-box; }
.mk:first-child { margin-left: 2px; }
.mk.own { box-shadow: 0 0 0 1.5px var(--ink); }
.mk.foe { border: 2px solid; transform: rotate(45deg) scale(.9); background: rgba(12, 15, 20, .55); }
.mk.mate { border-radius: 50%; box-shadow: 0 0 0 1.5px #06080c; }
.mk.you { width: 11px; height: 12px; background: var(--ink); clip-path: polygon(50% 0, 100% 100%, 50% 72%, 0 100%); }
#hud.tm0 .mk.own, #hud.tm0 .mk.mate { background: var(--team0); } #hud.tm0 .mk.foe { border-color: var(--team1); }
#hud.tm1 .mk.own, #hud.tm1 .mk.mate { background: var(--team1); } #hud.tm1 .mk.foe { border-color: var(--team0); }
#mapscale { display: flex; align-items: center; margin-left: auto; padding-left: 14px; color: var(--ink); }
#mapbar { display: block; height: 5px; margin-right: 7px; border: 2px solid var(--ink); border-top: 0; }

#perf { inset: auto; top: 8px; left: 8px; margin: 0; padding: 6px 8px; background: rgba(0, 0, 0, .66); color: #dfe; font: 12px/1.3 ui-monospace, Consolas, "Cascadia Mono", "DejaVu Sans Mono", monospace; white-space: pre; border-radius: 3px; }

/* The console (SPEC-admin-addendum A.6): over the top half of the view, the newest line at the bottom
   over the line typed in; 15 px lines, ten of them at 640 x 360. A long word breaks anywhere. */
#con { position: fixed; left: 0; right: 0; top: 0; height: 50%; z-index: 4; display: flex; flex-direction: column; justify-content: flex-end; background: rgba(8, 10, 14, .86); color: #dfe; font: 12px/15px ui-monospace, Consolas, "Cascadia Mono", "DejaVu Sans Mono", monospace; user-select: text; -webkit-user-select: text; }
#conout { overflow-y: auto; padding: 4px 8px 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
#conline { flex: none; height: 21px; padding: 0 8px; font: inherit; color: var(--ink); background: rgba(0, 0, 0, .4); border: 0; border-top: 1px solid var(--line); outline: none; }

/* The admin panel (hud/admin.rs): every setting and order of the console as a control, a tab a group,
   over play with the pointer free; the console's newest line at its foot. Built from the rows. */
#adm { position: fixed; left: 50%; top: 48px; z-index: 4; width: 760px; max-width: calc(100% - 24px); max-height: calc(100% - 96px); transform: translateX(-50%); display: flex; flex-direction: column; background: rgba(12, 15, 20, .92); border-radius: 4px; border-top: 3px solid var(--accent); box-shadow: 0 6px 0 rgba(0, 0, 0, .25); outline: none; }
#admhead { display: flex; align-items: baseline; gap: 18px; padding: 10px 14px 0; border-bottom: 1px solid var(--line); }
#admhead > b { font-size: 15px; text-transform: uppercase; letter-spacing: .1em; color: var(--accent-t); }
#admhead > span { margin-left: auto; font-size: 12px; color: var(--dim); }
#admhead kbd { font: inherit; color: var(--ink); }
#admtabs { display: flex; gap: 16px; }
#admtabs button { padding: 0 0 7px; font: inherit; font-weight: 600; color: var(--dim); background: none; border: 0; cursor: pointer; box-shadow: inset 0 -2px 0 transparent; }
#admtabs button.on { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
#admbody { overflow-y: auto; padding: 6px 14px 8px; }
.admr { display: flex; align-items: center; gap: 8px; min-height: 30px; font-size: 13px; }
.admr > b { flex: none; width: 96px; }
.admh { flex: 1; min-width: 0; font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admr select, .admr input, .admr button { flex: none; height: 24px; padding: 0 6px; font: inherit; color: var(--ink); background: #0a0c10; border: 1px solid #3a3f4a; border-radius: 3px; }
.admr input { width: 64px; }
.admlim { flex: none; font-size: 12px; color: var(--dim); }
.admr button { font-weight: 600; cursor: pointer; }
.admr select:hover, .admr input:hover, .admr button:hover, .admr :focus-visible { border-color: var(--accent-t); outline: none; }
.admbot > b { width: 160px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.admbot > select, .admhd > span { width: 120px; }
.admhd { min-height: 22px; margin-top: 8px; border-bottom: 1px solid var(--line); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
.admhd > b { font-weight: 400; }
.admkit { padding: 6px 0; font-size: 13px; }
/* The Logs tab (hud/logs.rs): who is on, the filter, the entries the newest first, a line each. */
.admhere { font-size: 12px; line-height: 18px; }
.admhere > div:not(.admhd) { font-family: ui-monospace, Consolas, "Cascadia Mono", "DejaVu Sans Mono", monospace; overflow-wrap: anywhere; }
.admfind { margin-top: 6px; }
.admfind input { width: 190px; }
.admlines { font: 12px/17px ui-monospace, Consolas, "Cascadia Mono", "DejaVu Sans Mono", monospace; }
.admlines > div { display: flex; gap: 8px; border-top: 1px solid rgba(255, 255, 255, .05); }
.admlines time { flex: none; color: var(--dim); }
.admlines b { flex: none; width: 76px; font-weight: 400; color: var(--accent-t); }
.admlines span { min-width: 0; overflow-wrap: anywhere; }
#admsay { flex: none; min-height: 15px; padding: 5px 14px 7px; border-top: 1px solid var(--line); color: #dfe; font: 12px/15px ui-monospace, Consolas, "Cascadia Mono", "DejaVu Sans Mono", monospace; overflow-wrap: anywhere; }

/* menu */
#menu { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(8, 10, 14, .62); }
/* While the game or a match loads, what is drawn under the menu is not for seeing yet, and there is
   nothing to press: the bar and the status line say what is being done. On a device the game cannot
   be played on yet (`unfit`) the status line says why, and there is nothing to press either. */
#menu.loading { background: rgb(8, 10, 14); }
#menu.loading #pages, #menu.loading .page, #menu.unfit #pages, #menu.unfit .page { display: none; }
/* In a match the front is the pause menu: Play reads Resume, and the side is changed, not chosen. */
#inmatch, #menu.inmatch #name, #menu.inmatch #modes, #menu.inmatch #sides { display: none; }
#menu.inmatch #inmatch { display: flex; margin-top: 10px; }
#pages { display: flex; gap: 18px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
#pages button { padding: 0 0 6px; font: inherit; font-weight: 600; color: var(--dim); background: none; border: 0; cursor: pointer; box-shadow: inset 0 -2px 0 transparent; }
#pages button.on { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
#bar { display: none; height: 6px; margin-top: 18px; overflow: hidden; background: rgba(255, 255, 255, .12); border-radius: 3px; }
#menu.loading #bar { display: block; }
[data-state^="error"] #bar { display: none; }
#bar i { display: block; width: calc(var(--done, 0) * 100%); height: 100%; background: var(--accent); }
/* Work that cannot be counted (starting, connecting, building the world): a stripe that keeps moving,
   on the compositor, while the page's thread is busy. Once the game has started (`data-state`) all
   that is left is such work, whatever the page's count of the download last wrote. */
#bar.busy i, [data-state] #bar i { width: 30%; animation: busy 1.1s linear infinite; }
@keyframes busy { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
#menu.unfit #status { height: auto; white-space: normal; }
#card { width: 520px; max-width: calc(100% - 80px); max-height: calc(100% - 64px); overflow-y: auto; padding: 26px 30px 22px; background: #0e1117; border-radius: 6px; border-top: 4px solid var(--accent); box-shadow: 0 6px 0 rgba(0, 0, 0, .25); }
h1 { margin: 0; font-size: 46px; line-height: 1; letter-spacing: .04em; text-transform: uppercase; color: var(--team0-t); }
h1 span { color: var(--team1-t); }
#tag { margin: 6px 0 14px; color: var(--dim); }
#join { display: flex; gap: 8px; }
#name { flex: 1; height: 38px; padding: 0 12px; font: inherit; font-size: 16px; color: var(--ink); background: #0a0c10; border: 1px solid #3a3f4a; border-radius: 3px; outline: none; }
#name:focus { border-color: var(--accent-t); }
#play { width: 120px; height: 40px; font: inherit; font-size: 17px; font-weight: 700; color: #1a1208; background: var(--accent); border: 0; border-radius: 3px; cursor: pointer; }
#play:hover { background: var(--accent-t); }
#play:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
#status { height: 18px; margin: 10px 0 14px; font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* settings: every action beside its key, two to a line */
#p-settings { font-size: 12.5px; color: var(--dim); }
#p-settings p { margin: 10px 0 0; }
#binds { display: grid; grid-template-columns: 1fr 104px 1fr 104px; gap: 4px 10px; align-items: center; margin-top: 10px; }
#p-settings button, #inmatch button { height: 24px; padding: 0 8px; font: inherit; font-weight: 600; color: var(--ink); background: #0a0c10; border: 1px solid #3a3f4a; border-radius: 3px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#p-settings button:hover, #inmatch button:hover { border-color: var(--accent-t); }
#inmatch button:disabled { opacity: .45; cursor: default; border-color: #3a3f4a; }
#p-settings label { cursor: pointer; }
#inmatch button { flex: 1; height: 32px; }
/* Short (640 x 360): the title gives up its line; upright, the cards stack into one column (design 5.8). */
@media (max-height: 480px) { h1 { font-size: 30px; } #tag { display: none; } #card { padding-top: 16px; } }
@media (orientation: portrait) { #modes, #card #pick { flex-direction: column; } #binds { grid-template-columns: 1fr 104px; } }
