/* =========================================================================
   SKYPATROL ATC — STYLES
   ========================================================================= */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-user-select: none; user-select: none; }
input, textarea { -webkit-user-select: text; user-select: text; }
:root {
  --btn-red: #E74C3C; --btn-red-shadow: #B03A2E;
  --btn-green: #22C55E; --btn-green-shadow: #15803D;
  --btn-blue: #3B82F6; --btn-blue-shadow: #1D4ED8;
  --btn-purple: #8B5CF6; --btn-purple-shadow: #6D28D9;
  --ad-gold: #F1C40F;
  --glass: rgba(10, 18, 32, 0.62);
  --glass-border: rgba(255, 255, 255, 0.18);
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-num: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}
html, body { height: 100%; }
body {
  background: radial-gradient(ellipse at top, #0E2340 0%, #050B16 70%);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  min-height: 100vh; font-family: var(--font-ui); overflow: hidden; color: #1E293B;
}

/* ---------- ad slots ---------- */
#adBannerTop {
  width: min(100vw, calc((100vh - 64px) * 16 / 9)); max-width: 1600px; height: 48px; margin-bottom: 6px;
  background: rgba(11, 26, 44, 0.85); border: 1px dashed rgba(241, 196, 15, 0.4); border-radius: 8px;
  display: flex; justify-content: center; align-items: center; color: var(--ad-gold);
  font-size: 11px; font-weight: 800; letter-spacing: 1px; overflow: hidden;
}
.ad-container-modal {
  width: 100%; min-height: 90px; background: #F8FAFC; border: 1px dashed var(--ad-gold); border-radius: 12px;
  margin: 14px 0; display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 10px; color: #718096; font-size: 11px; font-weight: 700; text-align: center;
}

/* ---------- game frame ---------- */
#game-container {
  position: relative;
  width: min(100vw, calc((100vh - 64px) * 16 / 9));
  max-width: 1600px;
  aspect-ratio: 16 / 9;
  background: #0B5C8C;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.06);
  border-radius: 16px; overflow: hidden;
  container-type: inline-size; container-name: game;
}
:fullscreen #game-container { width: min(100vw, calc(100vh * 16 / 9)); max-width: none; border-radius: 0; }
:fullscreen #adBannerTop { display: none; }
#threeCanvas, #gameCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#threeCanvas { z-index: 1; }
#gameCanvas { z-index: 2; cursor: crosshair; touch-action: none; }

/* ---------- HUD ---------- */
.hud { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
.top-hud-bar {
  position: absolute; top: 8px; left: 10px; right: 10px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px;
}
.hud-col { display: flex; align-items: center; gap: 6px; min-width: 0; pointer-events: auto; }
.hud-left { justify-content: flex-start; overflow: hidden; }
.hud-center { justify-content: center; align-items: center; flex-direction: column; gap: 2px; flex-shrink: 0; z-index: 2; }
.hud-right { justify-content: flex-end; overflow: hidden; }
.level-badge {
  background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: 5px 10px; border-radius: 18px; color: #FFF; font-weight: 800; font-size: 12px;
  display: flex; align-items: center; gap: 6px; border: 1px solid var(--glass-border); cursor: pointer;
  white-space: nowrap; min-width: 0; overflow: hidden; transition: background 0.15s, transform 0.1s;
}
.level-badge:hover { background: rgba(10, 18, 32, 0.85); transform: translateY(-1px); }
.sector-tag {
  background: linear-gradient(135deg, #F59E0B, #D97706); color: #FFF; font-size: 9px; font-weight: 900;
  padding: 2px 7px; border-radius: 10px; letter-spacing: 0.5px; text-transform: uppercase; flex: 0 0 auto;
}
.island-name { font-weight: 700; color: #BAE6FD; font-size: 11px; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.level-progress-wrap { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.progress-track { width: 64px; height: 8px; background: rgba(0, 0, 0, 0.55); border-radius: 4px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.3); }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #F1C40F, #2ECC71); border-radius: 4px; transition: width 0.3s ease-out; }
.progress-text { color: #FFF; font-weight: 800; font-size: 11px; text-shadow: 0 1px 3px #000; white-space: nowrap; font-family: var(--font-num); }

.landed-badge {
  font-family: 'Impact', 'Arial Black', sans-serif; font-size: 20px; line-height: 1;
  background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255, 255, 255, 0.3); padding: 5px 14px; border-radius: 14px; color: #FFF;
  text-shadow: -1.5px -1.5px 0 #000, 1.5px -1.5px 0 #000, -1.5px 1.5px 0 #000, 1.5px 1.5px 0 #000, 0 4px 8px rgba(0, 0, 0, 0.6);
  letter-spacing: 1.2px; white-space: nowrap; transition: transform 0.15s ease-out; flex-shrink: 0;
}
.landed-badge b { color: #6EE7B7; font-weight: inherit; }
.landed-badge small { font-size: 14px; color: #CBD5E1; margin-left: 2px; }
.score-badge {
  font-family: var(--font-num); font-size: 11px; font-weight: 800; color: #FDE68A;
  background: rgba(0, 0, 0, 0.45); padding: 1px 10px; border-radius: 10px; white-space: nowrap;
}
.score-badge .combo { color: #F97316; animation: comboPulse 0.6s ease-in-out infinite alternate; display: inline-block; }
@keyframes comboPulse { from { transform: scale(1); } to { transform: scale(1.25); } }
.score-bounce { animation: bounce 0.35s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes bounce { 0% { transform: scale(1); } 40% { transform: scale(1.28); } 100% { transform: scale(1); } }

.shields { display: flex; gap: 2px; background: var(--glass); border: 1px solid var(--glass-border); padding: 3px 7px; border-radius: 12px; }
.shield { color: #34D399; font-size: 13px; text-shadow: 0 0 6px rgba(52, 211, 153, 0.6); transition: all 0.3s; }
.shield.lost { color: #475569; text-shadow: none; transform: scale(0.85); }
.role-indicator-pill {
  background: var(--glass); backdrop-filter: blur(6px); padding: 5px 10px; border-radius: 14px; color: #2ECC71;
  font-size: 10px; font-weight: 800; display: flex; align-items: center; gap: 5px; border: 1px solid var(--glass-border); white-space: nowrap;
}
.round-icon-btn {
  width: 34px; height: 34px; border-radius: 10px; background: var(--glass); backdrop-filter: blur(6px);
  border: 1px solid var(--glass-border); color: #FFF; font-size: 15px; display: flex; justify-content: center; align-items: center;
  cursor: pointer; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3); transition: transform 0.1s, background 0.1s; flex: 0 0 auto;
}
.round-icon-btn:hover { background: rgba(10, 18, 32, 0.85); }
.round-icon-btn:active { transform: scale(0.92); }
.btn-red-pause {
  width: 36px; height: 34px; background: var(--btn-red); border: none; border-radius: 10px;
  box-shadow: 0 3px 0 var(--btn-red-shadow), 0 4px 8px rgba(0, 0, 0, 0.3); cursor: pointer;
  display: flex; justify-content: center; align-items: center; transition: transform 0.1s, box-shadow 0.1s; flex: 0 0 auto;
}
.btn-red-pause:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--btn-red-shadow); }
.pause-bar { width: 4px; height: 14px; background: #FFF; border-radius: 2px; margin: 0 2.5px; }

.bottom-left-controls { position: absolute; bottom: 14px; left: 14px; display: flex; align-items: center; gap: 10px; pointer-events: auto; }
.btn-red {
  width: 50px; height: 50px; background: var(--btn-red); border: none; border-radius: 14px;
  box-shadow: 0 5px 0 var(--btn-red-shadow), 0 8px 15px rgba(0, 0, 0, 0.3); cursor: pointer;
  display: flex; justify-content: center; align-items: center; transition: transform 0.1s, box-shadow 0.1s;
}
.btn-red:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--btn-red-shadow); }
.ff-arrow { width: 0; height: 0; border-top: 9px solid transparent; border-bottom: 9px solid transparent; border-left: 12px solid #FFF; margin-left: -2px; }
.speed-tag { color: #FFF; font-weight: 900; font-size: 18px; text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; min-width: 28px; font-family: var(--font-num); }
.bottom-right-controls { position: absolute; bottom: 14px; right: 14px; display: flex; gap: 6px; align-items: center; pointer-events: auto; }
.chip {
  display: flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px; border-radius: 10px;
  background: var(--glass); border: 1px solid var(--glass-border); color: #E2E8F0; font-size: 11px; font-weight: 800;
  font-family: var(--font-num); white-space: nowrap;
}
#weatherChip { display: none; color: #FCA5A5; border-color: rgba(252, 165, 165, 0.5); animation: comboPulse 0.9s ease-in-out infinite alternate; }

@container game (max-width: 900px) {
  .island-name, .role-indicator-pill { display: none; }
}
@container game (max-width: 768px) {
  .level-progress-wrap, #btnFullscreen, #btnSettings, #windChip { display: none; }
  .landed-badge { font-size: 17px; padding: 4px 11px; }
  .landed-badge small { font-size: 12px; }
}
@container game (max-width: 600px) {
  #btnOpenUserPanel, .shields { display: none; }
  .landed-badge { font-size: 14px; padding: 3px 8px; letter-spacing: 0.5px; }
  .score-badge { font-size: 10px; padding: 1px 6px; }
  .round-icon-btn { width: 30px; height: 30px; font-size: 13px; }
  .btn-red-pause { width: 32px; height: 30px; }
  .top-hud-bar { gap: 4px; left: 6px; right: 6px; top: 6px; }
}

/* Fallback Media Queries for window scaling / web popups */
@media screen and (max-width: 900px) {
  .island-name, .role-indicator-pill { display: none; }
}
@media screen and (max-width: 768px) {
  .level-progress-wrap, #btnFullscreen, #btnSettings, #windChip { display: none; }
  .landed-badge { font-size: 17px; padding: 4px 11px; }
  .landed-badge small { font-size: 12px; }
}
@media screen and (max-width: 600px) {
  #btnOpenUserPanel, .shields { display: none; }
  .landed-badge { font-size: 14px; padding: 3px 8px; letter-spacing: 0.5px; }
  .score-badge { font-size: 10px; padding: 1px 6px; }
  .round-icon-btn { width: 30px; height: 30px; font-size: 13px; }
  .btn-red-pause { width: 32px; height: 30px; }
  .top-hud-bar { gap: 4px; left: 6px; right: 6px; top: 6px; }
}

/* Chrome Extension Popup Mode */
html.is-extension, html.is-extension body {
  width: 800px;
  height: 520px;
  min-height: 520px;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
html.is-extension #game-container {
  width: 800px;
  height: 450px;
  max-width: 800px;
  border-radius: 8px;
}
html.is-extension #adBannerTop {
  width: 800px;
  height: 38px;
  margin-bottom: 4px;
}

/* ---------- banners / ticker / intro ---------- */
#alertBanner {
  position: absolute; top: 64px; left: 50%; transform: translateX(-50%); background: rgba(231, 76, 60, 0.95);
  color: #FFF; font-weight: 800; font-size: 13px; padding: 7px 18px; border-radius: 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4); display: none; pointer-events: none; white-space: nowrap; z-index: 50;
  max-width: 92%; overflow: hidden; text-overflow: ellipsis;
}
#alertBanner.big { font-family: 'Impact', 'Arial Black', sans-serif; font-size: 24px; letter-spacing: 2px; padding: 8px 24px; top: 17%; border: 3px solid rgba(255, 255, 255, 0.7); opacity: 0.95; }
#alertBanner.pop { animation: bannerPop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes bannerPop { 0% { transform: translateX(-50%) scale(0.4); opacity: 0; } 100% { transform: translateX(-50%) scale(1); opacity: 1; } }
#radioTicker {
  position: absolute; bottom: 20px; left: 50%; transform: translate(-50%, 20px); z-index: 12; pointer-events: none;
  background: rgba(2, 6, 23, 0.72); color: #A7F3D0; font-family: var(--font-num); font-size: 11px; font-weight: 600;
  padding: 6px 14px; border-radius: 10px; border: 1px solid rgba(110, 231, 183, 0.35); white-space: nowrap;
  max-width: 62%; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity 0.3s, transform 0.3s;
}
#radioTicker.show { opacity: 1; transform: translate(-50%, 0); }
#levelIntro {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -40%) scale(0.96); z-index: 60;
  width: min(92%, 520px); padding: 18px 22px; border-radius: 18px; color: #E2E8F0;
  background: linear-gradient(160deg, rgba(15, 30, 55, 0.92), rgba(5, 12, 26, 0.92));
  border: 1px solid rgba(125, 211, 252, 0.35); box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
  opacity: 0; pointer-events: none; transition: opacity 0.4s, transform 0.4s;
}
#levelIntro.show { opacity: 1; transform: translate(-50%, -50%) scale(1); pointer-events: auto; }
.li-kicker { font-size: 10px; font-weight: 900; letter-spacing: 2px; color: #FBBF24; margin-bottom: 4px; }
.li-title { font-family: 'Impact', 'Arial Black', sans-serif; font-size: 30px; letter-spacing: 1.5px; color: #FFF; margin-bottom: 8px; }
.li-title span { font-family: var(--font-num); font-size: 14px; color: #7DD3FC; background: rgba(125, 211, 252, 0.12); padding: 2px 8px; border-radius: 8px; vertical-align: middle; }
.li-row { font-size: 12px; margin: 4px 0; color: #CBD5E1; }
.li-row b { color: #FFF; font-family: var(--font-num); }
.li-new { margin-top: 8px; padding: 6px 10px; border-radius: 10px; background: rgba(251, 191, 36, 0.14); color: #FDE68A; font-weight: 800; font-size: 12px; }
.li-tip { margin-top: 10px; font-size: 11px; color: #94A3B8; border-top: 1px solid rgba(255, 255, 255, 0.1); padding-top: 8px; }

/* ---------- main menu ---------- */
#mainMenuScreen {
  position: absolute; inset: 0; z-index: 195; display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 16px; text-align: center; color: #FFF; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: radial-gradient(circle at center, rgba(8, 20, 45, 0.35) 0%, rgba(3, 10, 25, 0.8) 85%);
  animation: fadeIn 0.3s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.menu-radar-backdrop {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 640px; height: 640px; border-radius: 50%;
  border: 1.5px solid rgba(56, 189, 248, 0.2);
  box-shadow: 0 0 0 80px rgba(56, 189, 248, 0.035), 0 0 0 160px rgba(56, 189, 248, 0.025), 0 0 0 240px rgba(56, 189, 248, 0.015);
  pointer-events: none;
}
.menu-radar-sweep { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, rgba(56, 189, 248, 0.22) 0deg, rgba(56, 189, 248, 0) 65deg, rgba(56, 189, 248, 0) 360deg); animation: radarRotate 6s linear infinite; }
@keyframes radarRotate { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.menu-radar-crosshair-x { position: absolute; top: 50%; left: 0; width: 100%; height: 1px; background: rgba(56, 189, 248, 0.15); }
.menu-radar-crosshair-y { position: absolute; top: 0; left: 50%; width: 1px; height: 100%; background: rgba(56, 189, 248, 0.15); }
.menu-content-card {
  position: relative; z-index: 2; width: 100%; max-width: 430px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: rgba(5, 14, 32, 0.65); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 22px; padding: 18px 18px 14px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5); margin: auto 0;
}
.menu-logo-badge { font-size: 40px; filter: drop-shadow(0 4px 15px rgba(56, 189, 248, 0.4)); animation: planeHover 3s infinite ease-in-out; }
@keyframes planeHover { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(-3deg); } }
.menu-title-main { font-family: 'Impact', 'Arial Black', sans-serif; font-size: 36px; letter-spacing: 2.5px; color: #FFF; text-shadow: 0 4px 14px rgba(0, 0, 0, 0.7), 0 0 22px rgba(56, 189, 248, 0.45); line-height: 1.05; }
.menu-title-sub { font-size: 10px; font-weight: 800; letter-spacing: 2px; color: #FBBF24; text-transform: uppercase; }
.menu-tag-pill { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 20px; padding: 4px 12px; font-size: 9.5px; font-weight: 800; color: #CBD5E1; letter-spacing: 0.8px; margin-bottom: 6px; }
.menu-button-stack { width: 100%; display: flex; flex-direction: column; gap: 7px; }
.btn-menu-action {
  width: 100%; padding: 11px 16px; border: none; border-radius: 13px; font-family: inherit; font-size: 13px; font-weight: 900; letter-spacing: 0.8px;
  cursor: pointer; display: flex; align-items: center; justify-content: space-between; color: #FFF;
  transition: transform 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.15s; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.btn-menu-action:hover { transform: translateY(-2px) scale(1.01); filter: brightness(1.1); }
.btn-menu-action:active { transform: translateY(1px); }
.btn-menu-primary { background: linear-gradient(135deg, #10B981, #059669); box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45); font-size: 15px; padding: 14px 18px; }
.btn-menu-secondary { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); }
.btn-menu-hangar { background: linear-gradient(135deg, #6366F1, #4F46E5); }
.btn-menu-gold { background: linear-gradient(135deg, #F59E0B, #D97706); }
.menu-footer-bar {
  margin-top: 6px; display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; padding: 7px 10px;
  background: rgba(0, 0, 0, 0.35); border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.1); font-size: 10px; color: #94A3B8; font-weight: 700;
}
.menu-footer-bar > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- title / login ---------- */
#titleLoginScreen {
  position: absolute; inset: 0; z-index: 200; display: none; flex-direction: column; justify-content: center; align-items: center;
  padding: 16px; text-align: center; color: #FFF; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: linear-gradient(180deg, rgba(14, 60, 110, 0.88) 0%, rgba(5, 20, 45, 0.96) 100%); animation: fadeIn 0.3s ease-out;
}
.game-logo-badge { font-size: 44px; animation: planeHover 3s infinite ease-in-out; }
.game-title-main { font-family: 'Impact', 'Arial Black', sans-serif; font-size: 34px; letter-spacing: 2px; text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); }
.game-title-sub { font-size: 12px; font-weight: 800; letter-spacing: 2px; color: #FBBF24; text-transform: uppercase; margin-bottom: 14px; }
.login-box-card { background: #FFF; color: #1E293B; border-radius: 20px; padding: 20px 22px; width: 100%; max-width: 380px; box-shadow: 0 15px 45px rgba(0, 0, 0, 0.5); margin: 6px 0; }
.oauth-container { display: flex; flex-direction: column; gap: 9px; margin-bottom: 12px; }
.btn-oauth {
  width: 100%; padding: 11px; border-radius: 12px; border: 1.5px solid #CBD5E1; background: #FFF; color: #1E293B; font-weight: 800; font-size: 14px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08); transition: all 0.15s;
}
.btn-oauth:hover { background: #F8FAFC; border-color: #3B82F6; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15); }
.btn-oauth.google { border-color: #E2E8F0; }
.auth-divider { display: flex; align-items: center; margin: 10px 0; color: #94A3B8; font-size: 11px; font-weight: 800; letter-spacing: 1px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; border-bottom: 1px solid #E2E8F0; }
.auth-divider span { padding: 0 8px; }

/* ---------- Email OTP styles ---------- */
.otp-code-input {
  text-align: center; font-family: var(--font-num); font-size: 22px; font-weight: 900;
  letter-spacing: 8px; padding: 10px 14px; color: #0F172A; background: #F8FAFC;
  border: 2px solid #94A3B8; border-radius: 12px; transition: all 0.2s;
}
.otp-code-input:focus { border-color: #3B82F6; background: #FFF; box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15); outline: none; }
.otp-dev-hint {
  background: #EFF6FF; border: 1px dashed #60A5FA; color: #1E40AF;
  padding: 6px 10px; border-radius: 8px; font-size: 11px; font-weight: 700;
  margin: 6px 0; text-align: center; animation: fadeIn 0.3s ease-out;
}
.otp-resend-row {
  display: flex; justify-content: center; align-items: center; gap: 8px;
  margin-top: 8px; font-size: 11px; color: #64748B; font-weight: 700;
}

/* ---------- modals ---------- */
.modal-overlay {
  position: absolute; inset: 0; background: rgba(3, 10, 20, 0.78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: none; flex-direction: column; justify-content: center; align-items: center; pointer-events: auto; z-index: 210; padding: 14px;
}
.modal-card {
  background: #FFF; border-radius: 20px; padding: 20px; width: 100%; max-width: 440px; max-height: 92%; overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6); animation: popIn 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275); position: relative;
}
@keyframes popIn { from { transform: scale(0.88); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; border-bottom: 2px solid #F0F2F5; padding-bottom: 10px; }
.modal-title { font-size: 18px; font-weight: 900; color: #1E293B; display: flex; align-items: center; gap: 6px; }
.modal-close { background: #F1F2F6; border: none; width: 32px; height: 32px; border-radius: 50%; font-size: 15px; font-weight: 800; color: #7F8C8D; cursor: pointer; }
.modal-close:hover { background: #E4E7EB; color: #333; }
.segmented-control { display: flex; background: #E2E8F0; border-radius: 10px; padding: 3px; gap: 3px; }
.segmented-btn { border: none; background: transparent; padding: 8px 10px; font-size: 12px; font-weight: 700; border-radius: 8px; color: #64748B; cursor: pointer; transition: all 0.15s; flex: 1; text-align: center; }
.segmented-btn.active { background: #FFF; color: #1E293B; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12); }
.input-field { width: 100%; padding: 11px 14px; border-radius: 10px; border: 1px solid #CBD5E1; font-size: 14px; font-weight: 600; outline: none; transition: border-color 0.2s; }
.input-field:focus { border-color: #3B82F6; }
.input-wrapper { position: relative; margin-bottom: 10px; }
.input-toggle-btn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 16px; color: #64748B; }
.range-slider { width: 100%; accent-color: #3B82F6; cursor: pointer; }
.btn-action {
  width: 100%; padding: 12px; font-size: 14px; font-weight: 900; color: #FFF; background: var(--btn-green); border: none; border-radius: 12px;
  box-shadow: 0 4px 0 var(--btn-green-shadow); cursor: pointer; margin: 5px 0; transition: transform 0.1s;
}
.btn-action:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--btn-green-shadow); }
.btn-secondary { background: var(--btn-blue); box-shadow: 0 4px 0 var(--btn-blue-shadow); }
.btn-purple { background: var(--btn-purple); box-shadow: 0 4px 0 var(--btn-purple-shadow); }
.btn-danger { background: var(--btn-red); box-shadow: 0 4px 0 var(--btn-red-shadow); }
.btn-ghost { background: #E2E8F0; color: #334155; box-shadow: 0 4px 0 #CBD5E1; }
.level-selector-box { background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 12px; padding: 14px; margin-bottom: 12px; text-align: center; }
.level-num-display { font-size: 30px; font-weight: 900; color: #0F172A; font-family: var(--font-num); }
.level-stepper-btns { display: flex; justify-content: center; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.level-stepper-btns .btn-action { width: auto; padding: 7px 12px; font-size: 12px; margin: 0; }
.leaderboard-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.leaderboard-table th { text-align: left; font-size: 11px; color: #64748B; padding: 8px 6px; border-bottom: 2px solid #E2E8F0; text-transform: uppercase; }
.leaderboard-table td { padding: 9px 6px; font-size: 13px; font-weight: 700; color: #1E293B; border-bottom: 1px solid #F1F5F9; }
.rank-cell { width: 34px; text-align: center; font-weight: 900; }
.rank-1 { color: #EAB308; } .rank-2 { color: #94A3B8; } .rank-3 { color: #D97706; }
.verified-badge { display: inline-block; background: #DCFCE7; color: #16A34A; font-size: 10px; padding: 2px 5px; border-radius: 4px; margin-left: 4px; }
.leaderboard-guest-lock { text-align: center; padding: 22px 16px; background: #F8FAFC; border: 1.5px dashed #CBD5E1; border-radius: 14px; margin: 10px 0; }
.user-profile-header { display: flex; align-items: center; gap: 14px; background: #F8FAFC; padding: 12px; border-radius: 14px; margin-bottom: 12px; border: 1px solid #E2E8F0; }
.user-avatar { font-size: 30px; width: 50px; height: 50px; background: #E0E7FF; border-radius: 50%; display: flex; justify-content: center; align-items: center; }
.user-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.stat-box { background: #F1F5F9; padding: 10px; border-radius: 12px; text-align: center; }
.stat-val { font-size: 19px; font-weight: 900; color: #1E293B; font-family: var(--font-num); }
.stat-lbl { font-size: 10px; font-weight: 700; color: #64748B; text-transform: uppercase; }
.lc-stars { font-size: 34px; margin: 6px 0; letter-spacing: 4px; animation: bounce 0.6s cubic-bezier(0.2, 1.6, 0.4, 1); }
.lc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0; }
.lc-stats div { background: #F1F5F9; border-radius: 10px; padding: 8px 4px; display: flex; flex-direction: column; }
.lc-stats b { font-family: var(--font-num); font-size: 16px; color: #0F172A; }
.lc-stats span { font-size: 9px; font-weight: 800; color: #64748B; text-transform: uppercase; }
.lc-next { font-size: 12px; font-weight: 800; color: #0369A1; background: #E0F2FE; border-radius: 10px; padding: 7px; margin-bottom: 6px; }

/* ---------- hangar ---------- */
.modal-card.hangar-card { max-width: 760px; }
.hg-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.hg-tab { border: none; background: #E2E8F0; color: #475569; font-weight: 800; font-size: 11px; padding: 6px 10px; border-radius: 999px; cursor: pointer; }
.hg-tab.active { background: #1E293B; color: #FFF; }
.hg-body { display: grid; grid-template-columns: 190px 1fr; gap: 10px; }
.hg-list { max-height: 330px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; padding-right: 2px; }
.hg-item { text-align: left; border: 1px solid #E2E8F0; background: #F8FAFC; padding: 6px 8px; border-radius: 8px; font-size: 11px; font-weight: 700; color: #334155; cursor: pointer; }
.hg-item.active { background: #DBEAFE; border-color: #60A5FA; color: #1E3A8A; }
.hg-item.locked { opacity: 0.6; }
#hangarCanvas { width: 100%; height: 190px; border-radius: 14px; display: block; border: 1px solid #1E293B; }
.hg-name { font-size: 16px; font-weight: 900; color: #0F172A; margin-top: 8px; }
.hg-sub { font-size: 11px; font-weight: 700; color: #64748B; margin-bottom: 6px; }
.hg-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 11px; }
.hg-specs div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dashed #E2E8F0; padding: 3px 0; }
.hg-specs span { color: #64748B; font-weight: 700; }
.hg-specs b { color: #0F172A; text-align: right; }
.hg-nav { display: flex; gap: 8px; margin-top: 8px; }
.hg-nav .btn-action { margin: 0; }
@container game (max-width: 720px) { .hg-body { grid-template-columns: 1fr; } .hg-list { max-height: 110px; flex-direction: row; flex-wrap: wrap; } }

/* ---------- rewarded ad ---------- */
.ad-video-screen {
  width: 100%; height: 170px; background: linear-gradient(135deg, #09131F, #112233); border-radius: 14px; border: 2px solid rgba(241, 196, 15, 0.6);
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; align-items: center; color: #FFF; margin: 12px 0;
}
.ad-video-countdown { position: absolute; top: 10px; right: 12px; background: rgba(0, 0, 0, 0.8); border: 1px solid #F1C40F; color: #F1C40F; font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 12px; }
.ad-sponsor-tag { position: absolute; top: 10px; left: 12px; background: rgba(255, 255, 255, 0.15); font-size: 10px; font-weight: 800; color: #CBD5E1; padding: 3px 8px; border-radius: 6px; }
.ad-video-progress { position: absolute; bottom: 0; left: 0; width: 100%; height: 6px; background: rgba(255, 255, 255, 0.2); }
.ad-video-progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, #F1C40F, #2ECC71); transition: width 0.1s linear; }
.ad-video-content-center { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.ad-brand-logo { font-size: 38px; animation: planeHover 2s infinite ease-in-out; }
.ad-brand-title { font-size: 16px; font-weight: 900; letter-spacing: 1px; }
.ad-brand-desc { font-size: 11px; color: #94A3B8; max-width: 250px; }
.btn-link { background: none; border: none; color: #3B82F6; font-weight: 800; cursor: pointer; text-decoration: underline; margin-left: 4px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 13px; font-weight: 700; }
.setting-row input[type=checkbox] { width: 20px; height: 20px; }
.setting-label { font-size: 12px; font-weight: 800; color: #64748B; }

/* ---------- pilot briefing guide ---------- */
.pilot-guide-card {
  background: rgba(15, 23, 42, 0.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(56, 189, 248, 0.35); border-radius: 16px;
  padding: 12px 14px; max-width: 420px; width: 100%; margin-bottom: 12px; text-align: left;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35); animation: fadeIn 0.3s ease-out;
}
.pilot-guide-header {
  font-size: 11px; font-weight: 900; letter-spacing: 1.2px; color: #38BDF8;
  text-transform: uppercase; margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}
.pilot-guide-grid { display: flex; flex-direction: column; gap: 8px; }
.guide-item { display: flex; align-items: flex-start; gap: 10px; font-size: 11px; color: #CBD5E1; }
.guide-icon { font-size: 18px; line-height: 1; flex-shrink: 0; }
.guide-item b { display: block; color: #FFF; font-weight: 800; font-size: 11.5px; }
.guide-item span { line-height: 1.35; color: #94A3B8; }

/* ---------- guest level complete banner ---------- */
.lc-guest-banner {
  background: #FEF3C7; border: 1.5px solid #F59E0B; border-radius: 12px;
  padding: 10px 12px; margin: 8px 0 10px; text-align: center;
}

/* ---------- google oauth modal ---------- */
.google-oauth-card {
  max-width: 410px; padding: 22px; border-radius: 18px; border: 1px solid #dadce0;
  box-shadow: 0 16px 45px rgba(60, 64, 67, 0.35); text-align: left;
}
.google-oauth-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid #f1f3f4;
}
.google-account-list {
  display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px;
}
.google-account-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid #e8eaed; background: #fff; cursor: pointer; transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.google-account-item:hover {
  background: #f8fafd; border-color: #1a73e8; transform: translateY(-1px);
}
.google-account-item:active { transform: scale(0.98); }
.google-account-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: #e8f0fe;
  display: flex; justify-content: center; align-items: center; font-size: 19px; flex-shrink: 0;
}
.google-account-info {
  flex: 1; min-width: 0;
}
.google-account-name {
  font-size: 13.5px; font-weight: 800; color: #202124;
}
.google-account-email {
  font-size: 11px; color: #5f6368; text-overflow: ellipsis; overflow: hidden; white-space: nowrap;
}
.google-check-icon {
  color: #1a73e8; font-size: 14px; font-weight: 900;
}
.google-custom-account-section {
  border-top: 1px solid #f1f3f4; padding-top: 10px; margin-top: 6px;
}
.google-custom-trigger {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  font-size: 12.5px; font-weight: 700; color: #1a73e8; cursor: pointer; transition: background 0.15s;
}
.google-custom-trigger:hover {
  background: #f1f5f9;
}
.google-oauth-disclaimer {
  font-size: 10px; color: #70757a; line-height: 1.4; margin-top: 12px; padding-top: 8px; border-top: 1px solid #f1f3f4;
}

/* ---------- responsive mobile queries ---------- */
#rotateNoticePill {
  display: none;
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(14, 165, 233, 0.95);
  color: #FFF;
  font-size: 11px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  z-index: 250;
  pointer-events: none;
  white-space: nowrap;
  animation: pulse 2s infinite ease-in-out;
}

@media (max-width: 768px) and (orientation: portrait) {
  #rotateNoticePill { display: block; }
  body {
    padding: 0;
    margin: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    justify-content: flex-start;
  }
  #adBannerTop { display: none !important; }
  #game-container {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    aspect-ratio: auto;
    border-radius: 0;
    box-shadow: none;
  }
  .menu-content-card {
    padding: 14px 12px;
    border-radius: 18px;
    max-height: 94dvh;
    width: 96%;
  }
  .menu-title-main { font-size: 26px; }
  .btn-menu-action { padding: 10px 14px; font-size: 12.5px; }
  .btn-menu-primary { font-size: 14px; padding: 12px 16px; }
  .pilot-guide-card { display: none; } /* keep login screen clean and tap-ready */
}

@media (orientation: landscape) and (max-height: 520px) {
  body {
    padding: 0;
    margin: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
  #adBannerTop { display: none !important; }
  #game-container {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    aspect-ratio: auto;
    border-radius: 0;
    box-shadow: none;
  }
  .menu-content-card {
    padding: 10px 14px;
    border-radius: 16px;
    max-height: 96dvh;
  }
  .menu-button-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .btn-menu-primary {
    grid-column: 1 / -1;
    padding: 10px 14px;
  }
  .btn-menu-action {
    padding: 8px 10px;
    font-size: 11px;
  }
}

@media (max-width: 680px), (max-height: 520px) {
  .top-hud-bar { top: 6px; left: 6px; right: 6px; gap: 4px; }
  .level-badge { padding: 4px 7px; font-size: 11px; }
  .sector-tag { font-size: 8px; padding: 2px 4px; }
  .landed-badge { font-size: 16px; padding: 3px 8px; border-radius: 10px; }
  .landed-badge small { font-size: 12px; }
  .score-badge { font-size: 10px; padding: 1px 6px; }
  .round-icon-btn { width: 32px; height: 32px; font-size: 14px; border-radius: 8px; }
  .btn-red-pause { width: 32px; height: 32px; border-radius: 8px; }
  .bottom-left-controls { bottom: 8px; left: 8px; }
  .btn-red { width: 44px; height: 44px; border-radius: 12px; }
  .speed-tag { font-size: 14px; }
  .bottom-right-controls { bottom: 8px; right: 8px; gap: 4px; }
  .chip { height: 26px; padding: 0 6px; font-size: 9.5px; }
  .modal-overlay { padding: 6px; }
  .modal-card { padding: 14px 12px; border-radius: 16px; max-height: 96dvh; }
  .login-box-card { padding: 14px 12px; border-radius: 16px; }
}

