:root {
  color-scheme: dark;
  --gold: #f6d784;
  --cream: #fff0c8;
  --red: #be361b;
  --game-h: 100dvh;
  --wheel-size: 300px;
}
* {
  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;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #fff4be;
  outline-offset: 3px;
}
button:disabled {
  cursor: default;
}
#game {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 500px);
  height: var(--game-h);
  min-height: 0;
  padding: max(5px, env(safe-area-inset-top)) 8px
    max(6px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(#3b13093b, #71300b16),
    url(assets/art/background.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d) center/cover;
  overflow: hidden;
  border: 1px solid #8c5524;
}
.hud {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: none;
  min-height: 48px;
}
.brand {
  width: 56px;
  height: 46px;
  object-fit: contain;
  flex: none;
}
.icon-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #dfb455;
  background: linear-gradient(#9c572e, #482214);
  color: #fff3c7;
  font-size: 25px;
  font-weight: 700;
  box-shadow: 0 2px 0 #422015;
}
.wallet {
  min-height: 44px;
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
  padding: 5px 6px;
  border: 2px solid #e1b356;
  border-radius: 14px;
  background: #442111;
  color: #fff3ce;
}
.wallet b {
  font-size: 15px;
  white-space: nowrap;
}
.coin-symbol {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  flex: none;
  border: 2px solid #ffdb7d;
  border-radius: 50%;
  background: #d89025;
  font-weight: 800;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  flex: none;
  flex-wrap: wrap;
  font-size: 10px;
}
.online {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.connection-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f2bd50;
}
.is-ready .connection-dot {
  background: #87da87;
}
.view-control {
  display: flex;
  padding: 2px;
  border: 1px solid #e8bd70;
  border-radius: 11px;
  background: #592d1b;
}
.view-control button {
  min-height: 32px;
  min-width: 44px;
  padding: 3px 8px;
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--cream);
  font-size: 10px;
  font-weight: 700;
}
.view-control button[aria-pressed="true"] {
  background: linear-gradient(#d96132, #a22910);
  box-shadow: inset 0 1px 0 #ffd087;
}
.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wheel {
  position: relative;
  width: var(--wheel-size);
  height: var(--wheel-size);
  flex: none;
  direction: ltr;
  isolation: isolate;
}
.frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 3px 2px #371404);
  z-index: -1;
}
.food {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  width: 20%;
  height: 20%;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  border: 3px solid #edc57b;
  background: radial-gradient(at 40% 20%, #fffbe2, #f6e6b7 65%, #d9bd7e);
  box-shadow:
    0 3px 0 #82511c,
    inset 0 0 0 2px #fff9dd;
  padding: 0;
  overflow: visible;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.food img {
  width: 83%;
  height: 69%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 2px 1px #98713944);
}
.food .mult {
  display: block;
  min-width: 70%;
  height: 26%;
  padding: 0 4px;
  border-radius: 0 0 13px 13px;
  background: #4b2917;
  font-size: clamp(14px, 3.9vw, 18px);
  font-weight: 800;
  line-height: 1.15;
}
.food .mine {
  position: absolute;
  right: -7px;
  top: -5px;
  background: #b92e18;
  border: 1px solid #ffe5a6;
  border-radius: 9px;
  padding: 2px 4px;
  font-size: 10px;
  color: white;
  z-index: 1;
}
.food.selected {
  outline: 3px solid #fff3ad;
  outline-offset: 2px;
}
.food.hit {
  box-shadow:
    0 0 0 4px #fff0aa,
    0 0 14px 4px #ffba3580;
}
.food.scan {
  outline: 3px solid #ffdb72;
  outline-offset: 2px;
}
.food[aria-disabled="true"] {
  cursor: default;
}
.hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 33%;
  height: 33%;
  min-width: 88px;
  min-height: 88px;
  max-width: 156px;
  max-height: 156px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.hub > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.hub-info {
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: 4%;
  height: 49%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0;
  text-shadow: 0 1px 2px #5b0902;
}
.hub-info #phase {
  color: #ffe277;
  font-size: var(--phase-font, 12px);
  line-height: 1.1;
  max-width: 100%;
  overflow-wrap: anywhere;
  flex: none;
}
.hub-info #countdown {
  font-size: var(--timer-font, 28px);
  line-height: 1;
  font-weight: 850;
  color: #ffe291;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  flex: none;
}
.groups {
  position: absolute;
  bottom: max(0px, calc((100% - var(--wheel-size)) / 2));
  left: 5%;
  right: 5%;
  display: flex;
  justify-content: space-between;
  direction: ltr;
  pointer-events: none;
}
.group {
  width: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.group img {
  width: 34px;
  height: 26px;
  object-fit: contain;
  filter: drop-shadow(0 3px 1px #682d11);
}
.group b {
  font-size: 12px;
  line-height: 1.2;
  padding: 3px 12px;
  border: 1px solid #d6ae63;
  background: #4d5429;
  border-radius: 7px;
  box-shadow: 0 2px 0 #9f6b2d;
}
.group:last-child b {
  background: #9e2c17;
}
.group.active b {
  outline: 2px solid #ffe99d;
}
.dock {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  direction: inherit;
}
.chips {
  display: flex;
  gap: 7px;
  direction: ltr;
}
.chips button {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  border: 2px solid #c68e3a;
  border-radius: 10px;
  box-shadow:
    0 2px 0 #633212,
    inset 0 0 0 1px #fff7d7;
  background: linear-gradient(#fff6d9, #ead5a3);
  color: #352016;
  font-size: 18px;
  font-weight: 800;
  position: relative;
}
.chips button[aria-pressed="true"] {
  background: linear-gradient(#e36532, #b63018);
  color: white;
  border-color: #ffe79f;
}
.chips button[aria-pressed="true"]::after {
  content: "✓";
  position: absolute;
  top: -7px;
  right: 2px;
  border-radius: 50%;
  background: #fff0ce;
  color: #6c3b19;
  width: 18px;
  height: 18px;
  font-size: 12px;
  line-height: 18px;
}
.instruction {
  text-align: center;
  font-size: 12px;
  margin: 2px 0;
  line-height: 1.25;
}
.history {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid #c9a065;
  border-radius: 8px;
  background: linear-gradient(#fff3d1, #ead5a5);
  color: #43291a;
  font-size: 13px;
}
.today {
  margin-inline-start: auto;
  border: 0;
  background: none;
  color: inherit;
  padding: 0;
  min-height: 0;
  font-size: 10px;
  max-width: 105px;
  line-height: 1.2;
}
.today b {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.history {
  text-align: start;
  width: 100%;
  min-width: 0;
}
.history > span:first-child {
  font-size: 11px;
  max-width: 68px;
  line-height: 1.1;
}
.history #recent {
  display: flex;
  gap: 3px;
  flex: 1;
  min-width: 0;
  justify-content: space-evenly;
  direction: ltr;
}
.history img {
  width: 23px;
  height: 23px;
  object-fit: contain;
  border-radius: 50%;
  background: #fff6dc;
}
.bottom-actions {
  display: flex;
  gap: 4px;
  padding: 0;
  min-height: 44px;
}
.bottom-actions button {
  flex: 1;
  background: linear-gradient(#7b4226, #4a281c);
  border: 1px solid #c9a065;
  border-radius: 10px;
  color: #fff0c8;
  min-width: 0;
  min-height: 44px;
  font-size: 12px;
  font-weight: 700;
}
.notice {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
  min-height: 44px;
  background: #fff0d0;
  color: #542413;
  border: 1px solid #d6a04c;
  border-radius: 10px;
}
.notice[hidden] {
  display: none;
}
.notice img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}
.notice p {
  font-size: 11px;
  margin: 0;
  flex: 1;
}
.notice button,
.result-card button {
  border: 1px solid #d39b36;
  border-radius: 8px;
  background: #bf411e;
  color: #fff1c4;
  min-height: 44px;
  padding: 6px 12px;
}
.result-card {
  position: absolute;
  z-index: 10;
  bottom: 16px;
  left: 6%;
  right: 6%;
  background: linear-gradient(#fff4d2, #ead7aa);
  color: #572a15;
  border: 3px solid #d4a14d;
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 5px 18px #32100388;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.result-card[hidden] {
  display: none;
}
.result-card > #result-reward {
  font-size: 28px;
  line-height: 1.1;
  color: #aa321b;
}
.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-card #result-foods {
  display: flex;
  justify-content: center;
  gap: 4px;
}
.result-card img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.connection {
  background: #4d211adf;
  text-align: center;
  font-size: 11px;
  padding: 7px;
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid #d6a04c;
  border-radius: 10px;
}
.connection[hidden] {
  display: none;
}
.loading {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(#3f1d1790, #632b18cf),
    url(assets/art/background.webp?v=2ab444fbdec84a690c3daeb20e73c36114c6eded8af2c0b8081769dde5729c9d) center/cover;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  text-align: center;
}
.loading > img {
  width: 210px;
  height: 210px;
  object-fit: contain;
}
.loading small {
  color: #fff3dc;
  font-size: 12px;
  margin-top: 12px;
  flex: none;
}
.loading p {
  font-size: 15px;
}
.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: #a6381c;
  color: #fff1ce;
}
.loading[hidden] {
  display: none;
}
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: #442717;
  box-shadow: 0 5px 20px #35140ca0;
  overflow: hidden;
  z-index: 41;
}
dialog::backdrop {
  background: transparent;
}
dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px;
  border-bottom: 1px solid #c3a577;
  background: #e9cf9c;
}
dialog h2 {
  font-size: 19px;
  margin: 0;
}
dialog header button {
  border: 0;
  background: none;
  font-size: 27px;
  min-width: 44px;
  min-height: 44px;
  color: #54291a;
}
#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"] {
  width: 55%;
  accent-color: #b94726;
}
#panel-body select {
  max-width: 58%;
  min-height: 44px;
  background: #f9eacb;
  color: #432718;
  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 .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;
}
.low-motion * {
  animation: none !important;
  transition: none !important;
}
.food.pending {
  outline: 3px dashed #ffeac0;
}
@media (max-width: 350px) {
  #game {
    padding-left: 8px;
    padding-right: 8px;
  }
  .hud {
    gap: 3px;
  }
  .brand {
    width: 49px;
    height: 45px;
  }
  .icon-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    font-size: 22px;
  }
  .wallet b {
    font-size: 12px;
  }
  .coin-symbol {
    width: 18px;
    height: 18px;
    font-size: 12px;
  }
  .groups {
    left: 8%;
    right: 8%;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}

.loading-wheel {
  position: relative;
  width: 230px;
  height: 230px;
  direction: ltr;
}
.loading-wheel .frame {
  z-index: 0;
}
.splash-food {
  position: absolute;
  width: 18%;
  height: 18%;
  object-fit: contain;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #ffedc0;
  border: 2px solid #deb15f;
}
.splash-hub {
  position: absolute;
  width: 34%;
  height: 34%;
  left: 33%;
  top: 33%;
  object-fit: contain;
}
.loading > img {
  width: 160px;
  height: 94px;
}
.is-half .loading-wheel {
  width: 170px;
  height: 170px;
}
.is-half .loading > img {
  width: 110px;
  height: 85px;
}
.loading.failed .loading-wheel {
  display: none;
}

/* Layout follows the measured game container, including host safeHeight. */
[hidden] {
  display: none !important;
}
.wallet b,
.round,
.today b,
.result-values b,
.record-values b,
.row b,
output {
  direction: ltr;
  unicode-bidi: isolate;
  font-variant-numeric: tabular-nums;
}
.round {
  opacity: 0.8;
}
.online {
  font-size: 10px;
  flex-wrap: wrap;
}
.today span {
  max-width: 70px;
}
#demo {
  font-size: 9px;
}
.view-control {
  margin-inline-start: auto;
}
.feedback {
  order: 2;
  flex: none;
}
.stage {
  order: 3;
}
.dock {
  order: 4;
}
.has-feedback .feedback {
  min-height: 46px;
  margin: 2px 0;
}
.has-notice .connection {
  display: none;
}
.is-half .hud {
  min-height: 44px;
}
.is-half .brand {
  height: 44px;
}
.is-half .toolbar {
  min-height: 32px;
}
.is-half .instruction {
  display: none;
}
.is-half .history,
.is-short .history {
  display: none;
}
.is-short .brand {
  width: 44px;
}
.is-short .hud {
  gap: 3px;
}
.is-short .today {
  max-width: 72px;
}
.is-short .today span {
  max-width: 52px;
}
.is-short .chips button {
  font-size: 16px;
}
.is-short .loading-wheel {
  width: 170px;
  height: 170px;
}
.is-short .loading > img {
  width: 110px;
  height: 75px;
}
.is-compact.has-feedback .toolbar > .online,
.is-compact.has-feedback .toolbar > .round,
.is-compact.has-feedback .toolbar > .today {
  visibility: hidden;
}
.is-compact.has-feedback .toolbar {
  height: 48px;
  min-height: 48px;
}
.is-compact.has-feedback .view-control button {
  min-height: 44px;
}
.is-compact.has-feedback .feedback {
  position: absolute;
  top: 51px;
  left: 8px;
  right: 108px;
  margin: 0;
  z-index: 2;
}
[dir="rtl"] .is-compact.has-feedback .feedback {
  left: 108px;
  right: 8px;
}
.is-compact.has-feedback .instruction {
  display: none;
}
.is-compact .notice img {
  display: none;
}
.notice button {
  max-width: 68px;
  font-size: 10px;
  padding: 4px;
  flex: none;
}
.notice p {
  overflow-wrap: anywhere;
}
.food.selected::after {
  content: "✓";
  position: absolute;
  left: -5px;
  top: -5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #b9341c;
  border: 2px solid #fff0c6;
  font-size: 12px;
}
.result-card {
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  max-height: calc(100% - 24px);
  padding: 14px 12px 0;
  overflow: auto;
}
.result-card .result-close {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 44px;
  font-size: 24px;
  background: transparent;
  color: #54291a;
  border: 0;
}
#result-foods {
  padding: 0 28px;
  flex-wrap: wrap;
}
#result-title {
  text-align: center;
}
#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(#e67736, #ad361c);
  font-weight: 750;
  font-size: 16px;
}
#result-auto {
  font-size: 10px;
  margin: 7px 0 0;
}
#panel-mask {
  position: absolute;
  inset: 0;
  background: #25120b99;
  z-index: 40;
}
dialog[open] {
  display: flex;
  flex-direction: column;
}
dialog header {
  flex: none;
  gap: 8px;
}
#panel-body input[type="range"] {
  min-height: 44px;
  min-width: 0;
  width: 42%;
}
#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: #b94726;
}
#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: #b94726;
  border: 1px solid #9c4425;
  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;
}
.my-ranking {
  background: #e9cf9c;
  border-radius: 8px;
  padding: 8px;
}
#exited {
  z-index: 50;
}

.record > strong {
  display: block;
  direction: ltr;
  unicode-bidi: isolate;
}

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