/* ============================================================
   준혁 카지노 · compat.css  (항상 마지막에 로드)
   ① 모든 환경 공통 안정화  ② html.lite (카톡 등 인앱 브라우저) 경량 모드
   ③ 인앱 브라우저 안내 배너  ④ 공통 폴리시
   ============================================================ */

/* ---------- ① 공통 안정화 ---------- */
:root{color-scheme:dark}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;-webkit-tap-highlight-color:transparent;background:#0c0605}
body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility;overflow-wrap:break-word;
  font-family:'Noto Sans KR','Apple SD Gothic Neo','Malgun Gothic','Nanum Gothic',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif}
img,svg,canvas,video{max-width:100%}
button,.button,a,summary,[role=button],label,select,input[type=checkbox]{touch-action:manipulation}
button{font-family:inherit}
input,textarea,select{font-size:16px;font-family:inherit;-webkit-appearance:none;appearance:none;border-radius:12px}
input[type=checkbox]{-webkit-appearance:checkbox;appearance:auto}
:focus-visible{outline:2px solid #f0d594;outline-offset:2px}
:focus:not(:focus-visible){outline:none}
[hidden]{display:none!important}
html.modal-open,html.modal-open body{overflow:hidden}
html.modal-open #htFab,html.modal-open #pf{visibility:hidden}
.modal,.ht-win,.game-modal,.auth-modal{-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
.modal-backdrop{overscroll-behavior:contain}
.site-header{padding-top:env(safe-area-inset-top,0px)}
footer{padding-bottom:calc(env(safe-area-inset-bottom,0px) + 14px)}
#toast{bottom:calc(env(safe-area-inset-bottom,0px) + 22px)}
#htFab{bottom:calc(env(safe-area-inset-bottom,0px) + 18px);right:calc(env(safe-area-inset-right,0px) + 16px)}
.button,.filter,.auth-tab,.choice,.match-row{min-height:44px}
.game-card,.button,.filter,.match-row,.choice{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
input,textarea{-webkit-user-select:text;user-select:text}

/* 가로 스크롤/삐져나옴 방지 */
body{max-width:100vw;overflow-x:hidden}
@supports (overflow:clip){body{overflow-x:clip}}

/* 모바일 폭 다듬기 */
@media(max-width:560px){
  .hero h1{font-size:clamp(38px,11.5vw,52px);line-height:1.12;letter-spacing:-.01em}
  .section-heading h2{font-size:clamp(28px,8.4vw,38px)}
  .wrap{padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
  .hero-actions{display:flex;flex-direction:column;gap:10px}
  .hero-actions .button{width:100%;justify-content:center}
  .game-tabs{display:flex;gap:8px;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none;padding-bottom:4px}
  .game-tabs::-webkit-scrollbar{display:none}
  .game-tabs .filter{flex:none}
}

/* ---------- ② 경량 모드 (카카오톡·인앱 브라우저·저사양) ---------- */
/* 겹겹이 쌓인 블러/블렌드/그레인이 인앱 웹뷰에서 깜빡임·검은 깨짐의 주 원인이라 전부 끄고,
   같은 분위기를 단색+그라디언트로 대체합니다. */
html.lite *,html.lite *::before,html.lite *::after{
  -webkit-backdrop-filter:none!important;backdrop-filter:none!important;mix-blend-mode:normal!important}
html.lite body::after,html.lite body:after{display:none!important;content:none!important}
html.lite #fx,html.lite #spot,html.lite #glow,html.lite .suit,html.lite #intro,html.lite .hero::before,html.lite .hero:before{display:none!important}
html.lite .hero:after,html.lite .hero-image,html.lite .igb:before,html.lite .hero-ticket,html.lite .game-card,
html.lite .button-gold,html.lite .button-gold:after,html.lite .brand-mark,html.lite .art-symbol,html.lite .hero h1 em,
html.lite .section-heading h2 em,html.lite .tr-box:before,html.lite .igb-ring,html.lite .igb-ico{animation:none!important}
html.lite .igb:before{display:none!important}
html.lite .game-card{will-change:auto!important;transform-style:flat!important;transform:none}
html.lite .rv,html.lite .motion-item{opacity:1!important;transform:none!important;filter:none!important;transition:none!important}
html.lite .hero h1 .ch{opacity:1!important;transform:none!important;animation:none!important}
html.lite .rs.blur,html.lite .slot-drum.is-spinning{filter:none!important}
html.lite .game-scene::before,html.lite .slot-g3 .cab::before{filter:none!important}
/* 고정 배경: 주소창이 접힐 때 크기가 출렁이지 않게 '가장 큰 높이'로 고정 */
html.lite .site-backdrop{top:0;left:0;right:auto;bottom:auto;width:100%;height:calc(var(--lvh,1vh)*100);
  transform:translateZ(0);-webkit-transform:translateZ(0)}
html.lite .site-backdrop:after{display:none}
/* 유리(블러) 패널 → 불투명 패널 */
html.lite .site-header{background:#150a07!important;box-shadow:0 6px 20px #0008}
html.lite .member-bar,html.lite .activity-board,html.lite .sports-shell,html.lite .account-card,html.lite .exchange,
html.lite .prediction-panel,html.lite #sim,html.lite #pf,html.lite .hero-ticket{
  background:linear-gradient(160deg,#26150f,#150b08)!important}
html.lite .modal-backdrop,html.lite .ht-bg{background:#050302f2!important}
html.lite .modal-backdrop{animation:none!important}
html.lite .modal{animation:none!important}
html.lite .button-outline,html.lite .button-transparent{background:#1c0f0a}
html.lite .hwend{background:#000d!important}
/* 히어로: 단색 그라디언트로 조명 느낌만 */
html.lite .hero-shade{background:radial-gradient(ellipse at 70% 30%,rgba(227,178,71,.16),transparent 60%),linear-gradient(180deg,rgba(10,5,4,.55),rgba(10,5,4,.82))!important}
html.lite .hero-ticket{box-shadow:0 14px 34px #000a,inset 0 1px 0 rgba(255,235,190,.14)}
/* 스크롤이 부드럽도록 */
html.lite{scroll-behavior:auto}

/* ---------- 공통 폴리시 ---------- */
/* 한글은 어절 단위로 줄바꿈 ("레드 시/티 FC" 같은 글자 단위 끊김 방지) */
body{word-break:keep-all;line-break:strict}
input,textarea,.teams span,.login-name{word-break:normal}
/* 게임 카드: <button> 기본 세로 가운데 정렬 때문에 그림 위치가 제각각이던 문제 */
.game-card{display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;border-radius:16px;width:100%;font-family:inherit}
.game-card-art{flex:none}
.game-card-info{flex:1;width:100%}
.game-card-info b{font-size:14px;letter-spacing:-.01em}
.game-card-info span{line-height:1.45}
/* 모서리/그림자 통일 */
.account-card,.exchange{border-radius:16px}
#realMatches .button{margin:12px 16px!important}
.toast,#toast{border-radius:999px;line-height:1.4}
/* 모바일 하단 고정 요소가 서로 겹치지 않도록 */
@media(max-width:560px){
  #pf{right:auto;width:auto;max-width:calc(100% - 150px);left:calc(env(safe-area-inset-left,0px) + 10px);bottom:calc(env(safe-area-inset-bottom,0px) + 12px)}
  #pf.min{max-width:calc(100% - 150px)}
  #htFab{bottom:calc(env(safe-area-inset-bottom,0px) + 12px);right:calc(env(safe-area-inset-right,0px) + 10px)}
  #toast,.toast{bottom:calc(env(safe-area-inset-bottom,0px) + 82px)!important;max-width:calc(100% - 28px)}
  .sup-btns .button{white-space:nowrap;min-width:0}
  .sup-btns{flex-direction:column}
  .sup-btns .button{width:100%}
  .header-inner{gap:10px}
}

/* ---------- ③ 인앱 브라우저 안내 배너 ---------- */
#iab{position:relative;z-index:120;display:flex;align-items:center;gap:10px;
  padding:calc(env(safe-area-inset-top,0px) + 9px) 10px 9px 14px;
  background:linear-gradient(90deg,#2b1a0b,#3a2510);border-bottom:1px solid #8b6a2f;color:#f6e6bd;font-family:inherit}
#iab .iab-ic{flex:none;display:grid;place-items:center;width:30px;height:30px;border-radius:50%;
  background:linear-gradient(135deg,#fff0b0,#e3b247);color:#2a1808;font-size:15px}
#iab .iab-tx{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.3}
#iab .iab-tx b{font-size:13px;font-weight:800}
#iab .iab-tx small{font-size:11px;color:#cdb585;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#iab .iab-go{flex:none;min-height:34px;padding:0 13px;border:0;border-radius:999px;font:800 12px/1 inherit;color:#241405;
  background:linear-gradient(135deg,#fff0b0,#e3b247);cursor:pointer}
#iab .iab-x{flex:none;width:30px;height:30px;border:0;border-radius:50%;background:transparent;color:#c9b07a;font-size:20px;line-height:1;cursor:pointer}
html.modal-open #iab{display:none}

/* ---------- ⑤ soft 모드 (카톡/인스타 인앱) ----------
   backdrop-filter 만 끄고, 네온·아우라·스토리 애니메이션은 유지 */
html.soft *,html.soft *::before,html.soft *::after{
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
}
html.soft .site-header{
  background:rgba(12,8,18,0.96)!important;
}
html.soft .site-backdrop{
  /* 고정 배경으로 주소창 출렁임 방지 */
  transform:translateZ(0);
  -webkit-transform:translateZ(0);
}
/* 유리 패널 → 불투명에 가까운 다크 패널 (애니메이션은 유지) */
html.soft .member-bar,
html.soft .activity-board,
html.soft .rank-board,
html.soft .sports-shell,
html.soft .account-card,
html.soft .exchange,
html.soft .prediction-panel{
  background:linear-gradient(165deg,rgba(22,14,30,0.98),rgba(10,6,16,0.99))!important;
}
html.soft .modal-backdrop,
html.soft .ht-bg,
html.soft .story-overlay{
  background:rgba(5,3,8,0.94)!important;
}
html.soft .story-dialog{
  background:linear-gradient(180deg,#16101c,#0c0812)!important;
}
/* 인앱에서도 네온 배너/서열/스토리 연출 유지 — animation:none 금지 */

/* 인앱 전용: will-change 과다 사용 완화 */
html.inapp .neon-ban-bg,
html.inapp .neon-ban-glow,
html.inapp .rank-card-shine{
  will-change:auto;
}


/* ---------- ⑥ 구형 커튼 인트로 완전 차단 (글리치 방지) ---------- */
#intro, #intro * { display: none !important; visibility: hidden !important; opacity: 0 !important; pointer-events: none !important; }
body.p4-intro { overflow: auto !important; }
html.p4-intro, body.p4-intro { overflow: auto !important; }

/* ---------- ⑦ 인앱 강력 안정화 (지지직/글리치 차단) ---------- */
html.inapp #fx,
html.inapp #spot,
html.inapp #glow,
html.kakao #fx,
html.kakao #spot,
html.kakao #glow {
  display: none !important;
}
html.inapp body::before,
html.inapp body::after,
html.kakao body::before,
html.kakao body::after,
html.soft body::before,
html.soft body::after {
  display: none !important;
  content: none !important;
  animation: none !important;
}
html.inapp .site-backdrop::before,
html.inapp .site-backdrop::after,
html.kakao .site-backdrop::before,
html.kakao .site-backdrop::after {
  display: none !important;
}
/* 네온 스캔/발광 연속 애니 제거 */
html.inapp .neon-ban-scan,
html.inapp .neon-ban-glow,
html.inapp .neon-ban-bg,
html.inapp .tt-banner-shine,
html.inapp .rank-card-shine,
html.inapp .neon-marquee-track,
html.kakao .neon-ban-scan,
html.kakao .neon-ban-glow,
html.kakao .neon-ban-bg,
html.kakao .tt-banner-shine,
html.kakao .rank-card-shine,
html.kakao .neon-marquee-track {
  animation: none !important;
}
html.inapp .neon-ban-1,
html.inapp .neon-ban-2,
html.inapp .tt-banner,
html.kakao .neon-ban-1,
html.kakao .neon-ban-2,
html.kakao .tt-banner {
  animation: none !important;
  filter: none !important;
}
html.inapp *,
html.kakao * {
  mix-blend-mode: normal !important;
}
/* filter 합성 버그 많은 속성 제한 (이미지 자체는 유지) */
html.inapp .hero,
html.inapp .hero *,
html.inapp .igb,
html.inapp .rank-card,
html.inapp .game-card,
html.kakao .hero,
html.kakao .hero *,
html.kakao .igb,
html.kakao .rank-card,
html.kakao .game-card {
  filter: none !important;
  -webkit-filter: none !important;
}
html.inapp .game-card,
html.kakao .game-card {
  transform: none !important;
  will-change: auto !important;
  transform-style: flat !important;
}
/* fixed 레이어 출렁임 완화 */
html.inapp .site-backdrop,
html.kakao .site-backdrop {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: auto !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 100vh !important;
  transform: none !important;
}
html.inapp .live-points,
html.inapp #pf,
html.kakao .live-points,
html.kakao #pf {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: #120c10 !important;
}
/* 스토리/게이트 외 모달도 단순화 */
html.inapp .modal-backdrop,
html.kakao .modal-backdrop {
  background: rgba(5,3,8,0.94) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
