/* CASINO LAYER: loads after style.css. The core files are untouched. */
:root {
  --gold: #ffd700;
  --gold-dark: #b8860b;
  --felt: #0b6b2e;
  --felt-dark: #063d1a;
  --neon-pink: #ff2bd6;
  --neon-cyan: #00f0ff;
}

/* Stop sideways scrolling: the core layout hangs off the right edge on purpose, which made
   phones widen the page. "clip" (not "hidden") keeps the sticky top bars working. */
html, body { overflow-x: clip; }

/* Coin cursor everywhere, chip cursor on buttons */
html {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ccircle cx='16' cy='16' r='13' fill='%23ffd700' stroke='%23b8860b' stroke-width='3'/%3E%3Ctext x='16' y='22' font-size='16' text-anchor='middle' font-family='Impact' fill='%23b8860b'%3E$%3C/text%3E%3C/svg%3E") 16 16, wait;
}
button {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ccircle cx='16' cy='16' r='13' fill='%23d10000' stroke='%23fff' stroke-width='4' stroke-dasharray='5 4'/%3E%3Ccircle cx='16' cy='16' r='6' fill='%23fff'/%3E%3C/svg%3E") 16 16, pointer;
}

/* ---------- overlays ---------- */
.casino-glow {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 215, 0, .5), transparent 60%),
    radial-gradient(circle at 8% 92%, rgba(255, 0, 180, .4), transparent 40%),
    radial-gradient(circle at 92% 80%, rgba(0, 240, 255, .4), transparent 40%);
  mix-blend-mode: screen;
  animation: glowPulse 2.4s ease-in-out infinite alternate;
}
.jackpot-flash .casino-glow {
  background: radial-gradient(circle at 50% 50%, rgba(255, 215, 0, .95), rgba(255, 120, 0, .5) 50%, transparent 80%);
  animation: none;
}

.marquee-frame { position: fixed; inset: 0; z-index: 150; pointer-events: none; }
.marquee-frame span {
  position: absolute;
  background-image: radial-gradient(circle, #fffbd0 0 3px, var(--gold) 4px, transparent 6px);
  background-size: 22px 22px;
  filter: drop-shadow(0 0 4px #ffb300);
  animation: bulbChase .5s steps(2) infinite;
}
.marquee-frame .t { top: 0; left: 0; right: 0; height: 14px; }
.marquee-frame .b { bottom: 0; left: 0; right: 0; height: 14px; }
.marquee-frame .l { top: 0; bottom: 0; left: 0; width: 14px; }
.marquee-frame .r { top: 0; bottom: 0; right: 0; width: 14px; }

.coin-rain { position: fixed; inset: 0; z-index: 140; pointer-events: none; overflow: hidden; }
.coin {
  position: absolute;
  top: -60px;
  animation-name: coinFall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  filter: drop-shadow(0 0 6px #ffd700);
}

/* ---------- jackpot bar + winners ---------- */
.jackpot-bar {
  position: relative;
  z-index: 6;
  margin: 6px 8px;
  padding: 6px 10px;
  text-align: center;
  background: linear-gradient(180deg, #3a0000, #000 40%, #3a0000);
  border: 6px double var(--gold);
  box-shadow: 0 0 25px var(--gold), inset 0 0 30px #ff0040;
  color: var(--gold);
  font: clamp(16px, 3.6vw, 38px) Bungee, Impact, fantasy;
  text-shadow: 0 0 8px #ff0, 0 0 18px #f80;
  transform: rotate(-.6deg);
}
.jackpot-bar b {
  display: inline-block;
  min-width: 9ch;
  padding: 0 8px;
  color: #fff;
  background: #000;
  border: 3px inset var(--gold);
  font-family: "Courier New", monospace;
  letter-spacing: 2px;
  text-shadow: 0 0 10px #f00, 0 0 2px #fff;
}
.jackpot-bar small { display: block; font: 12px Tahoma, sans-serif; color: #fff; text-shadow: none; }
.winners-ticker { position: relative; z-index: 6; background: #000; color: var(--gold); border-color: var(--gold); font-size: 20px; text-shadow: 0 0 6px #f80; }
.winners-ticker span { animation-duration: 26s; }

/* ---------- shared casino table ---------- */
.casino-box {
  position: relative;
  margin: 26px -40px 32px 10px;
  padding: 6px 14px 18px;
  color: #fff;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.04) 0 2px, transparent 2px 6px),
    radial-gradient(ellipse at center, #14a84a 0, var(--felt) 55%, var(--felt-dark) 100%);
  border: 12px ridge var(--gold);
  border-radius: 30px 4px 60px 10px;
  box-shadow: 0 0 0 6px #600, 0 0 40px var(--gold), 18px 18px 0 #ff00ff;
}
.casino-box > .xpbar { margin: -6px -14px 6px; }
.casino-box h2 {
  margin: 0 0 8px;
  color: var(--gold);
  font: clamp(26px, 5vw, 54px) Monoton, Impact, fantasy;
  line-height: 1.05;
  text-shadow: 0 0 6px #fff, 0 0 14px var(--gold), 0 0 28px var(--neon-pink);
}
.casino-box .fine { display: inline-block; padding: 2px 5px; font: 11px Tahoma, sans-serif; color: #cfc; background: rgba(0,0,0,.45); }

/* ---------- slot machine ---------- */
.slot-machine { transform: rotate(-1.2deg); }
.slot-cabinet { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.slot-window {
  display: flex;
  gap: 8px;
  padding: 10px;
  background: #111;
  border: 8px inset var(--gold);
  border-radius: 14px;
  box-shadow: inset 0 0 25px #000, 0 0 18px #f00;
}
.reel {
  display: grid;
  place-items: center;
  width: clamp(62px, 13vw, 108px);
  height: clamp(78px, 16vw, 128px);
  overflow: hidden;
  font-size: clamp(38px, 8.5vw, 74px);
  background: linear-gradient(180deg, #999, #fff 28%, #fff 72%, #999);
  border: 4px solid #700;
  border-radius: 8px;
}
.reel.spinning { filter: blur(2px) saturate(3); animation: reelShake .08s infinite; }
.slot-lever {
  all: unset;
  position: relative;
  width: 22px;
  height: 140px;
  margin-top: 40px;
  border-radius: 11px;
  background: linear-gradient(90deg, #777, #fff, #777);
  box-shadow: 0 0 10px #000;
  transform-origin: 50% 100%;
  transition: transform .2s;
  cursor: grab;
}
.slot-lever::before {
  content: "";
  position: absolute;
  top: -34px;
  left: 50%;
  width: 46px;
  height: 46px;
  translate: -50% 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #f22 35%, #700);
  box-shadow: 0 0 14px #f00;
}
.slot-lever.pulled { transform: rotate(28deg) scaleY(.85); }
.slot-lever:focus-visible { outline: 4px dashed var(--gold); outline-offset: 6px; }
.players-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 210px;
  padding: 10px 12px;
  color: #000;
  background: linear-gradient(135deg, #fff6c0, var(--gold) 40%, #fff 55%, var(--gold-dark));
  border-radius: 12px;
  box-shadow: 6px 6px 0 #000, 0 0 20px var(--gold);
  font: 14px Impact, fantasy;
  transform: rotate(6deg);
}
.players-card b { font: 22px Bungee, Impact, fantasy; }
.players-card small { font: 10px Tahoma, sans-serif; }
.slot-panel { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; font: 17px "Courier New", monospace; }
.slot-panel span { padding: 2px 6px; color: #f33; background: #000; border: 3px inset var(--gold); text-shadow: 0 0 6px #f00; }
.slot-panel b { color: #ff0; }
.casino-box .spin-btn {
  min-width: 220px;
  font-size: clamp(26px, 5vw, 48px);
  color: var(--gold);
  background: radial-gradient(circle, #ff4040, #900);
  border-color: var(--gold);
  border-radius: 60px;
  box-shadow: 0 0 25px #f00, 8px 8px 0 #000;
}
.slot-result, .roulette-result, .bj-result {
  min-height: 1.2em;
  margin: 8px 0;
  color: #ff0;
  font: clamp(18px, 3.6vw, 32px) Bungee, Impact, fantasy;
  text-shadow: 3px 3px #f00, 0 0 12px #ff0;
}

/* ---------- roulette ---------- */
.roulette { transform: rotate(1.4deg); margin-left: 40px; margin-right: -70px; }
.roulette-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.wheel-holder { position: relative; width: clamp(180px, 38vw, 270px); aspect-ratio: 1; }
.wheel-pointer { position: absolute; top: -18px; left: 50%; z-index: 2; translate: -50% 0; font-size: 34px; filter: drop-shadow(0 0 6px #ff0); }
.wheel {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 10px solid var(--gold);
  background:
    conic-gradient(#0a0 0 10deg, transparent 10deg),
    repeating-conic-gradient(#c00 0 10deg, #111 10deg 20deg);
  box-shadow: 0 0 30px var(--gold), inset 0 0 20px #000;
  transition: transform 3.2s cubic-bezier(.15, .7, .1, 1);
}
.wheel::after {
  content: "🍌";
  position: absolute;
  inset: 34%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(#ffe680, var(--gold-dark));
  box-shadow: 0 0 10px #000;
  font-size: clamp(22px, 5vw, 40px);
}
.bets p { margin: 4px 0; font: 20px Impact, fantasy; color: var(--gold); }

/* ---------- scratch card ---------- */
.scratch-zone { display: inline-block; width: min(420px, 100%); margin-right: 0; transform: rotate(-3deg); }
.scratch-card {
  position: relative;
  display: grid;
  place-items: center;
  width: min(300px, 100%);
  height: 140px;
  margin-bottom: 8px;
  overflow: hidden;
  background: #fff;
  border: 6px dashed var(--gold);
  border-radius: 10px;
}
.scratch-prize { color: #d00; font: 30px Impact, fantasy; text-align: center; }
.scratch-card canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }

/* ---------- blackjack ---------- */
.blackjack { transform: rotate(-.8deg); }
.bj-row { margin: 6px 0 2px; font: 20px Impact, fantasy; }
.bj-row b { color: var(--gold); }
.cards { display: flex; flex-wrap: wrap; gap: 6px; min-height: 94px; margin-bottom: 6px; }
.card {
  display: grid;
  place-items: center;
  width: 60px;
  height: 88px;
  color: #000;
  background: #fff;
  border: 2px solid #333;
  border-radius: 8px;
  box-shadow: 3px 3px 0 #000;
  font: 26px Georgia, serif;
  transform: rotate(var(--cr, 0deg));
}
.card.red { color: #d00; }
.card.back { background: repeating-linear-gradient(45deg, #900 0 6px, #fff 6px 9px); color: transparent; }

/* ---------- fixed bits ---------- */
.dealer-box {
  position: fixed;
  right: 16px;
  bottom: 74px;
  z-index: 95;
  width: 240px;
  max-width: 60vw;
  padding: 6px 8px;
  color: #fff;
  background: #000;
  border: 5px ridge var(--gold);
  box-shadow: 0 0 18px var(--gold);
  font: 15px Tahoma, sans-serif;
  transform: rotate(-3deg);
}
.dealer-box b { color: var(--gold); }
.sound-toggle { position: fixed; left: 16px; bottom: 74px; z-index: 95; font-size: 14px; }

.casino-pop {
  font-family: "Comic Sans MS", Impact, fantasy;
  background: radial-gradient(circle, #4a0070, #000) !important;
  color: var(--gold);
  border: 4px ridge var(--gold) !important;
  box-shadow: 0 0 18px var(--gold), 8px 8px 0 #ff00ff !important;
}
.casino-pop p { color: #600; }
.casino-pop .xpbar { background: linear-gradient(90deg, #7a0000, #ff2bd6, #7a0000); }

.casino-legal {
  position: relative;
  margin: 10px 0 40px;
  padding: 10px 14px;
  color: #fff;
  background: #000;
  border: 4px solid var(--gold);
  font: 14px Tahoma, sans-serif;
}
.casino-legal b { color: var(--gold); font: 20px Bungee, Impact, fantasy; }

[hidden] { display: none !important; }

/* ---------- claim button ---------- */
.jackpot-bar .claim-btn {
  display: inline-block;
  margin: 4px 8px;
  font-size: clamp(16px, 3vw, 26px);
  color: #000;
  background: linear-gradient(180deg, #fff6a0, var(--gold) 45%, var(--gold-dark));
  border-color: #fff;
  box-shadow: 0 0 18px var(--gold), 5px 5px 0 #000;
}

/* ---------- haram-o-meter ---------- */
.haram-meter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 6px auto 2px;
  color: #fff;
  font: 14px Bungee, Impact, fantasy;
}
.haram-track {
  width: min(320px, 60vw);
  height: 18px;
  overflow: hidden;
  background: #111;
  border: 3px inset var(--gold);
  border-radius: 10px;
}
.haram-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #2ecc40, #ffdc00 45%, #ff4136 75%, #b10dc9);
  transition: width .4s;
}
.jackpot-bar .haram-meter b {
  min-width: 0;
  padding: 0;
  color: #ff4136;
  background: none;
  border: 0;
  font: 14px Bungee, Impact, fantasy;
  letter-spacing: 0;
}
.haram-meter.maxed .haram-track { box-shadow: 0 0 16px #f00, 0 0 30px #b10dc9; }

/* ---------- bar + riba ---------- */
.bar-box {
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.03) 0 3px, transparent 3px 9px),
    radial-gradient(ellipse at center, #5a1030 0, #2a0418 60%, #120008 100%);
  transform: rotate(1deg);
}
.drinks { display: flex; flex-wrap: wrap; gap: 4px; }
.riba-box {
  background: radial-gradient(ellipse at center, #1b3a8a, #0a1a45 70%);
  transform: rotate(-1.5deg);
}
.riba-box p { color: #fff; font: 20px Impact, fantasy; }
.riba-balance {
  display: inline-block;
  max-width: 100%;
  margin: 6px 0;
  padding: 4px 8px;
  color: #7cfc00;
  background: #000;
  border: 3px inset var(--gold);
  font: clamp(18px, 4vw, 30px) "Courier New", monospace;
  overflow-wrap: anywhere;
}
.riba-balance small { color: #aaa; font-size: 12px; }

/* ---------- prize claim wizard ---------- */
.wizard-backdrop {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: repeating-linear-gradient(-45deg, rgba(255, 215, 0, .45) 0 14px, rgba(120, 0, 0, .55) 14px 28px);
}
.wizard {
  width: min(540px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 4px 14px 16px;
  color: #000;
  background: #ece9d8;
  border: 7px outset #fff;
  box-shadow: 0 0 40px var(--gold), 16px 16px 0 #ff00ff;
  font-family: "Comic Sans MS", Impact, fantasy;
  transform: rotate(-1deg);
}
.wizard > .xpbar { margin: -4px -14px 8px; }
.wizard h3 { margin: 4px 0; color: #d00; font: clamp(22px, 5vw, 34px) Bungee, Impact, fantasy; text-shadow: 2px 2px #ff0; }
.wizard p { margin: 6px 0; font-size: 18px; }
.wiz-msg { min-height: 1.3em; color: #600; font-weight: bold; }

.captcha { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-width: 300px; margin: 8px 0; }
.wizard .captcha-tile {
  all: unset;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  font-size: 44px;
  background: #fff;
  border: 3px solid #999;
  cursor: pointer;
}
.wizard .captcha-tile[aria-pressed="true"] { background: #e8f0fe; border-color: #1a73e8; box-shadow: inset 0 0 0 4px #1a73e8; }
.wizard .captcha-tile:focus-visible { outline: 3px dashed #d00; }

.card-fan { display: flex; justify-content: center; min-height: 170px; padding: 34px 0 14px; }
.wizard .fan-card {
  all: unset;
  display: grid;
  place-items: center;
  width: 72px;
  height: 104px;
  margin: 0 -14px;
  background: repeating-linear-gradient(45deg, #900 0 6px, #fff 6px 9px);
  border: 3px solid #fff;
  border-radius: 8px;
  box-shadow: 3px 3px 0 #000;
  font-size: 0;
  transform: rotate(var(--fan));
  transform-origin: 50% 130%;
  transition: transform .3s, opacity .4s;
  cursor: pointer;
}
.wizard .fan-card:hover, .wizard .fan-card:focus-visible { transform: rotate(var(--fan)) translateY(-14px); }
.card-fan.picked .fan-card { opacity: 0; transform: rotate(var(--fan)) translateY(60px); pointer-events: none; }
.card-fan.picked .fan-card.chosen { position: relative; z-index: 2; opacity: 1; color: #000; background: #fff; font: 30px Georgia, serif; transform: scale(1.15); }
.card-fan .fan-card.chosen.red { color: #d00; }

.progress { position: relative; height: 34px; margin: 12px 0; overflow: hidden; background: #fff; border: 3px inset #999; }
.progress-fill { width: 0; height: 100%; background: repeating-linear-gradient(90deg, #2fbf2f 0 14px, #1e8f1e 14px 18px); }
.progress span { position: absolute; inset: 0; display: grid; place-items: center; font: bold 16px Tahoma, sans-serif; }

/* ---------- runaway CASH OUT ---------- */
.cash-out {
  position: fixed;
  z-index: 132;
  top: 32vh;
  right: 24px;
  margin: 0;
  white-space: nowrap;
  font-size: 22px;
  color: #063d1a;
  background: linear-gradient(180deg, #fff6a0, var(--gold) 45%, var(--gold-dark));
  border-color: #fff;
  box-shadow: 0 0 22px var(--gold), 6px 6px 0 #000;
  transition: left .18s ease-out, top .18s ease-out;
}
.cash-out.tired { color: #fff; background: linear-gradient(180deg, #bbb, #666); animation: none; }

/* ---------- achievement toasts ---------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: 84px;
  z-index: 205;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(390px, 92vw);
  translate: -50% 0;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  color: #fff;
  background: linear-gradient(90deg, #111, #2e2e2e);
  border: 3px solid var(--gold);
  border-radius: 40px;
  box-shadow: 0 0 18px var(--gold);
  font: 14px Tahoma, sans-serif;
  animation: toastIn .35s ease-out, toastOut .4s ease-in 3.6s forwards;
}
.toast .trophy { font-size: 30px; }
.toast b { display: block; color: var(--gold); font: 11px Bungee, Impact, fantasy; letter-spacing: 1px; }
.toast strong { color: #fff; }

/* ---------- animations ---------- */
@keyframes toastIn { from { opacity: 0; transform: translateY(40px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(20px); } }
@keyframes glowPulse { from { opacity: .55; } to { opacity: 1; } }
@keyframes bulbChase { from { background-position: 0 0; } to { background-position: 22px 22px; } }
@keyframes coinFall { to { transform: translateY(115vh) rotate(720deg); } }
@keyframes reelShake { from { translate: 0 -4px; } to { translate: 0 4px; } }

/* ---------- phones ---------- */
@media (max-width: 940px) {
  .casino-box, .roulette { margin: 20px 0; border-width: 8px; border-radius: 16px; box-shadow: 0 0 0 4px #600, 0 0 24px var(--gold); }
  .slot-lever { height: 100px; margin-top: 30px; }
  .players-card { width: 100%; transform: rotate(2deg); }
  .dealer-box { display: none; }
  .sound-toggle { bottom: 64px; }
  .casino-box .spin-btn { min-width: 0; }
}

/* Calm version for people who turn off motion in their OS settings */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .coin-rain { display: none; }
}
