:root {
  color-scheme: dark;
  --gold: #f6d078;
  --gold-hi: #ffe9a8;
  --cream: #fff0c8;
  --ink: #0f1d4d;
  --navy: #17306f;
  --game-h: 100dvh;
  --wheel-size: 300px;
  --u: 3.9px; /* 1% of the game width, set by main.js */
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  color: var(--cream);
  background: transparent;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  color: inherit;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #fff4be;
  outline-offset: 3px;
}
button:disabled {
  cursor: default;
}
img {
  -webkit-user-drag: none;
  user-select: none;
}
[hidden] {
  display: none !important;
}
#game {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 500px);
  height: var(--game-h);
  min-height: 0;
  padding: max(4px, env(safe-area-inset-top)) calc(var(--u) * 2.2)
    max(5px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 1);
  background: #2a2150 url(assets/art/bg.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d) center/cover;
  overflow: hidden;
  border: 1px solid #8c5524;
}
#game::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url(assets/art/frame.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d) center/100% 100% no-repeat;
  pointer-events: none;
  z-index: 1;
}
#game > * {
  position: relative;
  z-index: 2;
}
#game > .loading,
#game > #exited,
#game > #panel-mask,
#game > dialog,
#game > .result-card,
#game > .feedback {
  position: absolute;
}

/* ---- HUD ---- */
.hud {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 1.2);
  flex: none;
  height: calc(var(--u) * 12);
}
.round-btn {
  position: relative;
  flex: none;
  width: max(calc(var(--u) * 9.4), 34px);
  height: max(calc(var(--u) * 9.4), 34px);
  padding: 0;
  border: 0;
  background: url(assets/art/btn-round.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d) center/100% 100% no-repeat;
  filter: drop-shadow(0 2px 2px #1a0d0599);
}
.round-btn::before {
  content: "";
  position: absolute;
  inset: 0;
}
.round-btn svg {
  width: 52%;
  height: 52%;
  fill: none;
  stroke: #fff4cc;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.round-btn:active {
  transform: translateY(1px) scale(0.96);
}
#exit {
  width: max(calc(var(--u) * 10.4), 38px);
  height: max(calc(var(--u) * 10.4), 38px);
}
.title {
  flex: 1;
  min-width: 0;
  height: calc(var(--u) * 11);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: url(assets/art/plaque-title.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d) center/100% 100% no-repeat;
  padding: calc(var(--u) * 1.6) calc(var(--u) * 5) calc(var(--u) * 0.6);
  line-height: 1;
  direction: ltr;
}
.title-text {
  font-size: calc(var(--u) * 4);
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--gold-hi);
  text-shadow: 0 2px 0 #3a1c05, 0 0 6px #ffb23a88;
  white-space: nowrap;
}
.round {
  font-size: calc(var(--u) * 2.4);
  color: #dfe6ff;
  white-space: nowrap;
}
.hud-actions {
  display: flex;
  gap: calc(var(--u) * 1.1);
  flex: none;
}

/* ---- pool + bonus windows ---- */
.board {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  direction: ltr;
}
.pool {
  position: relative;
  width: calc(var(--u) * 58);
  aspect-ratio: 720 / 179;
  background: url(assets/art/plaque-pool.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d) center/100% 100% no-repeat;
  filter: drop-shadow(0 2px 3px #1c0e0599);
}
.pool-label {
  position: absolute;
  left: 0;
  right: 0;
  top: 7%;
  height: 28%;
  display: grid;
  place-items: center;
  font-size: calc(var(--u) * 2.5);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e4ebff;
}
.pool-value {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 38%;
  bottom: 8%;
  display: grid;
  place-items: center;
  font-size: calc(var(--u) * 6.6);
  font-variant-numeric: tabular-nums;
  color: var(--gold-hi);
  text-shadow: 0 2px 0 #3b1b04, 0 0 8px #ffbf4a88;
  white-space: nowrap;
}
.windows {
  position: relative;
  width: calc(var(--u) * 58);
  aspect-ratio: 720 / 207;
  background: url(assets/art/plaque-windows.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d) center/100% 100% no-repeat;
  margin-top: calc(var(--u) * -0.4);
  filter: drop-shadow(0 2px 3px #1c0e0599);
}
.win {
  position: absolute;
  top: 50%;
  width: 25%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}
#win0 {
  left: 21%;
}
#win1 {
  left: 50%;
}
#win2 {
  left: 78.5%;
}
.sym {
  position: absolute;
  inset: -6%;
  display: grid;
  place-items: center;
}
.sym img.medal {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.sym b {
  position: relative;
  font-size: calc(var(--u) * 4.1);
  font-weight: 900;
  color: #fffbe8;
  text-shadow: 0 2px 0 #3a0f06, 0 0 5px #0006;
  line-height: 1;
}
.sym.gold b {
  color: #ffeaa0;
  font-size: calc(var(--u) * 3.6);
  text-shadow: 0 2px 0 #5a2d03;
}
.sym .bowl {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58%;
  transform: translate(-50%, -52%);
}
.sym.spin {
  animation: reel 0.18s linear infinite;
  filter: blur(0.6px) brightness(1.1);
}
.win.stop .sym {
  animation: stop-pop 0.5s ease-out;
}
.win.hit::after {
  content: "";
  position: absolute;
  inset: -14%;
  border-radius: 50%;
  box-shadow:
    0 0 0 2px #ffe08a,
    0 0 14px 4px #ffbe42;
  animation: pulse 0.9s ease-in-out infinite;
}
@keyframes reel {
  0% {
    transform: translateY(-9%);
  }
  50% {
    transform: translateY(9%);
  }
  100% {
    transform: translateY(-9%);
  }
}
@keyframes stop-pop {
  0% {
    transform: scale(1.45);
  }
  60% {
    transform: scale(0.92);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes pulse {
  50% {
    opacity: 0.45;
    transform: scale(1.06);
  }
}

/* ---- stage ---- */
.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  direction: ltr;
}
.banner {
  position: absolute;
  top: 1%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  max-width: 92%;
  padding: calc(var(--u) * 1.2) calc(var(--u) * 4);
  border: 2px solid var(--gold);
  border-radius: 999px;
  background: linear-gradient(#26408f, #101f55);
  color: var(--gold-hi);
  font-weight: 800;
  font-size: calc(var(--u) * 3.6);
  text-align: center;
  box-shadow: 0 3px 10px #0008, 0 0 14px #ffbe4288;
  pointer-events: none;
  animation: banner-in 0.35s ease-out;
}
@keyframes banner-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-8px) scale(0.9);
  }
}
.wheel {
  position: relative;
  width: var(--wheel-size);
  height: var(--wheel-size);
  flex: none;
  direction: ltr;
}
.spokes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.spokes line {
  stroke: #e9b94c;
  stroke-width: 1.6;
  stroke-linecap: round;
  filter: drop-shadow(0 0.6px 0.6px #4a2305);
}
.spokes line.beam {
  stroke: #fff3b8;
  stroke-width: 0.7;
}
.hub {
  position: absolute;
  inset: 0;
}
.hub > * {
  position: absolute;
}
.aura {
  left: 16%;
  top: 16%;
  width: 68%;
  height: 68%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    #ffe9a099 0%,
    #ffb43a55 42%,
    #ff8a2000 70%
  );
  opacity: 0.35;
  pointer-events: none;
}
.mane {
  left: 17%;
  top: 17%;
  width: 66%;
  height: 66%;
  opacity: 0.55;
  pointer-events: none;
  will-change: transform;
}
.disc {
  left: 31.5%;
  top: 31.5%;
  width: 37%;
  height: 37%;
  object-fit: contain;
}
.rune {
  left: 29%;
  top: 29%;
  width: 42%;
  height: 42%;
  opacity: 0.5;
  pointer-events: none;
  will-change: transform;
  mix-blend-mode: screen;
}
.lion {
  left: 30%;
  top: 21.5%;
  width: 40%;
  aspect-ratio: 640 / 600;
  pointer-events: none;
  will-change: transform;
  transform-origin: 50% 90%;
}
.lion img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  filter: drop-shadow(0 4px 5px #2a0f0299);
}
.lion img[data-pose="idle"] {
  opacity: 1;
}
.seal {
  left: 50%;
  top: 60.5%;
  transform: translateX(-50%);
  width: 27%;
  height: 10%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--gold);
  border-radius: 999px;
  background: linear-gradient(#264592, #0d1b4d);
  box-shadow:
    0 2px 5px #0009,
    inset 0 0 6px #6c8bff55;
  line-height: 1;
  z-index: 3;
}
.seal strong {
  font-size: var(--phase-font, 10px);
  font-weight: 600;
  color: #cdd9ff;
  letter-spacing: 0.04em;
}
.seal b {
  font-size: var(--timer-font, 18px);
  color: var(--gold-hi);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 #2d1503;
}
.hub .seal.urgent b {
  color: #ffd2b0;
  animation: pulse 1s ease-in-out infinite;
}
.fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}
.multiplier-badge {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  z-index: 6;
  font-size: calc(var(--wheel-size) * 0.14);
  font-weight: 900;
  color: var(--gold-hi);
  -webkit-text-stroke: 2px #4b1d04;
  text-shadow: 0 0 16px #ffb43a;
  pointer-events: none;
  animation: badge-pop 0.55s cubic-bezier(0.2, 1.4, 0.4, 1);
  white-space: nowrap;
}
@keyframes badge-pop {
  from {
    transform: translate(-50%, -50%) scale(0.2);
    opacity: 0;
  }
}

/* ---- pedestals ---- */
.ped {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 20%;
  aspect-ratio: 246 / 320;
  transform: translate(-50%, -50%);
  padding: 0;
  border: 0;
  background: none;
  z-index: 4;
  transition: transform 0.18s ease-out;
  filter: drop-shadow(0 3px 3px #2a120599);
}
.ped > img.pav {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.ped > img.pav-glow {
  opacity: 0;
  transition: opacity 0.16s;
}
.ped > img.food {
  position: absolute;
  left: 50%;
  top: 31%;
  width: 62%;
  height: 40%;
  transform: translate(-50%, -50%);
  object-fit: contain;
  pointer-events: none;
}
.ped .mult {
  position: absolute;
  left: 18%;
  right: 18%;
  top: 68%;
  height: 14%;
  display: grid;
  place-items: center;
  font-size: max(12px, calc(var(--wheel-size) * 0.04));
  font-weight: 800;
  color: #fff2c4;
  text-shadow: 0 1px 0 #0b1640;
  pointer-events: none;
  line-height: 1;
}
.ped .mine {
  position: absolute;
  right: -2%;
  top: -3%;
  z-index: 2;
  min-width: 42%;
  padding: 0.12em 0.4em;
  border: 1.5px solid #fff0c0;
  border-radius: 999px;
  background: #c8331b;
  color: #fff;
  font-size: max(12px, calc(var(--wheel-size) * 0.034));
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
  pointer-events: none;
}
.ped:not(:disabled):active {
  transform: translate(-50%, -50%) scale(0.95);
}
.ped.selected > img.pav-bet,
.ped.scan > img.pav-bet {
  opacity: 1;
}
.ped.scan {
  transform: translate(-50%, -50%) scale(1.1);
  z-index: 5;
}
.ped.hit > img.pav-lit {
  opacity: 1;
}
.ped.hit {
  z-index: 5;
  animation: lit-bounce 1.2s ease-in-out infinite;
}
.ped.dim {
  filter: saturate(0.6) brightness(0.78) drop-shadow(0 3px 3px #2a120599);
}
.ped.pending {
  outline: 3px dashed #ffeac0;
  border-radius: 14px;
}
@keyframes lit-bounce {
  50% {
    transform: translate(-50%, calc(-50% - 2.5%)) scale(1.06);
  }
}

/* ---- salad / pizza bowls ---- */
.groups {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  z-index: 3;
  pointer-events: none;
}
.group {
  position: absolute;
  bottom: 0;
  width: calc(var(--u) * 17);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s;
}
#group-salad {
  left: 0;
}
#group-pizza {
  right: 0;
}
.group img {
  width: 100%;
  filter: drop-shadow(0 3px 3px #2a120599);
}
.group b {
  position: absolute;
  bottom: 3%;
  padding: 0.1em 0.9em;
  border: 1.5px solid var(--gold);
  border-radius: 999px;
  background: #0f1f55;
  font-size: calc(var(--u) * 2.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cream);
}
.group.active {
  transform: scale(1.12);
  animation: bowl-glow 0.9s ease-in-out infinite;
}
@keyframes bowl-glow {
  50% {
    filter: drop-shadow(0 0 12px #ffcf5a) brightness(1.2);
  }
}

/* ---- dock ---- */
.dock {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 1);
}
.history {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 1.2);
  height: calc(var(--u) * 9);
  padding: 0 calc(var(--u) * 2) 0 calc(var(--u) * 1.4);
  border: 2px solid var(--gold);
  border-radius: 999px;
  background: linear-gradient(#1c3a85, #0c1a4a);
  direction: ltr;
}
.history .tag {
  flex: none;
  padding: 0.25em 0.9em;
  border-radius: 999px;
  background: linear-gradient(#ffd25a, #e18a1c);
  color: #5a2807;
  font-weight: 900;
  font-size: calc(var(--u) * 2.6);
  text-transform: uppercase;
}
.recent {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: flex-start;
  gap: calc(var(--u) * 2.6);
  align-items: center;
}
.recent img {
  width: calc(var(--u) * 6.6);
  height: calc(var(--u) * 6.6);
  object-fit: contain;
  padding: 2px;
  border-radius: 50%;
  border: 1.5px solid #e1ad49;
  background: #0b183f;
}
.chips {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  direction: ltr;
  padding: 0 calc(var(--u) * 1);
}
.chips button {
  position: relative;
  width: calc(var(--u) * 15.5);
  height: calc(var(--u) * 17.5);
  padding: 0;
  border: 0;
  background: none;
  transition: transform 0.15s;
  filter: drop-shadow(0 2px 2px #1a0d0599);
}
.chips button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.chips button b {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 36%;
  height: 40%;
  display: grid;
  place-items: center;
  border: 2px dashed #ffffffcc;
  border-radius: 50%;
  font-size: calc(var(--u) * 3.3);
  letter-spacing: -0.03em;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 0 #0007;
  background: #00000026;
}
.chips button[aria-pressed="true"] {
  transform: translateY(calc(var(--u) * -1.6)) scale(1.07);
  filter: drop-shadow(0 0 7px #ffd35e) drop-shadow(0 2px 2px #1a0d05cc);
}
.bar {
  display: flex;
  align-items: stretch;
  gap: calc(var(--u) * 1.6);
  height: calc(var(--u) * 11);
  min-height: 40px;
}
.wallet,
.today {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 1.2);
  min-width: 0;
  padding: 0 calc(var(--u) * 2);
  border: 2px solid var(--gold);
  border-radius: 999px;
  background: linear-gradient(#1c3a85, #0c1a4a);
  box-shadow: inset 0 0 8px #6c8bff44;
  color: #fff6d8;
}
.wallet {
  flex: 1.6;
}
.today {
  flex: 0.8;
  font-size: calc(var(--u) * 3.2);
}
.wallet b,
.today b {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: calc(var(--u) * 3.6);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.today b {
  font-size: calc(var(--u) * 3.6);
}
.today-label {
  display: none;
}
.coin-symbol {
  display: grid;
  place-items: center;
  width: calc(var(--u) * 5.6);
  height: calc(var(--u) * 5.6);
  flex: none;
  border: 2px solid #ffdb7d;
  border-radius: 50%;
  background: radial-gradient(#ffd664, #c9791c);
  color: #7a3a08;
  font-size: calc(var(--u) * 3);
  font-weight: 800;
}
.wallet .plus {
  flex: none;
  width: calc(var(--u) * 4.6);
  height: calc(var(--u) * 4.6);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #2db25a;
  font-weight: 900;
  line-height: 1;
}
.auto {
  position: relative;
  flex: 1.15;
  min-width: 0;
  border: 0;
  background: url(assets/art/btn-green.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d) center/100% 100% no-repeat;
  font-size: calc(var(--u) * 5);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 0 #06340f;
  filter: drop-shadow(0 2px 2px #1a0d0599);
}
.auto span {
  padding-inline: 0.4em;
}
.auto:active {
  transform: translateY(1px) scale(0.97);
}
.auto[aria-pressed="true"] {
  background-image: url(assets/art/btn-amber.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d);
  text-shadow: 0 2px 0 #5a2c03;
  animation: auto-on 1.4s ease-in-out infinite;
}
.auto[aria-pressed="true"] span::after {
  content: " ●";
  font-size: 0.55em;
  vertical-align: 0.2em;
}
@keyframes auto-on {
  50% {
    filter: drop-shadow(0 0 9px #ffd35e) brightness(1.12);
  }
}
.meta {
  position: absolute;
  right: calc(var(--u) * 3);
  bottom: calc(var(--u) * 11.6);
  display: none;
}
.connection-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f2bd50;
  display: inline-block;
}
.is-ready .connection-dot {
  background: #87da87;
}

/* ---- feedback / notice / result ---- */
.feedback {
  top: calc(var(--u) * 13 + 6px);
  left: calc(var(--u) * 4);
  right: calc(var(--u) * 4);
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
}
.feedback > * {
  pointer-events: auto;
}
.notice {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
  min-height: 44px;
  background: #fff0d0;
  color: #2a1a45;
  border: 1.5px solid #d6a04c;
  border-radius: 12px;
  box-shadow: 0 4px 12px #0007;
}
.notice img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}
.notice p {
  font-size: 12px;
  margin: 0;
  flex: 1;
  overflow-wrap: anywhere;
}
.notice button,
.result-card button {
  border: 1px solid #d39b36;
  border-radius: 8px;
  background: #1d3a85;
  color: #fff1c4;
  min-height: 44px;
  padding: 6px 12px;
}
.notice button {
  max-width: 68px;
  font-size: 11px;
  padding: 4px;
  flex: none;
}
.connection {
  background: #0d1b4de6;
  text-align: center;
  font-size: 11px;
  padding: 7px;
  min-height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #d6a04c;
  border-radius: 10px;
}
.has-notice .connection {
  display: none;
}
.result-card {
  z-index: 10;
  top: 50%;
  left: 6%;
  right: 6%;
  transform: translateY(-50%);
  max-height: calc(100% - 24px);
  overflow: auto;
  background: linear-gradient(#fff4d2, #ebd6a6);
  color: #3a2150;
  border: 3px solid #d4a14d;
  border-radius: 16px;
  padding: 14px 12px 0;
  box-shadow:
    0 5px 18px #0009,
    0 0 20px #ffbe4266;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  direction: ltr;
}
.result-card > #result-reward {
  font-size: 28px;
  line-height: 1.1;
  color: #a8321b;
}
.result-event {
  margin: 0;
  padding: 2px 12px;
  border-radius: 999px;
  background: #1d3a85;
  color: var(--gold-hi);
  font-weight: 800;
  font-size: 13px;
}
.result-values {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 20px;
  font-size: 13px;
}
.result-values b {
  text-align: end;
  font-variant-numeric: tabular-nums;
}
#result-foods {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 28px;
}
#result-foods img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
#result-title {
  text-align: center;
}
.result-card .result-close {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 44px;
  font-size: 24px;
  background: transparent;
  color: #3a2150;
  border: 0;
}
#result-actions {
  width: calc(100% + 24px);
  flex: none;
  padding: 10px 14px 12px;
  border-top: 1px solid #b8915955;
  background: #f7dfb8;
  text-align: center;
  margin-top: 6px;
}
#result-actions button {
  min-height: 48px;
  width: 100%;
  border: 1px solid #9c4425;
  border-radius: 12px;
  background: linear-gradient(#34a85a, #11693a);
  font-weight: 750;
  font-size: 16px;
  color: #fff;
}
#result-auto {
  font-size: 10px;
  margin: 7px 0 0;
}

/* ---- loading ---- */
.loading {
  inset: 0;
  z-index: 30;
  background:
    linear-gradient(#1a174f99, #4a2410cc), url(assets/art/bg.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d) center/cover;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  text-align: center;
}
.loading-lion {
  width: min(62%, 260px);
  animation: lion-bob 3.6s ease-in-out infinite;
}
@keyframes lion-bob {
  50% {
    transform: translateY(-6px) scale(1.02);
  }
}
.loading-title {
  font-size: 30px;
  font-style: italic;
  color: var(--gold-hi);
  text-shadow: 0 2px 0 #3a1c05;
}
.loading small {
  color: #fff3dc;
  font-size: 12px;
  margin-top: 12px;
}
.loading p {
  font-size: 15px;
  margin: 0;
}
.loading progress {
  width: 70%;
  height: 15px;
  accent-color: #e7a644;
}
.loading button {
  min-height: 44px;
  padding: 8px 24px;
  border: 1px solid #ecc378;
  border-radius: 9px;
  background: #1d3a85;
  color: #fff1ce;
}
#exited {
  z-index: 50;
}

/* ---- panels ---- */
#panel-mask {
  inset: 0;
  background: #0c0d2699;
  z-index: 40;
}
#game > dialog {
  position: absolute;
  inset: 12px;
  margin: auto;
  width: calc(100% - 24px);
  max-width: 450px;
  max-height: calc(100% - 24px);
  padding: 0;
  border: 2px solid #d4aa5b;
  border-radius: 15px;
  background: #fff0cc;
  color: #2a1a45;
  box-shadow: 0 5px 20px #000a;
  overflow: hidden;
  z-index: 41;
}
dialog[open] {
  display: flex;
  flex-direction: column;
}
dialog::backdrop {
  background: transparent;
}
dialog header {
  flex: none;
  gap: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px;
  border-bottom: 1px solid #c3a577;
  background: linear-gradient(#27479a, #14275f);
  color: var(--gold-hi);
}
dialog h2 {
  font-size: 19px;
  margin: 0;
}
dialog header button {
  border: 0;
  background: none;
  font-size: 27px;
  min-width: 44px;
  min-height: 44px;
  color: var(--gold-hi);
}
#panel-body {
  padding: 16px;
  overflow: auto;
  min-height: 0;
  overscroll-behavior: contain;
}
#panel-body p {
  font-size: 14px;
  line-height: 1.65;
}
#panel-body label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  margin: 14px 0;
}
#panel-body input[type="range"] {
  min-height: 44px;
  min-width: 0;
  width: 42%;
  accent-color: #27479a;
}
#panel-body select {
  max-width: 58%;
  min-height: 44px;
  background: #f9eacb;
  color: #2a1a45;
  border: 1px solid #b59969;
  border-radius: 5px;
}
#panel-body ol {
  padding-inline-start: 24px;
  font-size: 14px;
  line-height: 1.7;
}
#panel-body .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #d4b990;
  padding: 10px 0;
  font-size: 14px;
}
#panel-body .row img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}
#panel-body .record {
  padding: 10px 0;
  border-bottom: 1px solid #d4b990;
}
#panel-body .record img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}
#panel-body .record p {
  margin: 4px 0;
}
.record > strong {
  display: block;
  direction: ltr;
  unicode-bidi: isolate;
}
#panel-body input[type="checkbox"] {
  appearance: none;
  position: relative;
  width: 44px;
  height: 44px;
  margin: 0;
  flex: none;
  cursor: pointer;
}
#panel-body input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 0;
  width: 44px;
  height: 24px;
  background: #b49c77;
  border: 1px solid #9c805b;
  border-radius: 16px;
}
#panel-body input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 14px;
  left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff6da;
  box-shadow: 0 1px 3px #43271866;
}
#panel-body input[type="checkbox"]:checked::before {
  background: #27479a;
}
#panel-body input[type="checkbox"]:checked::after {
  left: 24px;
}
#panel-body output {
  min-width: 40px;
  text-align: end;
}
.panel-retry {
  min-height: 44px;
  padding: 8px 20px;
  color: #fff0cc;
  background: #27479a;
  border: 1px solid #14275f;
  border-radius: 10px;
}
.record-values {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 6px;
}
.record-values span {
  font-size: 11px;
  display: block;
}
.record-values b {
  display: block;
  font-size: 16px;
  overflow-wrap: anywhere;
}
.list-caption {
  margin: 0 0 4px;
}
.my-ranking {
  background: #e9cf9c;
  border-radius: 8px;
  padding: 8px;
}

/* ---- display modes ---- */
.is-half .history,
.is-short .history {
  display: none;
}
.is-short .board {
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: calc(var(--u) * 1.4);
}
.is-short .pool,
.is-short .windows {
  width: calc(var(--u) * 46);
  margin-top: 0;
}
.is-short .pool-value {
  font-size: calc(var(--u) * 5.4);
}
.is-short .hud {
  height: calc(var(--u) * 10.5);
}
.is-short .title {
  height: calc(var(--u) * 9.6);
}
.is-short .title-text {
  font-size: calc(var(--u) * 4);
}
.is-short .round-btn {
  width: max(calc(var(--u) * 8.4), 32px);
  height: max(calc(var(--u) * 8.4), 32px);
}
.is-short .chips button {
  height: calc(var(--u) * 14);
  width: calc(var(--u) * 13);
}
.is-short .chips button b {
  font-size: calc(var(--u) * 3.6);
}
.is-short .bar {
  height: calc(var(--u) * 9.4);
  min-height: 38px;
}
.is-short .feedback {
  top: calc(var(--u) * 11.5 + 6px);
}
.is-short .group {
  width: calc(var(--u) * 13);
}
.is-short .group b {
  font-size: calc(var(--u) * 2.1);
}
.is-tiny .group b,
.is-tiny .notice img,
.is-tiny .pool-label {
  display: none;
}
.is-tiny .pool,
.is-tiny .windows {
  width: calc(var(--u) * 40);
}
.is-tiny .pool-value {
  top: 14%;
  font-size: calc(var(--u) * 4.6);
}
.is-tiny .chips button {
  height: calc(var(--u) * 11.5);
  width: calc(var(--u) * 12);
}
.is-tiny .chips button b {
  top: 32%;
  height: 46%;
}
.is-tiny .bar {
  height: calc(var(--u) * 8.4);
  min-height: 36px;
}
.is-tiny .group {
  width: calc(var(--u) * 10);
}
.view-hidden {
  display: none;
}

/* ---- motion preferences ---- */
.low-motion *,
.low-motion *::before,
.low-motion *::after {
  animation: none !important;
  transition: none !important;
}
body.low-motion #lion,
.fx-static #lion {
  animation: breathe 4.2s ease-in-out infinite !important;
}
@keyframes breathe {
  50% {
    transform: scale(1.012) translateY(-1px);
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
body.reduced-motion #lion {
  animation: none !important;
}
.hub.fx-static ~ .fx,
.hub.fx-paused ~ .fx {
  display: none;
}

/* ---- right-to-left: the HUD and the dock mirror, the stage and the lion do not ---- */
[dir="rtl"] .hud,
[dir="rtl"] .bar {
  direction: rtl;
}
[dir="rtl"] .stage,
[dir="rtl"] .wheel,
[dir="rtl"] .board,
[dir="rtl"] .chips,
[dir="rtl"] .history {
  direction: ltr;
}
[dir="rtl"] #panel-body,
[dir="rtl"] .notice {
  text-align: right;
}
@media (max-width: 350px) {
  .hud {
    gap: 3px;
  }
  .hud-actions {
    gap: 3px;
  }
}

/* The server-stage wait hint never intercepts gameplay or panel actions. */
#next-open {
  pointer-events: none;
}

/* Reserve disjoint touch targets even when the artwork scales down. */
.hud {
  min-height: 44px;
}
.hud button {
  min-width: 44px;
  min-height: 44px;
}

.ped .mine {
  right: 0;
  max-width: 100%;
  padding-inline: 2px;
  overflow-wrap: anywhere;
  white-space: normal;
}
.pool .pool-value {
  font-size: max(12px, calc(var(--u) * 3.6));
  overflow-wrap: anywhere;
  white-space: normal;
  text-align: center;
}

.wallet b,
.today b {
  font-size: max(12px, calc(var(--u) * 3.6));
}

/* Long wallet values retain their complete formatter output. */
.wallet b,
.today b {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.05;
}

.today {
  flex: 1.15;
  padding-inline: 3px;
  gap: 3px;
}
.today .coin-symbol {
  width: 14px;
  height: 14px;
  font-size: 10px;
}

/* Keep decorative backgrounds out of the critical background/lion transfer. */
.art-pending #game::after,
.art-pending .round-btn,
.art-pending .title,
.art-pending .pool,
.art-pending .windows,
.art-pending .auto { background-image: none; }
[lang="id"] .auto { font-size: calc(var(--u) * 4.5); }
