/* ========================================
   RESPONSIVE / BREAKPOINT RULES
   Mobile pass 1: device fit and layout polish.
   Keep this file loaded last in index.html.
======================================== */

/* ========================================
   TABLET / MOBILE BASE
======================================== */

@media (max-width: 900px) {
  html {
    scroll-snap-type: y proximity;
  }

  body {
    overflow-x: hidden;
  }

  #three-canvas,
  #three-logo-canvas {
    display: none !important;
  }

  .cursor-glow {
    display: none;
  }

  .site-nav {
    padding: 14px 18px;
  }

  .nav-links {
    display: none;
  }

  .scene {
    min-height: auto;
  }

  .scene-inner {
    min-height: 100svh;
    width: 100%;
    padding: 86px 22px 68px;
  }

  .split-layout,
  .split-layout.reverse {
    display: flex;
    flex-direction: column;
    gap: clamp(42px, 8vw, 64px);
  }

  .copy-block {
    max-width: 100%;
  }

  .section-title {
    font-size: clamp(3.05rem, 14vw, 5.8rem);
    line-height: .86;
  }

  .hero-copy,
  .section-copy {
    max-width: 38rem;
    font-size: 1rem;
    line-height: 1.62;
  }

  .button-row {
    align-items: stretch;
    gap: 12px;
    margin-bottom: clamp(8px, 2vw, 16px);
  }

  .btn {
    min-height: 48px;
    padding: 14px 22px;
  }

  .visual-stage {
    width: 100%;
    min-height: auto;
    margin-top: clamp(10px, 3vw, 24px);
    transform: none;
    transform-origin: center;
  }

  .interaction-hint {
    margin-top: 18px;
  }
}


/* ========================================
   MOBILE HTML HERO LOGO
======================================== */

@media (max-width: 900px) {
  .brand-title-shell {
    min-height: clamp(4rem, 18vw, 7rem);
  }

  .brand-title {
    position: fixed !important;
    top: 0;
    left: 50%;
    z-index: 10000;

    display: inline-block !important;
    width: max-content;
    max-width: none;
    white-space: nowrap;

    opacity: 1 !important;
    pointer-events: auto;
    transform-origin: center top;
    will-change: transform;
  }
}


/* ========================================
   MOBILE HERO / POKER
======================================== */

@media (max-width: 900px) {
  .hero-inner {
    min-height: 100svh;
    padding-top: 96px;
  }

  .brand-title {
    font-size: clamp(3.25rem, 14.5vw, 5.8rem);
  }

  .poker-stage {
    min-height: clamp(330px, 62vw, 460px);
    max-width: 430px;
    margin-inline: auto;
  }

  .card {
    width: clamp(166px, 34vw, 224px);
    height: clamp(250px, 51vw, 330px);
  }

  .card-back {
    top: clamp(72px, 14vw, 120px);
    left: 50%;
    transform: translateX(-95%) rotate(-14deg);
  }

  .card-front {
    top: clamp(42px, 10vw, 86px);
    left: 50%;
    transform: translateX(-5%) rotate(10deg);
  }

  .chip-red {
    width: clamp(96px, 22vw, 126px);
    height: clamp(96px, 22vw, 126px);
    left: clamp(18px, 8vw, 54px);
    bottom: clamp(34px, 8vw, 58px);
  }

  .chip-black {
    width: clamp(84px, 19vw, 108px);
    height: clamp(84px, 19vw, 108px);
    right: clamp(18px, 8vw, 54px);
    bottom: clamp(12px, 4vw, 24px);
  }

  .chip::before {
    border-width: clamp(4px, 1.1vw, 7px);
  }

  .chip::after {
    inset: 28%;
  }
}


/* ========================================
   MOBILE ROULETTE
======================================== */

@media (max-width: 900px) {
  .roulette-stage {
    min-height: clamp(360px, 82vw, 470px);
  }

  .roulette-stage::after {
    width: clamp(300px, 86vw, 430px);
    height: clamp(300px, 86vw, 430px);
  }

  .roulette-wheel {
    width: clamp(270px, 78vw, 360px);
    height: clamp(270px, 78vw, 360px);
  }

  .wheel-numbers span {
    top: 14px;
    width: clamp(24px, 7vw, 34px);
    height: clamp(24px, 7vw, 34px);
    font-size: clamp(.65rem, 2.5vw, .88rem);
    transform-origin: center calc(clamp(270px, 78vw, 360px) / 2 - 28px);
  }

  .wheel-ball {
    --ball-radius: calc(clamp(270px, 78vw, 360px) * .29);
    width: clamp(18px, 5vw, 24px);
    height: clamp(18px, 5vw, 24px);
  }
}


/* ========================================
   MOBILE SLOTS
======================================== */

@media (max-width: 900px) {
  .slot-machine {
    width: min(100%, 390px);
    padding: clamp(24px, 6vw, 34px);
    border-radius: 32px;
  }

  .slot-top {
    font-size: clamp(1.35rem, 6vw, 1.9rem);
    margin-bottom: 22px;
  }

  .reels {
    gap: clamp(8px, 3vw, 14px);
    padding: clamp(12px, 4vw, 18px);
  }

  .reel {
    height: clamp(86px, 25vw, 118px);
    font-size: clamp(2.3rem, 10vw, 3.4rem);
  }

  .slot-symbol,
  .diamond,
  .crown {
    font-size: clamp(2.4rem, 10vw, 3.6rem);
  }

  .seven {
    font-size: clamp(2.7rem, 11vw, 4rem);
  }

  .slot-lever {
    right: clamp(-34px, -7vw, -20px);
    top: clamp(84px, 24vw, 112px);
    transform: scale(.78);
    transform-origin: 50% 88%;
  }
}


/* ========================================
   MOBILE SCRATCH
======================================== */

@media (max-width: 900px) {
  .scratch-card-wrap {
    width: min(100%, 520px);
    border-radius: 30px;
  }

  .scratch-card-wrap::before {
    border-radius: 22px;
  }

  .scratch-prize {
    border-radius: 22px;
  }

  #scratchCanvas {
    border-radius: 22px;
  }

  .scratch-coin-cursor {
    display: none;
  }
}


/* ========================================
   MOBILE CONTACT
======================================== */

@media (max-width: 900px) {
  .contact-title {
    font-size: clamp(3rem, 14vw, 5.4rem);
  }
}


/* ========================================
   SMALL PHONES
======================================== */

@media (max-width: 520px) {
  .scene-inner {
    padding: 92px 18px 64px;
  }

  .section-title {
    font-size: clamp(2.75rem, 15vw, 4.65rem);
  }

  .brand-title {
    font-size: clamp(2.9rem, 14vw, 4.7rem);
  }

  .hero-copy,
  .section-copy {
    font-size: .96rem;
  }

  .button-row {
    flex-direction: column;
    width: 100%;
  }

  .btn {
    width: 100%;
  }

  .poker-stage {
    min-height: 300px;
    max-width: 330px;
  }

  .card {
    width: 150px;
    height: 226px;
  }

  .card-back {
    top: 66px;
    left: 50%;
    transform: translateX(-96%) rotate(-14deg);
  }

  .card-front {
    top: 42px;
    left: 50%;
    transform: translateX(-4%) rotate(10deg);
  }

  .chip-red {
    width: 82px;
    height: 82px;
    left: 18px;
    bottom: 34px;
  }

  .chip-black {
    width: 74px;
    height: 74px;
    right: 16px;
    bottom: 14px;
  }

  .roulette-stage {
    min-height: 335px;
  }

  .roulette-wheel {
    width: min(78vw, 310px);
    height: min(78vw, 310px);
  }

  .wheel-numbers span {
    transform-origin: center calc(min(78vw, 310px) / 2 - 25px);
  }

  .wheel-ball {
    --ball-radius: calc(min(78vw, 310px) * .29);
  }

  .slot-machine {
    width: min(100%, 340px);
  }

  .slot-lever {
    right: -24px;
    top: 88px;
    transform: scale(.68);
  }

  .scratch-card-wrap {
    padding: 14px;
  }

  .scratch-card-wrap::before,
  .scratch-prize,
  #scratchCanvas {
    inset: 14px;
  }

  #scratchCanvas {
    width: calc(100% - 28px);
    height: calc(100% - 28px);
  }
}


/* ========================================
   SHORT MOBILE LANDSCAPE
======================================== */

@media (max-width: 900px) and (max-height: 560px) and (orientation: landscape) {
  .scene-inner {
    min-height: auto;
    padding-top: 74px;
    padding-bottom: 44px;
  }

  .split-layout,
  .split-layout.reverse {
    display: grid;
    grid-template-columns: .92fr 1fr;
    gap: 30px;
    align-items: center;
  }

  .section-title {
    font-size: clamp(2.5rem, 8vw, 4rem);
  }

  .section-copy {
    font-size: .9rem;
    margin: 14px 0 18px;
  }

  .visual-stage {
    transform: scale(.88);
  }

  .roulette-stage,
  .poker-stage {
    min-height: 320px;
  }

  .slot-machine {
    width: min(100%, 320px);
  }

  .scratch-card-wrap {
    width: min(100%, 400px);
  }
}



/* ========================================
   MOBILE POKER CARD FAN OVERRIDE
   Stronger positioning so cards sit side-by-side instead of stacking.
======================================== */

@media (max-width: 900px) {
  .poker-stage .card {
    top: auto !important;
    bottom: clamp(42px, 9vw, 78px) !important;
  }

  .poker-stage .card-back {
    left: calc(50% - clamp(98px, 19vw, 138px)) !important;
    transform: translateX(-50%) rotate(-16deg) !important;
  }

  .poker-stage .card-front {
    left: calc(50% + clamp(98px, 19vw, 138px)) !important;
    transform: translateX(-50%) rotate(13deg) !important;
  }
}

@media (max-width: 520px) {
  .poker-stage .card {
    bottom: 44px !important;
  }

  .poker-stage .card-back {
    left: calc(50% - 78px) !important;
    transform: translateX(-50%) rotate(-16deg) !important;
  }

  .poker-stage .card-front {
    left: calc(50% + 78px) !important;
    transform: translateX(-50%) rotate(13deg) !important;
  }
}


/* ========================================
   TABLET / SMALL DESKTOP POKER FIT
   901px to 1100px only. Keep cards in view without pushing them too far left.
======================================== */

@media (min-width: 901px) and (max-width: 1100px) {
  .scene-poker .split-layout {
    grid-template-columns: minmax(0, .98fr) minmax(0, 1.02fr);
    gap: clamp(10px, 2vw, 24px);
  }

  .scene-poker .visual-stage.poker-stage {
    min-height: 560px;
    overflow: visible;
  }

  .scene-poker .poker-stage .card {
    width: 238px !important;
    height: 348px !important;
  }

  .scene-poker .poker-stage .card-back {
    left: -42px !important;
    top: 126px !important;
    transform: rotate(-12deg) !important;
  }

  .scene-poker .poker-stage .card-front {
    left: 106px !important;
    top: 84px !important;
    transform: rotate(8deg) !important;
  }

  .scene-poker .poker-stage .chip-red {
    left: 6px !important;
    bottom: 54px !important;
    width: 154px !important;
    height: 154px !important;
  }

  .scene-poker .poker-stage .chip-black {
    right: 188px !important;
    bottom: 12px !important;
    width: 120px !important;
    height: 120px !important;
  }
}

/* ========================================
   SNAP WIDTH CUTOFF
   Snap remains active down to 768px wide, including portrait.
   Below 768px wide, allow normal scroll.
======================================== */

@media (max-width: 767px) {
  html {
    scroll-snap-type: none !important;
  }
}

/* ========================================
   DESKTOP FIT RULES
======================================== */

@media (min-width: 901px) {
  .scene-inner {
    min-height: 100svh;
    padding-top: clamp(64px, 6vh, 90px);
    padding-bottom: clamp(28px, 4vh, 54px);
  }

  .split-layout {
    gap: clamp(28px, 5vw, 90px);
  }

  .section-title {
    font-size: clamp(3.2rem, 6.5vw, 7.6rem);
  }

  .section-copy {
    margin: 20px 0 26px;
    line-height: 1.55;
  }

  .visual-stage {
    min-height: min(620px, 68svh);
  }

  .roulette-wheel {
    width: min(500px, 62svh);
    height: min(500px, 62svh);
  }

  .roulette-stage::after {
    width: min(620px, 72svh);
    height: min(620px, 72svh);
  }

  .slot-machine {
    width: min(500px, 42vw);
    padding: clamp(24px, 4vh, 40px);
  }

  .scratch-card-wrap {
    transform: scale(.94);
    transform-origin: center;
  }

  body.hero-3d-ready .brand-title {
    opacity: 0;
    pointer-events: none;
  }
}
