:root {
  --bg-deep: #241317;
  --bg-mahogany: #3b1c22;
  --bg-cream: #fff6ea;
  --rose-pink: #f06d8c;
  --rose-deep: #c93d65;
  --gold-light: #ffe799;
  --gold-main: #f4b942;
  --gold-dark: #a66914;
  --mint-accent: #57c5a6;
  --text-light: #fff7ee;
  --text-muted: #e5c9c0;
  --frame-border: rgba(255, 224, 152, 0.55);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 18%, #592634 0%, #2b1219 55%, #16090d 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--text-light);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-shell {
  width: 100%;
  max-width: 430px;
  height: 100dvh;
  max-height: 880px;
  background: linear-gradient(180deg, #4b202b 0%, #34151e 48%, #251016 100%);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 217, 145, 0.2);
}

@media (min-width: 500px) {
  .game-shell {
    border-radius: 26px;
    height: min(94dvh, 844px);
    width: 390px;
  }
}

.game-shell.fs-mode {
  background: linear-gradient(180deg, #622238 0%, #3c1428 45%, #230b19 100%);
  box-shadow: 0 20px 65px rgba(255, 165, 60, 0.3), 0 0 0 2px rgba(255, 214, 102, 0.65);
}

/* Parisian Patisserie Awning Header */
.awning-header {
  flex-shrink: 0;
  position: relative;
}

.awning-stripes {
  height: 12px;
  background: repeating-linear-gradient(
    90deg,
    #f26d8a 0px,
    #f26d8a 24px,
    #fff4e4 24px,
    #fff4e4 48px
  );
  border-bottom: 2px solid #d4943a;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px 4px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-badge {
  background: linear-gradient(135deg, var(--gold-light), var(--gold-main));
  color: #461d0f;
  font-weight: 900;
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 7px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.brand-titles h1 {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.6px;
  background: linear-gradient(180deg, #fff6d1 0%, #f5b942 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.brand-sub {
  display: block;
  font-size: 9px;
  letter-spacing: 0.9px;
  color: var(--text-muted);
  font-weight: 600;
}

.header-actions {
  display: flex;
  gap: 6px;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--frame-border);
  background: rgba(255, 240, 220, 0.12);
  color: var(--gold-light);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.12s, background 0.15s;
}

.icon-btn:active {
  transform: scale(0.92);
}

.icon-btn.muted {
  opacity: 0.45;
}

/* Feature Strip */
.feature-strip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 12px 6px;
}

.mult-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #5e2234, #3b1320);
  border: 1.5px solid var(--gold-main);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 3px 10px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.mult-badge.pop {
  transform: scale(1.14);
  box-shadow: 0 0 18px rgba(255, 209, 92, 0.85);
}

.mult-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.7px;
  color: #f6c9a8;
}

.mult-val {
  font-size: 17px;
  font-weight: 900;
  color: #ffe37d;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.fs-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #d93f73, #8f1d45);
  border: 1.5px solid #ffd88a;
  animation: pulseGlow 1.5s infinite ease-in-out;
}

.fs-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.fs-val {
  font-size: 15px;
  font-weight: 900;
  color: #fff3b0;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 196, 92, 0.45); }
  50% { box-shadow: 0 0 18px rgba(255, 196, 92, 0.9); }
}

.buy-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border-radius: 12px;
  border: 1.5px solid #ffe49c;
  background: linear-gradient(180deg, #f77896 0%, #c6365e 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(198, 54, 94, 0.45);
  transition: transform 0.12s, filter 0.15s;
}

.buy-btn:active {
  transform: scale(0.95);
}

.buy-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.buy-title {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.6px;
}

.buy-cost {
  font-size: 12px;
  font-weight: 900;
  color: #fff0a8;
}

/* Main Stage */
.stage-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px 10px 4px;
}

.patisserie-frame {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #2b111a 0%, #1d0b11 100%);
  border: 2.5px solid #e7b357;
  box-shadow:
    inset 0 0 24px rgba(0, 0, 0, 0.75),
    0 8px 24px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.bottom-reel-caption {
  margin-top: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.45px;
  color: #f3d2b5;
  text-align: center;
  opacity: 0.9;
}

.bottom-reel-caption strong {
  color: #ffe27a;
}

/* Banner Overlay */
.banner-overlay {
  position: absolute;
  inset: 0;
  background: rgba(24, 7, 13, 0.62);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
  animation: fadeIn 0.2s ease-out;
}

.banner-card {
  text-align: center;
  padding: 18px 26px;
  border-radius: 20px;
  background: linear-gradient(180deg, #74223d 0%, #3c1122 100%);
  border: 2.5px solid #ffd975;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.65), 0 0 30px rgba(255, 200, 82, 0.45);
  transform: scale(1);
  animation: popIn 0.28s cubic-bezier(0.2, 1.3, 0.4, 1);
}

.banner-title {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #ffe891;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.banner-amount {
  font-size: 32px;
  font-weight: 900;
  color: #ffffff;
  margin: 4px 0;
  text-shadow: 0 3px 12px rgba(255, 190, 60, 0.75);
}

.banner-sub {
  font-size: 12px;
  font-weight: 700;
  color: #ffccd9;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.75); }
  to { opacity: 1; transform: scale(1); }
}

/* Toast */
.toast {
  position: absolute;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(190, 35, 68, 0.95);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid #ffd49e;
  z-index: 40;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

/* Control Deck */
.control-deck {
  flex-shrink: 0;
  padding: 6px 10px 10px;
  background: linear-gradient(180deg, rgba(44, 17, 25, 0.92), rgba(26, 9, 14, 0.98));
  border-top: 1.5px solid rgba(244, 185, 66, 0.35);
}

.metrics-row {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1.05fr;
  gap: 6px;
  margin-bottom: 8px;
}

.metric-card {
  background: rgba(255, 240, 224, 0.08);
  border: 1px solid rgba(255, 215, 145, 0.25);
  border-radius: 11px;
  padding: 4px 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.win-card {
  background: rgba(244, 185, 66, 0.12);
  border-color: rgba(255, 216, 110, 0.45);
}

.metric-label {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.7px;
  color: #dfbfb5;
}

.metric-value {
  font-size: 13.5px;
  font-weight: 900;
  color: #fff8ed;
  font-variant-numeric: tabular-nums;
}

.win-glow {
  color: #ffe27a;
}

.bet-stepper {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 1px;
}

.step-btn {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: 1px solid var(--gold-main);
  background: rgba(244, 185, 66, 0.22);
  color: var(--gold-light);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.step-btn:active {
  transform: scale(0.9);
}

.step-btn:disabled {
  opacity: 0.35;
}

/* Action Row */
.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  position: relative;
}

.side-btn {
  width: 76px;
  height: 48px;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 218, 150, 0.4);
  background: linear-gradient(180deg, rgba(105, 42, 60, 0.9), rgba(62, 22, 34, 0.95));
  color: #ffeed9;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: transform 0.12s, border-color 0.15s, background 0.15s;
}

.side-btn:active {
  transform: scale(0.95);
}

.side-btn.active {
  background: linear-gradient(180deg, #f4b942, #c47e17);
  border-color: #fff3b8;
  color: #2f1206;
}

.side-btn.stop-active {
  background: linear-gradient(180deg, #f2556b, #b31e38);
  border-color: #ffd1d9;
  color: #fff;
}

.side-icon {
  font-size: 15px;
  line-height: 1;
}

.side-text {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.6px;
}

.spin-btn {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 3px solid #fff0b3;
  background: radial-gradient(circle at 35% 30%, #ffdf7a 0%, #f09a26 58%, #b85312 100%);
  color: #3a1207;
  cursor: pointer;
  position: relative;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 22px rgba(244, 154, 38, 0.55), inset 0 2px 6px rgba(255, 255, 255, 0.55);
  transition: transform 0.12s, filter 0.15s;
}

.spin-btn:active {
  transform: scale(0.93);
}

.spin-btn:disabled {
  filter: grayscale(0.35) brightness(0.8);
  cursor: not-allowed;
}

.spin-btn.spinning .spin-ring {
  animation: spinRing 0.9s linear infinite;
}

.spin-ring {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 2.5px dashed rgba(255, 250, 225, 0.75);
  pointer-events: none;
}

@keyframes spinRing {
  to { transform: rotate(360deg); }
}

.spin-label {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.8px;
}

.auto-wrap {
  position: relative;
}

.auto-menu {
  position: absolute;
  bottom: 56px;
  right: 0;
  background: #35141f;
  border: 1.5px solid var(--gold-main);
  border-radius: 12px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 108px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.65);
  z-index: 30;
}

.auto-opt {
  background: rgba(255, 240, 220, 0.1);
  border: 1px solid rgba(255, 214, 130, 0.25);
  color: #fff6e8;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.auto-opt:hover {
  background: rgba(244, 185, 66, 0.35);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 5, 9, 0.76);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}

.modal-sheet {
  width: 100%;
  max-width: 370px;
  max-height: 84dvh;
  background: linear-gradient(180deg, #4b1d2b, #280f17);
  border: 2px solid var(--gold-main);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.7);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 214, 130, 0.3);
}

.modal-head h2 {
  font-size: 15px;
  font-weight: 900;
  color: var(--gold-light);
}

.close-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--frame-border);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
}

.modal-body {
  padding: 12px 14px 16px;
  overflow-y: auto;
}

.rules-box {
  background: rgba(255, 245, 232, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 11.5px;
  line-height: 1.45;
  color: #f5dcd2;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rules-box strong {
  color: #ffe38f;
}

.paytable-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pay-card {
  background: rgba(255, 240, 224, 0.07);
  border: 1px solid rgba(255, 215, 140, 0.25);
  border-radius: 11px;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pay-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 9px;
  background: rgba(255, 245, 235, 0.12);
}

.pay-info {
  flex: 1;
  min-width: 0;
}

.pay-name {
  font-size: 11px;
  font-weight: 800;
  color: #ffe49c;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pay-vals {
  font-size: 10px;
  color: #f2d5ca;
  line-height: 1.3;
}

/* Buy Modal */
.buy-desc {
  font-size: 13px;
  line-height: 1.45;
  color: #f8dfd6;
  margin-bottom: 12px;
}

.buy-price-box {
  background: rgba(244, 185, 66, 0.15);
  border: 1.5px solid var(--gold-main);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.buy-price-box span {
  font-size: 12px;
  color: #f4d3be;
}

.buy-price-box strong {
  font-size: 20px;
  color: #ffe482;
}

.buy-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 8px;
}

.btn-secondary, .btn-primary {
  padding: 10px 12px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
}

.btn-primary {
  background: linear-gradient(180deg, #ffdd77, #e5901d);
  border: 1.5px solid #fff4c2;
  color: #361206;
}

.hidden {
  display: none !important;
}
