:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #090e19;
  color: #f8fafc;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-width: 280px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 18% 10%, rgba(13, 148, 136, 0.19), transparent 30rem),
    radial-gradient(circle at 90% 80%, rgba(239, 68, 68, 0.15), transparent 34rem),
    #090e19;
}

button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }

.shell { width: min(1180px, 100%); margin: 0 auto; padding: 24px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.eyebrow { margin: 0 0 4px; color: #93a4ba; font-size: 0.73rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.6rem, 4vw, 2.35rem); letter-spacing: -0.04em; }
h2 { margin-bottom: 6px; letter-spacing: -0.025em; }

.connection { display: flex; align-items: center; gap: 8px; color: #cbd5e1; font-size: 0.86rem; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 12px currentColor; }
.connection[data-state="online"] .status-dot { background: #34d399; }
.connection[data-state="offline"] .status-dot { background: #fb7185; }

.privacy-banner {
  margin: 20px 0;
  padding: 10px 14px;
  border: 1px solid rgba(52, 211, 153, 0.25);
  border-radius: 12px;
  background: rgba(6, 78, 59, 0.16);
  color: #b7f7df;
  font-size: 0.86rem;
}

.join-card, .score-card {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.78);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(16px);
}
.join-card { display: grid; grid-template-columns: minmax(190px, 0.8fr) 1.4fr; gap: 28px; padding: 26px; }
.join-card p { margin-bottom: 0; color: #a9b5c6; line-height: 1.5; }
form { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 12px; }
label { display: grid; gap: 6px; color: #cbd5e1; font-size: 0.82rem; font-weight: 700; }
input {
  width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid #334155; border-radius: 10px;
  outline: none; background: #0b1220; color: #f8fafc;
}
input:focus { border-color: #2dd4bf; box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.13); }
.primary, .secondary { border-radius: 10px; font-weight: 800; }
.primary { min-height: 43px; padding: 10px 17px; border: 0; background: #2dd4bf; color: #042f2e; }
.secondary { width: 100%; margin-top: 10px; padding: 9px 12px; border: 1px solid #475569; background: transparent; color: #dbe5f2; }
.secondary:hover { background: rgba(148, 163, 184, 0.09); }
.danger { color: #fda4af; border-color: rgba(244, 63, 94, 0.4); }
.form-message, .action-message { min-height: 1.25rem; margin: 8px 0 0; color: #fda4af; font-size: 0.84rem; }
.form-message { grid-column: 2; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: start; }
.board {
  position: relative; overflow: hidden; aspect-ratio: 16 / 9; min-height: 320px;
  border: 1px solid rgba(148, 163, 184, 0.18); border-radius: 20px;
  background: linear-gradient(180deg, #10243d 0%, #0b1627 72%, #13291f 72%, #0a1711 100%);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.32), 0 24px 60px rgba(0, 0, 0, 0.23);
}
.board::after { content: ""; position: absolute; inset: auto 0 26% 0; height: 2px; background: rgba(255, 255, 255, 0.04); }
.board[data-boss-phase="countdown"], .board[data-boss-phase="active"] { background: linear-gradient(180deg, #260d1f 0%, #120b1c 72%, #25140f 72%, #100907 100%); }
.board-grid { position: absolute; inset: 0; opacity: 0.15; background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 10% 10%; }
.empty-board { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: 80%; color: #8fa2bb; text-align: center; }
.entity, .spark { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); will-change: transform, left, top; }
.entity { z-index: 2; display: grid; place-items: center; padding: 0; border: 0; background: transparent; font-size: clamp(1.7rem, 4vw, 3rem); filter: drop-shadow(0 5px 5px rgba(0,0,0,.35)); scale: var(--entity-scale, 1); transition: scale .12s ease-out; }
.entity.bucket { animation: bucket-wobble .5s ease-in-out infinite alternate; }
.entity.crab .emoji { display: inline-block; animation: crab-scuttle .18s steps(2) infinite; }
.entity.crab.angry-crab .emoji { filter: sepia(1) saturate(7) hue-rotate(318deg) brightness(.86) contrast(1.15); text-shadow: 0 0 .3em rgba(248,113,113,.95); }
.entity.crab.angry-crab::before, .entity.crab.angry-crab::after { content: ""; position: absolute; z-index: 3; top: .38em; width: .34em; height: .09em; border-radius: 999px; background: #4c0519; box-shadow: 0 0 .08em rgba(254,202,202,.9); pointer-events: none; }
.entity.crab.angry-crab::before { left: .13em; transform: rotate(25deg); transform-origin: right center; }
.entity.crab.angry-crab::after { right: .13em; transform: rotate(-25deg); transform-origin: left center; }
.angry-weapon { display: block; position: absolute; z-index: 4; left: 67%; top: 55%; transform: rotate(-34deg); font-size: .38em; filter: drop-shadow(0 2px 3px rgba(15,23,42,.9)); }
.angry-weapon[hidden] { display: none !important; }
.entity.crab.boss-minion .emoji { filter: hue-rotate(300deg) saturate(2.4) brightness(1.15); text-shadow: 0 0 12px rgba(248,113,113,.95); }
.entity.crab.shield-miniboss, .entity.crab.healer-miniboss, .entity.crab.summoner-miniboss, .entity.crab.eldritch-beast, .entity.crab.charmed-eldritch-beast { z-index: 5; }
.entity.crab.shield-miniboss .emoji { filter: saturate(1.35) brightness(1.08); text-shadow: 0 0 12px rgba(96,165,250,.9); }
.entity.crab.healer-miniboss .emoji { filter: sepia(.25) saturate(1.2) brightness(1.15); text-shadow: 0 0 12px rgba(250,204,21,.95); }
.entity.crab.healer-miniboss::before { content: ""; position: absolute; z-index: 4; left: 50%; top: .03em; width: .72em; height: .2em; transform: translateX(-50%); border: .07em solid #fde68a; border-radius: 50%; box-shadow: 0 0 .15em rgba(250,204,21,.95); pointer-events: none; }
.entity.crab.summoner-miniboss .emoji { filter: hue-rotate(225deg) saturate(1.8) brightness(.95); text-shadow: 0 0 14px rgba(192,132,252,.95); }
.entity.crab.eldritch-beast .emoji { filter: hue-rotate(235deg) saturate(2.4) brightness(.72) contrast(1.25); text-shadow: 0 0 18px rgba(126,34,206,.98); animation: eldritch-pulse .7s ease-in-out infinite alternate; }
.entity.crab.charmed-eldritch-beast .emoji { filter: hue-rotate(90deg) saturate(1.8) brightness(1.2); text-shadow: 0 0 18px rgba(74,222,128,.98); animation: eldritch-pulse .7s ease-in-out infinite alternate; }
.entity.crab.health-potion .emoji { filter: none; text-shadow: 0 0 12px rgba(74,222,128,.95); }
.boss-entity-emblem { display: block; position: absolute; z-index: 4; left: 65%; top: 40%; font-size: .38em; filter: drop-shadow(0 2px 3px rgba(15,23,42,.85)); }
.entity.crab.shield-miniboss .boss-entity-emblem { left: 52%; top: 44%; transform: translate(-5%, -42%); font-size: .195em; }
.entity.crab.healer-miniboss .boss-entity-emblem { transform: rotate(-18deg); }
.entity.crab.summoner-miniboss .boss-entity-emblem { left: 50%; top: 49%; transform: translate(-50%, -50%); font-size: .34em; }
.entity.crab.charmed-eldritch-beast .boss-entity-emblem { left: 68%; top: 5%; font-size: .32em; }
.mini-health { display: block; position: absolute; left: 50%; bottom: calc(100% + .16em); overflow: hidden; width: 1.8em; height: .2em; transform: translateX(-50%); border: .035em solid rgba(219,234,254,.9); border-radius: 999px; background: rgba(15,23,42,.92); box-shadow: 0 0 .16em rgba(59,130,246,.7); }
.boss-entity-emblem[hidden], .mini-health[hidden], .cast-progress[hidden] { display: none !important; }
.mini-health > span { display: block; width: 100%; height: 100%; background: linear-gradient(90deg, #1d4ed8, #60a5fa, #bfdbfe); transition: width .12s ease-out; }
.entity.crab.healer-miniboss .mini-health > span { background: linear-gradient(90deg, #15803d, #4ade80, #dcfce7); }
.entity.crab.summoner-miniboss .mini-health > span { background: linear-gradient(90deg, #6b21a8, #c084fc, #f3e8ff); }
.cast-progress { display: block; position: absolute; left: 50%; bottom: calc(100% - .09em); overflow: hidden; width: 1.8em; height: .16em; transform: translateX(-50%); border: .03em solid rgba(233,213,255,.9); border-radius: 999px; background: rgba(15,23,42,.92); box-shadow: 0 0 .15em rgba(168,85,247,.75); }
.cast-progress > span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #7e22ce, #d8b4fe, #fff); transition: width .08s linear; }
.entity.crab .bucket-art, .entity.bucket .emoji { display: none; }
.bucket-art { position: relative; display: inline-block; width: 1em; height: .92em; --bucket-fill: #8796a8; }
.bucket-handle { position: absolute; z-index: 0; left: 16%; top: 0; width: 68%; height: 52%; border: .075em solid #dbe4ee; border-bottom: 0; border-radius: 50% 50% 0 0; }
.bucket-body { position: absolute; z-index: 1; left: 13%; bottom: 2%; width: 74%; height: 64%; border: .055em solid #dbe4ee; border-radius: .08em .08em .18em .18em; background: var(--bucket-fill); clip-path: polygon(4% 0, 96% 0, 84% 100%, 16% 100%); box-shadow: inset 0 -.12em .15em rgba(15, 23, 42, .32); }
.entity.bucket.joined .bucket-body { box-shadow: inset 0 -.12em .15em rgba(15, 23, 42, .22), 0 0 .22em rgba(255,255,255,.3); }
.owner-marks { position: absolute; left: 50%; bottom: -7px; display: flex; transform: translateX(-50%); }
.owner-mark { width: 10px; height: 10px; margin-left: -2px; border: 2px solid #e2e8f0; border-radius: 50%; background: var(--owner-color); box-shadow: 0 2px 5px rgba(0,0,0,.45); }
.spark { z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 3px; color: #fde68a; font-size: 1.35rem; font-weight: 950; text-shadow: 0 2px 12px #f59e0b; animation: pop-score .95s ease-out forwards; }
.spark.angry { z-index: 5; color: #fecdd3; font-size: 1.75rem; text-shadow: 0 2px 18px #e11d48; }
.spark.escape { color: #a7f3d0; text-shadow: 0 2px 14px #10b981; }
.round-celebration { position: absolute; z-index: 7; inset: 50% auto auto 50%; display: grid; gap: 6px; min-width: min(82%, 360px); padding: 18px 22px; transform: translate(-50%, -50%); border: 1px solid rgba(253,224,71,.9); border-radius: 16px; background: rgba(30,41,59,.94); color: #fef9c3; text-align: center; box-shadow: 0 0 52px rgba(250,204,21,.5); animation: round-celebrate .65s ease-in-out infinite alternate; }
.round-celebration[hidden] { display: none; }
.round-celebration .celebration-icons { font-size: clamp(1.35rem, 5vw, 2rem); letter-spacing: .18em; }
.round-celebration strong { overflow-wrap: anywhere; color: #fff7ad; font-size: clamp(1.1rem, 4vw, 1.7rem); }
.round-celebration span { color: #fde68a; font-size: .82rem; }
.boss-health { position: absolute; z-index: 8; left: 7%; right: 7%; top: 5%; display: grid; gap: 5px; padding: 9px 13px; border: 1px solid rgba(248,113,113,.55); border-radius: 10px; background: rgba(20,5,12,.9); box-shadow: 0 0 28px rgba(220,38,38,.32); }
.boss-health-label { display: flex; justify-content: space-between; gap: 12px; color: #fecaca; font-size: clamp(.65rem, 1.7vw, .9rem); letter-spacing: .08em; }
.boss-health-value { font-variant-numeric: tabular-nums; }
.boss-health-track { overflow: hidden; height: 11px; border: 1px solid rgba(254,202,202,.4); border-radius: 999px; background: #21070d; }
.boss-health-track span { display: block; width: 100%; height: 100%; background: linear-gradient(90deg, #991b1b, #ef4444, #fb7185); box-shadow: 0 0 14px #ef4444; transition: width .15s ease-out; }
.boss-crab { position: absolute; z-index: 4; left: 92%; top: 12%; transform: translate(-50%, -50%) scale(5); font-size: clamp(1.8rem, 4vw, 3rem); filter: hue-rotate(145deg) saturate(2.5) brightness(1.25) drop-shadow(0 0 8px #ef4444); will-change: left, top; }
.tombstone { position: absolute; z-index: 2; display: grid; justify-items: center; gap: 1px; max-width: 130px; transform: translate(-50%, -50%); pointer-events: none; }
.tombstone-marker { font-size: clamp(1.3rem, 3vw, 2.2rem); filter: grayscale(.3) drop-shadow(0 4px 4px rgba(0,0,0,.6)); }
.tombstone-name { overflow: hidden; max-width: 130px; padding: 2px 6px; border-radius: 999px; background: rgba(15,23,42,.82); color: #e2e8f0; font-size: clamp(.55rem, 1.4vw, .72rem); font-weight: 850; line-height: 1.15; text-overflow: ellipsis; text-shadow: 0 1px 4px #000; white-space: nowrap; }
.roar-flash { position: absolute; z-index: 9; inset: 0; pointer-events: none; background: rgba(239,68,68,.62); opacity: 0; }
.roar-flash.shielded { background: rgba(37,99,235,.62); }
.roar-flash.active { animation: boss-roar-flash .85s ease-out; }
.spark.boss-hit { color: #fecaca; text-shadow: 0 2px 16px #ef4444; }
.spark.boss-heal { color: #bbf7d0; text-shadow: 0 2px 16px #22c55e; }
.spark.boss-burst { z-index: 6; color: #fed7aa; font-size: 1rem; letter-spacing: .05em; text-shadow: 0 2px 18px #f97316; }
.spark.shield-crab { z-index: 6; color: #bfdbfe; font-size: 1rem; text-shadow: 0 2px 18px #2563eb; }
.spark.shield-reward { z-index: 7; color: #dbeafe; font-size: 1.1rem; letter-spacing: .04em; text-shadow: 0 2px 20px #3b82f6; }
.spark.healer-crab, .spark.resurrected, .spark.potion { z-index: 7; color: #bbf7d0; font-size: 1.05rem; letter-spacing: .03em; text-shadow: 0 2px 20px #16a34a; }
.spark.summoner-crab, .spark.summoner-cast { z-index: 7; color: #e9d5ff; font-size: 1rem; letter-spacing: .03em; text-shadow: 0 2px 20px #9333ea; }
.spark.eldritch-beast { z-index: 8; color: #f0abfc; font-size: 1.05rem; text-shadow: 0 2px 22px #7e22ce; }
.spark.charmed-beast { z-index: 8; color: #bbf7d0; font-size: 1.05rem; text-shadow: 0 2px 22px #16a34a; }
.spark.resurrected { z-index: 9; font-size: 1.5rem; }
.spark.eliminated { z-index: 6; font-size: 2.2rem; }
.spark.boss-roar { z-index: 8; color: #fecaca; text-shadow: 0 2px 18px #dc2626; }
.combat-player-badges { display: flex; align-items: center; justify-content: center; min-height: 10px; padding: 2px 4px; border-radius: 999px; background: rgba(15,23,42,.78); box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.combat-player-badge { width: 9px; height: 9px; margin-left: -2px; border: 1px solid rgba(255,255,255,.9); border-radius: 50%; background: var(--owner-color); }
.combat-player-badge:first-child { margin-left: 0; }
.combat-player-badges b { margin-left: 3px; color: #e2e8f0; font-size: 8px; line-height: 1; text-shadow: none; }
.elimination-skull { flex: none; font-size: .85em; filter: grayscale(.2); }
.player-shield { flex: none; font-size: .9em; filter: drop-shadow(0 0 4px rgba(96,165,250,.95)); }
.boss-results { display: grid; gap: 3px; margin: 3px 0; padding: 0; list-style: none; text-align: left; }
.boss-results li { display: flex; justify-content: space-between; gap: 14px; padding: 3px 7px; border-radius: 6px; background: rgba(15,23,42,.58); color: #e2e8f0; font-size: .74rem; }
.boss-results strong { color: #fda4af; font-size: inherit; }

.bucket-aim { display: grid; grid-template-columns: auto minmax(90px, 1fr) 62px; gap: 10px; align-items: center; margin-top: 14px; padding: 9px 12px; border: 1px solid rgba(125,211,252,.24); border-radius: 12px; background: rgba(15,23,42,.68); color: #cbd5e1; font-size: .75rem; font-weight: 800; }
.bucket-aim input { width: 100%; accent-color: #7dd3fc; touch-action: pan-y; }
.bucket-aim output { color: #7dd3fc; font-size: .7rem; text-align: right; white-space: nowrap; }
.bucket-aim:has(input:disabled) { opacity: .55; }
.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.emoji-button { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 13px 18px; border: 1px solid transparent; border-radius: 15px; color: white; text-align: left; box-shadow: 0 12px 30px rgba(0,0,0,.2); transition: transform .08s ease, filter .1s ease; }
.emoji-button:hover { filter: brightness(1.08); }
.emoji-button:active { transform: translateY(2px) scale(.99); }
.emoji-button > span { grid-row: 1 / 3; font-size: 2rem; }
.emoji-button strong { font-size: 1rem; }
.emoji-button small { color: rgba(255,255,255,.72); }
.bucket-count { margin-left: .35rem; color: #ccfbf1; font-size: .78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bucket-button { background: linear-gradient(135deg, #0f766e, #115e59); border-color: rgba(94, 234, 212, .28); }
.crab-button { background: linear-gradient(135deg, #dc2626, #9f1239); border-color: rgba(253, 164, 175, .25); }

.score-card { padding: 19px; }
.score-heading { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.player-count { flex: none; padding: 4px 7px; border-radius: 999px; background: #1e293b; color: #aab9ca; font-size: .7rem; }
#leaderboard { display: grid; gap: 8px; margin: 15px 0 0; padding: 0; list-style: none; counter-reset: rank; }
#leaderboard li { counter-increment: rank; display: grid; grid-template-columns: 22px 12px minmax(0, 1fr) auto; gap: 8px; align-items: center; min-height: 38px; padding: 7px 9px; border-radius: 10px; background: rgba(30, 41, 59, .68); }
#leaderboard li::before { content: counter(rank); color: #718096; font-size: .76rem; font-weight: 800; }
.player-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--owner-color); }
.player-name { display: flex; align-items: center; gap: 4px; min-width: 0; white-space: nowrap; font-size: .88rem; }
.player-label { overflow: hidden; text-overflow: ellipsis; }
.player-name em { color: #718096; font-size: .72rem; font-style: normal; }
.win-crown { position: relative; display: inline-grid; flex: none; width: 1.35em; height: 1.25em; place-items: center; font-size: 1.05rem; filter: drop-shadow(0 2px 3px rgba(250,204,21,.45)); }
.win-crown[data-count]::after { content: attr(data-count); position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%); color: #422006; font-size: .48em; font-weight: 950; line-height: 1; text-shadow: 0 1px rgba(255,255,255,.5); }
.score { font-size: 1.1rem; font-variant-numeric: tabular-nums; font-weight: 900; }
.round-status { margin: 14px 0 0; padding: 8px 10px; border: 1px solid rgba(248,113,113,.42); border-radius: 9px; color: #fecaca; background: rgba(127,29,29,.16); font-size: .74rem; font-weight: 800; text-align: center; }
.round-status[data-state="boss"] { border-color: rgba(253,224,71,.48); color: #fef9c3; background: rgba(113,63,18,.22); box-shadow: 0 0 20px rgba(250,204,21,.12); }

@keyframes bucket-wobble { to { rotate: 7deg; } }
@keyframes crab-scuttle { to { transform: translateY(-3px) rotate(-4deg); } }
@keyframes pop-score { 0% { opacity: 0; scale: .5; } 25% { opacity: 1; scale: 1.25; } 100% { opacity: 0; translate: 0 -45px; scale: 1; } }
@keyframes round-celebrate { to { transform: translate(-50%, -50%) scale(1.035) rotate(.4deg); box-shadow: 0 0 70px rgba(250,204,21,.72); } }
@keyframes boss-roar-flash { 0% { opacity: 0; } 14% { opacity: 1; } 45% { opacity: .4; } 100% { opacity: 0; } }
@keyframes eldritch-pulse { to { scale: 1.08; rotate: 3deg; } }

@media (max-width: 760px) {
  .shell { padding: 15px; }
  .join-card, .game-layout { grid-template-columns: 1fr; }
  .join-card { gap: 18px; padding: 19px; }
  form { grid-template-columns: 1fr; }
  .form-message { grid-column: 1; }
  .score-card { order: -1; }
  .board { min-height: 230px; }
}

@media (max-width: 390px) {
  .topbar { align-items: start; }
  .connection span:last-child { display: none; }
  .controls { grid-template-columns: 1fr; }
  .privacy-banner { font-size: .75rem; }
}

/* Meet owns the outer side-panel dimensions. This layout deliberately treats
   that iframe as a narrow portrait surface instead of shrinking the 16:9 UI. */
html[data-surface="sidepanel"] body {
  min-width: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(13, 148, 136, 0.16), transparent 20rem),
    #090e19;
}

html[data-surface="sidepanel"] .shell {
  width: 100%;
  padding: 12px;
}

html[data-surface="sidepanel"] .topbar {
  align-items: center;
}

html[data-surface="sidepanel"] .topbar .eyebrow,
html[data-surface="sidepanel"] .privacy-banner span,
html[data-surface="sidepanel"] .connection span:last-child {
  display: none;
}

html[data-surface="sidepanel"] h1 {
  font-size: 1.35rem;
}

html[data-surface="sidepanel"] .privacy-banner {
  margin: 10px 0 12px;
  padding: 8px 10px;
  font-size: 0.7rem;
  line-height: 1.35;
}

html[data-surface="sidepanel"] .join-card,
html[data-surface="sidepanel"] .game-layout,
html[data-surface="sidepanel"] form {
  grid-template-columns: 1fr;
}

html[data-surface="sidepanel"] .join-card {
  gap: 14px;
  padding: 16px;
}

html[data-surface="sidepanel"] .form-message {
  grid-column: 1;
}

html[data-surface="sidepanel"] .game-layout {
  gap: 12px;
}
html[data-surface="sidepanel"] .board {
  aspect-ratio: 4 / 5;
  min-height: 0;
  border-radius: 16px;
}

html[data-surface="sidepanel"] .entity {
  font-size: clamp(1.55rem, 10vw, 2.3rem);
}

html[data-surface="sidepanel"] .controls {
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 9px;
}

html[data-surface="sidepanel"] .emoji-button {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr;
  gap: 7px;
  min-width: 0;
  padding: 10px;
  border-radius: 12px;
}

html[data-surface="sidepanel"] .emoji-button > span {
  grid-row: 1;
  font-size: 1.6rem;
}

html[data-surface="sidepanel"] .emoji-button small {
  display: none;
}

html[data-surface="sidepanel"] .score-card {
  order: 0;
  padding: 14px;
}

html[data-surface="sidepanel"] #leaderboard {
  max-height: 170px;
  overflow-y: auto;
}

html[data-surface="sidepanel"] .action-message {
  margin-top: 5px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
