* {
  box-sizing:border-box;
}

:root {
  color-scheme:dark;
  --gold:#ffd380;
  --line:#ffffff26;
  --muted:#bec0c1;
  --art:url(dunes.webp);
  font:16px/1.45 Inter,"Helvetica Neue",Arial,sans-serif;
}

body {
  margin:0;
  background:#11151b;
  color:#fff7e8;
}

body::before {
  content:"";
  position:fixed;
  inset:0;
  background:linear-gradient(90deg,#12131833,#16121b33 60%,#090c11bd),var(--art) center/cover;
  z-index:-1;
}

.candy-air {display:none}
@media (prefers-reduced-motion:no-preference) {
  .candy-default .candy-air {
    display:block;position:fixed;inset:0;overflow:hidden;z-index:-1;pointer-events:none;
  }
  .candy-air::before,.candy-air::after {
    content:"";position:absolute;background:url(candy-mist.webp) center / 100% 100% no-repeat;
    animation:candy-mist 17s ease-in-out -6s infinite alternate;
  }
  .candy-air::before {left:-12%;top:35%;width:78%;height:34%}
  .candy-air::after {
    left:14%;top:58%;width:64%;height:32%;
    animation-duration:23s;animation-direction:alternate-reverse;
  }
  .candy-air i {
    position:absolute;width:var(--size,14px);aspect-ratio:1;
    left:var(--x);top:var(--y);background:white;
    clip-path:polygon(50% 0,59% 39%,100% 50%,60% 58%,50% 100%,41% 61%,0 50%,40% 42%);
    animation:candy-twinkle var(--period,5.8s) ease-in-out var(--phase) infinite;
  }
  .candy-air i:nth-child(3n) {--size:19px;--period:7.1s}
  .candy-air i:nth-child(3n + 1) {--size:11px;--period:4.9s}
  .candy-air i:nth-child(1) {--x:3%;--y:22%;--phase:-2.37s}
  .candy-air i:nth-child(2) {--x:16%;--y:17%;--phase:-4.74s}
  .candy-air i:nth-child(3) {--x:33%;--y:12%;--phase:-1.11s}
  .candy-air i:nth-child(4) {--x:53%;--y:18%;--phase:-3.48s}
  .candy-air i:nth-child(5) {--x:65%;--y:31%;--phase:-5.85s}
  .candy-air i:nth-child(6) {--x:83%;--y:16%;--phase:-2.22s}
  .candy-air i:nth-child(7) {--x:95%;--y:28%;--phase:-4.59s}
  .candy-air i:nth-child(8) {--x:8%;--y:35%;--phase:-0.96s}
  .candy-air i:nth-child(9) {--x:21%;--y:39%;--phase:-3.33s}
  .candy-air i:nth-child(10) {--x:45%;--y:32%;--phase:-5.70s}
  .candy-air i:nth-child(11) {--x:3%;--y:57%;--phase:-2.07s}
  .candy-air i:nth-child(12) {--x:15%;--y:63%;--phase:-4.44s}
  .candy-air i:nth-child(13) {--x:58%;--y:54%;--phase:-0.81s}
  .candy-air i:nth-child(14) {--x:68%;--y:47%;--phase:-3.18s}
  .candy-air i:nth-child(15) {--x:92%;--y:51%;--phase:-5.55s}
  .candy-air i:nth-child(16) {--x:7%;--y:77%;--phase:-1.92s}
  .candy-air i:nth-child(17) {--x:27%;--y:73%;--phase:-4.29s}
  .candy-air i:nth-child(18) {--x:51%;--y:79%;--phase:-0.66s}
  .candy-air i:nth-child(19) {--x:65%;--y:69%;--phase:-3.03s}
  .candy-air i:nth-child(20) {--x:80%;--y:83%;--phase:-5.40s}
  .candy-air i:nth-child(21) {--x:94%;--y:72%;--phase:-1.77s}
  .candy-air i:nth-child(22) {--x:37%;--y:90%;--phase:-4.14s}
}
@keyframes candy-mist {
  from {opacity:.78;transform:translate(-5%,5%)}
  to {opacity:1;transform:translate(9%,-7%)}
}
@keyframes candy-twinkle {
  0%,83%,100% {opacity:0;transform:scale(.45)}
  24% {opacity:.66;transform:scale(.77)}
  42% {opacity:1;transform:scale(1)}
  65% {opacity:.4;transform:scale(.68)}
}

/* The scene shares the still's cover crop so the two mists stay over
   their sources, even when the board switches to a portrait viewport. */
.volcano-default {--island-anchor:26%}
.volcano-default body::before {background-position:var(--island-anchor) center}
@media (orientation:portrait) {
  .volcano-default {--island-anchor:18%}
}
.volcano-air {display:none}
@media (prefers-reduced-motion:no-preference) {
  .volcano-default .volcano-air {
    position:fixed;inset:0;display:block;z-index:-1;overflow:hidden;
    pointer-events:none;container-type:size;
  }
  .volcano-frame {
    position:absolute;top:50%;left:var(--island-anchor);
    width:max(100cqw,calc(100cqh * 1672 / 941));aspect-ratio:1672 / 941;
    transform:translate(calc(0% - var(--island-anchor)),-50%);
  }
  .volcano-frame::before,.volcano-frame::after {
    content:"";position:absolute;background-size:100% 100%;background-repeat:no-repeat;
  }
  .volcano-frame::before {
    left:-12%;top:29%;width:59%;height:42%;
    background-image:url(volcano-embers.webp);
    animation:volcano-steam 12s ease-in-out -4s infinite alternate;
  }
  .volcano-frame::after {
    left:17%;top:55%;width:47%;height:20%;
    background-image:url(volcano-sea-mist.webp);
    animation:volcano-sea-drift 19s ease-in-out -13s infinite alternate;
  }
}
/* In landscape the hex cluster covers the middle of the bay. Carry the
   near bank into the foreground and the far bank along its right edge. */
@media (orientation:landscape) and (prefers-reduced-motion:no-preference) {
  .volcano-frame::after {
    left:13%;top:48%;width:56%;height:46%;
    background-image:url(volcano-sea-mist.webp),url(volcano-sea-mist.webp);
    background-size:85% 64%,50% 44%;
    background-position:left bottom,right top;
  }
}
@keyframes volcano-steam {
  from {opacity:.92;transform:translate(-2%,6%)}
  to {opacity:1;transform:translate(9%,-12%)}
}
@keyframes volcano-sea-drift {
  from {opacity:.80;transform:translate(4%,2%)}
  to {opacity:1;transform:translate(-5%,-4%)}
}

/* Anchor the fireflies to the painted tree as the background crops. */
.glimmer-default {--forest-anchor:24%}
.glimmer-default body::before {background-position:var(--forest-anchor) center}
@media (orientation:portrait) {
  .glimmer-default {--forest-anchor:2%}
}
.glimmer-grove {display:none}
@media (prefers-reduced-motion:no-preference) {
  .glimmer-default .glimmer-grove {
    display:block;position:fixed;inset:0;overflow:hidden;z-index:-1;
    pointer-events:none;container-type:size;
  }
  .glimmer-tree {
    position:absolute;top:50%;left:var(--forest-anchor);
    width:max(100cqw,calc(100cqh * 1672 / 941));aspect-ratio:1672 / 941;
    transform:translate(calc(0% - var(--forest-anchor)),-50%);
  }
  .glimmer-tree::before {
    content:"";position:absolute;left:-3%;top:55%;width:85%;height:35%;
    background:
      radial-gradient(ellipse 30% 11% at 26% 41%,#d4f8eab8,transparent),
      radial-gradient(ellipse 17% 15% at 38% 38%,#c6e8db8f,transparent),
      radial-gradient(ellipse 26% 13% at 68% 63%,#e0f9efc4,transparent),
      radial-gradient(ellipse 17% 12% at 77% 57%,#cee9de85,transparent);
    animation:glimmer-mist 22s ease-in-out -7s infinite alternate;
  }
  .glimmer-tree i {
    position:absolute;left:var(--x);top:var(--y);width:20px;height:20px;
    background:radial-gradient(circle,#f6ffff 0 10%,#94fff5 14%,#38fbe8bb 27%,#26d8ce52 45%,transparent 70%);
    animation:glimmer-rise 10s ease-in-out var(--delay) infinite;
  }
  .glimmer-tree i:nth-child(1) {--x:4%;--y:30%;--delay:-2s;--sway:12px}
  .glimmer-tree i:nth-child(2) {--x:7%;--y:49%;--delay:-7s;--sway:-11px}
  .glimmer-tree i:nth-child(3) {--x:11%;--y:21%;--delay:-4s;--sway:9px}
  .glimmer-tree i:nth-child(4) {--x:17%;--y:74%;--delay:-6s;--sway:-14px}
  .glimmer-tree i:nth-child(5) {--x:23%;--y:28%;--delay:-8s;--sway:14px}
  .glimmer-tree i:nth-child(6) {--x:25%;--y:51%;--delay:-3s;--sway:-8px}
  .glimmer-tree i:nth-child(7) {--x:4%;--y:68%;--delay:-5s;--sway:13px}
  .glimmer-tree i:nth-child(8) {--x:8%;--y:77%;--delay:-8.5s;--sway:-6px}
  .glimmer-tree i:nth-child(9) {--x:24%;--y:72%;--delay:-4.5s;--sway:8px}
  .glimmer-tree i:nth-child(10) {--x:30%;--y:39%;--delay:-2.5s;--sway:12px}
  .glimmer-tree i:nth-child(11) {--x:41%;--y:83%;--delay:-5.5s;--sway:-12px}
  .glimmer-tree i:nth-child(12) {--x:51%;--y:49%;--delay:-7.5s;--sway:9px}
  .glimmer-tree i:nth-child(13) {--x:59%;--y:30%;--delay:-3.5s;--sway:-13px}
  .glimmer-tree i:nth-child(14) {--x:62%;--y:73%;--delay:-6.5s;--sway:8px}
  .glimmer-tree i:nth-child(15) {--x:36%;--y:17%;--delay:-1.5s;--sway:-9px}
}
/* Bring three glade lights inside the narrow portrait crop. */
@media (orientation:portrait) {
  .glimmer-tree i:nth-child(10) {--x:3%;--y:44%}
  .glimmer-tree i:nth-child(12) {--x:25%;--y:37%}
  .glimmer-tree i:nth-child(15) {--x:15%;--y:61%}
}
@keyframes glimmer-rise {
  0%,100% {opacity:0}
  0% {transform:translate(0,0)}
  13% {opacity:.9;transform:translate(var(--sway),-2cqh)}
  40%,52% {opacity:1;transform:translate(2px,-5cqh)}
  76% {opacity:.77;transform:translate(var(--sway),-7cqh)}
  94%,100% {opacity:0;transform:translate(4px,-8cqh)}
}
@keyframes glimmer-mist {
  from {opacity:.49;transform:translate(-3%,2%)}
  to {opacity:.76;transform:translate(4%,-3%)}
}

/* Align both the crop and its effects to the same point on the terrace. */
.citadel-default {--citadel-anchor:25%}
.citadel-default body::before {background-position:var(--citadel-anchor) center}
@media (orientation:portrait) {
  .citadel-default {--citadel-anchor:24%}
}

.citadel-scene {display:none}
@media (prefers-reduced-motion:no-preference) {
  .citadel-default .citadel-scene {
    display:block;position:fixed;inset:0;z-index:-1;overflow:hidden;
    pointer-events:none;container-type:size;
  }
  .citadel-frame {
    position:absolute;top:50%;left:var(--citadel-anchor);
    width:max(100cqw,calc(100cqh * 1672 / 941));aspect-ratio:1672 / 941;
    transform:translate(calc(0% - var(--citadel-anchor)),-50%);
  }
  /* Keep drifting fog behind the terrace rail, castle walls and near cliffs. */
  .citadel-valley {
    position:absolute;inset:0;
    -webkit-mask:url(citadel-valley-mask.webp) center / 100% 100% no-repeat;
    mask:url(citadel-valley-mask.webp) center / 100% 100% no-repeat;
  }
  .citadel-valley::before,.citadel-valley::after {
    content:"";position:absolute;left:0;width:200%;height:29%;top:48%;
    background:url(citadel-mist.webp?v=feather1) repeat-x 0 center / 50% 100%;
    animation:citadel-drift 44s linear infinite;animation-delay:-11s;
  }
  .citadel-valley::after {
    top:59%;height:40%;opacity:.93;animation-duration:35s;animation-delay:-21s;
  }
  .citadel-fireflies i {
    position:absolute;
    left:22%;top:26%;
    width:10px;height:10px;
    background:radial-gradient(circle,#fff6c2 0 15%,#efd991a8 28%,transparent 72%);
    animation:citadel-firefly 9s ease-in-out -3s infinite;
  }
  .citadel-fireflies i:nth-child(2) {left:32%;top:12%;animation-duration:13s;animation-delay:-8s}
  .citadel-fireflies i:nth-child(3) {left:41%;top:20%;animation-duration:11s;animation-delay:-2s}
  .citadel-fireflies i:nth-child(4) {left:58%;top:15%;animation-duration:15s;animation-delay:-6s}
}

@keyframes citadel-drift {to {transform:translateX(-50%)}}
@keyframes citadel-firefly {
  0%,100% {opacity:0;transform:translate(0,4px)}
  28% {opacity:.78;transform:translate(8px,-6px)}
  62% {opacity:.24;transform:translate(17px,-14px)}
  82% {opacity:0;transform:translate(12px,-19px)}
}

/* The inner frame follows the still's center/cover crop. Only the two
   soft sand plumes move; their positions are relative to the artwork. */
.dune-wind {display:none}
@media (prefers-reduced-motion:no-preference) {
  .dunes-default .dune-wind {
    display:grid;
    place-items:center;
    position:fixed;
    inset:0;
    overflow:hidden;
    z-index:-1;
    pointer-events:none;
    container-type:size;
  }

  .dune-wind > div {
    position:absolute;
    width:max(100cqw, calc(100cqh * 1672 / 941));
    aspect-ratio:1672 / 941;
  }

  .dune-wind > div::before,
  .dune-wind > div::after {
    content:"";
    position:absolute;
    background:url(dune-spindrift.webp) center / 100% 100% no-repeat;
    animation:dune-gust 12s ease-in-out infinite;
  }

  .dune-wind > div::before {
    left:25%;
    top:56%;
    width:55%;
    height:26%;
    animation-delay:-4s;
  }
  .dune-wind > div::after {
    left:2%;
    top:45%;
    width:47%;
    height:20%;
    animation-duration:15s;
    animation-delay:-9s;
  }
}

@keyframes dune-gust {
  0% {opacity:0;transform:translate(7%,6%)}
  16%,62% {opacity:1}
  100% {opacity:0;transform:translate(-18%,-12%)}
}

@media (prefers-reduced-motion:no-preference) {
  .city-default body::after,.riffcade-default body::after {
    content:"";
    position:fixed;
    inset:0;
    z-index:-1;
    pointer-events:none;
    background:url(city-waterfront.svg?v=low-notes1) center / cover no-repeat;
  }
  .riffcade-default body::after { background-image:url(riffcade-lights.svg); }
}
@media (orientation:portrait) {
  /* Keep the animated mask aligned with the skyline in the portrait crop. */
  .city-default body::before, .city-default body::after {background-position:55% center}
}

@media (max-width:700px) {
  .vale-default body::before {
    --art:url(vale-mobile.webp);
  }
}

/* Two depth planes follow the distant ridges and the waterfall basin.
   The strip has transparent ends and repeats once beyond the viewport. */
.vale-atmosphere {display:none}

@media (prefers-reduced-motion:no-preference) {
  .vale-default .vale-atmosphere {
    display:block;
    overflow:hidden;
    position:fixed;
    z-index:-1;
    pointer-events:none;
    inset:0;
  }

  .vale-atmosphere::before,
  .vale-atmosphere::after {
    content:"";
    position:absolute;
    left:0;
    width:200%;
    background:url(vale-mist.webp) repeat-x 0 center / 50% 100%;
    animation:vale-mist-drift 56s linear infinite;
  }

  .vale-atmosphere::before {
    top:28%;
    height:24%;
    opacity:.58;
    animation-delay:-24s;
  }

  .vale-atmosphere::after {
    top:51%;
    height:33%;
    opacity:.76;
    animation-duration:48s;
    animation-delay:-6s;
  }
}

@keyframes vale-mist-drift {
  to {transform:translateX(-50%)}
}

button,select,input {
  font:inherit;
}

button,select,input:not([type=color]) {
  border-radius:8px;
}

button,select {
  background:#22262b;
  color:#fff7e8;
  border:1px solid #b6a58d88;
  padding:.55rem .85rem;
}

button:not(:disabled),select,summary {
  cursor:pointer;
}

button:disabled {
  opacity:.48;
}

button:focus-visible,a:focus-visible,select:focus-visible,summary:focus-visible,[role=button]:focus-visible {
  outline:3px solid #74fffa;
  outline-offset:2px;
}

button:hover:not(:disabled) {
  filter:brightness(1.2);
}

a {
  color:var(--gold);
}

header {
  height:64px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 clamp(16px,3vw,48px);
  border-bottom:1px solid var(--line);
  background:#101219cf;
}

.brand,h1,h2,summary,.primary {
  font-family:"Arial Narrow",Impact,system-ui,sans-serif;
  font-weight:850;
}

.brand {min-width:0}
@media (min-width:761px) {
  body > header {display:grid;grid-template-columns:1fr auto 1fr}
  .brand {grid-column:2;width:210px}
  body > header .tools {justify-self:end}
}
.brand img {display:block;width:100%;height:auto}
.gold {color:var(--gold)}

.tools,.mapfoot,.panel h2,footer {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

#status,small,#round {
  font-size:.72rem;
  font-weight:800;
  letter-spacing:.14em;
  text-transform:uppercase;
}

.tools button,.mapfoot button {
  background:#161a20d9;
}

.tools #status {
  background:#16191dd9;
  border:1px solid #ffffff42;
  border-radius:2em;
  padding:5px 12px;
}

.tools #status.live:before {
  content:"";
  display:inline-block;
  background:#ff534f;
  border-radius:100%;
  width:8px;
  height:8px;
  margin-right:7px;
  box-shadow:0 0 10px #ff5757;
}

main {
  display:grid;
  grid-template-columns:minmax(0,1fr) clamp(290px,29vw,420px);
  gap:clamp(16px,2vw,32px);
  padding:20px clamp(14px,2.5vw,44px) 30px;
  max-width:2050px;
  margin:auto;
}

#arena {
  position:relative;
  display:flex;
  flex-direction:column;
  min-width:0;
  height:calc(100svh - 116px);
  min-height:480px;
}

.heading {
  pointer-events:none;
  align-self:flex-start;
}

h1,h2,p {
  margin:0;
}

h1 {
  font-style:italic;
  letter-spacing:-.035em;
  text-transform:uppercase;
  font-size:clamp(2rem,4vw,4.1rem);
  line-height:1.05;
}

.heading h1 {
  background:linear-gradient(115deg,#15171deb,#302419d9);
  border:1px solid #ffce7ca8;
  border-left:5px solid var(--gold);
  padding:5px 23px 8px 12px;
  clip-path:polygon(0 0,100% 0,96% 100%,0 100%);
  text-shadow:0 3px 4px #0008;
}

#round {
  display:inline-block;
  background:#13161bc9;
  padding:3px 10px;
  color:var(--gold);
  margin-top:6px;
}

#map {
  overflow:auto;
  flex:1;
  min-height:0;
  display:block;
  touch-action:none;
  overscroll-behavior:contain;
}

#tiles {
  display:block;
  width:100%;
  height:100%;
  min-height:160px;
}

#tiles text {
  font:800 12px system-ui;
  fill:white;
  paint-order:stroke;
  stroke:#1119;
  stroke-width:2;
  pointer-events:none;
}

.tile[role=button] {
  cursor:pointer;
}

.tile[role=button]:hover .rim,.tile:focus .rim {
  stroke:#fff;
  stroke-width:4;
}

.mapfoot {
  font-size:.8rem;
}

.mapfoot>span {
  padding:6px 10px;
  border:1px solid var(--line);
  background:#13161bcf;
  border-radius:7px;
}

.mapfoot button {
  min-width:42px;
  font-size:1rem;
  margin-left:5px;
}

#overlay:not(:empty) {
  position:absolute;
  top:50%;
  left:50%;
  transform:translate(-50%,-45%);
  width:min(92%,330px);
  text-align:center;
  background:linear-gradient(145deg,#282823f5,#14171df7);
  border:1px solid #eac180;
  border-radius:14px;
  box-shadow:0 12px 40px #0009;
  padding:22px;
}

#overlay h2 {
  font-style:italic;
}

#overlay.welcome:not(:empty) {
  width:min(92%,430px);
  padding:clamp(21px,3vw,32px);
}

#overlay.welcome h2 {
  font-size:clamp(1.85rem,4vw,2.6rem);
  line-height:1.05;
  text-wrap:balance;
}

#overlay p,.panel p,dialog p {
  color:var(--muted);
  margin:.5rem 0;
}

.primary {
  width:100%;
  background:linear-gradient(#ffdd91,#f0ac43);
  color:#201705;
  border:1px solid #fff0b7;
  box-shadow:inset 0 0 0 2px #fff4;
  font-size:1.02rem;
  letter-spacing:.02em;
  margin-top:.6rem;
}

select {
  width:100%;
  margin-top:.5rem;
}

aside {
  display:flex;
  flex-direction:column;
  gap:12px;
  align-self:start;
  min-width:0;
}

.panel,dialog,.admin {
  background:linear-gradient(135deg,#25282bf7,#11151af7);
  border:1px solid #bda98c88;
  border-radius:12px;
  box-shadow:0 6px 20px #0004;
}

.panel {
  padding:17px;
}

small {
  color:var(--gold);
  display:block;
  margin-bottom:7px;
}

h2,summary {
  font-size:1.4rem;
  letter-spacing:-.02em;
}

.panel h2 {
  font-style:italic;
}

#count {
  font:700 .9rem system-ui;
  color:var(--gold);
}

ul,ol {
  padding:0;
  margin:0;
  list-style:none;
}

#roster {
  max-height:40vh;
  overflow:auto;
}

li {
  padding:8px 0;
  border-top:1px solid var(--line);
  overflow-wrap:anywhere;
}

#roster li {
  display:flex;
  align-items:center;
  gap:8px;
}

#roster li span:last-child {
  margin-left:auto;
  color:var(--muted);
  font-size:.76rem;
  white-space:nowrap;
}

#roster .performer-counts { display:inline-flex; align-items:center; gap:.3em; flex:none; font-variant-numeric:tabular-nums; }
#roster .performer-counts svg { width:1.1em; height:1.1em; }
#roster .performer-counts .echo-orb { margin:0; }

#roster img,.avatar {
  width:31px;
  height:31px;
  object-fit:cover;
  border-radius:50%;
  background:#34383e;
  border:2px solid var(--edge,#827c72);
  display:grid;
  place-items:center;
  font-weight:800;
}

.out {
  opacity:.57;
}

#events {
  margin-top:10px;
  font-size:.88rem;
}

#feedback:empty {
  display:none;
}

footer {
  padding:6px 4px;
  font-size:.85rem;
}

.board-links {display:flex;align-items:stretch;gap:6px}
aside .board-link {
  display:inline-flex;align-items:center;justify-content:center;gap:.35em;min-height:44px;
  padding:6px clamp(6px,1vw,12px);border:1px solid #6094c6;border-radius:8px;
  background:linear-gradient(115deg,#1e4874,#223c64);color:#eef6ff;font:700 .9rem/1.2 system-ui,sans-serif;
  text-align:center;text-decoration:none;
}
aside .board-link:hover {background:#285886;filter:none}
aside footer:has(.board-link) {padding:0}
#howToPlay {
  width:min(38rem,calc(100vw - 24px)); max-height:85vh; max-height:85dvh;
  padding:0; overflow:hidden; text-align:left; border:1px solid #77bc94;
  background:linear-gradient(135deg,rgba(22,45,37,.94),rgba(14,23,25,.94));
  box-shadow:0 18px 64px #0009;
}
#howToPlay[open] { display:flex; flex-direction:column; }
.guide-head { display:flex; justify-content:space-between; align-items:center; padding:14px 22px; border-bottom:1px solid #8dcfae45; }
.guide-head h2 { color:#e5f8e7; line-height:1.1; }
.guide-head button { height:44px; width:44px; padding:0; font-size:1.5rem; background:#182b24; }
.guide-body { padding:18px clamp(16px,4vw,26px) 24px; overflow:auto; overscroll-behavior:contain; }
#howToPlay p { margin:0; color:#e6eae6; font-size:1rem; line-height:1.55; }
.guide-body section { border-top:1px solid #8dcfae35; padding-top:14px; margin-top:16px; }
.guide-body h3 { display:flex; gap:9px; align-items:center; color:#ade8c1; margin:0 0 5px; font-size:1.12rem; }
.guide-body h3 svg,.guide-body h3 img { width:25px; height:25px; }
.guide-body strong { color:#fff4cd; }

#staffTools a,#staffTools button { display:inline-flex;align-items:center;justify-content:center;
  min-height:38px;line-height:1.15;text-align:center;text-decoration:none; }
#staffTools { justify-content:flex-start;gap:5px;padding:0;flex-wrap:nowrap; }
#staffTools a,#staffTools button { margin:0;padding:6px 8px;background:#53222a;color:#ffe6e4;
  border:1px solid #a25760;border-radius:6px;font-size:clamp(.7rem,2.7vw,.82rem);font-weight:700; }

#staffTools [hidden],#staffTools[hidden] { display:none; }
#staffTools :is(button,a):hover { filter:brightness(1.18); }

footer a,footer button {
  padding:7px 10px;
  background:#17191fee;
  border:1px solid var(--line);
  border-radius:6px;
}

footer button {
  color:#ffc1ad;
  margin-left:auto;
}

dialog {
  padding:25px;
  width:min(390px,92vw);
  color:inherit;
  text-align:center;
  border-color:var(--gold);
}

dialog::backdrop {
  background:#080b11a8;
  backdrop-filter:blur(3px);
}

dialog h2 {
  font-size:2rem;
  font-style:italic;
}

#close {
  float:right;
  background:none;
  border:0;
  padding:0 4px;
  font-size:1.5rem;
}

input[type=color] {
  width:100%;
  height:44px;
  background:#181a20;
  border:1px solid var(--line);
  padding:3px;
  margin-top:8px;
}

.versus {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:15px;
  margin:15px 0;
}

#controls .versus {
  --portrait-size:60px;
  align-items:flex-start;
}

#controls .fighter-portrait,
#controls .versus>b {
  display:grid;
  place-items:center;
  height:var(--portrait-size);
}

.fighter {
  display:grid;
  justify-items:center;
  gap:6px;
  flex:1;
  overflow-wrap:anywhere;
}

.fighter img,.fighter .avatar {
  width:var(--portrait-size,60px);
  height:var(--portrait-size,60px);
  border-color:var(--gold);
}

.versus>b {
  color:var(--gold);
  font-style:italic;
}

.admin {
  max-width:1080px;
  margin:24px auto;
  padding:24px;
}

.admin p {
  margin:10px 0 20px;
}

.worlds {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(260px,100%),1fr));
  gap:16px;
}

.worlds img {
  width:100%;
  aspect-ratio:16/9;
  object-fit:cover;
  border-radius:6px;
}

.worlds label {
  display:block;
  margin:10px 0;
}

.worlds input:not([type=checkbox]) {
  display:block;
  width:100%;
  padding:8px;
  background:#181c22;
  border:1px solid var(--line);
  color:white;
}

.worlds output {
  display:block;
}

@media(max-width:760px) {
  header {
    height:49px;
  }
  main {
    display:block;
    padding:8px 10px 18px;
  }
  #arena {
    height:clamp(365px,64svh,650px);
    min-height:0;
  }
  .heading {
    align-self:center;
    text-align:center;
  }
  .heading h1 {
    font-size:clamp(1.55rem,7vw,2.6rem);
  }
  #round {
    font-size:.63rem;
  }
  .mapfoot {
    padding-bottom:6px;
  }
  .panel {
    padding:13px 15px;
  }
  aside {
    gap:9px;
    margin-top:8px;
  }
  .tools {
    gap:6px;
  }
  .tools button {
    padding:4px 8px;
  }
  .brand {width:min(98px,23.5vw)}
  #roster {
    max-height:260px;
  }
  #overlay:not(:empty) {
    padding:15px;
    width:min(84%,290px);
  }
}

[hidden] { display: none !important; }
#round { font-size: clamp(.92rem, 1.2vw, 1.15rem); letter-spacing: .055em; text-transform: none; }
#events { max-height: min(36vh, 260px); overflow-y: auto; overscroll-behavior: contain; }
.tile[role=button]:focus, .tile[role=button]:focus-visible { outline: none; }
.tile[role=button] { -webkit-tap-highlight-color: transparent; }
.tile .rim.selected { stroke: white; stroke-width: 4; }
#roster .group-title { color: var(--gold); font-weight: 800; padding-top: 13px; }
.echo-orb {
  display: inline-block; width: 1em; height: 1em; margin-right: .3em; vertical-align: -.12em;
  border-radius: 50%; background: radial-gradient(circle at 34% 28%, white, #97f9ff 17%, #8789ff 48%, #40207e 80%);
  box-shadow: 0 0 5px #a29dff;
}

#tiles .crate-price, .crate-art .crate-price { fill:#ffda70; stroke:none; font:800 15px/1 system-ui,sans-serif;
  text-shadow:0 0 1px #ffad28, 0 0 2.2px #ff780c; }
.crate-art { display:block; width:112px; height:112px; margin:16px auto; }
.inventory { display:flex; justify-content:center; gap:4px; flex-wrap:wrap; }
.inventory:empty { display:none; }
.item-chip { position:relative; display:inline-flex; align-items:center; gap:2px; min-height:34px; padding:3px 7px; background:#221d26; border:1px solid #b99759; }
.item-chip small { margin:0; font-size:.67rem; }
.item-chip sup { color:white; font-size:.6rem; }
#crateReveal { overflow:visible; background:radial-gradient(ellipse at 50% 24%,#423521,#17181e 76%); border:1px solid #edc479; }
#crateReveal.manual-reveal { position:relative; inset:auto; margin:12px 0; padding:14px; width:100%; max-width:100%; }
#crateClose { position:absolute; right:6px; top:5px; font-size:1.35rem; border:none; background:none; z-index:1; }
.loot-icon { position:relative; font-size:3rem; text-align:center; margin:.3em 0; filter:drop-shadow(0 0 10px #ffc67766); }
.loot-burst { position:absolute; inset:0; pointer-events:none; display:grid; place-items:center; }
.loot-burst i { position:absolute; animation:realm-burst 1s ease-out both; }
.loot-burst .spark { width:6px; height:10px; background:linear-gradient(#fff6ba,#f0a22b); }
.loot-burst .skull { font-size:16px; }
@keyframes realm-burst { from { transform:rotate(var(--angle)) translateY(-6px); opacity:1; } to { transform:rotate(var(--angle)) translateY(-85px) rotate(65deg); opacity:0; } }
@media (prefers-reduced-motion:reduce) { .loot-burst { display:none; } }

.relic-icon { width:1.65em; height:1.65em; vertical-align:middle; }
.loot-icon .relic-icon { width:1.2em; height:1.2em; }

#drawSweep {
  position:absolute; inset:0; overflow:hidden; pointer-events:none; z-index:3;
}
#drawSweep::after {
  content:""; position:absolute; inset:0;
  background:linear-gradient(105deg,transparent 22%,#359aff26 42%,#beefff6b 50%,#5dc7ff38 55%,transparent 72%);
  animation:draw-sweep .9s ease-out both;
}
@keyframes draw-sweep { from { transform:translateX(-95%); } to { transform:translateX(95%); } }
#turnDraw {
  position:fixed; margin:0; right:auto; bottom:auto; top:clamp(76px,13vh,130px); left:50%; transform:translateX(-50%); z-index:12;
  display:flex; align-items:center; gap:16px; width:max-content; max-width:calc(100% - 32px);
  padding:14px 24px; border:1px solid #7fe2ff; border-radius:14px; pointer-events:none;
  color:white; background:linear-gradient(120deg,#07182cf7,#16395bf7 64%,#102039fa);
  box-shadow:0 8px 26px #02081399,inset 0 1px #e2f8ff55; overflow-wrap:anywhere; overflow:visible;
}
#turnDraw[hidden],#drawSweep[hidden] { display:none; }
.draw-copy { min-width:0; display:grid; gap:3px; }
.draw-copy small { color:#a0eaff; font:bold .69rem system-ui; letter-spacing:.15em; }
.draw-copy strong { font:800 clamp(1.15rem,3vw,1.8rem)/1.1 system-ui; }
.draw-emblem { position:relative; flex:none; width:42px; height:42px; border:2px solid #6cdcff; border-radius:50%; background:radial-gradient(circle,#c1faff,#3791db 20%,#122b45 60%); }
.draw-emblem img,.draw-emblem .avatar { width:100%; height:100%; border:0; border-radius:50%; object-fit:cover; }
.draw-bolt { position:absolute; top:50%; left:50%; width:28px; height:9px; background:#a4efff; transform-origin:0 50%;
  clip-path:polygon(0 65%,43% 0,51% 37%,100% 5%,47% 100%,38% 59%);
  animation:draw-zap .64s ease-out both; }
@keyframes draw-zap {
  from { transform:rotate(var(--angle)) translateX(12px) scale(.45); opacity:1; }
  to { transform:rotate(var(--angle)) translateX(40px) scale(.9); opacity:0; }
}
.draw-marker { fill:#8cdfff40; stroke:#e6ffff; stroke-width:4; pointer-events:none; }
#tiles.drawing .duel-trace,#tiles.drawing .duel-rim,#tiles.drawing .stage-marker { visibility:hidden; }
.duel-trace { animation:duel-lap 2s linear infinite; pointer-events:none; }
.rival-trace { animation-direction:reverse; }
@keyframes duel-lap { to { stroke-dashoffset:-50; } }
@media (prefers-reduced-motion:reduce) {
  .duel-trace,.draw-bolt,#drawSweep::after { animation:none; }
  .draw-bolt,#drawSweep { display:none; }
}

#controls .turns-remaining {color:#8ce9aa;font-weight:700;margin:.25rem 0 .7rem}

button.primary.retreat-action {
  background:linear-gradient(#ffb5ae,#e78a85);
  border-color:#ffd4cf;
  color:#341716;
}

button.primary.fate-action {
  background:linear-gradient(145deg,#8947c5,#582386);
  border-color:#deacff; color:#fff; text-shadow:0 1px 2px #34164c;
}
.relic-icon:has(use[href$="#coin"]) { filter:drop-shadow(0 0 3px #bb64f9); }
#crateReveal.fate-verdict { border-color:#d297ff; background:radial-gradient(ellipse at 50% 25%,#482260,#1b1428 76%); }
.fate-verdict .spark { background:linear-gradient(#faf1ff,#b155fc 70%,#751dcc); }
.fate-flip { width:76px; height:76px; margin:32px auto 12px; display:block;
  animation:fate-toss 1.8s cubic-bezier(.18,.55,.36,1) both; }
@keyframes fate-toss {
  0% {transform:translateY(12px) rotateY(0);}
  42% {transform:translateY(-25px) rotateY(600deg);}
  82% {transform:translateY(4px) rotateY(1020deg);}
  100% {transform:translateY(0) rotateY(1080deg);}
}
@media(prefers-reduced-motion:reduce){.fate-flip{animation:none;}}

#inventoryOpen {align-self:stretch;width:100%;min-height:44px;color:#f0fff2;font-weight:750;border:1px solid #78c790;
  background:linear-gradient(115deg,#185938,#226743);box-shadow:inset 0 1px #c5ffce30}
#inventoryOpen:hover {background:#277047}
#memberInventory {
  --brass:#c49054; --ivory:#fff1d9;
  width:min(34rem,calc(100vw - 24px)); max-height:86dvh; padding:0; overflow:auto;
  text-align:left; color:var(--ivory); border:1px solid var(--brass); border-radius:14px;
  background:radial-gradient(ellipse at top left,#74442a70,transparent 65%),linear-gradient(140deg,#442818,#27170f 75%);
  box-shadow:inset 0 0 0 3px #20120c,inset 0 0 0 4px #805334,0 24px 80px #080503c9;
  scrollbar-color:#a6794d #291a11;
}
#memberInventory::backdrop {background:#130d09b8}
#memberInventory header {
  position:static; display:flex; align-items:center; justify-content:flex-start; gap:.7rem; height:auto;
  margin:4px 4px 0; padding:.85rem clamp(.85rem,4vw,1.4rem); border-bottom:1px solid #a67847;
  background:linear-gradient(100deg,#65402a,#392217); border-radius:10px 10px 0 0;
}
#memberInventory .inventory-seal {width:42px;height:42px;flex:none}
#memberInventory h2 {margin:0;color:var(--ivory);font-size:1.65rem;line-height:1.2;font-style:normal}
#memberInventory header form {margin:0 0 0 auto}
#memberInventory header button {width:44px;height:44px;padding:0;font-size:1.5rem;background:#352116;border:1px solid #956a43;color:#ffe7c8}
#inventoryBody {padding:1.25rem clamp(1rem,4vw,1.65rem) 1.6rem}
#inventoryBody p {color:#efdbc3;line-height:1.5}
#inventoryBody .inventory-balance {
  display:inline-flex;align-items:center;gap:.45rem;margin:0 0 .9rem;padding:.3rem .75rem;
  background:#20140e;border:1px solid #88613d;border-radius:2rem;color:#fff2da;font-weight:750;
}
#inventoryBody .echo-orb {margin:0}
.relic-grid {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,96px),1fr));gap:.55rem}
.relic-grid button {
  display:grid;align-content:center;justify-items:center;gap:.35rem;position:relative;min-height:106px;
  padding:1.05rem .4rem .65rem;line-height:1.2;background:radial-gradient(ellipse at 50% 15%,#523725,#261a13 80%);
  color:#f4e4ca;border:1px solid #816043;box-shadow:inset 0 0 0 3px #25170f;
}
.relic-grid button[aria-pressed=true] {border-color:#ffd087;background:radial-gradient(ellipse at top,#86542c,#4b2b16);box-shadow:inset 0 0 0 2px #513119,inset 0 0 0 3px #bb8849}
.relic-grid .relic-icon {width:36px;height:36px;filter:drop-shadow(0 3px 2px #130c09)}
.relic-grid small {position:absolute;top:5px;right:7px;font-size:.73rem;color:#ffe3b8}
.relic-detail {margin-top:1rem;padding:1rem;border:1px solid #805736;border-radius:8px;background:#251710}
.relic-detail h3 {margin:0;color:#ffda96;font-size:1.15rem}
.relic-detail p {margin:.35rem 0 1rem}
.relic-detail button,.inventory-login {min-height:44px;border-radius:6px;font-weight:800}
.relic-detail button {width:100%;background:linear-gradient(#ffda91,#d79c4f);color:#28180d;border:1px solid #ffe1a7}
.relic-detail button:disabled {background:#45413e;color:#dfdcd7;border-color:#716b63;opacity:1}
.inventory-gate {text-align:center}

.inventory-gate p {margin:.75rem auto 1.1rem;max-width:31ch}
.inventory-login {display:inline-flex;align-items:center;justify-content:center;padding:.65rem 1.35rem;color:#23170b;
  background:linear-gradient(#ffda91,#d79c4f);border:1px solid #ffe1a7;text-decoration:none}
#memberInventory :is(button,a):focus-visible {outline-color:#ffe8a4}

/* Battle announcements share the same frame as the audience ballot. */
#popup.battle-dialog {
  --cut:14px;
  --corner:polygon(var(--cut) 0,calc(100% - var(--cut)) 0,100% var(--cut),100% calc(100% - var(--cut)),calc(100% - var(--cut)) 100%,var(--cut) 100%,0 calc(100% - var(--cut)),0 var(--cut));
  width:min(640px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:clamp(16px,3.5vw,30px);
  isolation:isolate;clip-path:var(--corner);border:0;color:#fff6e5;background:linear-gradient(125deg,#ad752d,#ffe2a0 37%,#9a652b 68%,#ffc56f);
}
#popup.battle-dialog::before {
  content:"";position:absolute;inset:1.5px;z-index:-1;clip-path:var(--corner);
  background:radial-gradient(ellipse at 52% 10%,#2b2d32,#191d23 57%,#111319);
}
#popup.battle-dialog::backdrop {background:#080b1282;backdrop-filter:blur(2px)}
.battle-dialog #close {position:absolute;right:5px;top:4px;width:44px;height:44px;z-index:2;color:#fff3da}
.battle-dialog #close:focus-visible {outline:2px solid #ffcf82;outline-offset:-5px}
.battle-dialog #dialogLabel {display:flex;align-items:center;justify-content:center;gap:.65em;margin:0 2rem;color:#ffd484;font-size:.76rem;font-weight:850;letter-spacing:.2em;text-transform:uppercase}
.battle-dialog #dialogLabel::before,.battle-dialog #dialogLabel::after {content:"";width:clamp(16px,7vw,52px);height:1px;background:linear-gradient(90deg,transparent,#d7a351)}
.battle-dialog #dialogLabel::after {transform:scaleX(-1)}
.battle-dialog #dialogTitle {margin:.25em 0 .45em;color:#fff6e5;font-size:clamp(1.75rem,5.2vw,3.1rem);line-height:1.04;overflow-wrap:anywhere;text-shadow:0 3px 6px #090b10}
.battle-dialog .versus {
  position:relative;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:0;align-items:stretch;
  margin:0 0 1rem;border-block:1px solid #c4944d80;
}
.battle-dialog .fighter {
  --hex:polygon(24% 0,76% 0,100% 50%,76% 100%,24% 100%,0 50%);
  position:relative;isolation:isolate;padding:clamp(15px,3vw,27px) 12%;min-width:0;align-content:start;
  background:linear-gradient(145deg,color-mix(in srgb,var(--fighter-color) 24%,#13171e),#15181ef2 80%);
}
.battle-dialog .fighter:last-child {background:linear-gradient(215deg,color-mix(in srgb,var(--fighter-color) 24%,#13171e),#15181ef2 80%)}
.battle-dialog .fighter::before,.battle-dialog .fighter::after {content:"";position:absolute;pointer-events:none;z-index:-1;background:var(--fighter-color)}
.battle-dialog .fighter::before {inset:0;opacity:.22;mask:url("duel-hex.svg") 0 0/36px 62px repeat}
.battle-dialog .fighter::after {top:7%;left:0;width:100%;height:34%;opacity:.55;mask:url("duel-wave.svg") center/100% 100% no-repeat}
.battle-dialog .fighter:last-child::after {transform:scaleX(-1)}
.battle-dialog .fighter-portrait {
  position:relative;display:grid;place-items:center;width:min(100%,150px);aspect-ratio:1.12;
  filter:drop-shadow(0 0 1px #fff1ce) drop-shadow(0 0 6px color-mix(in srgb,var(--fighter-color) 62%,transparent));
}
.battle-dialog .fighter-portrait::before {content:"";position:absolute;inset:0;clip-path:var(--hex);background:var(--fighter-color)}
.battle-dialog .fighter-portrait::after {content:"";position:absolute;inset:2px;clip-path:var(--hex);background:#1a1d23}
.battle-dialog .fighter-portrait :is(img,.avatar) {position:relative;z-index:1;width:calc(100% - 10px);height:calc(100% - 9px);object-fit:cover;border:0;border-radius:0;clip-path:var(--hex);background:#31363e;color:#fff5e2;font-size:clamp(1.75rem,5vw,3.25rem)}
.battle-dialog .fighter strong {color:#fff5e7;font-size:clamp(.98rem,2.8vw,1.52rem);font-weight:850;font-style:italic;line-height:1.12;text-shadow:0 1px 3px #000,0 0 8px #090c12}
.battle-dialog .inventory {max-width:100%}
.battle-dialog .versus>b {position:absolute;left:50%;top:42%;transform:translate(-50%,-50%);z-index:2;isolation:isolate;color:#ffe7ad;font:italic 950 clamp(1.65rem,5vw,3rem)/1 system-ui,sans-serif;letter-spacing:-.09em;text-shadow:0 2px 5px #38210b}
.battle-dialog .versus>b::before {content:"";position:absolute;z-index:-1;inset:-85% 2%;transform:skew(-28deg);clip-path:polygon(85% 0,62% 44%,90% 42%,9% 100%,36% 55%,8% 58%);background:linear-gradient(#fbb755,#fff0aa,#de8f2c)}
.battle-dialog .versus>b::after {content:"";position:absolute;inset:-12% -28%;pointer-events:none;background:linear-gradient(120deg,transparent 35%,#ffe8a9b0 50%,transparent 65%);clip-path:polygon(0 32%,100% 16%,95% 23%,5% 37%,0 79%,100% 63%,90% 73%,2% 86%);opacity:0}
.battle-dialog #dialogBody select,.battle-dialog #dialogBody .primary {min-height:44px;width:100%;margin:.22rem 0}
.battle-dialog #dialogBody select {background:#25272b;color:#fff5e5;border-color:#bd945c}
.battle-dialog #dialogBody .primary:disabled {opacity:1;background:#686055;color:#f2eade}
@media(prefers-reduced-motion:no-preference) {
  .battle-dialog[open] .fighter {animation:battle-arrival .24s ease-out both;--arrival:-10px}
  .battle-dialog[open] .fighter:last-child {--arrival:10px}
  .battle-dialog[open] .versus>b::after {animation:battle-sweep .42s .08s ease-out both}
}
@keyframes battle-arrival {from{opacity:0;transform:translateX(var(--arrival))}to{opacity:1;transform:none}}
@keyframes battle-sweep {0%{opacity:0;transform:translateX(-35%)}45%{opacity:1}100%{opacity:0;transform:translateX(35%)}}

.performance-clock {display:inline-block;background:#270c14;color:#ff8b91;border:1px solid #af434e;
  border-radius:6px;padding:.12em .55em;font:800 1.15rem/1.3 system-ui,sans-serif;font-variant-numeric:tabular-nums}
.performance-clock[hidden],#timeUp[hidden]{display:none}
#timeUp {position:fixed;inset:auto auto max(20px,env(safe-area-inset-bottom)) 50%;transform:translateX(-50%);
  margin:0;padding:14px 47px 14px 22px;border:1px solid #fc727d;border-radius:9px;
  background:linear-gradient(125deg,#8d2132,#42101c);color:#fff3ee;box-shadow:0 5px 24px #14060988;z-index:20}
#timeUp button {position:absolute;right:2px;top:0;background:none;border:0;color:inherit;font-size:1.2rem}

#controls .crystal-art {display:block;width:64px;height:64px;margin:6px auto}
.crystal-stats {display:flex;align-items:center;justify-content:center;gap:.4em;color:#bdecff;font-weight:750}
#crateReveal.crystal-verdict {border-color:#98edff;background:radial-gradient(ellipse at 50% 25%,#1c6287,#102c4c 60%,#0c1727);box-shadow:0 0 32px #5ecfff4d}
.crystal-verdict .crystal-art {display:block;width:112px;height:112px;margin:.4rem auto}
.crystal-verdict small {color:#aff4ff}

#inventoryTray {
  position:absolute;left:0;bottom:clamp(54px,8vh,92px);z-index:2;
  max-width:min(270px,40%);min-width:0;padding:6px 8px 7px;
  border:1px solid color-mix(in srgb,var(--territory) 55%,#d0dde1);
  border-left:3px solid var(--territory);border-radius:3px 11px 5px 6px;
  background:linear-gradient(110deg,color-mix(in srgb,var(--territory) 44%,#10151ae0),color-mix(in srgb,var(--territory) 14%,#0b1015d9));
  box-shadow:0 3px 12px #0006,inset 0 1px #ffffff1f;color:#fff;
}
.tray-heading {display:flex;align-items:center;gap:7px;font-size:9px;font-weight:800;letter-spacing:.13em;line-height:12px;text-transform:uppercase;text-shadow:0 1px 3px #000}
.tray-heading::after {content:"";height:1px;flex:1;background:linear-gradient(90deg,#ffffff60,transparent)}
.tray-slots {display:flex;gap:3px;margin-top:3px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin}
#inventoryTray button {position:relative;flex:0 0 42px;height:40px;min-width:0;margin:0;padding:3px;display:grid;place-items:center;background:#0b111a80;border:1px solid #ffffff28;border-radius:5px;color:#fff}
#inventoryTray button:is(:hover,:focus-visible) {background:#19222dec;border-color:#ffe1a4;outline-offset:-2px}
#inventoryTray svg {width:30px;height:30px}
.tray-time,.tray-count {position:absolute;background:#10151ded;border-radius:3px;padding:0 2px;font:700 9px/12px system-ui}
.tray-time {bottom:0;left:1px;color:#ffdc96}
.tray-count {right:1px;top:0}
@media(max-width:760px){
  .mapfoot:has(#inventoryTray:not([hidden])) {margin-top:12px}
  #inventoryTray {position:static;max-width:calc(100% - 106px);padding:2px 3px;border-left-width:2px;box-shadow:0 1px 5px #0005}
  #inventoryTray .tray-heading {display:none}
  #inventoryTray .tray-slots {margin:0;gap:2px}
  #inventoryTray svg {width:24px;height:24px}
  #inventoryTray:not([hidden]) + span {display:none}
  #inventoryTray button {flex-basis:36px;height:36px;background:#0b111a55;border-color:#ffffff1c}
  .mapfoot>div:last-child {display:flex;flex-shrink:0}
}

/* Compact independent audio controls in the board header. */
body > header .tools {gap:6px;white-space:nowrap}
.tools :is(#realmMusic,#realmSound) {
  display:inline-flex;align-items:center;gap:5px;padding:5px 8px;
  font-size:.81rem;min-height:32px;
}
.tools :is(#realmMusic,#realmSound)::before {
  content:"";width:6px;height:6px;border-radius:50%;background:#707580;
}
.tools :is(#realmMusic,#realmSound)[aria-pressed=true]::before {background:#91e3ac}
.tools #realmMusic.awaiting-tap::before {background:var(--gold)}
@media (max-width:760px) {
  body > header {padding-inline:10px;gap:6px}
  body > header .tools {gap:4px}
  .tools #status {padding:4px 7px;letter-spacing:.06em}
  .tools :is(#realmMusic,#realmSound) {font-size:.75rem;padding-inline:6px;gap:4px}
}
@media (min-width:761px) and (max-width:900px) {
  body > header {padding-inline:10px;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)}
  body > header .tools {gap:4px}
  .tools #status {padding-inline:7px}
  .tools #full {padding-inline:7px}
}

#roster .team-label {
  display: block;
  margin-top: .15rem;
  padding-left: .45rem;
  border-left: 3px solid var(--edge);
  color: #e4e2de;
  font-size: .78rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

#roster .team-swatch {
  display:inline-block;
  width:.7em;
  height:.7em;
  margin-right:.4em;
  background:#656873;
  border:1px solid rgba(255,255,255,.65);
  border-radius:50%;
}

#questCard {border-color:#a98858;border-left:3px solid #edc680;background:linear-gradient(115deg,#352b28f5,#161a22f7)}
#questCard h2 {margin:.3rem 0}
#questCard p,#questRecap p {margin:.35rem 0}
#questProgress {display:flex;gap:.4rem;flex-wrap:wrap}
#questProgress span {padding:.15rem .45rem;border-radius:4px;color:#ffe0ac;background:#ffffff12;font-size:.8rem}
#questStatus:empty {display:none}
#questStatus {display:block;margin-top:.4rem;color:#ffdb87}
#questRecap img {width:30px;height:30px;vertical-align:middle;margin-right:.5rem;border-radius:50%}
#questReward {float:right;color:#ffe0ac;letter-spacing:normal}

#questRecap {padding:0;overflow:hidden;border-color:#a98b577a;background:linear-gradient(135deg,#282733fa,#131922fa 62%)}
#questRecap summary {padding:.75rem 1rem;color:#ffe4a7}
#questHighlights {display:grid;gap:10px;padding:0 12px 12px}
.recap-moment {--ink:#f4cc84;position:relative;isolation:isolate;display:grid;grid-template-columns:34px 1fr;align-items:center;gap:6px 10px;padding:12px;background:#ffffff07;border-inline-start:2px solid var(--ink);overflow-wrap:anywhere}
.recap-moment[data-kind=comeback] {--ink:#ffb18a}
.recap-moment[data-kind=takeover] {--ink:#88d3ed}
.recap-moment h3 {grid-column:1/-1;color:var(--ink);margin:0;font-size:1.02rem;line-height:1.15}
.recap-feature {grid-template-columns:46px 1fr;padding:16px 13px;border:1px solid color-mix(in srgb,var(--ink) 52%,transparent);border-radius:3px 14px 3px 14px;background:radial-gradient(ellipse at top left,color-mix(in srgb,var(--ink) 18%,transparent),transparent 76%),#1a202b}
.recap-feature::after {content:'';position:absolute;z-index:-1;inset:0;opacity:.14;background:repeating-linear-gradient(125deg,transparent 0 18px,var(--ink) 19px,transparent 20px 29px);mask-image:linear-gradient(90deg,transparent 50%,black)}
.recap-feature h3 {font-size:1.55rem;font-style:italic}
.recap-story {font-size:.9rem;line-height:1.45;color:#eee9e2}
.recap-story strong,.recap-leader strong {color:#fff8e9}
.recap-portrait {position:relative;display:grid;place-items:center;width:32px;aspect-ratio:1;clip-path:polygon(25% 5%,75% 5%,100% 50%,75% 95%,25% 95%,0 50%);background:linear-gradient(140deg,#524968,#252a39);color:#ffddb0;font-weight:bold}
.recap-feature .recap-portrait {width:45px}
#questRecap .recap-portrait img {position:absolute;inset:0;width:100%;height:100%;margin:0;border-radius:0;object-fit:cover}
.recap-quests {padding:5px 2px;min-width:0}
.recap-quests h3 {display:inline;margin:0 .5rem 0 0;font-size:1rem}
.recap-total,.recap-leader div span {font-size:.77rem;color:#d3c9b9}
.recap-leader {display:flex;gap:9px;align-items:center;margin-top:6px;padding-top:6px;border-top:1px solid #ffffff18;overflow-wrap:anywhere}
.recap-leader div span {display:block}
.recap-feature h3 {display:flex;align-items:center;justify-content:space-between;gap:8px}
.recap-feature h3 .relic-icon {width:31px;height:31px;flex:none;filter:drop-shadow(0 1px 6px #dfaa454a)}
#feedback:empty {display:none}
.lobby-links {display:grid;gap:7px}
.lobby-links button {width:100%;min-height:44px}
#leaderOpen {border:1px solid #ffe3a2;color:#291b08;background:linear-gradient(120deg,#ffe1a1,#eeb453 70%,#df9c3e);font-weight:800}
.realm-return {max-width:1400px;margin:auto;justify-content:flex-end;padding:8px 16px 16px}
.realm-return a {display:inline-flex;align-items:center;min-height:40px;padding:0 12px;color:#eff7ff;background:#203f63;border:1px solid #6497bd;border-radius:8px;text-decoration:none;font-weight:700}
#realmStandings {width:min(40rem,calc(100% - 24px));max-height:82dvh;padding:0;overflow:auto;text-align:left;border:1px solid #c59b56;color:#fff5de;background:linear-gradient(135deg,#32303a,#151d2a 65%);box-shadow:0 18px 60px #000a}
.standings-head,.standings-pager {display:flex;align-items:center;justify-content:space-between;gap:8px}
.standings-head {padding:16px 18px 0}
.standings-head h2 {margin:0;font-size:clamp(1.7rem,4vw,2.4rem);font-style:italic}
.standings-head small,.standings-winner small {color:#ffe0a2;letter-spacing:.12em;font-size:.72rem}
.standings-head button {min-height:40px;min-width:40px}
#standingsBody {padding:12px clamp(10px,3vw,18px) 18px}
.standings-winner {display:flex;align-items:center;gap:14px;padding:14px;margin-bottom:14px;border:1px solid #c69e5b;border-radius:2px 16px;background:linear-gradient(115deg,#59452d,#2e2733 70%,#252834)}
.standings-winner svg {width:46px;height:46px;flex:none}
.standings-winner :is(span,strong,small){display:block;overflow-wrap:anywhere}
.standings-winner strong {font-size:1.3rem}
#standingsBody table {width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums;font-size:clamp(.78rem,2vw,.95rem)}
#standingsBody :is(td,th){padding:.5rem .3rem;text-align:right;border-bottom:1px solid #ffffff22}
#standingsBody th:first-child {text-align:left;width:45%;overflow-wrap:anywhere}
#standingsBody thead th {font-size:.75rem;color:#dcc9aa}
#standingsBody tbody small {color:#c7ac80;margin-right:.4rem}
#standingsBody tbody td:first-of-type {color:#ffda8f;font-weight:bold}
.standings-pager {margin-top:12px}
@media(min-width:761px){.realm-return {position:fixed;z-index:2;right:0;bottom:0;margin:0}.realm-return a {background:#1f3d60}main aside {padding-bottom:54px}}

.territory-picker {position:relative;display:block;width:min(100%,15rem);height:44px;margin:8px auto;border:2px solid #c3c5c8;border-radius:8px;box-sizing:border-box}
.territory-picker:focus-within {outline:2px solid white;outline-offset:2px}
#popup .territory-picker input {position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
#soloNotice {margin:0;right:auto;bottom:auto;position:fixed;z-index:9;left:50%;top:clamp(65px,12vh,120px);transform:translateX(-50%);width:max-content;max-width:calc(100% - 24px);box-sizing:border-box;display:flex;align-items:center;gap:12px;padding:12px 18px;border:1px solid #9deaff;border-radius:5px 16px;background:linear-gradient(125deg,#184e68,#102333 85%);color:#ecfbff;box-shadow:0 4px 24px #03132599;pointer-events:none}
#soloNotice img {width:46px}
#soloNotice strong {color:#b9f3ff;font-size:1.18rem}
#soloNotice p {margin:3px 0 0;overflow-wrap:anywhere}
.shift-ring {pointer-events:none;animation:shift-ring 1.5s ease-in-out 4 forwards}
@keyframes shift-ring {0% {opacity:.95;transform:scale(.82)} 65% {opacity:1;stroke:#bf9bff} 100% {opacity:0;transform:scale(1.12)}}
@media(prefers-reduced-motion:reduce){.shift-ring {animation:shift-static 6s steps(1,end) forwards}}
@keyframes shift-static {to {opacity:0}}
@media(max-width:760px){aside .realm-return {align-self:flex-end;margin:0;padding:0 0 env(safe-area-inset-bottom)}}
@media(min-width:761px){#inventoryTray {max-width:min(350px,42%);padding:8px 10px}.tray-heading {font-size:11px}#inventoryTray .tray-slots button {min-width:48px;height:48px}#inventoryTray .tray-slots svg {width:37px;height:37px}}

.quake-art {animation:realm-tremor .48s ease-in-out 3;animation-delay:var(--quake-delay)}
.quake-rim {stroke:#ffce76;stroke-width:3;fill:#ffb850;fill-opacity:.16;animation:quake-highlight 4.2s linear forwards;animation-delay:var(--quake-delay)}
@keyframes realm-tremor {0%,100% {transform:translate(0,0)} 20%,60% {transform:translate(-2.8px,1px) rotate(-1deg)} 40%,80% {transform:translate(2.8px,-1px) rotate(1deg)}}
@keyframes quake-highlight {0%,70% {opacity:1} 100% {opacity:0}}
@media(prefers-reduced-motion:reduce){.quake-art {animation:none}}

#musicLevel {position:relative;color:var(--ivory)}
#musicLevel summary {display:grid;place-items:center;cursor:pointer;list-style:none;width:24px;height:32px;border:1px solid var(--line);border-radius:6px;background:#171b22}
#musicLevel summary::-webkit-details-marker {display:none}
#musicLevel label {position:absolute;z-index:12;right:0;top:calc(100% + 5px);display:grid;grid-template-columns:1fr auto;gap:6px;width:170px;padding:12px;border:1px solid var(--line);border-radius:8px;background:#181d25;font-size:.85rem}
#musicVolume {grid-column:1/-1;width:100%;min-height:26px;margin:0;padding:0;accent-color:#ffcf72}
@media(max-width:380px){.brand {width:72px}body > header .tools {gap:2px}}

#lobbyLights {display:none}
@media (prefers-reduced-motion:no-preference) {
  #lobbyLights.idle, #lobbyLights.queue {
    display:block; position:fixed; inset:0; width:100%; height:100%;
    overflow:hidden; z-index:-1; pointer-events:none;
  }
  #lobbyLights use {opacity:0}
  #lobbyLights.idle .idle-light {animation:lobby-seam-rise 8s linear infinite}
  #lobbyLights .cyan-light {color:#55fbff}
  #lobbyLights.idle .pink-light {color:#ff77da; animation-delay:-4s}
  .join-path {transform:translate(465px,506px)}
  #queueGlint {color:#ffcc5c}
  #roster .just-joined {animation:lobby-row-join 1.6s ease-out both}
  @keyframes lobby-seam-rise {
    0% {opacity:0; transform:translate(0,0)}
    4%,36% {opacity:1}
    42%,100% {opacity:0; transform:translate(291px,-506px)}
  }
  @keyframes lobby-row-join {
    0% {background-color:#ffcf683c;box-shadow:inset 3px 0 #ffd380}
    100% {background-color:transparent;box-shadow:inset 0 0 transparent}
  }
  @media(max-width:700px) {
    #lobbyLights.idle g:has(> .cyan-light) {transform:translate(277px,506px)}
    .join-path {transform:translate(568px,0) rotate(180deg)}
  }
}

#playerSignIn {text-align:center}
#playerSignIn a {
  display:block; padding:10px 14px; border:1px solid #aa98ff; border-radius:8px;
  background:#6143ad; color:#fff; text-decoration:none; font-weight:700;
}
#playerSignIn a:hover {background:#7052be}
#playerSignIn a:focus-visible {outline:2px solid white;outline-offset:2px}
#playerSignIn p {margin:7px 0 0;color:#e2dfeb;font-size:.88rem}

.team-setup {margin:.6rem 0; text-align:left}
.team-setup label {font-weight:700}
.team-setup input[type=range] {display:block;width:100%;accent-color:#ffd380}
#overlay .team-setup p {font-size:.9rem;line-height:1.35}
#arena:has(.team-setup:not([hidden])) {min-height:34rem}

#cohostOpen{width:100%;background:linear-gradient(#ffe497,#efb54e);color:#302008;border:1px solid #ffdc86}
#cohostDialog{width:min(26rem,90vw);box-sizing:border-box;padding:1.5rem;color:#fff3dd;background:#20232b;border:1px solid #cfa75b;border-radius:14px}
#cohostDialog::backdrop{background:#090b12aa}
#cohostDialog form{float:right}
#cohostDialog label,#cohostSearch{display:block;margin-top:.65rem}
#cohostSearch{width:100%;padding:.7rem;box-sizing:border-box}
#cohostResults{display:grid;gap:.4rem;max-height:32vh;overflow:auto;margin-top:.7rem}

#audienceCheers{position:fixed;inset:auto auto 6vh 50%;transform:translateX(-50%);display:grid;gap:.3rem;width:min(90vw,28rem);background:none;border:0;padding:0;overflow:visible;pointer-events:none;z-index:1000}
#audienceCheers:empty{display:none}
.audience-cheer{display:flex;align-items:center;gap:.65rem;padding:.48rem .85rem;border:1px solid #e2ad72;border-radius:1rem;background:#211927ee;color:#fff2df;font-weight:700;box-shadow:0 4px 16px #120c2444;position:relative;isolation:isolate}
.audience-cheer img{width:3rem;height:3rem;flex:none}
.audience-cheer.bouquet img{animation:roses-arrive .65s ease-out both}
.audience-cheer.beacon::before,.audience-cheer.beacon::after{content:"";position:absolute;bottom:12%;left:24%;width:26%;height:140%;background:linear-gradient(0deg,#fff0,var(--cheer-light,#70edff88));clip-path:polygon(0 0,100% 0,50% 100%);transform-origin:50% 100%;animation:cheer-beam 1.3s ease-in-out alternate 3;z-index:-1}
.audience-cheer.beacon::after{left:51%;animation-direction:alternate-reverse}
.audience-cheer.buzzer::before{content:"";position:absolute;inset:10%;border:2px solid #ffcf54;border-radius:50%;animation:cheer-pulse 1.1s ease-out 2;pointer-events:none}
.tile:is(.cheered-bouquet,.cheered-beacon,.cheered-buzzer)>.rim{stroke:#ffe4a0;stroke-width:3}
.tile.cheered-beacon>.rim{stroke:var(--cheer-light,#93ecff);filter:drop-shadow(0 0 5px var(--cheer-light,#82ddff))}
@keyframes roses-arrive{from{transform:translate(-24px,34px) rotate(-28deg);opacity:0}65%{transform:translate(0,-5px) rotate(5deg)}}
@keyframes cheer-beam{from{transform:rotate(-28deg)}to{transform:rotate(28deg)}}
@keyframes cheer-pulse{from{opacity:.9;transform:scale(.8)}to{opacity:0;transform:scale(2.5)}}
@media(prefers-reduced-motion:reduce){.audience-cheer img,.audience-cheer::before,.audience-cheer::after{animation:none!important}.audience-cheer.buzzer::before{display:none}}
.audience-gold-wave{position:absolute;pointer-events:none;z-index:2;left:0;right:0;top:25%;bottom:25%;border:3px solid #ffda72;border-radius:50%;animation:cheer-board-ripple 1.5s ease-out both}
.cheer-art-beacon path{animation:cheer-tile-sweep 1.5s ease-in-out alternate 4}
@keyframes cheer-tile-sweep{from{transform:rotate(var(--angle))}to{transform:rotate(0deg)}}
@keyframes cheer-board-ripple{from{transform:scale(.08);opacity:.95}to{transform:scale(1.4);opacity:0}}
@media(prefers-reduced-motion:reduce){.audience-gold-wave{display:none}.cheer-art-beacon path{animation:none;transform:rotate(var(--angle))}}
