/* Android fills the viewport. Controls stay inside the device safe area. */
.native-app .game-layout { padding: 0; }
.native-app .game-layout .arcade { border: 0; border-radius: 0; }
.native-app.menu-home #compactActions { display: none; }
.native-app .compact-tools {
  padding: max(6px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 6px max(10px, env(safe-area-inset-left));
}
.native-app .hud {
  padding-top: max(8px, env(safe-area-inset-top));
  padding-inline: max(10px, env(safe-area-inset-left)) max(10px, env(safe-area-inset-right));
}
.native-app .home-menu {
  padding-top: max(86px, 14dvh);
  padding-bottom: max(48px, env(safe-area-inset-bottom));
  --menu-icon-size: clamp(56px, 20vw, 76px);
  --menu-icon-top: 10px;
  --menu-icon-edge: 12px;
}
.native-app .home-menu .chest-button,
.native-app .home-menu .ranking-trophy {
  position: absolute; top: var(--menu-icon-top);
  width: var(--menu-icon-size); height: var(--menu-icon-size); z-index: 4;
  padding: 0; border: 0; background: transparent;
}
.native-app .home-menu .chest-button { right: max(var(--menu-icon-edge), env(safe-area-inset-right)); }
.native-app .home-menu .ranking-trophy { left: max(var(--menu-icon-edge), env(safe-area-inset-left)); }
.ranking-trophy img { display: block; width: 84%; height: 84%; margin: auto; object-fit: contain; filter: drop-shadow(0 4px 6px #0008); }
.ranking-trophy:active img { transform: scale(.93); }
.overlay:not(.home-menu) :is(.ranking-trophy, .profile-launch) { display: none; }
.profile-launch {
  position: absolute; bottom: max(10px, env(safe-area-inset-bottom)); left: max(12px, env(safe-area-inset-left));
  padding: 0 12px; min-height: 44px; max-width: 52%; z-index: 4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 1px solid #447266; border-radius: 9px; color: #b0f6d5; background: #12242b;
}
.native-app .about-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.native-app .about-links a { width: 100%; min-width: 0; min-height: 44px; padding: 7px 4px; display: grid; place-items: center; text-align: center; }
.native-app .about-links a:last-child { font-size: clamp(8px, 2.8vw, 11px); overflow-wrap: anywhere; }
.touch-firing-hint, .garage-tabs { display: none; }
.native-app .touch-firing-row {
  display: grid; grid-template-columns: minmax(0,1fr); gap: 7px; text-align: left;
  border: 1px solid #2f4a5a; border-radius: 11px; padding: 10px 12px; background: #10202e;
}
.native-app #autoFireSetting { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.native-app #autoFireSetting button { min-width: 0; min-height: 38px; padding: 0 4px; }
.native-app .touch-firing-hint { display: block; color: #a8bdca; line-height: 1.4; font-size: 11px; font-weight: 500; }
.native-app .garage-tabs {
  position: sticky; top: -1px; z-index: 2; display: grid; grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 6px; margin: 0 0 14px; padding: 5px; background: #101f2b; border: 1px solid #2f4a5a; border-radius: 12px;
}
.native-app .garage-tabs button { min-height: 44px; }
.native-app .garage-tabs [aria-pressed="true"] { background: #b0f6d5; color: #092c25; }
.native-app #shipShop[data-tab="fleet"] .garage-workbench,
.native-app #shipShop[data-tab="upgrades"] :is(.garage-fleet, .garage-preview, #equipShip, .garage-role) { display: none; }
.native-app #shipShop[data-tab="upgrades"] .garage-showcase h3 { margin-top: 0; }
.native-app #shipShop .garage-preview { height: clamp(98px, 22dvh, 180px); }
.native-app #shipShop .garage-preview > img { height: 78%; }
.native-app #shipShop .garage-body { display: flex; flex-direction: column; gap: 12px; }
.native-app #shipShop .fleet-label { margin-top: 4px !important; }
.native-app .rewards-body { grid-template-columns: 1fr; }
.native-app .reward-card .ad-progress { flex-basis: 100%; margin: 0; color: #b8c9d8; }
.native-app .mobile-card {
  width: min(420px, 94vw); max-height: 89dvh; padding: 16px;
  color: #e7f3f7; background: #0c1723; border: 1px solid #345160; border-radius: 16px;
}
.mobile-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mobile-card-heading button { flex: 0 0 44px; font-size: 21px; }
.mobile-card h2 { font-size: clamp(20px, 6vw, 28px); }
.mobile-card h3 { margin-top: 18px; }
.mobile-card button { padding: 0 12px; }
.mobile-card form:not([hidden]) { display: grid; gap: 7px; margin: 14px 0; }
.mobile-card form p { margin: 0 0 5px; }
.mobile-card input { min-height: 44px; width: 100%; padding: 0 10px; color: #fff; background: #101f2b; border: 1px solid #4b6878; border-radius: 8px; font-size: 16px; }
.mobile-card article a { color: #b0f6d5; }
.ranking-rows { display: grid; gap: 5px; padding: 0; list-style: none; counter-reset: rank; }
.ranking-rows li {
  counter-increment: rank; display: grid; grid-template-columns: 1.7rem minmax(0,1fr) auto; align-items: center;
  gap: 8px; min-height: 40px; padding: 6px 10px; background: #142536; border-radius: 8px;
}
.ranking-rows li::before { content: counter(rank); color: #b0f6d5; font-weight: 700; }
.ranking-rows li span { overflow-wrap: anywhere; }
.ranking-rows li strong { font-variant-numeric: tabular-nums; color: #ffdc88; }
@media (max-height: 570px) {
  .native-app .home-menu { padding-top: 68px; --menu-icon-size: 52px; }
  .native-app .home-menu h2 { margin-bottom: 14px; }
}

.native-app .ranking-trophy img,
.native-app .chest { filter: drop-shadow(0 0 9px #ffc56d80) drop-shadow(0 4px 5px #0008); }
.native-app .chest-rays { opacity: .72; }
.native-app .ranking-trophy img { position: relative; }
.ranking-clock {
  position: absolute; inset: 100% -5px auto; color: #ffdfa1;
  font: 700 11px "Neon Sans", sans-serif; font-variant-numeric: tabular-nums;
  letter-spacing: .02em; pointer-events: none;
}
.native-app .garage::backdrop { backdrop-filter: none; background: #030914eb; }
.native-app .revive-menu { backdrop-filter: none !important; background: #07111bdc !important; }
.native-app .revive-menu #start.revive-fill,
.native-app .revive-menu #retryRun.revive-fill {
  background-image: linear-gradient(90deg, #edac35 var(--revive-progress), transparent var(--revive-progress)) !important;
}
.native-app .revive-menu #retryRun.revive-fill {
  background-image: linear-gradient(90deg, #255b50 var(--revive-progress), transparent var(--revive-progress)) !important;
}
.native-app #shipShop { height: 94dvh; }
.native-app #shipShop .garage-preview > #garageShip {
  position: absolute; inset: 8%; width: 84%; height: 84%;
  max-width: none; max-height: none; object-fit: contain; object-position: center;
}
.native-app #shipShop .garage-body > section { width: 100%; min-width: 0; }
.native-app #shipShop[data-tab="upgrades"] .garage-body { min-height: calc(94dvh - 165px); }
.native-app #shipShop[data-tab="upgrades"] .garage-workbench {
  display: flex; flex-direction: column; flex: 1;
}
.native-app #shipShop[data-tab="upgrades"] #upgradeRows {
  flex: 1; display: grid; grid-template-rows: repeat(4, minmax(60px,1fr));
}
.native-app #shipShop[data-tab="upgrades"] .weapon-stage { min-height: clamp(62px, 12dvh, 102px); justify-content: center; }
.native-app .garage-tabs button[aria-pressed="true"] { background: #b0f6d5 !important; color: #092c25 !important; }
.garage .fleet-tile .tile-status.cost { display: inline-flex; align-items: center; gap: 3px; }
.garage .fleet-tile .tile-status.cost::after { content: none; }
.garage .price-coin { width: 12px; height: 12px; object-fit: contain; vertical-align: -2px; }
.garage #equipShip .price-coin, .garage .upgrade-row .price-coin { width: 15px; height: 15px; }
.native-app .fleet-tile strong { white-space: nowrap; font-size: clamp(8px, 2.55vw, 11px); letter-spacing: 0; }
.native-app .reward-card { gap: 8px; padding: 12px; }
.native-app .reward-card.ship header { width: 100%; }
.native-app .reward-card.ship header .coin-mark { width: 28px; height: 28px; }
.native-app .rewards-notice:empty, .mobile-card [role="status"]:empty { display: none; }
.control-choices { display: grid; gap: 8px; }
.control-choices small { display: block; font-size: 10px; }
.control-choices button { min-height: 48px; }
#rankingDialog { --ranking-columns: 26px minmax(0, 1fr) 62px 56px; }
.ranking-head, .ranking-rows li {
  display: grid; grid-template-columns: var(--ranking-columns);
  align-items: center; gap: 6px; padding-inline: 8px; text-align: center; font-size: 14px;
}
.ranking-prize { display: flex; align-items: center; justify-content: center; gap: 3px; color: #ffdc88; }
.ranking-prize img { width: 14px; height: 14px; object-fit: contain; }
.ranking-head { color: #b3c7d5; font: 700 12px var(--display); }
.ranking-caption { font-family: var(--display); }
.ranking-head > :nth-child(2), .ranking-rows li > :nth-child(2) { text-align: left; }
.ranking-rows li::before { content: none; }
.ranking-rows li > :nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-place { position: relative; display: grid; place-items: center; font: 700 13px var(--display); }
.ranking-place svg { width: 24px; height: 24px; fill: currentColor; }
.ranking-place b { position: absolute; inset: 8px 0 auto; text-align: center; font-size: 10px; color: #0a1320; }
.place-1 { color: #ffce63; }.place-2 { color: #c7d8e4; }.place-3 { color: #eaa479; }

.home-balance, .native-backdrop, .hud .hud-sound { display: none; }
.native-app .compact-tools { display: none !important; }
.native-app .hud .hud-sound { display: grid; place-items: center; font-size: 18px; }
.native-app .native-backdrop {
  display: block; position: absolute; inset: 0; overflow: hidden;
  background: #081220; pointer-events: none;
}
.native-backdrop canvas { position: absolute; inset: 0; width: 100%; height: 200%; will-change: transform; }
.native-app .field > #game { position: relative; background: transparent; }
.native-app .home-menu { --menu-icon-top: max(18px, env(safe-area-inset-top)); }
.native-app .home-menu .home-balance {
  display: inline-flex; position: absolute; z-index: 4;
  right: max(12px, env(safe-area-inset-right));
  top: calc(var(--menu-icon-top) + var(--menu-icon-size) + 6px);
}
.native-app .coin-pill { min-height: 34px; padding: 4px 9px; font-size: 14px; gap: 6px; }
.native-app .coin-pill b { font-family: var(--display); }
.native-app .coin-pill .coin-mark { width: 23px; height: 23px; }
.native-app .chest-button img.chest { display: block; width: 90%; height: 90%; margin: auto; object-fit: contain; }
.native-app dialog.garage:not(.compact-dialog)[open] {
  position: fixed; inset: 0; margin: 0; box-sizing: border-box;
  width: 100% !important; max-width: none !important;
  height: 100dvh !important; max-height: none !important; border-radius: 0 !important; border: 0 !important;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right))
    max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)) !important;
  display: flex; flex-direction: column; overflow: auto;
}
.native-app dialog.compact-dialog[open] {
  position: fixed; inset: 0; margin: auto; box-sizing: border-box;
  width: min(440px, calc(100vw - max(16px, env(safe-area-inset-left)) - max(16px, env(safe-area-inset-right)))) !important;
  max-height: calc(100dvh - max(16px, env(safe-area-inset-top)) - max(16px, env(safe-area-inset-bottom)));
  display: flex; flex-direction: column; overflow: auto;
}
/* Keep both rewards cards the same size, with room around them on small screens. */
.native-app :is(#rewardsDialog, #shipUnlockedDialog)[open] { height: min(540px, 88dvh); }
.native-app .compact-dialog .result-body { padding: 12px 0; gap: 10px; }
.native-app #shipUnlockedDialog .result-body img { width: min(66vw, 240px); height: min(32dvh, 240px); }
.native-app .compact-dialog .result-body img.result-coin { width: min(22vw, 80px); height: auto; }
#profileDialog h2 { font-size: clamp(15px, 5vw, 22px); }
#confirmControls { margin-top: 12px; }
.native-app #shipShop[data-tab="upgrades"] .garage-body { flex: 1; min-height: 0; }
.native-app #rankingRows { flex: 1; min-height: 0; overflow: auto; align-content: start; }
.native-app #openRankingProfile { flex-shrink: 0; }
.native-app .settings-panel, .native-app .about-panel { max-width: 420px; }
.native-app .overlay.panel-menu { overflow: auto; padding-block: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-bottom)); }
.native-app .result-body {
  flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 20px; text-align: center;
}
.native-app .result-body img { width: min(56vw, 260px); height: min(38dvh, 280px); object-fit: contain; }
.native-app .result-body img.result-coin { width: min(34vw, 140px); height: auto; }
.result-body strong { font: 700 clamp(20px, 7vw, 34px) var(--display); color: #ffe197; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#controlSetup .control-choices { flex: 1; align-content: center; }
#controlSetup .control-choices button[aria-pressed="true"] { background: #b0f6d5; color: #092c25; }

/* A compact report control keeps scores and prizes aligned. */
#rankingDialog { --ranking-columns: 24px minmax(0,1fr) 52px 48px 28px; }
.ranking-report { width:28px; height:32px; padding:0; border:1px solid #41615f; border-radius:7px; background:#102b30; color:#b0f6d5; font-size:18px; }
.ranking-report:disabled { opacity:.45; }
.nickname-rules { color:#abc4cb; font-size:12px; line-height:1.4; margin:8px 0; }
.nickname-rules a { color:#b0f6d5; }
#reportReason { box-sizing:border-box; width:100%; padding:12px; margin:8px 0 12px; color:#e6fff5; background:#10232e; border:1px solid #41615f; border-radius:10px; font:inherit; }
#reportNameForm label { display:block; text-align:left; }
