/* ── MAIN ── */
main {
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 20px 100px;
  text-align: center;
}

/* ── SIDE-BY-SIDE LAYOUT ── */
.game-layout {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  column-gap: 24px;
}

/* pay table goes in the left column, pushed to the right (near the machine) */
.pay-table {
  grid-column: 1;
  justify-self: end;
}

/* machine + result go in the center column */
.game-col {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

@media (max-width: 640px) {
  .game-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #888;
  text-decoration: none;
  margin-bottom: 32px;
  transition: color 0.15s;
}
.back-link:hover { color: #1a1a1a; }

.game-title {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -1.5px;
  margin-bottom: 10px;
}
.game-subtitle {
  font-size: 1.05rem;
  color: #777;
  margin-bottom: 32px;
  font-weight: 600;
}

/* ── VOLUME DISPLAY ── */
.vol-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin-bottom: 10px;
}
.vol-number {
  font-size: 7rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -4px;
  transition: color 0.4s ease;
}
.vol-pct {
  font-size: 2.8rem;
  font-weight: 800;
  color: #aaa;
}
.vol-bar-wrap {
  width: 100%;
  height: 14px;
  background: #eee;
  border-radius: 99px;
  border: 2.5px solid #1a1a1a;
  overflow: hidden;
  margin-bottom: 10px;
}
.vol-bar {
  height: 100%;
  background: #1a1a1a;
  border-radius: 99px;
  transition: width 0.5s cubic-bezier(.4,0,.2,1);
}
.vol-info {
  font-size: 0.9rem;
  color: #999;
  font-weight: 700;
  margin-bottom: 28px;
  min-height: 1.4em;
}

/* ── SLOT MACHINE ── */
.machine {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  background: #dbeafe;
  border: 3px solid #1a1a1a;
  border-radius: 24px;
  box-shadow: 6px 6px 0 #1a1a1a;
  padding: 20px 28px 26px;
  margin-bottom: 10px;
}

.machine-label {
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #1e40af;
}

/* ── REELS ── */
.reels-frame {
  position: relative;
}

.reels-wrap {
  display: flex;
  background: #1a1a1a;
  border-radius: 14px;
  padding: 4px;
  gap: 4px;
}

.reel-window {
  width: 90px;
  height: 264px; /* 3 × 88px */
  overflow: hidden;
  background: #fafafa;
  border-radius: 8px;
  position: relative;
}

/* Fade top and bottom thirds to focus the eye on the center */
.reel-window::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(250,250,250,0.88) 0%,
    rgba(250,250,250,0) 30%,
    rgba(250,250,250,0) 70%,
    rgba(250,250,250,0.88) 100%
  );
  pointer-events: none;
  z-index: 5;
}

.reel-strip {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  will-change: transform;
}

.reel-cell {
  width: 90px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 46px;
  line-height: 1;
  user-select: none;
}

.reel-cell[data-sym="7"] {
  font-size: 58px;
  font-weight: 900;
  font-family: 'Nunito', sans-serif;
  color: #dc2626;
  letter-spacing: -2px;
}

/* Payline: golden highlight on center row */
.payline {
  position: absolute;
  left: 4px;
  right: 4px;
  top: 92px; /* 4px padding + 88px first cell */
  height: 88px;
  border: 3px solid #fbbf24;
  border-radius: 8px;
  pointer-events: none;
  z-index: 10;
  transition: box-shadow 0.3s ease;
}

.machine.spinning .payline {
  animation: payline-pulse 0.45s ease-in-out infinite alternate;
}

@keyframes payline-pulse {
  from { box-shadow: 0 0 6px rgba(251,191,36,0.4); }
  to   { box-shadow: 0 0 18px rgba(251,191,36,0.9); }
}

.machine.jackpot .payline {
  border-color: #dc2626;
  animation: jackpot-glow 0.3s ease-in-out infinite alternate;
}

@keyframes jackpot-glow {
  from { box-shadow: 0 0 12px rgba(220,38,38,0.5); }
  to   { box-shadow: 0 0 32px rgba(220,38,38,1); }
}

@keyframes machine-shake {
  0%,100% { transform: translateX(0) rotate(0deg); }
  20%     { transform: translateX(-5px) rotate(-1deg); }
  40%     { transform: translateX(5px) rotate(1deg); }
  60%     { transform: translateX(-4px) rotate(-0.6deg); }
  80%     { transform: translateX(4px) rotate(0.6deg); }
}
.machine.jackpot {
  animation: machine-shake 0.5s ease-in-out 2;
}

/* ── RESULT ── */
.result-msg {
  margin-top: 4px;
  margin-bottom: 22px;
  font-size: 1.6rem;
  font-weight: 900;
  min-height: 2.4rem;
  letter-spacing: -0.5px;
}
.result-msg.pos  { color: #16a34a; }
.result-msg.mid  { color: #d97706; }
.result-msg.neg  { color: #dc2626; }
.result-msg.jackpot { color: #dc2626; font-size: 2rem; }

/* ── PAY TABLE ── */
.pay-table {
  border-collapse: collapse;
  background: #f5f5f5;
  border: 3px solid #1a1a1a;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 4px 4px 0 #1a1a1a;
  font-size: 0.88rem;
  font-weight: 700;
}
.pay-table td {
  padding: 7px 20px;
  text-align: left;
  border-bottom: 1.5px solid #e5e7eb;
  color: #444;
}
.pay-table tr:last-child td { border-bottom: none; }
.pay-table .pv {
  text-align: right;
  font-weight: 900;
  color: #1a1a1a;
}
.pay-table .row-jackpot td {
  color: #dc2626;
  font-weight: 900;
}
