/* ——— ARABIAN FEAST — Arabian feast wheel (video reference) ——— */
@import url('https://fonts.googleapis.com/css2?family=Trebuchet MS:wght@600;700;800;900&display=swap');

.game-shell.af-mode {
  max-width: 480px;
  margin: 0 auto;
  background: #041a12;
}
.game-shell.af-mode .game-top {
  display: none;
}
.game-shell.af-mode .game-stage {
  padding: 0;
  max-width: 100%;
  width: 100%;
  min-height: 100dvh;
  display: block; /* don't flex-spread stage children */
}

.af-screen {
  position: relative;
  min-height: 100dvh;
  min-height: 100svh;
  color: #fff;
  font-family: Trebuchet MS, system-ui, sans-serif;
  overflow: hidden;
}
.af-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  z-index: 0;
  filter: brightness(0.9) saturate(1.1);
}
.af-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(40, 180, 100, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(4, 26, 18, 0.25) 0%, transparent 28%, rgba(2, 18, 12, 0.65) 100%);
}
.af-ui {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 100dvh;
  min-height: 100svh;
  padding: max(2px, env(safe-area-inset-top)) 8px max(4px, env(safe-area-inset-bottom));
  gap: 4px;
  box-sizing: border-box;
}
.af-bottom {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  margin-top: 2px;
  position: relative;
  z-index: 5;
}

/* Header — 3-col aligned + AI icons */
.af-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  margin: 0;
  padding: 0;
}
.af-top-l {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  flex-wrap: wrap;
}
.af-top-r {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.af-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 2px solid #f0d060;
  background: linear-gradient(160deg, #1fa86a, #0a3d2a 55%, #06281c);
  color: #fff;
  font-weight: 900;
  display: grid;
  place-items: center;
  padding: 0;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), 0 0 10px rgba(255, 200, 40, 0.45);
}
.af-btn img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
  background: transparent !important;
  pointer-events: none;
}
.af-btn.back {
  background: radial-gradient(circle at 35% 28%, #ff6a4a, #e02020 60%, #9a1010);
  border-color: #ffd080;
}
.af-btn.back img {
  width: 16px;
  height: 16px;
}
.af-btn.off {
  opacity: 0.45;
  filter: grayscale(0.5);
}
.af-bal-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  background: linear-gradient(180deg, #2a2040, #120c22);
  border: 2px solid #e8b0ff;
  border-radius: 999px;
  padding: 0 12px 0 4px;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 0 12px rgba(200, 100, 255, 0.35);
  box-sizing: border-box;
}
.af-bal-pill img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  background: transparent !important;
}
.af-bal-pill b {
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  line-height: 1;
  display: flex;
  align-items: center;
  height: 26px;
  margin: 0;
  padding: 0;
}
.af-ping {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 36px;
  font-size: 0.62rem;
  color: #6dff8a;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 0 6px rgba(80, 255, 140, 0.6);
  flex-shrink: 0;
}
.af-ping img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  display: block;
  background: transparent !important;
  filter: drop-shadow(0 0 4px rgba(80, 255, 140, 0.7));
}

.af-logo-wrap {
  display: grid;
  place-items: center;
  margin: 0 0 6px;
  z-index: 6;
  line-height: 0;
  height: auto;
  flex-shrink: 0;
}
.af-logo {
  height: clamp(48px, 12vw, 68px);
  width: auto;
  max-width: min(88vw, 340px);
  object-fit: contain;
  object-position: center center;
  background: transparent !important;
  filter: drop-shadow(0 0 14px rgba(255, 180, 60, 0.85));
}

/* Ferris wheel arena */
.af-arena {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  overflow: visible;
  margin: 0;
  padding-top: 0;
}
.af-wheel-stack {
  position: relative;
  width: min(92vw, 360px);
  margin-top: 2px;
  flex-shrink: 0;
  margin-bottom: 0;
}
.af-wheel {
  position: relative;
  width: 100%;
  /* circle + short stand only — no tall empty legs */
  aspect-ratio: 200 / 200;
  overflow: visible;
}
.af-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
}
.af-seat {
  position: absolute;
  width: 21%;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  z-index: 2;
}
.af-seat:disabled {
  cursor: default;
}
.af-pod {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #ffffff, #f2f2f8 65%, #dddde8);
  border: 3px solid #ff5a3a;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.5),
    0 0 0 2px rgba(255, 200, 100, 0.35);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.af-pod img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  background: transparent !important;
}
.af-mult {
  font-size: 0.52rem;
  font-weight: 800;
  color: #1a1208;
  background: rgba(255, 236, 160, 0.92);
  border-radius: 4px;
  padding: 1px 4px;
  text-shadow: none;
  white-space: nowrap;
  line-height: 1.15;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.af-hot {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  font-style: normal;
  font-size: 0.5rem;
  font-weight: 900;
  background: linear-gradient(180deg, #ff6a40, #e02020);
  color: #fff;
  border-radius: 4px;
  padding: 1px 5px;
  z-index: 3;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  letter-spacing: 0.04em;
}
.af-stake {
  position: absolute;
  bottom: 14px;
  font-style: normal;
  font-size: 0.52rem;
  font-weight: 900;
  background: #e8b923;
  color: #2a1608;
  border-radius: 6px;
  padding: 1px 5px;
  z-index: 2;
}
.af-seat.has-bet .af-pod {
  box-shadow: 0 0 0 3px #4dff8a, 0 4px 14px rgba(0, 0, 0, 0.5);
}
.af-seat.is-hl .af-pod {
  outline: 3px solid #fff;
  box-shadow: 0 0 24px rgba(255, 220, 100, 1);
  transform: scale(1.08);
}
.af-seat.is-win .af-pod {
  animation: delWinPulse 0.55s ease infinite alternate;
}
@keyframes delWinPulse {
  from {
    box-shadow: 0 0 12px #ffe08a;
  }
  to {
    box-shadow: 0 0 28px #ff9f2e;
  }
}

.af-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 36%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #3dff9a, #1fa86a 42%, #0a4a32 78%, #031a12);
  border: 4px solid #f0d060;
  box-shadow:
    0 0 0 4px rgba(240, 208, 96, 0.35),
    0 0 32px rgba(40, 220, 120, 0.75),
    inset 0 3px 12px rgba(255, 255, 255, 0.35);
  display: grid;
  place-items: center;
  z-index: 3;
  overflow: hidden;
}
.af-hub-txt {
  position: relative;
  z-index: 1;
  text-align: center;
  line-height: 1.1;
  padding: 4px;
}
.af-hub-txt small {
  display: block;
  margin-top: 4px;
  font-size: 0.58rem;
  font-weight: 800;
  color: #d8ffe8;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}
.af-timer {
  display: block;
  margin: 0;
  min-width: 0;
  padding: 0;
  border-radius: 0;
  background: transparent !important;
  border: none;
  font-size: clamp(1.35rem, 7vw, 1.85rem);
  font-weight: 900;
  color: #fff !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
  box-shadow: none;
}

/* Salad / Pizza — in flow under stand (kills bottom empty gap) */
.af-platform {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 2px;
  z-index: 5;
  width: min(92vw, 360px);
  margin: 4px auto 0;
  padding: 0 6px;
  pointer-events: none;
  flex-shrink: 0;
}
.af-group {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: #f0d060;
  font-weight: 900;
  font-size: 0.72rem;
  justify-self: center;
}
.af-group-odds {
  font-size: 0.78rem;
  font-weight: 900;
  color: #ffe9a0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}
.af-group:first-child {
  justify-self: start;
  margin-left: 2%;
}
.af-group:last-child {
  justify-self: end;
  margin-right: 2%;
}
.af-group-disk {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fff, #f0f0f6);
  border: 3px solid #fff;
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.45),
    0 0 0 2px rgba(255, 160, 80, 0.5);
  display: grid;
  place-items: center;
  overflow: hidden;
  z-index: 1;
  margin-bottom: -6px;
}
.af-group-disk img {
  width: 86%;
  height: 86%;
  object-fit: contain;
  background: transparent !important;
}
.af-pedestal {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 22px;
  padding: 0 10px;
  border-radius: 4px 4px 8px 8px;
  background: linear-gradient(180deg, #ff6a4a, #c02020 55%, #8a1010);
  border: 1px solid #ffb090;
  box-shadow:
    0 4px 0 #6a0808,
    0 6px 10px rgba(0, 0, 0, 0.35);
  color: #1a1008;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 0 rgba(255, 220, 180, 0.35);
}
.af-group:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.af-played {
  pointer-events: none;
  font-size: 0.58rem;
  color: #9ec8ff;
  text-align: center;
  padding-bottom: 8px;
  line-height: 1.15;
  text-shadow: 0 1px 3px #000;
}
.af-played b {
  color: #ffe08a;
  font-size: 0.9rem;
}

/* Chips — reference tray + purple G */
.af-chips {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: nowrap;
  background: linear-gradient(180deg, rgba(10, 60, 40, 0.55), rgba(4, 28, 18, 0.75));
  border: 1px solid rgba(240, 208, 96, 0.35);
  border-radius: 14px;
  padding: 8px 10px;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 3px 10px rgba(0, 0, 0, 0.35);
}
.af-chip {
  min-width: 60px;
  padding: 6px 8px;
  border-radius: 12px;
  border: 2px solid #c9a227;
  background: linear-gradient(160deg, #1a5c3e, #0a3d2a 55%, #06281c);
  color: #ffe9a0;
  font-weight: 900;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}
.af-chip img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  background: transparent !important;
  filter: drop-shadow(0 1px 3px rgba(120, 70, 0, 0.45));
}
.af-chip.active {
  border-color: #ffe9a0;
  background: linear-gradient(160deg, #2ecc71, #14804a 55%, #0a4a32);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(240, 208, 96, 0.55), 0 0 14px rgba(40, 200, 120, 0.45);
}
.af-chip:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.af-today {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(90deg, #0a5c3a, #1fa86a 50%, #0a5c3a);
  border: 1px solid #c9a227;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.75rem;
  font-weight: 800;
  box-shadow: 0 0 16px rgba(255, 80, 160, 0.35);
}
.af-today img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  background: transparent !important;
}
.af-today b {
  color: #fff6c8;
}

.af-resultbar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(40, 36, 56, 0.88);
  border-radius: 8px;
  padding: 5px 6px;
  color: #fff;
}
.af-result-lab {
  font-size: 0.65rem;
  font-weight: 900;
  color: #cbb8ff;
  flex-shrink: 0;
}
.af-hist-track {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.af-hist {
  position: relative;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.af-hist img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  background: transparent !important;
}
.af-hist.new {
  outline: 2px solid #3b8cff;
}
.af-hist i {
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  font-style: normal;
  font-size: 0.36rem;
  font-weight: 900;
  background: #3b8cff;
  color: #fff;
  padding: 0 3px;
  border-radius: 2px;
}
.af-hist-empty {
  font-size: 0.75rem;
  color: #888;
}
.af-repeat {
  flex-shrink: 0;
  border: none;
  border-radius: 8px;
  padding: 5px 9px;
  background: #5a6070;
  color: #fff;
  font-weight: 900;
  font-size: 0.68rem;
  cursor: pointer;
}
.af-repeat:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.af-rankbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(12, 10, 28, 0.92);
  color: #fff;
  font-weight: 800;
  font-size: 0.72rem;
  cursor: pointer;
}
.af-rank-l {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.af-rank-l em {
  font-style: normal;
}
.af-rankbar b {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #ffe08a;
}
.af-rankbar img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  background: transparent !important;
}

.af-modal {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(8, 6, 20, 0.75);
}
.af-card {
  width: min(360px, 100%);
  max-height: 80dvh;
  overflow: auto;
  background: linear-gradient(180deg, rgba(70, 190, 110, 0.95), rgba(28, 90, 55, 0.97));
  border: 2px solid #ffe08a;
  border-radius: 16px;
  padding: 12px;
  color: #fff;
}
.af-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, #ff7aa8, #e83d7a);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 10px;
}
.af-card-head h3 {
  margin: 0;
  font-size: 0.95rem;
}
.af-card-head button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: #e23;
  font-weight: 900;
  cursor: pointer;
}
.af-card ol {
  margin: 0;
  padding-left: 18px;
  font-size: 0.78rem;
  line-height: 1.45;
}
.af-rank-table {
  text-align: left;
}
.af-rt {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  padding: 6px 4px;
  font-size: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  align-items: center;
}
.af-rt.head {
  font-weight: 900;
  color: #ffe08a;
}
.af-rt.me {
  background: rgba(255, 220, 100, 0.2);
}
.af-rt img {
  width: 14px;
  height: 14px;
  vertical-align: middle;
  background: transparent !important;
}

/* Win / Lose result popup */
.af-result-modal {
  z-index: 40;
  background: rgba(6, 4, 18, 0.78);
}
.af-result-card {
  position: relative;
  width: min(300px, 88vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 22px 18px 16px;
  border-radius: 20px;
  border: 2px solid #ffe08a;
  color: #fff;
  text-align: center;
  animation: del-pop-in 0.45s cubic-bezier(0.2, 1.2, 0.4, 1) both;
  overflow: hidden;
}
.af-result-card.win {
  background: linear-gradient(165deg, #3ecf78 0%, #1a7a45 55%, #0f4a2c 100%);
  box-shadow: 0 12px 40px rgba(40, 200, 100, 0.45), 0 0 0 3px rgba(255, 220, 100, 0.35);
}
.af-result-card.lose {
  background: linear-gradient(165deg, #6a6e88 0%, #3a3d55 55%, #22243a 100%);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), 0 0 0 2px rgba(180, 190, 220, 0.25);
}
@keyframes del-pop-in {
  from { transform: scale(0.55); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.af-result-burst {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 240, 120, 0.55), transparent 55%),
    conic-gradient(from 0deg, transparent 0 8%, rgba(255, 255, 255, 0.15) 8% 12%, transparent 12% 20%);
  animation: del-burst-spin 6s linear infinite;
  pointer-events: none;
}
@keyframes del-burst-spin {
  to { transform: rotate(360deg); }
}
.af-result-banner {
  position: relative;
  z-index: 1;
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #fff6b0;
  text-shadow: 0 2px 0 #c45a10, 0 4px 12px rgba(0, 0, 0, 0.35);
  animation: del-banner-bounce 0.7s ease both;
}
.af-result-banner.lose {
  color: #d8dff5;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
@keyframes del-banner-bounce {
  0% { transform: translateY(-18px) scale(0.8); opacity: 0; }
  60% { transform: translateY(2px) scale(1.05); opacity: 1; }
  100% { transform: translateY(0) scale(1); }
}
.af-result-food {
  position: relative;
  z-index: 1;
  width: 96px;
  height: 96px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.35));
  animation: del-food-pop 0.55s ease 0.1s both;
  background: transparent !important;
}
@keyframes del-food-pop {
  from { transform: scale(0.3) rotate(-12deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}
.af-result-mult {
  position: relative;
  z-index: 1;
  font-size: 1.35rem;
  font-weight: 900;
  color: #f0d060;
}
.af-result-name {
  position: relative;
  z-index: 1;
  font-size: 0.95rem;
  font-weight: 800;
}
.af-result-win {
  position: relative;
  z-index: 1;
  font-size: 0.9rem;
  font-weight: 700;
}
.af-result-win b {
  color: #9dffb0;
  font-size: 1.1rem;
}
.af-result-card.lose .af-result-win b {
  color: #ffb0b0;
}
.af-result-coins {
  position: relative;
  z-index: 1;
  font-size: 0.85rem;
  font-weight: 800;
  color: #ffe08a;
  margin-bottom: 4px;
}
.af-result-coins.lose {
  color: #ff9a9a;
}
.af-result-ok {
  position: relative;
  z-index: 1;
  margin-top: 6px;
  min-width: 120px;
  padding: 10px 22px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #f0d060, #d4a017);
  color: #5a2200;
  font-weight: 900;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 0 #c45a10;
}
.af-result-ok:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #c45a10;
}

@media (max-width: 380px) {
  .af-seat {
    width: 23%;
  }
  .af-mult {
    font-size: 0.44rem;
  }
  .af-hub-txt span {
    font-size: 0.58rem;
  }
  .af-group-disk {
    width: 50px;
    height: 50px;
  }
  .af-pedestal {
    min-width: 56px;
    height: 20px;
    font-size: 0.65rem;
  }
  .af-logo {
    height: clamp(44px, 12vw, 62px);
  }
  .af-platform {
    margin-top: -46px;
  }
}
