/* Five-reel casino cabinet, based on the classic 777 proportions */
html,body{min-height:100%;overflow-x:hidden}
.shell{padding:clamp(3px,1.2vw,12px);justify-content:center}
.machine{width:min(100%,850px);border-radius:38px 38px 22px 22px;padding:clamp(8px,1.8vw,19px);background:linear-gradient(100deg,#130e18,#482434 10%,#2d1828 45%,#542839 75%,#17101a);border-width:6px;box-shadow:0 0 0 3px #251a23,0 0 0 7px #70512f,0 24px 55px #000d,inset 0 0 0 3px #2a1723}
.machine:before{inset:5px;border-color:#f3d48c88;border-radius:28px 28px 12px 12px}
.top{position:relative;z-index:2;gap:5px;background:radial-gradient(ellipse,#4e2b34,#140e1e);border:2px solid #9c753f;border-radius:23px 23px 9px 9px;padding:8px 10px;box-shadow:inset 0 0 22px #0009}
.top button{font-family:Georgia,serif;font-size:12px;white-space:nowrap;padding:8px}
.brand h1{font-family:Georgia,serif;font-size:clamp(23px,4vw,45px);letter-spacing:1px}
.brand small{font-size:clamp(7px,1.3vw,10px);letter-spacing:1px}
.stats{margin:9px 0 12px}
.stat{border-radius:6px}
.stat strong{font-family:monospace}
.stage{border:6px solid #1c1620;outline:3px solid #b48a4e;border-radius:13px;padding:6px;background:linear-gradient(#9b886d,#f9efdc 17%,#fff9eb 50%,#c5b297 84%,#73604e);box-shadow:inset 0 0 25px #0009,0 0 0 4px #321d27}
.stage:before{background:linear-gradient(#251a2299,transparent 18%,transparent 82%,#251a2299);z-index:3}
.reels{position:relative;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));height:clamp(220px,40dvh,370px);gap:0;overflow:hidden;background:#221b1e;border-radius:5px}
.cell{height:auto;min-height:0;border-radius:0;border:0;border-left:2px solid #54402c;background:linear-gradient(90deg,#ad9a7e,#fff9e9 20%,#fffdf4 50%,#e8d9c2 80%,#a48c70);box-shadow:inset 0 2px 12px #53402b33;font-size:clamp(32px,6vw,65px);text-shadow:0 3px 5px #0003}
.cell:after{border-radius:0;background:linear-gradient(#00000014,transparent 35%,transparent 65%,#00000012)}
.reels.rolling .cell{visibility:hidden}
.spin-column{position:absolute;top:0;height:100%;overflow:hidden;z-index:5;background:linear-gradient(90deg,#a9977d,#fff9e9 22%,#fffdf2 65%,#ac977d);border-left:2px solid #6c5437}
.spin-track{position:absolute;left:0;top:0;width:100%;height:900%;will-change:transform}
.spin-symbol{height:calc(100% / 27);display:grid;place-items:center;font-size:clamp(32px,6vw,65px);border-bottom:1px solid #c4af90}
.banner{color:#ffe5aa;text-shadow:0 2px 5px #000;min-height:30px;margin:6px 0 1px;background:linear-gradient(90deg,transparent,#2d1c29,transparent);padding:4px}
.controls{margin-top:15px}
.controls button{font-family:Georgia,serif;border-radius:7px}
.controls .spinbtn{background:linear-gradient(#ffe5a0,#c18b3d);box-shadow:inset 0 0 0 3px #9a6428,inset 0 0 0 4px #ffe7a7,0 4px 0 #4e2b17}
.bottom{margin-top:10px}
.bottom button{font-family:Georgia,serif;text-decoration:none;border:1px solid #a47b45;background:linear-gradient(#3a2c3b,#171421);padding:8px;border-radius:7px;font-size:11px}
@media(max-width:600px){.shell{padding:2px 5px;justify-content:center}.machine{width:100%;border-width:4px;padding:8px 7px 9px;border-radius:25px 25px 15px 15px}.machine:before{inset:3px;border-radius:20px}.top{padding:8px 3px}.top button{padding:7px 5px;font-size:10px}.brand h1{font-size:clamp(19px,5.4vw,30px)}.brand small{font-size:7px;letter-spacing:.4px}.stats{gap:4px;margin:9px 0}.stat{padding:5px 1px}.stat label{font-size:8px}.stat strong{font-size:20px}.stage{padding:3px;border-width:4px;outline-width:2px}.reels{height:clamp(235px,41dvh,420px)}.cell,.spin-symbol{font-size:clamp(33px,9vw,55px)}.controls{gap:5px;margin-top:12px}.controls button{min-height:43px;font-size:11px;padding:8px 7px}.controls .spinbtn{font-size:18px;min-width:120px}.bottom{gap:5px}.bottom button{font-size:9px;padding:7px 5px}.footnote{font-size:9px}}
@media(max-height:730px) and (min-width:601px){.reels{height:clamp(160px,37dvh,260px)}.controls{margin-top:7px}.stats{margin:6px 0}}

/* Custom themed vector artwork, not platform emoji */
.slot-art{display:block;width:94%;height:94%;object-fit:contain;filter:drop-shadow(0 5px 3px #33201055);user-select:none;pointer-events:none}
.spin-symbol .slot-art{width:90%;height:90%}
.reels.rolling .cell{visibility:hidden}
@media(max-width:600px){.slot-art{width:100%;height:100%}.spin-symbol .slot-art{width:100%;height:100%}}

/* Show each finished reel immediately; avoid dark/blank columns during staggered stops */
.reels.rolling .cell.reel-stopped{visibility:visible}
.reels.rolling .cell:not(.reel-stopped){visibility:hidden}


/* Single authoritative responsive layout; remove conflicting earlier viewport overrides. */
html,body{margin:0!important;width:100%;height:100%;min-height:0;overflow:hidden!important}
.shell{box-sizing:border-box;width:100%;height:100vh;height:100dvh;min-height:0;max-height:100dvh;display:flex;align-items:stretch;justify-content:center;overflow:hidden;padding:4px max(4px,env(safe-area-inset-right)) 4px max(4px,env(safe-area-inset-left))}
.machine{box-sizing:border-box;flex:0 1 1080px;width:100%;height:100%;min-height:0;max-height:100%;display:flex;flex-direction:column;justify-content:flex-start;gap:clamp(2px,.5dvh,8px);overflow:hidden;padding:clamp(5px,1dvh,13px) clamp(5px,1vw,13px)}
.top,.stats,.controls,.bottom,.footnote{flex:0 0 auto;margin:0}
.stage{box-sizing:border-box;flex:1 1 0;min-height:0;max-height:none;display:flex;flex-direction:column;overflow:hidden;margin:2px 2px;padding:4px}
.reels{flex:1 1 0;min-height:0;max-height:none;height:auto;grid-template-rows:repeat(3,minmax(0,1fr));overflow:hidden}
.banner{flex:0 0 auto;min-height:0;margin:2px 0;padding:3px}
.cell,.spin-symbol{min-height:0}
.controls{margin-top:3px;gap:5px}
.bottom{margin-top:2px}
.footnote{margin:0}
@media(max-width:600px){
 .shell{padding:3px}
 .machine{width:100%;flex:1 1 auto;min-height:0;border-width:3px;border-radius:18px;padding:6px;gap:3px}
 .top{padding:5px 3px;gap:3px}
 .top button{padding:5px;font-size:10px}
 .brand h1{font-size:clamp(18px,5.3vw,29px)}
 .brand small{font-size:7px;letter-spacing:0}
 .stats{gap:4px}
 .stat{padding:3px 1px}
 .stat strong{font-size:clamp(15px,4.7vw,21px)}
 .stat label{font-size:8px}
 .stage{min-height:0;padding:3px;border-width:3px}
 .reels{height:auto;min-height:0}
 .controls{gap:4px}
 .controls button{min-height:35px;padding:6px;font-size:clamp(10px,2.7vw,13px)}
 .controls .spinbtn{min-width:105px;font-size:17px}
 .bottom{gap:4px}
 .bottom button{font-size:9px;padding:5px}
 .footnote{font-size:8px}
}
@media(max-height:680px){
 .machine{gap:2px;padding-top:4px;padding-bottom:4px}
 .top{padding:3px}
 .brand h1{font-size:clamp(17px,3vw,27px)}
 .brand small{font-size:7px}
 .stats{margin:0}
 .stat{padding:2px}
 .stat strong{font-size:clamp(14px,2.5vw,19px)}
 .controls button{min-height:30px;padding:4px 6px}
 .controls .spinbtn{font-size:15px}
 .bottom button{padding:3px 5px}
 .banner{font-size:11px;padding:2px}
}
@media(max-height:450px){.footnote{display:none}.brand small{display:none}.top button{padding:2px 5px}.controls button{min-height:26px}.bottom button{padding:2px 5px}}

/* Desktop only: show complete symbols inside each reel stop, without changing reel height. */
@media(min-width:601px) and (min-height:451px){
 .reels .cell .slot-art,
 .reels .spin-symbol .slot-art{
  width:74%;
  height:74%;
  max-width:74%;
  max-height:74%;
  object-fit:contain;
  margin:auto;
 }
}

/* Desktop reel artwork: absolute centering avoids grid intrinsic image sizing and clipping. */
@media(min-width:601px) and (min-height:451px){
 .reels .cell,
 .reels .spin-symbol{position:relative}
 .reels .cell > img.slot-art,
 .reels .spin-symbol > img.slot-art{
  position:absolute!important;
  top:50%!important;
  left:50%!important;
  display:block!important;
  width:60%!important;
  height:64%!important;
  max-width:60%!important;
  max-height:64%!important;
  margin:0!important;
  padding:0!important;
  object-fit:contain!important;
  object-position:center center!important;
  transform:translate(-50%,-50%)!important;
 }
}

/* Actual win paths on top of the reels, generated from evaluated combinations. */
.reels .payline-overlay{
 position:absolute;inset:0;width:100%;height:100%;z-index:12;
 pointer-events:none;overflow:visible;filter:drop-shadow(0 0 4px #000c);
}
.reels .payline-path{
 stroke-dasharray:700;stroke-dashoffset:700;
 animation:casinoPaylineDraw .55s ease-out forwards,casinoPaylineGlow 1.15s ease-in-out .55s infinite alternate;
 filter:drop-shadow(0 0 3px currentColor);
}
@keyframes casinoPaylineDraw{to{stroke-dashoffset:0}}
@keyframes casinoPaylineGlow{to{stroke-width:6;opacity:.75}}
@media(prefers-reduced-motion:reduce){.reels .payline-path{animation:none;stroke-dashoffset:0}}

/* Mega Fortune: frameless uploaded premium symbols, centered and proportionate. */
body[data-game="fortune"] .reels .cell,
body[data-game="fortune"] .reels .spin-symbol{position:relative}
body[data-game="fortune"] .reels .cell > img.slot-art,
body[data-game="fortune"] .reels .spin-symbol > img.slot-art{
 position:absolute!important;top:50%!important;left:50%!important;
 display:block!important;width:78%!important;height:80%!important;
 max-width:78%!important;max-height:80%!important;
 margin:0!important;padding:0!important;
 object-fit:contain!important;object-position:center!important;
 transform:translate(-50%,-50%)!important;
 filter:drop-shadow(0 3px 5px #0006);
}
@media(max-width:600px){
 body[data-game="fortune"] .reels .cell > img.slot-art,
 body[data-game="fortune"] .reels .spin-symbol > img.slot-art{
  width:83%!important;height:82%!important;
  max-width:83%!important;max-height:82%!important;
 }
}

/* Mega Fortune mobile cabinet: compact 5x3 reels; keep all controls on screen. */
@media(max-width:600px){
 body[data-game="fortune"] .machine{
  justify-content:center;
  gap:clamp(3px,.65dvh,7px);
 }
 body[data-game="fortune"] .stage{
  flex:0 1 auto;
  min-height:0;
  overflow:hidden;
 }
 body[data-game="fortune"] .reels{
  flex:0 1 auto;
  height:clamp(310px,47dvh,440px);
  min-height:0;
  max-height:47dvh;
  aspect-ratio:auto;
  touch-action:pan-y;
  cursor:pointer;
 }
 body[data-game="fortune"] .controls{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1.25fr) minmax(0,1fr);
  gap:5px;
  width:100%;
 }
 body[data-game="fortune"] .controls button{
  min-width:0;
  min-height:42px;
  padding:7px 3px;
  font-size:clamp(10px,2.7vw,13px);
  white-space:nowrap;
 }
 body[data-game="fortune"] .controls .spinbtn{
  min-width:0;
  font-size:clamp(17px,4.5vw,21px);
 }
 body[data-game="fortune"] .controls #auto{
  grid-column:1/-1;
  justify-self:center;
  width:min(62%,240px);
  min-height:34px;
 }
 body[data-game="fortune"] .bottom{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:4px;
 }
 body[data-game="fortune"] .bottom button{
  min-height:29px;
  padding:5px 7px;
 }
 body[data-game="fortune"] .footnote{font-size:8px}
 body[data-game="fortune"] .reels .cell > img.slot-art,
 body[data-game="fortune"] .reels .spin-symbol > img.slot-art{
  width:84%!important;height:84%!important;
  max-width:84%!important;max-height:84%!important;
 }
}
@media(max-width:600px) and (max-height:690px){
 body[data-game="fortune"] .top{padding:3px}
 body[data-game="fortune"] .brand h1{font-size:clamp(17px,4.8vw,23px)}
 body[data-game="fortune"] .stats{margin:0}
 body[data-game="fortune"] .reels{height:clamp(230px,42dvh,350px);max-height:42dvh}
 body[data-game="fortune"] .controls button{min-height:35px}
 body[data-game="fortune"] .controls #auto{min-height:30px}
}

/* Mobile Mega Fortune: use the available viewport rather than a small fixed reel cap. */
@media(max-width:600px){
 body[data-game="fortune"] .machine{justify-content:flex-start}
 body[data-game="fortune"] .stage{flex:1 1 0;min-height:0}
 body[data-game="fortune"] .reels{
  flex:1 1 0;
  height:auto;
  min-height:0;
  max-height:none;
 }
 body[data-game="fortune"] .controls{flex:0 0 auto}
}

/* Installed Android PWA only. Keep the fixed controls in the machine's
   flex flow and give the safe-area-adjusted remainder to the reel window.
   The normal Chrome and desktop rules above remain untouched. */
@media (display-mode:standalone) and (max-width:600px) and (orientation:portrait){
 html,body{height:100%;min-height:0;overflow:hidden}
 .shell{
  height:100dvh;max-height:100dvh;min-height:0;overflow:hidden;
  padding:calc(max(3px,env(safe-area-inset-top)) + 56px) max(3px,env(safe-area-inset-right))
          max(3px,env(safe-area-inset-bottom)) max(3px,env(safe-area-inset-left));
 }
 .machine{
  display:flex!important;flex-direction:column!important;
  height:100%!important;min-height:0!important;max-height:100%!important;
  overflow:hidden!important;
 }
 .machine>.top,.machine>.stats,.machine>.controls,.machine>.bottom,.machine>.footnote{
  flex:0 0 auto;min-height:0;min-width:0;margin:0;
 }
 .machine>.stage{
  flex:1 1 0!important;height:auto!important;min-height:0!important;max-height:none!important;
  display:flex!important;flex-direction:column!important;overflow:hidden!important;
 }
 .machine>.stage>.reels{
  flex:1 1 0!important;height:auto!important;min-height:0!important;
  max-height:none!important;overflow:hidden!important;
 }
 .machine>.stage>.banner{flex:0 0 auto}
 .machine>.bottom,.machine>.footnote{display:flex}
}
