/* position: fixed + inset: 0 (thay vi chi overflow: hidden) de khoa trang khong cho Safari iOS tu
   cuon/day khi ban phim ao mo (no cuon de dua input an - dung de bat native keyboard - vao "giua"
   vung con nhin thay) - canvas luon dung yen, MobileKeyboardAvoider.cs tu quyet dinh day panel nao
   len bao nhieu dua tren KB_VisibleCanvasRatio (visualViewport). */
html, body { padding: 0; margin: 0; width: 100%; height: 100%; overflow: hidden; position: fixed; inset: 0; background: #000 }
/* Canvas size (width/height) is computed in JS to preserve the game's
   native aspect ratio. Centered with flexbox (not position+transform) --
   transform-based centering was observed to go stale until a real window
   resize forced a recomposite on this setup. The body's black background
   shows as letterbox bars on the sides. */
body { display: flex; align-items: center; justify-content: center }
#unity-container { position: relative }
#unity-canvas { background: #231F20; transform: translateZ(0) }
#unity-loading-bar { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none }
#unity-logo { width: 310px; height: 150px; max-width: 80vw; margin: 0 auto; background: url('unity-logo-dark.png') no-repeat center; background-size: contain }
/* Font game (subset tu Assets/Fonts: TitanOne cho so %, Baloo2 700 cho chu co dau) - chi vai KB,
   preload trong index.html. Them chu moi vao loading screen thi phai subset lai font. */
@font-face { font-family: 'LoadingPercent'; src: url('loading-percent.woff2') format('woff2'); font-display: block }
@font-face { font-family: 'LoadingText'; src: url('loading-text.woff2') format('woff2'); font-display: block }
#unity-progress-bar-empty { position: relative; width: 340px; max-width: 72vw; height: 28px; margin: 14px auto 0; box-sizing: border-box; border: 2px solid #f5c542; border-radius: 16px; background: rgba(20, 8, 0, .65); box-shadow: 0 0 0 2px #5a2400, inset 0 3px 6px rgba(0, 0, 0, .6); overflow: hidden }
#unity-progress-bar-full { position: relative; width: 0%; height: 100%; border-radius: 14px; background: linear-gradient(#ffe066, #ff9d00 55%, #e05a00); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55); overflow: hidden }
/* Vet sang chay lien tuc: giai doan compile wasm loader khong bao progress, bar van nhin la dang chay */
#unity-progress-bar-full::after { content: ''; position: absolute; top: 0; bottom: 0; width: 60px; left: -60px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: loading-shine 1.4s linear infinite }
@keyframes loading-shine { to { left: 100% } }
/* Chu trang dac (khong dung gradient vang/cam nhu truoc) - gradient do trung tong mau voi
   #unity-progress-bar-full khien so % bi mo khi de len phan thanh da lap day; trang tuong phan
   manh voi ca nen toi (empty bar) lan nen cam/vang (full bar), dong bo voi #unity-loading-text. */
#unity-progress-percent { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; font-family: 'LoadingPercent', 'Arial Black', sans-serif; font-size: 20px; line-height: 1; letter-spacing: 1px; color: #fff; -webkit-text-stroke: 4px #4a1800; paint-order: stroke fill; filter: drop-shadow(0 2px 0 #2a0c00); pointer-events: none }
#unity-progress-percent.bump { animation: loading-bump .25s ease-out }
@keyframes loading-bump { 0% { transform: translateY(-50%) scale(1.25) } 100% { transform: translateY(-50%) scale(1) } }
#unity-loading-text, #unity-loading-hint { text-align: center; font-family: 'LoadingText', sans-serif; font-weight: 700; color: #fff; -webkit-text-stroke: 3px #3a1400; paint-order: stroke fill; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .6)); white-space: nowrap }
#unity-loading-text { min-width: 16em; margin-top: 8px; font-size: 17px }
#unity-loading-hint { margin-top: 2px; font-size: 13px; color: #ffe7a8; opacity: 0; transition: opacity .6s }
#unity-loading-hint.show { opacity: 1 }
#unity-footer { display: none }
#unity-logo-title-footer { float:left; width: 102px; height: 38px; background: url('unity-logo-title-footer.png') no-repeat center }
#unity-build-title { float: right; margin-right: 10px; line-height: 38px; font-family: arial; font-size: 18px }
#unity-warning { position: absolute; left: 50%; top: 5%; transform: translate(-50%); background: white; padding: 10px; display: none }
