/* ==========================================================================
   LuckyNick — style.css
   Mobile-first, cảm giác full-screen như native app (chuẩn bị cho TWA).
   Giữ file nhỏ gọn để load < 0.5s trên mạng di động.
   ========================================================================== */

:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html, body {
  height: 100%;
  overscroll-behavior: none;      /* chặn hiệu ứng "kéo bật lại" gây cảm giác web, không giống app */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;      /* bỏ delay 300ms khi tap trên mobile */
}

body {
  -webkit-user-select: none;
  user-select: none;
  overflow-x: hidden;
}

/* Cho phép chọn text ở input/textarea bình thường */
input, textarea {
  -webkit-user-select: text;
  user-select: text;
}

.safe-top { padding-top: var(--safe-top); }
.safe-bottom { padding-bottom: calc(var(--safe-bottom) + 8px); }

/* ===== Ad slot placeholders — media buyer thay bằng code AdSense/network thật ===== */
.ad-slot { display: flex; align-items: center; justify-content: center; margin: 8px 0; min-height: 50px; }
.ad-slot--top, .ad-slot--ingame-top { min-height: 50px; }
.ad-slot--bottom-sticky {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  background: rgba(2, 6, 23, 0.92);
  backdrop-filter: blur(6px);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 6px 8px calc(6px + var(--safe-bottom));
}
.ad-placeholder {
  width: 100%;
  border: 1px dashed rgba(255,255,255,0.25);
  border-radius: 10px;
  font-size: 11px;
  letter-spacing: .04em;
  color: rgba(255,255,255,0.35);
  padding: 14px 8px;
  text-align: center;
}

/* ===== Game card tap feedback ===== */
.game-card { -webkit-tap-highlight-color: transparent; }

/* ===== Overlay modals (fallback nếu Tailwind CDN load chậm) ===== */
#rewardedOverlay.flex, #resultOverlay.flex,
#g1_rewarded.flex, #g2_rewarded.flex,
#cw_result_overlay.flex, #cw_rewarded.flex, #cw_stage.flex,
#th_result_overlay.flex, #th_rewarded.flex { display: flex; }

/* ===== Spin button disabled state ===== */
#spinBtn:disabled, #cw_spin:disabled, #th_spin:disabled { opacity: .5; pointer-events: none; }

/* ===== Loading skeleton nhẹ cho play-count (tránh layout shift) ===== */
.js-play-count { min-height: 14px; }

/* Fallback cứng cho .hidden — phòng khi Tailwind CDN load chậm/lỗi mạng,
   tránh 2 màn hình/overlay chồng lên nhau. */
.hidden { display: none !important; }

/* ==========================================================================
   RADAR TÌNH YÊU — tile trang chủ dạng ảnh/poster (bấm ảnh để chơi)
   ========================================================================== */
.tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 22px;
  overflow: hidden;
  text-align: left;
  border: 1px solid rgba(255,255,255,.08);
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}
.tile:active { transform: scale(.97); }
.tile-bg { position: absolute; inset: 0; }
.tile-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 16px 12px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.78) 60%);
}
.tile-badge {
  position: absolute; top: 10px; right: 10px;
  font-size: 10px; font-weight: 800; letter-spacing: .05em;
  padding: 4px 9px; border-radius: 999px;
  background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.2);
  backdrop-filter: blur(4px);
}
.tile-play {
  position: absolute; top: 10px; left: 10px;
  width: 30px; height: 30px; border-radius: 999px;
  background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}

/* Trang trí Radar (game "Đo Độ Hợp") */
.radar-bg { background: radial-gradient(circle at 50% 42%, #ff2e93 0%, #a21caf 45%, #2c0a3e 100%); }
.radar-rings { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: .55; }
.radar-rings i { position: absolute; border: 1.5px solid rgba(255,255,255,.55); border-radius: 50%; }
.radar-rings i:nth-child(1) { width: 60px; height: 60px; }
.radar-rings i:nth-child(2) { width: 110px; height: 110px; }
.radar-rings i:nth-child(3) { width: 165px; height: 165px; }
.radar-sweep {
  position: absolute; inset: 0; margin: auto; width: 165px; height: 165px; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(255,255,255,.55), transparent 35%);
  animation: ln-spin 3.2s linear infinite;
  mix-blend-mode: screen;
}
.radar-heart { position: relative; font-size: 40px; filter: drop-shadow(0 0 10px rgba(255,255,255,.6)); animation: ln-pulse 1.6s ease-in-out infinite; }

/* Trang trí huyền bí (game "Triệu Hồi Kiếp Trước") */
.mystic-bg { background: radial-gradient(circle at 50% 42%, #6d28d9 0%, #1e1147 45%, #0a0518 100%); }
.mystic-ring {
  position: absolute; inset: 0; margin: auto; width: 150px; height: 150px; border-radius: 50%;
  border: 2px dashed rgba(196,181,253,.55);
  animation: ln-spin 9s linear infinite;
}
.mystic-ring--2 { width: 110px; height: 110px; animation-duration: 6s; animation-direction: reverse; border-style: dotted; }
.mystic-orb { font-size: 42px; filter: drop-shadow(0 0 14px rgba(196,181,253,.7)); animation: ln-floaty 2.4s ease-in-out infinite; }

@keyframes ln-spin { to { transform: rotate(360deg); } }
@keyframes ln-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes ln-floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes ln-glow { 0%,100% { box-shadow: 0 0 16px rgba(255,0,127,.35);} 50% { box-shadow: 0 0 30px rgba(168,85,247,.75);} }
.glow-border { animation: ln-glow 3s ease-in-out infinite; }

/* Đồng hồ đếm số ngày kiểu "digit box" */
.digit-box {
  font-variant-numeric: tabular-nums;
  background: #150a24; border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px; padding: 6px 4px; min-width: 30px; text-align: center;
  font-weight: 900; font-size: 20px; color: #ff6fc4;
}

.screen-fade { animation: ln-fadeIn .25s ease; }
@keyframes ln-fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================================================
   VÒNG QUAY — tile trang chủ (visual = 'wheel') + engine wheel-core.js
   ========================================================================== */
.wheel-bg { background: radial-gradient(circle at 50% 45%, #3b1466 0%, #1a0b2e 68%, #0a0518 100%); }
.wheel-deco {
  position: absolute; inset: 0; margin: auto; width: 150px; height: 150px; border-radius: 50%;
  background: conic-gradient(
    #7C3AED 0deg 45deg, #EC4899 45deg 90deg, #F59E0B 90deg 135deg, #10B981 135deg 180deg,
    #3B82F6 180deg 225deg, #EF4444 225deg 270deg, #A855F7 270deg 315deg, #22C55E 315deg 360deg);
  border: 3px solid rgba(255,255,255,.25);
  box-shadow: 0 0 24px rgba(168,85,247,.5);
  animation: ln-spin 7s linear infinite;
}
.wheel-emoji { position: relative; font-size: 34px; filter: drop-shadow(0 1px 4px rgba(0,0,0,.55)); }

/* Nhãn từng ô do wheel-core.js sinh ra — đặt quanh vành, chữ luôn đứng thẳng */
.wc-label {
  position: absolute; inset: 0;
  display: flex; justify-content: center;
  pointer-events: none;
}
.wc-label-text {
  margin-top: 14px;
  max-width: 42%;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform-origin: center top;
  line-height: 1;
}
/* Kim chỉ vòng quay — đặt absolute cứng (không phụ thuộc Tailwind CDN) để không đè nút quay */
.wheel-pointer {
  position: absolute;
  left: 50%;
  top: -6px;
  transform: translateX(-50%);
  z-index: 10;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.5));
}
/* Khung vòng quay luôn tròn (fallback nếu Tailwind CDN lỗi) + SVG lấp đầy */
#cw_wheel, #th_wheel { border-radius: 50%; }
#cw_wheel svg, #th_wheel svg { display: block; width: 100%; height: 100%; }
