.font-oswald {
      font-family: 'Oswald', sans-serif
    }

    :root {
     --frame-top: 14.6%;
      --frame-width:68%;
      --frame-height: 73.6%;
      --slot-scale: .92;
      --symbol-scale: 0.90;
      --slot-shift-x: .3%;
      --slot-shift-y: 0%;
      --win-inset: 10px;
        --frame-left: 15.6%;
    }
 
    
    /* ================== WIN BORDER (no rotation) ================== */
    .cell {
      box-sizing: border-box;
      overflow: visible
    }
#your-toggle-container {
  position: relative; /* Or absolute */
  z-index: 10;
}
    .cell.win-border {
      position: relative;
      border-radius: 10px;
      isolation: isolate;
      
      
    }

    .cell .img {
      position: relative;
      z-index: -1;

      display: block;
      margin: auto
    }

    .cell.win-border::before {
      content: "";
      position: absolute;
      inset: 1px;
      border-radius: inherit;
      pointer-events: none;
      z-index: 4;
      outline: 3px solid rgba(255, 229, 90, .95);
      box-shadow: 0 0 0 2px rgba(230, 168, 1, .35), 0 0 14px 6px rgba(217, 255, 0, .35), 0 0 36px 10px rgba(244, 255, 88, .3);
    }

    .cell.win-border::after {
      content: "";
      position: absolute;
      inset: 0;
      border-radius: inherit;
      pointer-events: none;
      z-index: 5;
      box-shadow: 0 0 0 2px rgba(229, 255, 0, .45), 0 0 14px 6px rgba(241, 199, 10, .35), 0 0 36px 10px rgba(255, 215, 80, .25);
      animation: win-pulse 1.05s ease-in-out infinite;
    }

    @keyframes win-pulse {

      0%,
      100% {
        opacity: .9
      }

      50% {
        opacity: 1
      }
    }

    .win-pop {
      animation: win-pop 320ms cubic-bezier(.22, 1.2, .35, 1) 1
    }

    @keyframes win-pop {
      0% {
        transform: scale(1)
      }

      35% {
        transform: scale(1.14)
      }

      70% {
        transform: scale(.96)
      }

      100% {
        transform: scale(1)
      }
    }

    .win-boom {
      animation: win-boom 1200ms cubic-bezier(.2, .9, .25, 1) 1 forwards
    }

    @keyframes win-boom {
      0% {
        transform: scale(1);
        opacity: 1;
        filter: brightness(1)
      }

      60% {
        transform: scale(1.22);
        opacity: 1;
        filter: brightness(1.08)
      }

      82% {
        transform: scale(1.12);
        opacity: 1
      }

      100% {
        transform: scale(.94);
        opacity: 0;
        filter: brightness(1)
      }
    }

    .boom-bg {
      position: absolute;
      left: 50%;
      top: 50%;
      width: 140%;
      height: 140%;
      transform: translate(-50%, -50%) scale(.45);
      opacity: 0;
      background-repeat: no-repeat;
      background-position: center;
      background-size: contain;
      pointer-events: none;
      z-index: 2;
      animation: boomBg 900ms cubic-bezier(.2, .9, .35, 1) 1 forwards;
    }

    @keyframes boomBg {
      0% {
        transform: translate(-50%, -50%) scale(.45);
        opacity: 0
      }

      18% {
        opacity: .95
      }

      60% {
        transform: translate(-50%, -50%) scale(1.15);
        opacity: 1
      }

      100% {
        transform: translate(-50%, -50%) scale(1.65);
        opacity: 0
      }
    }

    .bg-flare {
      position: absolute;
      inset: 8% 8%;
      border-radius: 12px;
      z-index: 1;
      pointer-events: none;
      
      opacity: 0;
      transform: scale(.75);
      animation: bgFlare 620ms cubic-bezier(.20, .90, .35, 1) 1 forwards;
    }

    @keyframes bgFlare {
      0% {
        opacity: 0;
        transform: scale(.75)
      }

      24% {
        opacity: 1;
        transform: scale(1.05)
      }

      62% {
        opacity: .9;
        transform: scale(1.18)
      }

      100% {
        opacity: 0;
        transform: scale(1.45)
      }
    }

    .spark {
      position: absolute;
      width: 7px;
      height: 7px;
      border-radius: 50%;
     
      pointer-events: none;
      z-index: 6;
    }

    .win-wave {
      position: absolute;
      left: 50%;
      top: 50%;
      width: 10px;
      height: 10px;
      border: 2px solid rgba(255, 240, 150, .9);
      border-radius: 999px;
      transform: translate(-50%, -50%) scale(.2);
      pointer-events: none;
      z-index: 6;
      animation: win-wave 420ms ease-out forwards;
    }

    @keyframes win-wave {
      to {
        transform: translate(-50%, -50%) scale(2.4);
        opacity: 0;
        border-width: 0
      }
    }

    @keyframes shake-hard {
      0% {
        transform: translate3d(0, 0, 0)
      }

      20% {
        transform: translate3d(2px, 0, 0)
      }

      40% {
        transform: translate3d(-3px, 0, 0)
      }

      60% {
        transform: translate3d(2px, 0, 0)
      }

      80% {
        transform: translate3d(-1px, 0, 0)
      }

      100% {
        transform: translate3d(0, 0, 0)
      }
    }

    .shake-hard {
      animation: shake-hard 180ms ease-in-out
    }

    .dust {
      position: absolute;
      bottom: 6px;
      left: 50%;
      width: 8px;
      height: 8px;
      transform: translateX(-50%) scale(.6);
      border-radius: 50%;
      pointer-events: none;
      z-index: 7;
      background: radial-gradient(circle, #fff7c2, #ffd268 55%, rgba(255, 210, 104, 0) 65%);
      filter: blur(.2px) drop-shadow(0 0 6px rgba(255, 220, 120, .8));
      opacity: .95;
    }

    @keyframes dustUp {
      to {
        transform: translateX(-50%) scale(2.6, 1.1);
        opacity: 0
      }
    }

    /* NEW: Win Flash Effect */
    @keyframes win-flash {
      from {
        transform: scale(1);
        opacity: .8;
        background: radial-gradient(ellipse at center, rgba(255, 255, 200, .9) 0%, rgba(255, 240, 150, .4) 40%, rgba(255, 214, 64, 0) 70%)
      }

      to {
        transform: scale(1.6);
        opacity: 0;
        background: radial-gradient(ellipse at center, rgba(255, 255, 200, 0) 0%, rgba(255, 240, 150, 0) 40%, rgba(255, 214, 64, 0) 70%)
      }
    }

    .win-flash-effect {
      position: absolute;
      inset: 0;
      z-index: 2;
      pointer-events: none;
      border-radius: 10px;
      animation: win-flash 300ms ease-out forwards
    }

    @media (max-width:767px) {
      :root {
        --frame-left: 14%;
        --frame-top: 33%;
        --frame-width: 65%;
        --frame-height: 68.2%;
        --slot-scale: .92;
        --symbol-scale: .88;
        --slot-shift-x: .2%;
        --slot-shift-y: 0%;
      }
    }

    .center-stage {
      position: absolute;
      inset: 0;
      display: grid;
      place-items: center;
      z-index: 30
    }

    .board-wrap {
      position: relative;
      width: min(100vw, calc(100vh*(16/9)));
      height: min(100vh, calc(100vw*(9/16)));
      aspect-ratio: 16/9
    }

    .board-img {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 86%;
      object-fit: contain;
      pointer-events: none;
      user-select: none;
      top: 30px;
      
    }

    .slot-box {
      position: absolute;
      overflow: hidden;
      z-index: 40;
      left: calc(var(--frame-left) + (var(--frame-width) - (var(--frame-width)*var(--slot-scale)))/2 + var(--slot-shift-x));
      top: calc(var(--frame-top) + (var(--frame-height) - (var(--frame-height)*var(--slot-scale)))/2 + var(--slot-shift-y));
      width: calc(var(--frame-width)*var(--slot-scale));
      height: calc(var(--frame-height)*var(--slot-scale));
    }
@media (max-width: 767px) {
  /* mobile layout frame */
  .m-board-wrap{
    position: relative;
    width: 100vw;             /* full width */
    max-width: 100vw;
    aspect-ratio: 16 / 11.6;
    height: auto;
    margin: 0 auto;
    /* remove offsets & scaling to avoid overflow */
    left: -14px;
    transform: none;
    transform-origin: center;
  }
  /* background image inside the board */
  .board-img{
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* tune geometry variables for mobile */
  :root{
    --frame-left: 2.7%;
    --frame-top: 13%;
    --frame-width: 95%;
    --frame-height: 84%;
    --slot-scale: 1;
    --symbol-scale: 1;
    --slot-shift-x: 0%;
    --slot-shift-y: 0%;

    /* gaps (smaller for mobile) */
    --slot-gap: 1px;      /* gap BETWEEN reels/columns */
    --symbol-gap: 5px;     /* gap BETWEEN symbols in a reel */
  }

  /* reel area */
  .m-slot-box{
    justify-content: center;
   
    position: absolute;
    display: flex;
    gap: var(--slot-gap);
    overflow: hidden;
    z-index: 40; /* keep above bg */
    left: calc(var(--frame-left) + (var(--frame-width) - (var(--frame-width)*var(--slot-scale)))/2 + var(--slot-shift-x));
    top:  calc(var(--frame-top)  + (var(--frame-height) - (var(--frame-height)*var(--slot-scale)))/2 + var(--slot-shift-y));
    width:  calc(var(--frame-width)*var(--slot-scale));
    height: calc(var(--frame-height)*var(--slot-scale));
  }

  /* apply vertical gap between symbols */
  .m-slot-box .reel-col{
    display: flex;
    flex-direction: column;
    gap: var(--symbol-gap);
  }
}


    /* toast */
    @keyframes toast-pop {
      from {
        transform: scale(.92)
      }

      to {
        transform: scale(1)
      }
    }

    .win-chip.pop {
      animation: toast-pop .5s ease-out 1
    }

    /* shine sweep */
    .shine-sweep {
      position: absolute;
      inset: 0;
      pointer-events: none;
      z-index: 6;
      background: linear-gradient(100deg, rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, .7) 50%, rgba(255, 255, 255, 0) 65%);
      transform: skewX(-20deg) translateX(-160%);
      mix-blend-mode: screen;
      opacity: .9;
      animation: shine-sweep 650ms ease-out forwards;
    }

    @keyframes shine-sweep {
      to {
        transform: skewX(-20deg) translateX(160%);
        opacity: 0
      }
    }

    /* === Scatter (4+ landed) flash === */
    .scatter-aura {
      position: absolute;
      inset: -8px;
      border-radius: 12px;
      pointer-events: none;
     
      animation: scatterPulse 900ms ease-in-out infinite;
      z-index: 3;
    }

    .scatter-shine {
      position: absolute;
      inset: 0;
      pointer-events: none;
      border-radius: 12px;
      background: linear-gradient(100deg, rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, .75) 50%, rgba(255, 255, 255, 0) 65%);
      mix-blend-mode: screen;
      opacity: .85;
      transform: skewX(-18deg) translateX(-160%);
      animation: scatterShine 750ms ease-out infinite;
      z-index: 4;
    }

    @keyframes scatterPulse {

      0%,
      100% {
        transform: scale(1);
        opacity: .95
      }

      50% {
        transform: scale(1.06);
        opacity: 1
      }
    }

    @keyframes scatterShine {
      to {
        transform: skewX(-18deg) translateX(160%);
        opacity: 0
      }
    }

    .sky-border-effect {
      position: absolute;
      inset: -2px;
      border-radius: 12px;
      pointer-events: none;
      z-index: 5;
     
      animation: sky-pulse 1.2s ease-in-out infinite;
    }

    @keyframes sky-pulse {

      0%,
      100% {
        opacity: .8;
        transform: scale(1)
      }

      50% {
        opacity: 1;
        transform: scale(1.04)
      }
    }

    @media (max-width:1280px) {
      .zute {
        margin-top: 25%
      }
    }

   /* Background overlay behind scatter pop */
.scatter-pop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5); /* grayish dark background */
  z-index: 109;
  opacity: 0;
  pointer-events: none;
}

/* Scatter pop */
.scatter-pop {
  position: fixed;
  z-index: 110;
  pointer-events: none;
  display: grid;
  background-color: beige;
  place-items: center;
  transform-origin: center;
  will-change: transform, opacity, left, top;
}

.scatter-pop img {
  width: clamp(160px, 26vw, 360px);
  height: auto;
  border-radius: 14px;
  box-shadow:
    0 10px 30px rgba(0,0,0,.5),
    0 0 0 3px rgba(255, 230, 120, .9),
    0 0 24px 8px rgba(255, 230, 120, .35);
}

.scatter-pop .amount {
  margin-top: 10px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(0,0,0,.65);
  color: #ffe070;
  font-weight: 800;
  font-size: clamp(18px, 3.4vw, 34px);
  letter-spacing: .5px;
  text-shadow: 0 2px 4px rgba(0,0,0,.8);
}

/* Fiery pulse animation for winning scatter symbols */
@keyframes fiery-pulse {
  0% { 
    filter: drop-shadow(0 0 4px #4fee10) drop-shadow(0 0 8px #ff8c00) brightness(1.1);
    background: linear-gradient(45deg, #1bffa7, #ff8c00, #ff4500);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: 0 0 5px rgba(43, 195, 255, 0.3);
  }
  50% { 
    filter: drop-shadow(0 0 10px #ffd700) drop-shadow(0 0 20px #ff8c00) brightness(1.3);
    background: linear-gradient(45deg, #ffec8b, #ffa500, #ff6347);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: 0 0 8px rgba(255, 165, 0, 0.5);
  }
  100% { 
    filter: drop-shadow(0 0 4px #ffd700) drop-shadow(0 0 8px #ff8c00) brightness(1.2);
    background: linear-gradient(45deg, #ffd700, #ff8c00, #ff4500);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
  }
}

/* Example usage */
.fiery-text {
  animation: fiery-pulse 2s infinite ease-in-out;
  font-weight: bold;
  font-size: 3rem;
  display: inline-block;
  padding: 0.5rem 1rem;
}
.scatter-win-effect {
    animation: fiery-pulse 800ms ease-in-out infinite;
    z-index: 10;
    position: relative;
}

/* Ornate frame for the win pop-up */
.ornate-frame {
    position: relative;
    padding: 18px;
    background: linear-gradient(145deg, #a88d3a, #f0e68c, #a88d3a);
    border-radius: 12px;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5), inset 0 0 10px rgba(0,0,0,0.6);
    transform-origin: center;
}

.ornate-frame::before {
    content: '';
    position: absolute;
    inset: 10px;
    background-color: #1a1a1a;
    border-radius: 8px;
    border: 2px solid #5a4a1c;
    z-index: 1;
}

.frame-content {
    position: relative;
    z-index: 2;
    color: white;
    text-shadow: 1px 1px 3px black;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
}

/* Landing bounce animation for the pop-up */
@keyframes scatter-land-pop {
  0%   { transform: scale(.9); opacity: 0; }
  60%  { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1.7); opacity: 1; }
}

/* New, authentic win effect for regular symbols */
@keyframes olympus-win-effect {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0px 0px rgba(255, 223, 100, 0);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 12px 3px rgba(255, 223, 100, 0.8);
    filter: brightness(1.2);
  }
  100% {
    transform: scale(1.05);
    box-shadow: 0 0 8px 2px rgba(255, 223, 100, 0.6);
    filter: brightness(1.1);
  }
}

.symbol-win-effect {
  position: relative;
  z-index: 10;
  animation: olympus-win-effect 400ms ease-out forwards;
}
.shake-hard {
  animation: hard-shake 500ms ease-in-out forwards; /* Increased duration for more impact */
}

.win-zoom-earthquake {
    /* Apply the zoom and shake animation */
    animation: zoomAndShake 800ms ease-out forwards;
    z-index: 9999; /* Ensure zoomed symbol is on top */
    position: relative; /* Required for z-index to work */
}
/* Style for the new explosion particles */
.particle {
  position: fixed; /* Use 'fixed' so it appears correctly on the whole page */
  border-radius: 50%;
  pointer-events: none; /* Particles shouldn't be clickable */
  z-index: 1002; /* Ensure particles appear on top */
}
.rules-container {
            height: 600px;
            
            position: relative;
            overflow: hidden;
        }
        .page {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            opacity: 0;
            transition: opacity 0.3s ease;
            pointer-events: none;
            overflow-y: auto;
            height: 100%;
        }
        .page.active {
            opacity: 1;
            pointer-events: auto;
        }
        .symbol-img {
            width: 80px;
            height: 40px;
            object-fit: contain;
            margin: 0 auto;
            display: block;
        }
        .pay-table {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
            margin-bottom: 16px;
        }
        .pay-item {
           width: 100%;
           
           
            text-align: center;
        }
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.85);
            display: grid;
            place-items: center;
            z-index: 1000;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s ease;
        }

        .modal-overlay.active {
            opacity: 1;
            pointer-events: auto;
        }

        /* Hides all pages by default */
        .page {
            display: none;
        }
        /* Shows only the current page */
        .page.active {
            display: block;
        }

        /* Close Button Styling */
        #rules-container {
            position: relative; /* Needed for positioning the close button */
        }
        #close-modal-button {
            position: absolute;
            top: 5px;
            right: 15px;
            font-size: 2.5rem;
            font-weight: bold;
            color: #aaa;
            background: none;
            border: none;
            cursor: pointer;
            line-height: 1;
        }
        #close-modal-button:hover {
            color: white;
        }
        
        /* Your existing symbol and layout styles */
        .rules-container {
            height: 65vh; /* Fixed height for content */
            overflow-y: auto; /* Scroll if content exceeds height */
        }
        .pay-table {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1rem;
            margin-bottom: 1.5rem;
            text-align: center;
        }
        .pay-item {
        
            padding: 0.2rem;
            border-radius: 8px;
        }
        .symbol-img {
            width: 50px;
            height: 50px;
            margin: 0 auto 0.5rem;
        }
        /* Style for the active page in the rules panel */
.page {
  display: none; /* Hide all pages by default */
}
.page.active {
  display: block; /* Show only the active page */
}
 @media (max-width: 767px) {
            .game-container {
                aspect-ratio: 9 / 19.5; /* Tall aspect ratio for mobile */
                justify-content: flex-start;
            }
        }

.element {
  animation: zoomInOut 2s infinite ease-in-out;
}
    @keyframes zoomInOut {
  from {
    transform: scale(0);
  }
 to{
    transform: scale(1.2);
  
}
    }

    /* Add this CSS to your main <style> tag */
.win-box {
    position: relative;
    width: 120px; /* Adjust size as needed */
    height: 140px; /* Adjust size as needed */
    background-color: #1a100f; /* Dark background */
    border: 3px solid transparent;
    border-image: linear-gradient(to bottom, #f0e0a0, #c0a060);
    border-image-slice: 1;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    color: white;
    font-weight: bold;
}

.win-box-symbol {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
}

.win-box-symbol img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

.win-box-info {
    background-color: #3a2a29; /* Darker bar at the bottom */
    border-top: 2px solid #c0a060;
    padding: 4px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
}

.win-box-info .count {
    display: flex;
    align-items: center;
    gap: 4px;
}

.win-box-info .count img {
    width: 20px;
    height: 20px;
}
/* Panel container: collapsed by default, drops open when .open is added */
.win-tracker{
  position: absolute;        /* adjust to your HUD */
  top: 12px;                 /* panel sits near top then drops open */
  right: 12px;
  width: 240px;
  background: rgba(0,0,0,.7);
  border: 2px solid #d1b85a;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(0,0,0,.35), inset 0 0 0 2px rgba(255,255,255,.06);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .35s ease, opacity .35s ease;
  backdrop-filter: blur(2px);
}
.win-tracker.open{
  max-height: 320px;         /* how tall the panel can open */
  opacity: 1;
}

/* Optional inner padding */
#win-tracker-content{
  padding: 10px;
}

/* Entry look (matches your screenshot vibe) */
.win-tracker-entry{
  background: rgba(20,20,20,.65);
  border-radius: 1px;
  border: 2px solid rgba(226, 102, 0, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}

/* Drop-down animation for each row */
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes winZoom {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.14); }
  70%  { transform: scale(1.00); }
  100% { transform: scale(1); }
}
.win-pulse {
  animation: winZoom 700ms cubic-bezier(.25,.9,.25,1) infinite;
  transform-origin: 50% 50%;
  will-change: transform;
}
/* MOBILE tracker shell + list (<= 767px) */
@media (max-width: 767px) {
  #win-tracker-shell-mob {
    width: 96px;          /* tighten the gold frame */
    padding: 6px 5px;     /* inner padding */
    border-radius: 16px;
  }
  #win-tracker-content-mob {
    max-height: 140px;    /* scroll if many rows */
    overflow-y: auto;
    gap: 4px;
  }

  /* compact entries */
  #win-tracker-content-mob .win-tracker-entry {
    padding: 3px 4px;
    border-radius: 8px;
    margin: 2px 0;
  }
  #win-tracker-content-mob .win-tracker-entry img {
    width: 18px; height: 18px;
  }
  #win-tracker-content-mob .win-tracker-entry .name {
    font-size: 2px; line-height: 1;
  }
  #win-tracker-content-mob .win-tracker-entry .count {
    font-size: 9px; opacity: .8; line-height: 1.05;
  }
  #win-tracker-content-mob .win-tracker-entry .payout {
    font-size: 12px; font-weight: 800;
  }
  #win-tracker-content-mob p {      /* "No wins yet" */
    font-size: 3px; opacity: .8;
    text-align: center;
    margin: 4px 0;
  }
}
@media (max-width: 767px){
  #total-win-container{
    width: min(78vw, 320px);   /* fixed visual width */
    box-sizing: border-box;
    white-space: nowrap;       /* text changes won't stretch it */
  }

  /* Win tracker box on mobile keeps a steady footprint */
  #win-tracker-content-mob{
    min-height: 120px;         /* already your height, keep it */
  }
  #win-tracker-content-mob .win-tracker-entry,
  #win-tracker-content-mob .win-tracker-empty{
    width: 100%;
  }
}