* { box-sizing: border-box; }

:root { color-scheme: dark; --bg: #07101d; --surface: rgba(10, 22, 39, 0.84); --gold: #ffd357; --gold2: #e69918; --text: #fff; --muted: rgba(255, 255, 255, 0.72); }
html, body { min-height: 100%; margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Thai", "Noto Sans", Arial, sans-serif; }

html.dialog-open, body.dialog-open { overflow: hidden; }

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.download-page { position: relative; display: flex; align-items: center; justify-content: center; min-height: 100dvh; padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom)); overflow: hidden; }

.background-layer { position: fixed; inset: 0; background: linear-gradient(rgba(0, 10, 23, 0.24), rgba(0, 10, 23, 0.66)), url("../image/background.webp") center/cover no-repeat; }

.download-card { position: relative; z-index: 1; width: min(100%, 440px); padding: 30px 22px 24px; border: 1px solid rgba(255, 214, 87, 0.18); border-radius: 26px; background: radial-gradient( circle at 50% 0, rgba(255, 213, 87, 0.1), transparent 38% ), var(--surface); box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); text-align: center; }

.brand-logo { display: block; width: min(70%, 270px); max-height: 82px; margin: 0 auto 20px; object-fit: contain; }

.app-icon-wrap { display: flex; align-items: center; justify-content: center; width: 112px; height: 112px; margin: 0 auto 20px; border-radius: 25px; background: rgba(255, 255, 255, 0.05); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.34); }

.app-icon { display: block; width: 100%; height: 100%; border-radius: 25px; object-fit: cover; }

.page-title { margin: 0; color: var(--gold); font-size: clamp(27px, 7vw, 36px); line-height: 1.15; font-weight: 900; }
.page-description { max-width: 330px; margin: 12px auto 24px; color: var(--muted); font-size: 15px; line-height: 1.6; }

.download-actions { display: grid; gap: 13px; }
.download-button { width: 100%; min-height: 66px; display: flex; align-items: center; gap: 16px; padding: 10px 20px; border: 0; border-radius: 17px; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24); cursor: pointer; text-decoration: none; }
.download-button:active { transform: scale(0.985); }
.download-button-android { background: linear-gradient(180deg, #83e7a3, #2dbd73); color: #052616; }
.download-button-ios { background: linear-gradient(180deg, #f1f4f8, #aeb8c8); color: #101827; }
.download-button-icon { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, 0.24); font-size: 25px; }
.download-button-icon svg { width: 70%; aspect-ratio: 1 / 1; }

.apple-icon { font-size: 31px; padding-bottom: 3px; }

.download-button-content { display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.download-button-content strong { font-size: 16px; line-height: 1.25; font-weight: 900; }
.download-button-content small { margin-top: 2px; opacity: 0.72; font-size: 12px; }

.device-hint { min-height: 20px; margin: 14px 0 0; color: rgba(255, 255, 255, 0.66); font-size: 13px; line-height: 1.5; }

.security-note { display: inline-flex; align-items: center; gap: 7px; margin-top: 16px; color: rgba(255, 255, 255, 0.58); font-size: 12px; }
.security-note-icon { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: rgba(77, 213, 135, 0.14); color: #63e398; font-size: 12px; font-weight: 900; }

.install-overlay[hidden] { display: none; }
.install-overlay { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom)); background: rgba(0, 8, 20, 0.84); backdrop-filter: blur(13px); -webkit-backdrop-filter: blur(13px); }
.install-dialog { position: relative; width: min(100%, 420px); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 30px 22px 24px; border: 1px solid rgba(255, 214, 92, 0.34); border-radius: 24px; background: radial-gradient( circle at 50% 0, rgba(255, 205, 72, 0.13), transparent 42% ), linear-gradient(180deg, #101d32, #07101d); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5); text-align: center; }
.install-close { position: absolute; top: 12px; right: 14px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.75); font-size: 25px; }
.install-success-icon { display: flex; align-items: center; justify-content: center; width: 68px; height: 68px; margin: 0 auto 18px; border: 2px solid var(--gold); border-radius: 50%; background: rgba(255, 214, 87, 0.12); color: var(--gold); font-size: 34px; font-weight: 800; }
.install-dialog h2 { margin: 0; color: var(--gold); font-size: clamp(21px, 5.5vw, 27px); }
.install-dialog > p { margin: 12px auto 20px; color: rgba(255, 255, 255, 0.78); font-size: 15px; line-height: 1.65; }
.open-settings-button { display: block; width: 100%; min-height: 58px; border: 0; border-radius: 16px; background: linear-gradient( 180deg, #fff2a9 0%, var(--gold) 52%, var(--gold2) 100% ); color: #352100; font-size: 17px; font-weight: 900; }

.download-again-button { margin-top: 10px; padding: 11px 18px; border: 0; background: transparent; color: rgba(255, 255, 255, 0.7); font-size: 14px; text-decoration: underline; }

.install-steps { display: grid; gap: 10px; margin-top: 20px; text-align: left; }
.install-step { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 14px; background: rgba(255, 255, 255, 0.045); }
.install-step span { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: #332000; font-size: 14px; font-weight: 900; }
.install-step p { margin: 0; color: rgba(255, 255, 255, 0.88); font-size: 14px; }
.install-dialog .install-time-warning { margin: 16px 0 0; color: #ffcf5b; font-size: 13px; }
.install-dialog .settings-fallback { margin: 9px 0 0; color: rgba(255, 255, 255, 0.56); font-size: 12px; }

@media (max-height: 700px) {
	.download-page { align-items: flex-start; }
	.download-card { padding-top: 22px; }
	.app-icon-wrap { width: 92px; height: 92px; }
	.page-description { margin-bottom: 18px; }
}
