/* ─── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:        #f5f0e8;
  --border:    #1a1a2e;
  --accent:    #c9a961;
  --muted:     #7f8c8d;
  --card-bg:   #ede8dc;
  --slot-bg:   #2a1620;
  --slot-edge: #c9a961;
  --font-mono: 'Courier New', Courier, monospace;
}

body {
  background: var(--bg);
  font-family: var(--font-mono);
  color: var(--border);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
}

h1.game-title {
  font-size: 1.4rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--border);
  padding-bottom: 6px;
  margin-bottom: 20px;
}

/* ─── Utility ───────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ─── PHASE WRAPPER ─────────────────────────────────────────── */
.phase {
  width: 100vw;
  min-height: 100vh;
}

/* ════════════════════════════════════════════════════════════
   PHASE 1 — Design Your Casino
════════════════════════════════════════════════════════════ */
.phase-label {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

/* ── Bunny Counter ─────────────────────────────────────── */
.bunny-counter {
  display: inline-block;
  border: 1.5px solid var(--border);
  padding: 4px 14px;
  font-size: 0.85rem;
  margin-bottom: 14px;
  background: var(--card-bg);
}

/* ── Casino Floor ──────────────────────────────────────── */
#casinoFloor {
  position: relative;
  border: 3px solid var(--border);
  background-image: url('../assets/casino-floor-2.svg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 16px;
  display: grid;
  grid-template-columns: 160px 1fr 160px;
  grid-template-rows: auto 1fr;
  gap: 12px;
  min-height: 540px;
  box-shadow: inset 0 0 80px rgba(0,0,0,0.4);
}

/* ── Entrance labels (bottom only — left removed) ──────── */
.entrance-left {
  display: none;        /* ← LEFT ENTRANCE CLOSED */
}

.door-notch-left {
  display: none;        /* ← LEFT DOOR NOTCH CLOSED */
}

.entrance-bottom {
  position: absolute;
  bottom: -26px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: bold;
}

/* WIDER bottom door notch */
.door-notch {
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  height: 6px;
  background: var(--bg);
  border-left: 3px solid var(--border);
  border-right: 3px solid var(--border);
}

/* ── Zone labels ───────────────────────────────────────── */
.zone-label {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 4px;
  font-weight: bold;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

/* ── Top row ──────────────────────────────────────────── */
.top-row {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

/* Zone bank containers */
.slot-bank-top,
.slot-bank-left,
.slot-bank-right {
  position: relative;          /* needed for absolute unlock button */
  border: 1.5px solid rgba(201, 169, 97, 0.5);
  padding: 10px;
  background: rgba(20, 8, 14, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* Row 1 slots — CENTERED */
.slot-bank-top {
  display: flex;
  gap: 18px;
  flex: 1;
  justify-content: center;
  align-items: center;
}

/* The "1" zone label sits inline; let the slots center independently */
.slot-bank-top > .zone-label {
  position: absolute;
}

.slot-bank-left {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: start;
}

.slot-bank-right {
  grid-column: 3;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: start;
}

/* ── Bar area ─────────────────────────────────────────── */
.bar-area {
  border: 1.5px solid rgba(201, 169, 97, 0.5);
  padding: 10px;
  min-width: 120px;
  background: rgba(15, 26, 61, 0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  color: var(--accent);
  text-transform: uppercase;
  font-weight: bold;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

/* ── Center open floor area ───────────────────────────── */
.center-area {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 8px;
}

.zone-number {
  display: none;
}

/* ════════════════════════════════════════════════════════
   LOCKED ZONE OVERLAY
   Add `.locked` class to .slot-bank-left / .slot-bank-right
   to gray it out and show the unlock button.
════════════════════════════════════════════════════════ */
.slot-bank-left.locked,
.slot-bank-right.locked {
  background: rgba(20, 20, 25, 0.65);
  border-color: rgba(120, 120, 130, 0.5);
}

/* Desaturate the slot machines inside locked zones */
.slot-bank-left.locked .slotMachine,
.slot-bank-right.locked .slotMachine {
  filter: grayscale(100%) brightness(0.5);
  pointer-events: none;
  transition: filter 0.3s ease;
}

/* Dim the zone label number when locked */
.slot-bank-left.locked > .zone-label,
.slot-bank-right.locked > .zone-label {
  opacity: 0.4;
}

/* The unlock button — hidden by default */
.zone-unlock-btn {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5;
  font-family: var(--font-mono);
  color: #ffd97a;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: bold;
  padding: 0;
}

/* Show unlock button only when zone is locked */
.locked .zone-unlock-btn {
  display: flex;
}

/* The button's inner pill — what actually animates */
.zone-unlock-btn .pill {
  background: rgba(20, 8, 14, 0.9);
  border: 1.5px solid var(--accent);
  padding: 10px 18px;
  border-radius: 4px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  box-shadow: 0 0 0 0 rgba(201, 169, 97, 0.5);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0.85;
  animation: idleBreathe 2.4s ease-in-out infinite;
}

.zone-unlock-btn .pill .price {
  font-size: 1rem;
  color: #ffd97a;
  letter-spacing: 0.1em;
}

.zone-unlock-btn .pill .label {
  font-size: 0.55rem;
  color: rgba(255, 217, 122, 0.75);
  letter-spacing: 0.18em;
}

/* Hover: gold glow pulse + scale up */
.zone-unlock-btn:hover .pill {
  border-color: #ffd97a;
  background: rgba(60, 30, 20, 0.95);
  transform: scale(1.08);
  box-shadow: 0 0 18px rgba(255, 217, 122, 0.6),
              inset 0 0 10px rgba(255, 217, 122, 0.2);
  opacity: 1;
  animation: pulseGold 1.2s ease-in-out infinite;
}

.zone-unlock-btn:active .pill {
  transform: scale(0.96);
}

@keyframes pulseGold {
  0%, 100% {
    box-shadow: 0 0 18px rgba(255, 217, 122, 0.55),
                inset 0 0 10px rgba(255, 217, 122, 0.2);
  }
  50% {
    box-shadow: 0 0 28px rgba(255, 217, 122, 0.85),
                inset 0 0 14px rgba(255, 217, 122, 0.35);
  }
}

@keyframes idleBreathe {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 1; }
}

/* Zone 3 stays disabled until Zone 2 unlocks.
   Add `.zone3-disabled` to .slot-bank-right alongside `.locked`. */
.slot-bank-right.zone3-disabled .zone-unlock-btn {
  cursor: not-allowed;
  opacity: 0.5;
}

.slot-bank-right.zone3-disabled .zone-unlock-btn:hover .pill {
  transform: none;
  border-color: var(--accent);
  animation: none;
  box-shadow: none;
}

.slot-bank-right.zone3-disabled .zone-unlock-btn .pill .label::after {
  content: " (unlock 2 first)";
  display: block;
  font-size: 0.45rem;
  color: rgba(255, 217, 122, 0.5);
  margin-top: 2px;
}

/* ════════════════════════════════════════════════════════
   Slot Machine Component
════════════════════════════════════════════════════════ */
.slotMachine {
  position: relative;
  width: 64px;
  flex-shrink: 0;
}

.slotMachine.horizontal {
  width: 72px;
}

.slotVisual {
  width: 100%;
  aspect-ratio: 1 / 1.25;
  background: linear-gradient(180deg, #3d1828 0%, #1a0a14 100%);
  border: 1.5px solid var(--slot-edge);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  padding: 6px 4px;
  gap: 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.slotVisual::before,
.slotVisual::after { display: none; }

.reel-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 80%;
}

.reel {
  width: 100%;
  height: 14px;
  background: #ede8dc;
  border: 1px solid #6b1f2a;
}

.slotHitbox {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  cursor: pointer;
  outline: none;
}

.slotMachine:hover .slotVisual {
  border-color: #ffd97a;
  outline: 1.5px dashed #ffd97a;
  box-shadow: 0 0 12px rgba(255, 217, 122, 0.5);
}

/* ════════════════════════════════════════════════════════
   Machine Settings Menu (Modal)
════════════════════════════════════════════════════════ */
#machineMenu {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg);
  border: 2.5px solid var(--border);
  padding: 24px;
  width: 300px;
  z-index: 100;
  box-shadow: 6px 6px 0 var(--border);
}

#machineMenu h3 {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.menu-field {
  margin-bottom: 16px;
}

.menu-field label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.menu-field input[type="range"] {
  width: 100%;
  accent-color: #c0392b;
}

.menu-field .range-val {
  font-size: 0.75rem;
  text-align: right;
  display: block;
  color: var(--border);
}

#menuClose {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  background: var(--border);
  color: var(--bg);
  border: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
}

#menuClose:hover {
  background: #c0392b;
}

/* ════════════════════════════════════════════════════════
   PHASE 2 — Victim Mode
════════════════════════════════════════════════════════ */
#phase2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  border: 2.5px solid var(--border);
  background: var(--card-bg);
  padding: 40px 24px;
  gap: 20px;
  text-align: center;
}

#phase2 .hud {
  display: flex;
  gap: 40px;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
}

#phase2 .hud span {
  font-size: 1.4rem;
  font-weight: bold;
}

#playBtn {
  padding: 12px 48px;
  background: var(--border);
  color: var(--bg);
  border: none;
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  cursor: pointer;
}

#playBtn:hover {
  background: #c0392b;
}

#lastResult {
  min-height: 24px;
  font-size: 0.85rem;
  color: #c0392b;
  letter-spacing: 0.08em;
}

/* ════════════════════════════════════════════════════════
   PHASE 3 — End Screen
════════════════════════════════════════════════════════ */
#phase3 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  border: 2.5px solid var(--border);
  background: var(--card-bg);
  padding: 40px 24px;
  gap: 16px;
  text-align: center;
}

#phase3 h2 {
  font-size: 1.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

#phase3 .survive-label {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}



#surviveTime {
  font-size: 2rem;
  font-weight: bold;
  display: block;
  margin-top: 4px;
}

#endMessage {
  font-size: 0.9rem;
  max-width: 480px;
  line-height: 1.7;
  color: var(--muted);
}



/* Dim backdrop behind the settings modal */
#menuBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 90;            /* below #machineMenu (z-index: 100) */
}

/* Small "Editing: slot1" header inside the modal */
.menu-target {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.menu-target #menuTargetLabel {
  color: var(--border);
  font-weight: bold;
}

.slotVisual {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.slotVisual img {
  width: 100%;
  height: 100%;
  display: block;
}
.bar-area img {
  width: 100%;
  height: auto;
  max-height: 100%;
  display: block;
}

.center-area .fountain {
  width: 140px;
  height: 140px;
  margin: auto;
  display: block;
  opacity: 0.85;
}

.center-area {
  align-items: center;
  justify-content: center;
}


/* ── START MENU ────────────────────────────────────────── */
.start-menu {
  width: 100%;
  max-width: 860px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 480px;
  border: 3px solid var(--border);
  background: var(--card-bg);
  padding: 60px 24px;
}

.start-menu-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
  max-width: 320px;
}

.start-title {
  font-size: 1.2rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 20px;
  color: var(--border);
  border-bottom: 1.5px solid var(--border);
  padding-bottom: 8px;
  width: 100%;
  text-align: center;
}

/* Stacked rectangular buttons */
.menu-btn {
  width: 100%;
  padding: 16px 24px;
  background: var(--border);
  color: var(--bg);
  border: 2px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.15s ease;
}

.menu-btn:hover {
  background: var(--bg);
  color: var(--border);
  box-shadow: 4px 4px 0 var(--border);
  transform: translate(-2px, -2px);
}

.menu-btn:active {
  transform: translate(0, 0);
  box-shadow: none;
}

/* ── CHEAT / SETTINGS POPUP ─────────────────────────────── */
#cheatPopup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

#cheatPopup.hidden {
  display: none;
}

.cheat-popup-inner {
  background: var(--bg);
  border: 2.5px solid var(--border);
  box-shadow: 6px 6px 0 var(--border);
  padding: 28px;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
}

.cheat-popup-inner h3 {
  font-size: 0.95rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 22px;
  border-bottom: 1.5px solid var(--border);
  padding-bottom: 10px;
}

.cheat-field {
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 12px;
}

.cheat-field label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  grid-column: 1 / -1;
}

.cheat-field input[type="range"] {
  width: 100%;
  accent-color: #c0392b;
  grid-column: 1;
}

.cheat-field output {
  font-size: 0.8rem;
  font-weight: bold;
  color: var(--border);
  min-width: 48px;
  text-align: right;
  grid-column: 2;
  grid-row: 2;
}

.cheat-submit {
  margin-top: 18px;
}

.bunny {
  position: absolute;
  width: 32px;
  height: 32px;
  pointer-events: none;
  transition: transform 0.3s ease, left 0.4s ease, top 0.4s ease;
  /* JS sets left/top + transform: rotate() to face direction */
}

/* Tiny idle wiggle */
@keyframes bunnyHop {
  0%, 100% { transform: translateY(0) rotate(var(--dir, 0deg)); }
  50%      { transform: translateY(-2px) rotate(var(--dir, 0deg)); }
}

.bunny.walking {
  animation: bunnyHop 0.4s ease-in-out infinite;
}

.start-day-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;

  padding: 14px 28px;
  background: var(--border);
  color: var(--bg);
  border: 2px solid var(--border);

  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;

  cursor: pointer;
  transition: all 0.15s ease;
  z-index: 50;
}

.start-day-btn:hover {
  background: var(--bg);
  color: var(--border);
  box-shadow: 4px 4px 0 var(--border);
  transform: translate(-2px, -2px);
}

.start-day-btn:active {
  transform: translate(0, 0);
  box-shadow: none;
}



/* disabled state after click */
.start-day-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
/* ════════════════════════════════════════════════════════
   APPEND TO css/styles.css
   Styles for the new #machinePopup slot settings dialog
════════════════════════════════════════════════════════ */

#machinePopup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.machine-popup-inner {
  background: var(--bg);
  border: 2.5px solid var(--border);
  box-shadow: 6px 6px 0 var(--border);
  padding: 28px;
  width: 100%;
  max-width: 380px;
}

.machine-popup-inner h3 {
  font-size: 0.95rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 22px;
  border-bottom: 1.5px solid var(--border);
  padding-bottom: 10px;
}

.machine-popup-inner h3 #machineTargetLabel {
  color: #c0392b;
}

.machine-field {
  margin-bottom: 18px;
}

.machine-field label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.machine-field label span {
  color: var(--border);
  font-weight: bold;
}

.machine-field input[type="range"] {
  width: 100%;
  accent-color: #c0392b;
}

.machine-field select {
  width: 100%;
  padding: 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--border);
  cursor: pointer;
}

#machine_submit_btn {
  margin-top: 8px;
}

/* ════════════════════════════════════════════════════════
   APPEND TO css/styles.css
   Day-runner additions: HUD row, bunny layer, bunny anim
════════════════════════════════════════════════════════ */

/* HUD row above the casino floor */
.phase1-hud {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 14px;
}

.money-counter {
  display: inline-block;
  border: 1.5px solid var(--border);
  padding: 4px 14px;
  font-size: 0.85rem;
  background: var(--card-bg);
  font-weight: bold;
}

.money-counter span {
  color: #2d8a4f;
}

/* Bunny layer — covers casino floor, bunnies positioned absolutely inside */
#bunnyLayer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* Bunny element — JS sets left/top, CSS animates the movement */
.bunny {
  position: absolute;
  width: 32px;
  height: 32px;
  pointer-events: none;
  transition: left 1.5s cubic-bezier(0.4, 0, 0.2, 1),
              top 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 11;
}

/* Idle hop animation, applied via .walking class */
@keyframes bunnyHop {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}

.bunny.walking {
  animation: bunnyHop 0.45s ease-in-out infinite;
}

/* Start Day button disabled state styling */
.start-day-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
/* ════════════════════════════════════════════════════════════
   PHASE 2 — REVERSAL / VICTIM MODE
   Append these rules to css/styles.css
════════════════════════════════════════════════════════════ */

#phase2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    padding: 32px 24px 40px;
    min-height: 420px;
    border: 2.5px solid var(--border);
    background: var(--card-bg);
    width: 100%;
    max-width: 860px;
}

/* ── Info row (machine / balance / plays / stats) ── */
.p2-info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    width: 100%;
}

.p2-info-card {
    border: 1.5px solid var(--border);
    padding: 8px 18px;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 90px;
}

.p2-info-label {
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--muted);
}

.p2-info-val {
    font-size: 1.05rem;
    font-weight: bold;
    color: var(--border);
    letter-spacing: 0.05em;
}

/* ── Bet row ── */
.p2-bet-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 340px;
}

.p2-bet-label {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.p2-bet-controls {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid var(--border);
    overflow: hidden;
}

.p2-bet-adj {
    width: 44px;
    height: 44px;
    background: var(--border);
    color: var(--bg);
    border: none;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}

.p2-bet-adj:hover { background: #c0392b; }

.p2-bet-input {
    width: 120px;
    height: 44px;
    border: none;
    border-left: 1.5px solid var(--border);
    border-right: 1.5px solid var(--border);
    text-align: center;
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: bold;
    background: var(--bg);
    color: var(--border);
    outline: none;
}

/* ── Reel display ── */
.p2-reels {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.p2-reel {
    width: 80px;
    height: 80px;
    border: 2.5px solid var(--border);
    background: var(--slot-bg);
    color: #fff;
    font-size: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 14px rgba(0,0,0,0.5);
    transition: background 0.3s;
    position: relative;
    overflow: hidden;
}

/* Spinning state — shimmer flash */
@keyframes reelSpin {
    0%   { transform: translateY(0);   opacity: 1; }
    25%  { transform: translateY(-6px); opacity: 0.6; }
    50%  { transform: translateY(0);   opacity: 1; }
    75%  { transform: translateY(6px);  opacity: 0.6; }
    100% { transform: translateY(0);   opacity: 1; }
}

.p2-reel.spinning {
    animation: reelSpin 0.18s linear infinite;
    color: rgba(255,255,255,0.5);
}

/* Win highlight */
.p2-reel.reel-win {
    background: #1a4d2e;
    border-color: #2ecc71;
    box-shadow: 0 0 18px rgba(46, 204, 113, 0.6),
                inset 0 0 10px rgba(46, 204, 113, 0.2);
}

/* Lose highlight */
.p2-reel.reel-lose {
    background: #4d1a1a;
    border-color: #c0392b;
    box-shadow: 0 0 18px rgba(192, 57, 43, 0.5),
                inset 0 0 10px rgba(192, 57, 43, 0.2);
}

/* ── Result message ── */
.p2-result-msg {
    min-height: 28px;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    font-weight: bold;
    text-align: center;
}

.p2-win  { color: #27ae60; }
.p2-loss { color: #c0392b; }

/* ── Play button ── */
.p2-play-btn {
    min-width: 200px;
}


/* ════════════════════════════════════════════════════════════
   PHASE 3 — GAME OVER  (additions / overrides)
════════════════════════════════════════════════════════════ */

#phase3 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 420px;
    border: 2.5px solid var(--border);
    background: var(--card-bg);
    padding: 48px 24px;
    gap: 18px;
    text-align: center;
    width: 100%;
    max-width: 860px;
}

#phase3 h2 {
    font-size: 1.8rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
}

#phase3 .survive-label {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

#surviveTime {
    font-size: 2.4rem;
    font-weight: bold;
    display: block;
    margin-top: 4px;
    color: var(--border);
}

#endMessage {
    font-size: 0.95rem;
    max-width: 440px;
    line-height: 1.75;
    color: var(--muted);
    font-style: italic;
}

#returnHomeBtn {
    margin-top: 12px;
    min-width: 220px;
}

/* ════════════════════════════════════════════════════════════
   CASINO THEME OVERRIDES
   Append to the bottom of css/styles.css
════════════════════════════════════════════════════════════ */

/* ── Start Screen — dark velvet casino look ────────────────── */
.start-menu {
    background: linear-gradient(160deg, #0d0810 0%, #1a0a14 60%, #0d1020 100%);
    border-color: var(--accent);
    box-shadow: 0 0 60px rgba(201, 169, 97, 0.15), inset 0 0 80px rgba(0,0,0,0.6);
    position: relative;
    overflow: hidden;
}

/* Subtle felt texture via radial gradient */
.start-menu::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(201,169,97,0.07) 0%, transparent 70%);
    pointer-events: none;
}

.start-title {
    color: var(--accent);
    border-bottom-color: var(--accent);
    text-shadow: 0 0 20px rgba(201, 169, 97, 0.4);
    letter-spacing: 0.4em;
}

h1.game-title {
    color: var(--accent);
    text-shadow: 0 0 16px rgba(201, 169, 97, 0.35);
    border-bottom-color: var(--accent);
}

/* Start menu buttons — gold on dark */
.start-menu .menu-btn {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
    letter-spacing: 0.3em;
    box-shadow: 0 0 0 0 rgba(201,169,97,0.3);
    transition: all 0.2s ease;
}

.start-menu .menu-btn:hover {
    background: var(--accent);
    color: #0d0810;
    box-shadow: 0 0 24px rgba(201,169,97,0.55), 4px 4px 0 rgba(201,169,97,0.4);
    transform: translate(-2px, -2px);
}


/* ════════════════════════════════════════════════════════════
   PHASE 2 — REVERSAL  (slot-machine colour palette)
════════════════════════════════════════════════════════════ */

#phase2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    padding: 32px 24px 40px;
    min-height: 420px;
    width: 100%;
    max-width: 860px;

    /* Deep casino burgundy/midnight felt */
    background: linear-gradient(170deg, #0d0810 0%, #1c0a18 50%, #0a0d1a 100%);
    border: 2.5px solid var(--accent);
    box-shadow: 0 0 50px rgba(201,169,97,0.12), inset 0 0 60px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
}

#phase2::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(201,169,97,0.06) 0%, transparent 65%);
    pointer-events: none;
}

#phase2 .phase-label {
    color: var(--accent);
    text-shadow: 0 0 10px rgba(201,169,97,0.3);
}

/* ── Info cards ────────────────────────────────────────────── */
.p2-info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    width: 100%;
}

.p2-info-card {
    border: 1.5px solid rgba(201,169,97,0.5);
    padding: 8px 18px;
    background: rgba(20, 8, 14, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 90px;
}

.p2-info-label {
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(201,169,97,0.6);
}

.p2-info-val {
    font-size: 1.05rem;
    font-weight: bold;
    color: var(--accent);
    letter-spacing: 0.05em;
    text-shadow: 0 0 8px rgba(201,169,97,0.3);
}

/* ── Bet row ───────────────────────────────────────────────── */
.p2-bet-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 340px;
}

.p2-bet-label {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(201,169,97,0.7);
}

.p2-bet-controls {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--accent);
    overflow: hidden;
}

.p2-bet-adj {
    width: 44px;
    height: 44px;
    background: rgba(201,169,97,0.15);
    color: var(--accent);
    border: none;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}

.p2-bet-adj:hover {
    background: var(--accent);
    color: #0d0810;
}

.p2-bet-input {
    width: 120px;
    height: 44px;
    border: none;
    border-left: 1.5px solid var(--accent);
    border-right: 1.5px solid var(--accent);
    text-align: center;
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: bold;
    background: rgba(20,8,14,0.8);
    color: var(--accent);
    outline: none;
}

/* ── Reels ─────────────────────────────────────────────────── */
.p2-reels {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.p2-reel {
    width: 84px;
    height: 84px;
    border: 2.5px solid var(--slot-edge);
    background: #0a0510;
    color: #fff;
    font-size: 2.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.7),
                0 0 8px rgba(201,169,97,0.15);
    transition: background 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

@keyframes reelSpin {
    0%   { transform: translateY(0);    opacity: 1; }
    25%  { transform: translateY(-8px); opacity: 0.5; }
    50%  { transform: translateY(0);    opacity: 1; }
    75%  { transform: translateY(8px);  opacity: 0.5; }
    100% { transform: translateY(0);    opacity: 1; }
}

.p2-reel.spinning {
    animation: reelSpin 0.16s linear infinite;
    color: rgba(255,255,255,0.4);
}

.p2-reel.reel-win {
    background: #0d3320;
    border-color: #2ecc71;
    box-shadow: 0 0 24px rgba(46,204,113,0.7),
                inset 0 0 12px rgba(46,204,113,0.25);
}

.p2-reel.reel-lose {
    background: #2a0a0a;
    border-color: #c0392b;
    box-shadow: 0 0 24px rgba(192,57,43,0.6),
                inset 0 0 12px rgba(192,57,43,0.2);
}

/* ── Result message ────────────────────────────────────────── */
.p2-result-msg {
    min-height: 28px;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    font-weight: bold;
    text-align: center;
}

.p2-win  { color: #2ecc71; text-shadow: 0 0 10px rgba(46,204,113,0.5); }
.p2-loss { color: #e74c3c; text-shadow: 0 0 10px rgba(231,76,60,0.4); }

/* ── Pull Lever button ─────────────────────────────────────── */
.p2-play-btn {
    min-width: 200px;
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}

.p2-play-btn:hover {
    background: var(--accent);
    color: #0d0810;
    box-shadow: 0 0 20px rgba(201,169,97,0.5), 4px 4px 0 rgba(201,169,97,0.3);
}

.p2-play-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}


/* ════════════════════════════════════════════════════════════
   PHASE 3 — GAME OVER (casino theme)
════════════════════════════════════════════════════════════ */

#phase3 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 420px;
    width: 100%;
    max-width: 860px;
    background: linear-gradient(160deg, #0d0810 0%, #1a0a14 100%);
    border: 2.5px solid var(--accent);
    box-shadow: 0 0 50px rgba(201,169,97,0.1);
    padding: 48px 24px;
    gap: 18px;
    text-align: center;
}

#phase3 h2 {
    font-size: 1.8rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--accent);
    text-shadow: 0 0 20px rgba(201,169,97,0.4);
}

#phase3 .survive-label {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(201,169,97,0.55);
}

#surviveTime {
    font-size: 2.4rem;
    font-weight: bold;
    display: block;
    margin-top: 4px;
    color: var(--accent);
    text-shadow: 0 0 12px rgba(201,169,97,0.4);
}

#endMessage {
    font-size: 0.95rem;
    max-width: 440px;
    line-height: 1.75;
    color: rgba(201,169,97,0.65);
    font-style: italic;
}

#returnHomeBtn {
    margin-top: 12px;
    min-width: 220px;
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}

#returnHomeBtn:hover {
    background: var(--accent);
    color: #0d0810;
    box-shadow: 0 0 20px rgba(201,169,97,0.5), 4px 4px 0 rgba(201,169,97,0.3);
}


/* ════════════════════════════════════════════════════════════
   WHITE RABBIT TRANSITION OVERLAY
════════════════════════════════════════════════════════════ */

#rabbitOverlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    background: rgba(5, 2, 10, 0.92);
    backdrop-filter: blur(4px);

    opacity: 0;
    transition: opacity 0.6s ease;

    /* Vignette glow from bottom */
    box-shadow: inset 0 -180px 120px rgba(100, 60, 180, 0.15);
}

#rabbitOverlay.rabbit-visible {
    opacity: 1;
}

/* Dialogue text box — VN style, positioned well above the rabbit portrait */
.rabbit-dialogue-box {
    position: absolute;
    top: 12%;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 640px;
    background: rgba(10, 5, 20, 0.88);
    border: 1.5px solid rgba(201,169,97,0.6);
    box-shadow: 0 0 30px rgba(201,169,97,0.15),
                inset 0 0 20px rgba(0,0,0,0.5);
    padding: 24px 32px;
    text-align: center;
    z-index: 510;
}

.rabbit-message {
    font-family: var(--font-mono);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--accent);
    letter-spacing: 0.04em;
    text-shadow: 0 0 10px rgba(201,169,97,0.3);
    margin: 0;

    opacity: 1;
    transition: opacity 0.5s ease;
}

.rabbit-message.rabbit-msg-out {
    opacity: 0;
}

/* Portrait container — slides up from below like a VN character */
.rabbit-portrait-wrap {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 320px;
    max-width: 55vw;
    z-index: 505;

    transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);

    /* Subtle glow halo behind the image */
    filter: drop-shadow(0 -20px 40px rgba(160, 100, 255, 0.3))
            drop-shadow(0 0 60px rgba(201,169,97,0.15));
}

.rabbit-portrait-wrap.rabbit-portrait-in {
    transform: translateX(-50%) translateY(0%);
}

.rabbit-portrait-img {
    width: 100%;
    display: block;
    image-rendering: crisp-edges;
}