
/* =========================================================
   STILL FLIES — FINAL GAME LAYOUT
   Purpose: stable 16:9 game box, no overlay spill, no section overlap
   ========================================================= */

#game.game-section{
  padding-bottom:112px;
}

#game .game-wrap{
  width:min(1080px,100%);
  margin:0 auto;
  border:1px solid rgba(157,255,0,.28);
  border-radius:20px;
  overflow:hidden;
  position:relative;
  isolation:isolate;
  background:linear-gradient(180deg,rgba(9,14,9,.96),rgba(3,6,3,.98));
  box-shadow:0 30px 90px rgba(0,0,0,.42),0 0 48px rgba(157,255,0,.06);
}

#game .game-topbar{
  min-height:72px;
  display:flex;
  align-items:center;
  gap:28px;
  padding:12px 18px;
  position:relative;
  z-index:5;
  border-bottom:1px solid rgba(157,255,0,.16);
  background:rgba(2,5,2,.82);
}

#game .game-stat{
  display:flex;
  align-items:baseline;
  gap:9px;
}
#game .game-stat small{
  font-size:9px;
  letter-spacing:.16em;
  color:#748071;
  font-weight:900;
}
#game .game-stat strong{
  color:var(--green);
  font-family:"Archivo Black",Impact,sans-serif;
  font-size:23px;
}
#game .game-icon-btn{
  margin-left:auto;
}

#game .game-stage{
  position:relative;
  width:100%;
  max-width:none;
  height:auto;
  min-height:0;
  aspect-ratio:16/9;
  margin:0;
  overflow:hidden;
  cursor:pointer;
  user-select:none;
  -webkit-user-select:none;
  touch-action:manipulation;
  background:#020502;
  z-index:1;
}

#game #stillGame{
  display:block;
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  z-index:1;
}

#game .game-stage::before,
#game .game-stage::after{
  pointer-events:none;
  z-index:2;
}

#game .game-overlay{
  position:absolute;
  inset:0;
  z-index:4;
  display:grid;
  place-items:center;
  overflow:hidden;
  background:radial-gradient(circle at 50% 38%,rgba(157,255,0,.08),transparent 28%),rgba(2,5,2,.62);
  backdrop-filter:blur(6px);
  transition:opacity .25s ease,visibility .25s ease;
}

#game .game-overlay.hidden{
  opacity:0;
  visibility:hidden;
  pointer-events:none;
}

#game .game-overlay-inner{
  width:min(520px,88%);
  max-width:520px;
  padding:20px;
  text-align:center;
}

#game .game-overlay-inner img{
  width:96px;
  height:96px;
  object-fit:cover;
  border-radius:50%;
  margin:0 auto 14px;
}

#game .game-overlay h3{
  font-size:clamp(38px,5.2vw,70px);
}

#game .game-footer{
  display:flex;
  gap:18px;
  flex-wrap:wrap;
  justify-content:space-between;
  align-items:center;
  min-height:46px;
  padding:12px 18px;
  position:relative;
  z-index:5;
  border-top:1px solid rgba(157,255,0,.12);
  background:linear-gradient(180deg,rgba(4,8,4,.94),rgba(2,4,2,.98));
  color:#778473;
  font:800 9px Inter,sans-serif;
  letter-spacing:.10em;
}

#pair.section{
  clear:both;
  padding-top:112px;
}

@media(max-width:720px){
  #game.game-section{padding-bottom:78px}
  #game .game-topbar{gap:12px;flex-wrap:wrap}
  #game .game-stat strong{font-size:18px}
  #game .game-icon-btn{margin-left:0}
  #game .game-stage{aspect-ratio:16/10}
  #game .game-footer{justify-content:flex-start;font-size:8px}
  #pair.section{padding-top:78px}
}


/* =========================================================
   MOBILE OPTIMIZATION PASS
   ========================================================= */

#game .game-wrap,
#game .game-stage,
#game #stillGame{
  -webkit-tap-highlight-color: transparent;
}

#game .game-stage{
  touch-action:none;
  overscroll-behavior:contain;
}

#game .game-overlay-inner .btn{
  min-height:54px;
}

#game .mobile-flap-btn{
  display:none;
}

@media (max-width: 820px){
  #game.game-section{
    padding-bottom:84px;
  }

  #game .game-wrap{
    width:min(100%, 620px);
    border-radius:18px;
  }

  #game .game-topbar{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:12px;
    align-items:center;
    padding:14px;
  }

  #game .game-stat{
    min-height:48px;
    padding:10px 12px;
    border:1px solid rgba(157,255,0,.12);
    border-radius:12px;
    background:rgba(255,255,255,.02);
    justify-content:space-between;
  }

  #game .game-stat small{
    font-size:10px;
  }

  #game .game-stat strong{
    font-size:22px;
  }

  #game .game-icon-btn{
    margin-left:0;
    width:100%;
    min-height:48px;
    display:flex;
    align-items:center;
    justify-content:center;
  }

  #game .game-stage{
    aspect-ratio:4 / 5;
    min-height:420px;
    max-height:72svh;
  }

  #game .game-overlay-inner{
    width:min(92%, 360px);
    padding:18px 14px 20px;
  }

  #game .game-overlay-inner img{
    width:84px;
    height:84px;
    margin-bottom:10px;
  }

  #game .game-overlay h3{
    font-size:clamp(34px, 12vw, 54px);
    line-height:.95;
    margin-bottom:10px;
  }

  #game .game-footer{
    justify-content:center;
    gap:10px 14px;
    text-align:center;
    font-size:9px;
    padding:12px 12px 10px;
  }

  #game .mobile-flap-btn{
    display:flex;
    width:calc(100% - 24px);
    margin:0 12px 14px;
    min-height:56px;
    align-items:center;
    justify-content:center;
    border-radius:14px;
    border:1px solid rgba(157,255,0,.42);
    background:linear-gradient(180deg, rgba(157,255,0,.18), rgba(157,255,0,.08));
    color:var(--white);
    font:900 15px Inter,sans-serif;
    letter-spacing:.14em;
    box-shadow:inset 0 0 20px rgba(157,255,0,.06), 0 0 24px rgba(157,255,0,.10);
  }

  .mobile-overlay-tip{
    display:block;
  }
}

@media (max-width: 480px){
  #game .game-stage{
    aspect-ratio:7 / 9;
    min-height:400px;
    max-height:68svh;
  }

  #game .game-topbar{
    grid-template-columns:1fr;
  }

  #game .game-stat,
  #game .game-icon-btn{
    width:100%;
  }

  .mobile-game-tip{
    font-size:13px;
  }
}


/* =========================================================
   MOBILE PLAYABILITY V2 — FOCUS MODE + INPUT FIX
   ========================================================= */

#game .game-focus-btn{
  display:none;
}

@media (max-width:820px){

  #game .game-focus-btn{
    display:flex;
  }

  /* Keep the compact HUD readable instead of stacking everything vertically. */
  #game .game-topbar{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }

  #game .game-stage{
    touch-action:none;
    overscroll-behavior:contain;
    -webkit-user-select:none;
    user-select:none;
  }

  #game .mobile-flap-btn{
    touch-action:none;
    -webkit-tap-highlight-color:transparent;
  }
}

/* Reliable fullscreen-like focus mode, including iPhone Safari. */
@media (max-width:820px){

  body.game-focus-mode{
    overflow:hidden !important;
    overscroll-behavior:none;
  }

  body.game-focus-mode #game .game-wrap{
    position:fixed;
    inset:0;
    z-index:10000;
    width:100vw;
    height:100svh;
    max-width:none;
    margin:0;
    border:0;
    border-radius:0;
    display:flex;
    flex-direction:column;
    background:#020502;
  }

  body.game-focus-mode #game .game-topbar{
    flex:0 0 auto;
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:6px;
    padding:max(7px,env(safe-area-inset-top)) 8px 8px;
  }

  body.game-focus-mode #game .game-stat{
    min-height:40px;
    padding:6px 8px;
  }

  body.game-focus-mode #game .game-stat small{
    font-size:7px;
    letter-spacing:.10em;
  }

  body.game-focus-mode #game .game-stat strong{
    font-size:17px;
  }

  body.game-focus-mode #game .game-icon-btn{
    min-height:40px;
    font-size:8px;
  }

  body.game-focus-mode #game .game-focus-btn{
    grid-column:span 2;
  }

  body.game-focus-mode #game .game-stage{
    flex:1 1 auto;
    width:100%;
    height:auto;
    min-height:0;
    max-height:none;
    aspect-ratio:auto !important;
  }

  body.game-focus-mode #game .game-footer{
    display:none;
  }

  body.game-focus-mode #game .mobile-flap-btn{
    flex:0 0 auto;
    width:calc(100% - 20px);
    min-height:60px;
    margin:8px 10px max(8px,env(safe-area-inset-bottom));
    font-size:16px;
  }

  body.game-focus-mode #game .game-overlay-inner{
    max-width:340px;
  }
}


/* =========================================================
   V6 MOBILE TUNE — LIGHTER / COMPACT / HAPTIC READY
   ========================================================= */

#game .game-vibe-btn{
  display:none;
}

#game .game-icon-btn.is-disabled{
  opacity:.45;
  pointer-events:none;
}

@media (max-width:820px){
  body.touch-device #particleCanvas,
  body.touch-device .floating-feather,
  body.touch-device .cursor-glow{
    display:none !important;
  }

  #game .game-wrap{
    width:min(100%, 680px);
  }

  #game .game-topbar{
    display:grid !important;
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:8px;
    align-items:stretch;
    padding:10px;
  }

  #game .game-stat{
    min-height:44px;
    padding:8px 10px;
  }

  #game .game-stat small{
    font-size:8px;
    letter-spacing:.14em;
  }

  #game .game-stat strong{
    font-size:20px;
  }

  #game .game-icon-btn{
    margin-left:0;
    width:100%;
    min-height:44px;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0 8px;
    font-size:11px;
    letter-spacing:.08em;
  }

  #game .game-vibe-btn,
  #game .game-focus-btn{
    display:flex;
  }

  #game .game-stage{
    aspect-ratio:4 / 5;
    min-height:400px;
    max-height:70svh;
  }

  #game .game-footer{
    gap:8px 12px;
    padding:10px 10px 8px;
    font-size:8.5px;
    line-height:1.35;
  }

  #game .mobile-flap-btn{
    margin:0 10px 12px;
    min-height:54px;
    font-size:14px;
  }
}

@media (max-width:480px){
  #game .game-topbar{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:7px;
  }

  #game .game-stat{
    min-height:42px;
    padding:7px 8px;
  }

  #game .game-stat strong{
    font-size:18px;
  }

  #game .game-icon-btn{
    min-height:42px;
    font-size:10px;
    letter-spacing:.05em;
  }

  #game .game-stage{
    aspect-ratio:4 / 5;
    min-height:380px;
    max-height:66svh;
  }
}

@media (max-width:820px){
  body.game-focus-mode #game .game-topbar{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:6px;
    padding:max(8px,env(safe-area-inset-top)) 8px 8px;
  }

  body.game-focus-mode #game .game-stat{
    min-height:40px;
    padding:6px 8px;
  }

  body.game-focus-mode #game .game-stat small{
    font-size:7px;
  }

  body.game-focus-mode #game .game-stat strong{
    font-size:16px;
  }

  body.game-focus-mode #game .game-icon-btn{
    min-height:40px;
    padding:0 4px;
    font-size:9px;
    letter-spacing:.04em;
  }

  body.game-focus-mode #game .game-stage{
    flex:1 1 auto;
    width:100%;
    height:auto;
    min-height:0;
    max-height:none;
    aspect-ratio:auto !important;
  }

  body.game-focus-mode #game .mobile-flap-btn{
    min-height:58px;
    margin:8px 10px max(8px,env(safe-area-inset-bottom));
  }
}


@media(max-width:820px){
  body.game-focus-mode #game .local-leaderboard{
    display:none;
  }
}


/* =========================================================
   V6.2 — FULL SCREEN BUTTON REMOVED
   ========================================================= */

#game .game-focus-btn{
  display:none !important;
}

/* Restore normal page flow even if an old focus-mode class somehow exists. */
body.game-focus-mode{
  overflow:auto !important;
  overscroll-behavior:auto !important;
}

body.game-focus-mode #game .game-wrap{
  position:relative !important;
  inset:auto !important;
  z-index:auto !important;
  width:min(1080px,100%) !important;
  height:auto !important;
  max-width:1080px !important;
  margin:0 auto !important;
  border:1px solid rgba(157,255,0,.28) !important;
  border-radius:20px !important;
  display:block !important;
}

body.game-focus-mode #game .game-footer,
body.game-focus-mode #game .local-leaderboard{
  display:flex !important;
}

body.game-focus-mode #game .local-leaderboard{
  display:block !important;
}
