/* =============================================================================
   Lucky Wheel 3D Studio Typography & Color System
   Single Studio Font Authority: Outfit (Weights: 400, 500, 600, 700, 800, 900)
   Game Color Palette: Radiant Championship Gold, Cyber Cyan, Crimson & Royal Purple
   ============================================================================= */

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('Outfit-SemiBold.ttf') format('truetype');
}

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: url('Outfit-Bold.ttf') format('truetype');
}

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('Outfit-SemiBold.ttf') format('truetype');
}

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('Outfit-SemiBold.ttf') format('truetype');
}

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('Outfit-SemiBold.ttf') format('truetype');
}

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('Outfit-Bold.ttf') format('truetype');
}

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('Outfit-Bold.ttf') format('truetype');
}

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('Outfit-Bold.ttf') format('truetype');
}

:root {
  /* Lucky Wheel Core Theme Palette */
  --wheel-gold: #ffd700;
  --wheel-gold-glow: rgba(255, 215, 0, 0.28);
  --wheel-cyan: #00f0ff;
  --wheel-cyan-glow: rgba(0, 240, 255, 0.25);
  --wheel-crimson: #eb1224;
  --wheel-purple: #a855f7;
  --wheel-amber: #ff9900;
  --wheel-green: #00e676;
  --wheel-slate: #94a3b8;

  /* Surfaces & Chassis */
  --wheel-bg-dark: #0a0a0f;
  --wheel-surface-card: #13141f;
  --wheel-surface-elevated: #1a1b2b;
  --wheel-border-subtle: rgba(255, 255, 255, 0.08);

  /* Single Studio Font Authority: 100% Outfit Across ALL Elements */
  --font-game-body: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-game-num: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* =========================================================================
     100% MATHEMATICAL & OPTICAL FONT EQUALITY WITH GAME CANVAS:
     In Unity (UIConfig.cs), the Canvas reference resolution width is 1080px
     and the game's strict mobile legibility floor is GlobalMinFontSize = 40pt
     (prescribed in AGENTS.md Rule 7: com.udp.ui mobile floor >= 40pt).
     
     Optical & Screen Ratio Math:
       Game Min Font Ratio = 40pt / 1080px = 0.037037 (3.7037% of screen width).
     
     By applying calc(40 / 1080 * 100vw) clamped to desktop/mobile constraints:
       - On a 390px mobile viewport: 390px * (40 / 1080) = 14.44px.
       - On a 414px mobile viewport: 414px * (40 / 1080) = 15.33px.
       - On desktop screens: smoothly clamps up to 16px to prevent viewport blowout.
     ========================================================================= */
  --game-ref-width: 1080;
  --game-min-font-pt: 40;
  --font-game-min: clamp(14px, calc(40 / 1080 * 100vw), 16px);
  --font-game-subtitle: calc(var(--font-game-min) * (44 / 40));
  --font-game-title: calc(var(--font-game-min) * (72 / 40));
  --font-game-hero: calc(var(--font-game-min) * (96 / 40));
}

/* Base Reset & Page Layout — 100% Strict Single Font Authority: Outfit */
*, *::before, *::after {
  box-sizing: border-box;
  font-family: var(--font-game-body);
}

button, input, select, textarea,
h1, h2, h3, h4, h5, h6,
p, span, a, label, summary, strong, em, b, i,
table, th, td {
  font-family: var(--font-game-body);
}

html, body { padding: 0; margin: 0; background: #0a0a0d; color: #ffffff; user-select: none; }

/* =============================================================================
   Web Portal Header
   ============================================================================= */
#web-portal-header {
  width: 100%;
  height: 54px;
  background: rgba(14, 15, 23, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--wheel-border-subtle);
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

.header-container {
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  flex-shrink: 0;
}

.header-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.header-brand-title {
  font-family: var(--font-game-body);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ffffff;
}

.header-brand-tag {
  font-family: var(--font-game-body);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 215, 0, 0.15);
  color: var(--wheel-gold);
  border: 1px solid rgba(255, 215, 0, 0.35);
}

.header-notice-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 5px 14px;
  max-width: 640px;
  overflow: hidden;
}

.notice-pill-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--wheel-gold);
  white-space: nowrap;
}

.notice-pill-text {
  font-size: 12px;
  color: #a0a2b0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.header-link {
  font-size: 13px;
  font-weight: 600;
  color: #9da1b0;
  text-decoration: none;
  transition: color 0.15s ease;
}

.header-link:hover {
  color: #ffffff;
}

.header-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #ffd700, #ffb800);
  color: #0b0c10;
  font-family: var(--font-game-body);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(255, 184, 0, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.header-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(255, 184, 0, 0.4);
}

/* =============================================================================
   Unity Container & Canvas
   ============================================================================= */
#unity-container {
  width: 100%;
  position: relative;
  background: #000000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#unity-canvas { background: #0a0a0d; outline: none !important; border: none !important; box-shadow: none !important; }
#unity-canvas:focus, #unity-canvas:focus-visible { outline: none !important; border: none !important; box-shadow: none !important; }

#unity-loading-bar {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: none;
  text-align: center;
  z-index: 20;
}

#unity-loading-text {
  font-family: var(--font-game-body);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #ffffff;
  margin-bottom: 12px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

#unity-progress-bar-empty { width: 260px; height: 16px; margin: 0 auto; background: #0a0814; border: 1.5px solid rgba(255, 214, 71, 0.45); border-radius: 10px; overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,0.6); }

#unity-progress-bar-full { width: 0%; height: 100%; background: linear-gradient(180deg, #ffe047 0%, #d4af37 100%); border-radius: 8px; transition: width 0.15s ease-out; }

#unity-warning {
  position: absolute;
  left: 50%;
  top: 20px;
  transform: translateX(-50%);
  background: rgba(220, 38, 38, 0.9);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  display: none;
  z-index: 30;
}

/* =============================================================================
   Scroll Cue Indicator
   ============================================================================= */
.scroll-cue-container {
  width: 100%;
  padding: 16px 20px;
  text-align: center;
  background: linear-gradient(180deg, rgba(14, 15, 23, 0.8), rgba(10, 10, 15, 1));
  border-bottom: 1px solid var(--wheel-border-subtle);
  color: #9da1b0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
  user-select: none;
}

.scroll-cue-container:hover {
  color: var(--wheel-gold);
  background: rgba(20, 21, 32, 0.95);
}

.scroll-cue-arrow {
  display: inline-block;
  margin-right: 6px;
  animation: bounceDown 1.6s infinite ease-in-out;
  color: var(--wheel-gold);
}

@keyframes bounceDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* =============================================================================
   Mobile Browser Block Overlay
   ============================================================================= */
.mobile-block-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, #191a2a 0%, #0a0a0f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  z-index: 50;
}

.mobile-block-card {
  max-width: 420px;
  width: 100%;
  background: rgba(22, 23, 36, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.mobile-block-badge {
  font-family: var(--font-game-body) !important;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #ffe047;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.18) 0%, rgba(255, 107, 0, 0.12) 100%);
  border: 1px solid rgba(255, 215, 71, 0.45);
  box-shadow: 0 0 16px rgba(255, 215, 71, 0.22);
  padding: 5px 16px;
  border-radius: 14px;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.mobile-block-icon-wrapper {
  position: relative;
  margin: 0 auto 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mobile-block-icon-wrapper::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 28px;
  background: conic-gradient(from 180deg at 50% 50%, var(--wheel-gold), #ff6b00, var(--wheel-crimson), var(--wheel-cyan), var(--wheel-green), var(--wheel-gold));
  opacity: 0.65;
  filter: blur(10px);
  z-index: 0;
  animation: iconHaloSpin 14s linear infinite;
}

@keyframes iconHaloSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.mobile-block-icon {
  position: relative;
  z-index: 1;
  width: 80px;
  height: 80px;
  border-radius: 22px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.65);
  border: 2px solid rgba(255, 255, 255, 0.25);
  display: block;
}

.mobile-block-title {
  font-family: var(--font-game-body) !important;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.2px;
  background: linear-gradient(180deg, #ffffff 20%, #ffd747 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
  margin: 0 0 12px 0;
}

.mobile-block-desc {
  font-family: var(--font-game-body) !important;
  font-size: 14.5px;
  color: #c8c8da;
  line-height: 1.6;
  margin: 0 0 16px 0;
}

.desc-hl-gold { color: #ffd747; font-weight: 600; }
.desc-hl-cyan { color: #00f0ff; font-weight: 600; }
.desc-hl-green { color: #00e676; font-weight: 600; }
.desc-hl-purple { color: #a855f7; font-weight: 600; }

.mobile-block-features {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  width: 100%;
}

.feature-chip {
  font-family: var(--font-game-body) !important;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 4px 10px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chip-gold {
  background: rgba(255, 215, 0, 0.12);
  border: 1px solid rgba(255, 215, 0, 0.38);
  color: #ffe047;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.15);
}

.chip-cyan {
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.38);
  color: #00f0ff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
}

.chip-green {
  background: rgba(0, 230, 118, 0.12);
  border: 1px solid rgba(0, 230, 118, 0.38);
  color: #00e676;
  box-shadow: 0 0 10px rgba(0, 230, 118, 0.15);
}

.mobile-block-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  width: 100%;
}

.store-badge-link {
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease;
  border-radius: 9px;
  display: inline-block;
}

.store-badge-link:not(.store-badge-disabled):hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 24px rgba(0, 230, 118, 0.35);
}

.store-badge-disabled {
  opacity: 0.65;
  filter: grayscale(30%);
  border: 1px dashed rgba(255, 255, 255, 0.25);
  cursor: default;
}

.store-badge-disabled:hover {
  transform: none;
}

/* =============================================================================
   Play on Mobile Dialog Modal
   ============================================================================= */
.play-mobile-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 45%, rgba(20, 24, 40, 0.88) 0%, rgba(6, 7, 12, 0.98) 100%);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 24px;
  box-sizing: border-box;
}

.play-mobile-card {
  font-family: var(--font-game-body) !important;
  max-width: 460px;
  width: 100%;
  background: 
    linear-gradient(180deg, rgba(22, 24, 38, 0.98) 0%, rgba(12, 13, 20, 0.99) 100%) padding-box,
    linear-gradient(135deg, var(--wheel-gold) 0%, #ff6b00 25%, var(--wheel-crimson) 50%, var(--wheel-cyan) 75%, var(--wheel-green) 100%) border-box;
  border: 2px solid transparent;
  border-radius: 26px;
  padding: 34px 28px 28px 28px;
  box-sizing: border-box;
  text-align: center;
  box-shadow: 
    0 26px 70px rgba(0, 0, 0, 0.85),
    0 0 35px var(--wheel-gold-glow),
    0 0 65px var(--wheel-cyan-glow);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  animation: modalPopIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPopIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.play-mobile-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #e0e0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 10;
}

.play-mobile-close-btn svg {
  display: block;
  width: 16px;
  height: 16px;
  stroke: currentColor;
  transition: transform 0.25s ease;
}

.play-mobile-close-btn:hover {
  background: rgba(255, 215, 71, 0.22);
  border-color: #ffd747;
  color: #ffd747;
  box-shadow: 0 0 18px rgba(255, 215, 71, 0.45);
  transform: scale(1.08);
}

.play-mobile-close-btn:hover svg {
  transform: rotate(90deg);
}

.play-mobile-close-btn:active {
  transform: scale(0.95);
}

.store-badge-status-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
  font-size: 11px;
  color: #7a7d8c;
}

.store-badge-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--wheel-green);
  box-shadow: 0 0 8px var(--wheel-green);
}

.status-active-label {
  color: var(--wheel-green);
  font-weight: 700;
}

.status-sep {
  color: #444755;
}

/* Hide footer store badges & ASO body content on mobile device (since blocking dialog already shows app CTA) */
body.is-mobile-device #web-portal-footer .footer-col-right,
body.is-mobile-device #web-portal-footer .store-badge-container,
body.is-mobile-device #aso-content-section {
  display: none !important;
}

@media (max-width: 768px) {
  .header-notice-pill {
    display: none;
  }
}
