/* UI sizes are CSS pixels: compact screens scroll menus instead of shrinking text. */
.round-button { width:48px; height:48px; padding:10px; border-radius:14px; }
.hud { top:max(12px,env(safe-area-inset-top)); }
.premium-button { min-width:56px; min-height:60px; font-size:11px; }
.tap-start span { font-size:12px; letter-spacing:1px; margin-top:10px; }
.upgrade-card>strong { font-size:12px; line-height:14px; height:35px; }
.upgrade-card>small { font-size:12px; line-height:22px; }
.upgrade-cost { font-size:18px; min-height:30px; line-height:28px; }
.bottom-nav { height:calc(68px + env(safe-area-inset-bottom)); }
.bottom-nav>button,.nav-home { min-height:58px; font-size:13px; gap:4px; }
.squad-label { font-size:12px; }
.squad-dots { display:none; }
.era-caption { font-size:10px; }
.progress-meta { font-size:12px; text-shadow:0 1px 2px #173b2b; }
.run-progress { width:69%; }
.run-xp { width:48px; font-size:12px; }
.run-xp small { font-size:11px; }
.recruit-badge b { font-size:16px; }
.buffs>span { font-size:11px; padding:8px 3px; }
.buffs b { font-size:17px; }
.play-footer>.run-notice { font-size:13px; }
.play-footer>span { font-size:13px; }

/* These native dialogs live in the top layer, fitted to #stage by fitMenus(). */
dialog.game-dialog {
  position:fixed; inset:auto; margin:0; padding:12px;
  max-width:none; max-height:none; overflow:hidden;
  border:0; border-radius:0; background:transparent; box-shadow:none;
  color:#203e31; text-shadow:none; touch-action:auto;
  padding-bottom:max(12px,env(safe-area-inset-bottom));
  padding-top:max(12px,env(safe-area-inset-top));
}
dialog.game-dialog[open] { display:flex; align-items:flex-end; justify-content:center; }
dialog.game-dialog::backdrop { background:#142d32a6; backdrop-filter:none; }
.dialog-sheet {
  display:flex; flex-direction:column; width:100%; max-height:100%; min-height:0;
  background:#fff7e6; border:2px solid #d6bd8b; border-radius:24px;
  box-shadow:0 5px 0 #674f32,0 15px 40px #0b211d55; overflow:hidden;
}
.dialog-heading {
  flex:none; display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:16px 16px 14px 22px; border-bottom:1px solid #ded5bb;
}
.game-dialog .dialog-heading h2 {
  margin:0; padding:0; font-size:28px; line-height:1.15; font-weight:900;
  color:#244c38; text-shadow:none; letter-spacing:-.5px; text-align:left;
}
.game-dialog .dialog-close {
  position:static; flex:0 0 48px; width:48px; height:48px; padding:0;
  display:grid; place-items:center; font-size:31px; line-height:1;
  border:2px solid #d2c3a0; border-radius:14px; background:#f1e5c9;
  color:#4f5b40; box-shadow:0 2px 0 #c1af89;
}
.dialog-scroll {
  min-height:0; overflow-y:auto; overflow-x:hidden; overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch; touch-action:pan-y;
  padding:20px; scrollbar-width:thin; scrollbar-color:#a6b291 transparent;
}
.dialog-scroll:focus-visible { outline:2px solid #39745a; outline-offset:-3px; }
.game-dialog p { font-size:16px; line-height:1.5; color:#4a5e50; margin:0 0 16px; }
.game-dialog b,.game-dialog strong { color:#244b37; }
.game-dialog .modal-footer { font-size:14px!important; color:#596652; margin:18px 0 0; }
.dialog-footer { flex:none; display:flex; flex-direction:column; gap:12px; padding:14px 20px 18px; border-top:1px solid #ded5bb; background:#f6ecd6; }
.game-dialog .start-button,.start-button {
  min-height:52px; padding:13px 16px; font-size:17px; line-height:1.25;
  border-radius:15px; background:linear-gradient(#3b8151,#286441);
  border:2px solid #2b643e; box-shadow:inset 0 2px #a9dba4,0 3px #245637;
  text-shadow:0 1px #2c673f; color:#fff; font-weight:900;
}
.game-dialog .start-button { margin-top:0; }
.secondary-button,.text-button {
  display:flex; align-items:center; justify-content:center; width:100%; min-height:48px;
  font-size:16px; line-height:1.3; font-weight:800; text-decoration:none;
  padding:12px 14px; margin:12px 0 0; border:2px solid #c8bca0;
  border-radius:14px; color:#355744; background:#f3e9d2;
}
.secondary-button { margin:0; }
.game-dialog .danger-button {
  width:100%; min-height:50px; padding:12px 16px; font-size:16px; font-weight:800;
  background:#fff4e7; border:2px solid #dca895; border-radius:14px; color:#9a4333;
}
.game-dialog button:focus-visible { outline:3px solid #427557; outline-offset:3px; }
.menu-highlight,.touch-guide {
  display:flex; align-items:center; gap:14px; padding:16px;
  border:1px solid #c7d7b5; border-radius:16px; background:#e7eed6; margin-bottom:16px;
}
.menu-highlight>svg { width:44px; height:44px; }
.menu-highlight strong,.touch-guide b { display:block; font-size:19px; line-height:1.3; }
.menu-highlight span { display:block; font-size:15px; line-height:1.5; margin-top:3px; }
.touch-guide p { margin:5px 0 0; font-size:15px; }
.swipe-arrows { flex:none; font-family:Arial,sans-serif; font-size:46px; font-weight:bold; line-height:1; color:#498663; }
.guide-card { margin:0 0 16px; }
.guide-card>b { font-size:16px; }
.guide-card p { margin:5px 0 0; }
.game-dialog .setting-row { padding:16px 0; font-size:16px; line-height:1.4; border-color:#dfd5bc; border-top:1px solid #dfd5bc; }
.setting-row>b { display:grid; place-items:center; min-width:36px; height:32px; border-radius:9px; background:#e3ebd0; font-size:18px; }
.game-dialog .save-note { font-size:14px; text-align:center; margin:16px 0; }
.cloud-summary { display:grid; gap:12px; padding:18px; margin:0 0 18px; border:2px solid #597f62; border-radius:16px; background:#e8efd9; }
.cloud-summary b { display:block; font-size:20px; color:#244b37; }
.cloud-summary small { display:block; margin-top:5px; font-size:14px; line-height:1.4; color:#365942; }
.cloud-summary .start-button,.cloud-save-panel>button { width:100%; margin:8px 0; }
.cloud-save-panel { padding:4px 0 12px; }
.cloud-save-panel p { line-height:1.5; }
.cloud-save-panel small { display:block; line-height:1.4; }
.game-dialog .cloud-status { padding:14px; border-radius:12px; background:#e4edcf; color:#244b37; font-size:19px; font-weight:800; }
.cloud-mode { padding:10px; border:1px solid #b29bc6; border-radius:10px; background:#efe5f5; color:#53386b; }
.cloud-error { padding:12px; border:1px solid #c59c75; border-radius:10px; color:#793d25; background:#fff0dc; }
.cloud-choices { display:grid; gap:10px; margin:16px 0; }
.cloud-choices>div { padding:14px; border:1px solid #c7d7b5; border-radius:12px; background:#f1f3e5; }
.cloud-choices b,.cloud-choices span { display:block; }
.cloud-choices span { margin-top:5px; line-height:1.4; font-size:14px; }
.cloud-google-button { display:flex; justify-content:center; min-height:48px; margin:18px 0; max-width:100%; overflow:hidden; }
.cloud-save-panel button:disabled { opacity:.6; cursor:wait; }
.confirm-actions { display:grid; gap:12px; margin:24px 0 4px; }
.gold-label { display:block; margin:20px 0 8px; font-size:17px; font-weight:800; color:#244b37; }
.gold-input { display:block; width:100%; min-height:54px; padding:12px 16px; border:2px solid #8da97c; border-radius:12px; background:#fffdf3; color:#244b37; font:800 22px Arial,sans-serif; }
.gold-input:focus-visible { outline:3px solid #427557; outline-offset:3px; }
.gold-presets { display:flex; gap:8px; margin:10px 0 14px; }
.gold-presets button { flex:1; min-height:46px; padding:8px; border:1px solid #9aaa80; border-radius:10px; background:#e7eed6; color:#244b37; font-size:16px; font-weight:800; }
.game-dialog .gold-help { font-size:14px; line-height:1.45; }
.restore-save { margin-top:20px; padding-top:18px; border-top:1px solid #dfd5bc; }
.game-dialog .restore-save p { font-size:14px; line-height:1.5; }
.game-dialog .weapon-item { display:grid; grid-template-columns:40px minmax(0,1fr); gap:4px 12px; padding:16px 0; border-color:#dfd5bc; }
.weapon-item>svg { grid-row:span 2; align-self:center; }
.game-dialog .weapon-item b { font-size:18px; }
.game-dialog .weapon-item small { color:#566754; font-size:14px; line-height:1.4; margin-top:4px; }
.game-dialog .weapon-item>.weapon-status { grid-column:2; justify-self:start; margin:3px 0 0; font-size:13px; color:#48794b; }
.game-dialog .dialog-list { display:grid; gap:12px; margin:18px 0; }
.game-dialog .dialog-list li { padding:16px; background:#e7eed6; border-radius:14px; }
.game-dialog .dialog-list b { font-size:18px; }
.game-dialog .dialog-list small { font-size:15px; line-height:1.5; color:#4a5e50; }
.game-dialog .skin-options { display:grid; grid-template-columns:1fr; gap:12px; margin:18px 0; }
.game-dialog .skin-choice { display:flex; align-items:center; gap:14px; padding:14px; text-align:left; border:2px solid #d4c6a4; border-radius:16px; color:#385640; background:#fffaf0; }
.game-dialog .skin-choice.selected { background:#e6eed7; border-color:#558756; }
.game-dialog .skin-choice b { font-size:18px; }
.game-dialog .skin-choice small { font-size:14px; margin-top:4px; }
.skin-check { margin-left:auto; font-size:26px; color:#558756; }
.game-dialog .ad-demo-icon { margin:6px auto 20px; background:#e3ebd0; }
.game-dialog .ad-progress { background:#dedac1; border-color:#9aaa80; }
.game-dialog #ad-countdown { font-size:32px; padding:6px; }

/* Pause and reward screens use the same legible menu sizing. */
.result-overlay,.paused-overlay { padding:16px; backdrop-filter:none; background:#142d32a6; display:flex; align-items:center; justify-content:center; }
.result-card,.pause-card { max-width:360px; max-height:100%; overflow-y:auto; transform:none; background:#fff7e6; color:#355744; border-color:#cbb483; padding:24px 20px; box-shadow:0 5px #725b3a; touch-action:pan-y; }
.pause-card h2 { color:#284c37; font-size:30px; text-shadow:none; }
.result-card p { font-size:15px; line-height:1.4; }
.eyebrow,.result-card .reward-label { font-size:12px; color:#536849; }
.result-stats { font-size:13px; line-height:1.5; color:#536849; }
.simulation-note { font-size:12px; line-height:1.5; color:#536849; }
.result-xp { font-size:13px; }
.multiplier-label { font-size:12px; }
.multiplier-label b { font-size:15px; }
.reward-amount strong { color:#8b5d16; text-shadow:none; }
.toast { font-size:15px; line-height:1.4; background:#fff7e6; color:#355744; border-color:#cbb483; }
.toast:empty { visibility:hidden; }

@container (max-height:720px) {
  .upgrade-card>strong { font-size:11px; height:30px; line-height:12px; }
  .upgrade-card>small { font-size:11px; line-height:19px; }
  .upgrade-cost { font-size:16px; line-height:25px; min-height:27px; }
  .upgrade-picture { height:36px; }
  .upgrade-picture>svg { width:33px; height:33px; }
  .bottom-nav { height:calc(60px + env(safe-area-inset-bottom)); }
  .bottom-nav>button,.nav-home { min-height:52px; font-size:12px; }
  .round-button { width:48px; height:48px; }
  .era-heading { top:73px; width:186px; transform:translateX(-50%); }
  .era-card { height:60px; }
  .era-card h1 { font-size:22px; }
  .era-avatar { width:64px; height:64px; }
  .era-caption { display:none; }
  .premium-button { top:152px; right:10px; font-size:11px; }
  .evolution { top:214px; }
  .tap-start { top:38%; font-size:25px; }
  .tap-start span { font-size:11px; }
  .squad-label { font-size:11px; margin-bottom:9px; }
}
@container (max-height:610px) {
  .era-heading { top:66px; width:172px; }
  .era-card { height:54px; }
  .era-card h1 { font-size:20px; }
  .premium-button { top:133px; }
  .evolution { top:195px; }
  .tap-start { top:38%; font-size:24px; padding:10px; }
  .upgrades { margin-bottom:12px; }
  .upgrade-card>strong { font-size:11px; }
  .upgrade-card>small { font-size:11px; }
  .upgrade-cost { font-size:15px; }
  .run-xp { top:31%; width:44px; font-size:11px; }
  .run-xp small { font-size:10px; }
  .buffs>span { font-size:10px; padding:6px 2px; }
  .buffs b { font-size:15px; }
  .play-footer>span { font-size:12px; }
  .play-footer>.run-notice { font-size:12px; }
  .play-footer>div { font-size:12px; }
  .result-card { transform:none; }
}
@media (max-width:350px) {
  .dialog-heading { padding:12px 12px 12px 16px; }
  .game-dialog .dialog-heading h2 { font-size:25px; }
  .dialog-scroll { padding:16px; }
  .dialog-footer { padding:12px 16px 16px; }
  .touch-guide { padding:12px; gap:10px; }
}

.start-button:active{box-shadow:inset 0 2px #a9dba4,0 1px #245637}
.result-card h2{margin:8px 0 16px;transform:none;font-size:30px}

.dialog-heading h2:focus{outline:none}

#dialog-action{display:flex;flex-direction:column;gap:12px;margin:0}
#dialog-action>button{flex-shrink:0;margin:0}

.weapon-ranks { display:flex; gap:5px; height:7px; }
.weapon-ranks i { width:23px; height:6px; border-radius:3px; background:#385347; border:1px solid #e5e8b8; }
.weapon-ranks i.filled { background:#ffdf75; border-color:#fff4b9; }

/* Earned coins and passive bonuses share the bottom row; drags pass through. */
.stage:not([data-state=home]) .hud { left:12px; right:12px; }
.stage:not([data-state=home]) .resources { gap:7px; }
.stage:not([data-state=home]) .coin-total { min-width:78px; font-size:17px; padding-right:8px; }
.stage:not([data-state=home]) .coin-total>svg { width:34px; height:34px; }
.stage:not([data-state=home]) .troop-total { min-width:46px; font-size:15px; }
.trophy-total { display:flex; align-items:center; gap:3px; min-width:44px; height:30px; padding:0 7px 0 2px; border-radius:7px; background:#506c576b; color:#fff6c4; font-size:15px; font-weight:900; }
.trophy-total>svg { width:26px; height:26px; }
.run-progress { top:calc(max(12px,env(safe-area-inset-top)) + 51px); left:14px; right:90px; width:auto; transform:none; pointer-events:none; }
.progress-meta { font-size:11px; margin-bottom:5px; }
.progress-track { height:8px; border-width:1px; overflow:hidden; }
.progress-track>span { display:none; }
.run-xp { top:calc(max(12px,env(safe-area-inset-top)) + 52px); left:auto; right:14px; width:58px; gap:6px; font-size:12px; }
.run-xp-track { width:58px; height:6px; border:1px solid #e1d9ff; border-radius:4px; box-shadow:none; }
.run-xp-track i { top:0; bottom:0; height:100%; width:0; transition:width .2s; }
.run-footer { position:absolute; z-index:2; left:12px; right:12px; bottom:max(18px,calc(env(safe-area-inset-bottom) + 8px)); display:grid; grid-template-columns:minmax(82px,.95fr) minmax(0,3fr); gap:6px; align-items:stretch; pointer-events:none; }
.run-bonuses { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); overflow:hidden; border:1px solid #a8c6a878; border-radius:10px; background:#214d3dde; pointer-events:none; }
.run-bonuses>div { display:grid; justify-items:center; gap:2px; min-width:0; padding:6px 3px; }
.run-bonuses>div+div { border-left:1px solid #bed7ba35; }
.run-bonuses span { font:600 12px/1.15 Arial,sans-serif; color:#dfe9d2; white-space:nowrap; }
.run-bonuses b { font:900 15px/1.1 Arial,sans-serif; color:#f3f7d8; font-variant-numeric:tabular-nums; }
.run-earnings { display:flex; align-items:center; justify-content:center; gap:3px; min-width:0; padding:5px 3px; background:#234c3fbc; border:1px solid #c0cf926e; border-radius:10px; color:#ffea9e; pointer-events:none; }
.run-earnings svg { width:22px; height:22px; flex-shrink:0; }.run-earnings b { font:900 17px/1.1 Arial,sans-serif; font-variant-numeric:tabular-nums; white-space:nowrap; }
@container(max-width:360px) { .run-bonuses span { font-size:11px; } }
.boss-hud { top:calc(max(12px,env(safe-area-inset-top)) + 52px); left:14px; right:90px; width:auto; transform:none; }
.boss-heading { margin-bottom:4px; }.boss-heading strong { font-size:17px; }.boss-heading b { font-size:11px; }
.boss-health { height:10px; border-width:1px; }
.pause-stats { display:grid; gap:0; margin:15px 0 24px; text-align:left; }
.pause-stats>div { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:13px 0; border-top:1px solid #d8cfae; font-size:16px; }
.pause-stats dd { margin:0; font-weight:900; }.pause-stats small { display:inline-block; margin-left:4px; color:#786199; }
.division-hero { display:grid; justify-items:center; gap:7px; padding:14px; border-radius:16px; background:#e6ecd4; }
.division-hero>svg { width:60px; height:60px; }.division-hero>strong { font-size:28px; }.division-hero>b { font-size:20px; }.division-hero>span { font-size:15px; }
.division-steps { display:flex; overflow-x:auto; gap:6px; margin:18px 0; }
.division-steps>span { flex:1; min-width:0; padding:10px 2px; background:#e3ddce; border-radius:9px; text-align:center; font-size:12px; }.division-steps b { display:block; font-size:11px; margin-bottom:4px; }.division-steps .unlocked { background:#d1e5bc; }
.run-ranking { list-style:none; margin:0; padding:0; }.run-ranking li { display:flex; align-items:center; gap:14px; padding:13px 0; border-bottom:1px solid #d8cfae; }.run-ranking small { display:block; font-size:13px; margin-top:4px; }.run-ranking strong { margin-left:auto; display:flex; align-items:center; gap:5px; }.run-ranking svg { width:24px; height:24px; }
.result-trophies { display:grid; grid-template-columns:32px auto; justify-content:center; align-items:center; column-gap:8px; margin:10px 0 20px; color:#876224; }.result-trophies svg { width:32px; height:32px; grid-row:span 2; }.result-trophies b { font-size:16px; }.result-trophies span { font-size:13px; }
@media(max-width:350px) { .resources { gap:5px; }.coin-total { min-width:78px; font-size:17px; }.troop-total { min-width:44px; }.hud { left:10px; right:10px; }.trophy-total { min-width:39px; padding-right:5px; } }

/* Era identity stays separate from XP training in the upgrade card. */
.era-heading { width:230px; }
.era-card { height:82px; padding:4px 6px 4px 13px; }
.era-card h1 { font-size:25px; }
.era-select { padding:0; border:0; background:none; color:inherit; width:100%; pointer-events:auto; font:inherit; }
.era-select:focus-visible { outline:3px solid #ffe9a1; outline-offset:5px; border-radius:12px; }
.era-title { font-size:25px; font-weight:900; line-height:1; color:#fff; text-shadow:0 2px #7850ac; }
.era-select .era-caption { display:table; min-height:23px; padding:5px 12px; font-size:10px; }
.era-avatar { flex:none; width:94px; height:94px; margin:0 -5px -11px 0; object-fit:contain; }
.game-dialog .skin-choice { gap:10px; padding:8px; }
.outfit-preview { flex:none; width:90px; height:126px; object-fit:cover; border-radius:12px; background:radial-gradient(ellipse,#ece6cf,#e0d7ba); }
.outfit-details { min-width:0; }
.outfit-description { display:block; font:14px/1.35 Arial,sans-serif; color:#5c6956; margin-top:6px; }
.game-dialog .skin-choice small { color:#3b6b45; font-weight:800; line-height:1.4; }
.game-dialog .skin-check { font-size:22px; padding-right:5px; }
.outfit-view { width:100%; min-height:48px; padding:10px; border:1px solid #c7c9a6; border-radius:12px; background:#e9ecd8; color:#32513b; font-size:15px; font-weight:800; }
.leaderboard-status { padding:18px; margin-bottom:18px; border:1px solid #d6cfb4; border-radius:16px; background:#f1eddf; }
.connection-tag { color:#5c6756; font-size:11px; font-weight:800; letter-spacing:1px; }
.leaderboard-status h3 { margin:10px 0 8px; color:#284c37; font-size:22px; }
.leaderboard-status p { margin-bottom:0; }
.era-map-hero { padding:12px; background:linear-gradient(135deg,#486a43,#233e31); border-radius:18px; text-align:center; color:#ffe9ab; }
.era-map-hero>span { font:800 12px Arial,sans-serif; letter-spacing:2px; }
.era-map-hero h3 { color:#fff4d7; margin:4px 0; font-size:23px; }
.era-map-hero p { color:#e3e9cc; font-size:15px; margin:0 0 12px; }
.boss-progress { display:flex; justify-content:center; gap:7px; }
.boss-progress i { width:46px; height:7px; border-radius:5px; background:#0e2e23; border:1px solid #6a865f; }
.boss-progress .cleared { background:#f6cf67; border-color:#ffeea8; }
.stage-path { display:grid; gap:10px; margin:14px 0; }
.stage-choice { position:relative; display:flex; align-items:center; gap:6px; width:100%; min-height:130px; text-align:left; padding:10px 8px 10px 3px; border:2px solid #d6c59b; border-radius:16px; background:#f5ecd6; color:#315140; }
.stage-choice.selected { border-color:#56865a; background:#e5edd5; }
.stage-choice:disabled { opacity:.65; }
.stage-number { position:absolute; left:9px; top:9px; display:grid; place-items:center; width:24px; height:24px; border-radius:50%; background:#385e43; color:#fff4cc; font-size:13px; font-weight:900; }
.stage-choice>img { width:88px; height:100px; object-fit:cover; flex:none; }
.stage-details { display:grid; gap:5px; min-width:0; }
.stage-details>b { font-size:17px; line-height:1.15; }
.stage-details>small { font:14px/1.3 Arial,sans-serif; color:#617052; }
.stage-details>span { font:800 13px Arial,sans-serif; color:#8d5e3a; }
.stage-details>strong { font-size:14px; line-height:1.3; }
.game-dialog .era-map-note { font-size:14px; }
.next-era { display:grid; gap:6px; padding:16px; background:#e7e4d7; border:1px dashed #b8b79f; border-radius:14px; }
.next-era>span { color:#6c7360; font-size:14px; }
.boss-heading strong { max-width:65%; font-size:14px; }
.game-dialog .atlas-intro { margin:0 0 16px; font-size:15px; line-height:1.45; }
.era-atlas { position:relative; padding:14px 10px; border:1px solid #abc2aa; border-radius:22px; background:radial-gradient(ellipse at 10% 20%,#769964 0,transparent 45%),linear-gradient(150deg,#c0d4aa,#e6cca2 52%,#afbac1); }
.era-region { position:relative; isolation:isolate; display:flex; align-items:center; overflow:hidden; width:100%; min-height:156px; padding:16px 10px; gap:4px; border:2px solid #faf0cf; border-radius:18px; color:#fff4dc; text-align:left; box-shadow:0 4px 0 #263e3e24; }
.era-enter:focus-visible { outline:3px solid #fff4dc; outline-offset:3px; }
.region-jungle { background:linear-gradient(125deg,#6b8850,#28543e); }
.region-egypt { background:linear-gradient(125deg,#c59853,#755634); }
.region-rome { background:linear-gradient(125deg,#a97463,#644b50); }
.region-north { background:linear-gradient(125deg,#527b88,#303f56); }
.region-japan { background:linear-gradient(125deg,#765367,#3a4941); }
.era-upcoming { min-height:125px; gap:14px; padding:16px; border-style:dashed; }
.era-upcoming .future-icon { font-size:38px; flex:0 0 45px; text-align:center; }
.era-upcoming .region-copy { min-width:0; }
.era-upcoming .region-copy>b { font-size:21px; }
.era-upcoming .region-copy>span { font:13px/1.4 Arial,sans-serif; white-space:normal; }
.region-medieval { background:linear-gradient(125deg,#829798,#425a6c); }
.region-art { position:relative; display:grid; place-items:center; flex:0 0 29%; height:100px; }
.region-art>img { width:112px; height:140px; object-fit:contain; }
.region-copy { position:relative; display:grid; gap:7px; min-width:0; }
.region-copy>small { font:800 10px/1.3 Arial,sans-serif; letter-spacing:.8px; }
.region-copy>b { color:#fff4dc; font-size:22px; line-height:1.05; }
.region-copy>span { font:14px/1.3 Arial,sans-serif; }
.game-dialog .region-copy>strong { color:#ffefd1; font:800 12px/1.3 Arial,sans-serif; }
.era-destination { display:grid; grid-template-columns:minmax(54px,24%) minmax(0,1fr) 72px; gap:8px; padding:12px 8px; }
.era-destination .region-art { width:100%; height:128px; overflow:hidden; }
.era-destination .region-art>img { position:absolute; width:180px; max-width:none; height:180px; object-fit:contain; }
.era-destination .region-copy>b { font-size:clamp(17px,4.5vw,22px); line-height:1.15; }
.era-destination .region-copy>span { font-size:12px; }
.era-enter { display:grid; place-content:center; gap:7px; min-height:72px; padding:10px 4px; border:2px solid #ffe5a1; border-radius:14px; background:#f4c860; color:#304732; box-shadow:0 4px 0 #765123; font:900 14px/1.2 Arial,sans-serif; text-align:center; }
.era-enter>span { font-size:22px; }
.era-enter:disabled { opacity:1; background:#665a48; color:#f3e7cf; border-color:#bca787; box-shadow:0 3px 0 #413b30; cursor:not-allowed; font-size:11px; }
.region-locked .region-art { filter:grayscale(.7); opacity:.75; }
.era-unlock-note { grid-column:1/-1; padding:8px 4px 2px; border-top:1px solid #f2d29e55; text-align:center; font:700 12px/1.4 Arial,sans-serif; }
.era-path-link { width:0; height:25px; border-left:4px dotted #faf0cd; margin:auto; }
.game-dialog .future-era-label { font:800 10px/1.4 Arial,sans-serif; letter-spacing:1.5px; text-align:center; color:#36513c; margin:0 0 12px; }
.pyramid { display:block; width:70px; height:64px; background:linear-gradient(120deg,#f5daa1 50%,#bd894c 50%); clip-path:polygon(50% 0,100% 100%,0 100%); }
.columns { width:64px; height:62px; border-top:10px solid #e7d5ad; border-bottom:7px solid #d9bc9e; background:repeating-linear-gradient(90deg,#e7d5ad 0 10px,transparent 10px 18px); }
.castle { width:67px; height:55px; border-bottom:8px solid #92a7b2; background:linear-gradient(90deg,#c7d5d2 0 24%,transparent 24% 37%,#c7d5d2 37% 63%,transparent 63% 76%,#c7d5d2 76%); clip-path:polygon(0 0,24% 0,24% 30%,37% 30%,37% 0,63% 0,63% 30%,76% 30%,76% 0,100% 0,100% 100%,0 100%); }
.map-back { min-height:48px; padding:8px 12px; margin:0 0 12px; border:1px solid #a7b49b; border-radius:12px; background:#e1e8d7; color:#2c4e3a; font-size:15px; font-weight:800; }
.stage-choice.locked { opacity:1; background:#e3dfd2; border-color:#c1bcad; }
.stage-choice.locked>img { filter:grayscale(1); opacity:.65; }
.stage-details>em { color:#566447; font:800 10px/1.3 Arial,sans-serif; letter-spacing:.7px; font-style:normal; }
.stage-choice.locked .stage-details>em { color:#785c3e; }
.result-next { font-size:14px; font-weight:800; color:#345b3b; padding:8px; background:#e3edce; border-radius:8px; }
/* Outfit choices live in the pre-run menu; no additional overlay during play. */
.equipped-outfit>b { margin-left:4px; font-size:22px; }
.outfit-era-tabs,.outfit-weapon-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
.outfit-era-tabs button,.outfit-weapon-tabs button { min-height:48px; padding:8px; border:1px solid #bec9af; border-radius:10px; background:#e8e8d7; color:#3a5941; font:700 14px/1.2 Arial,sans-serif; }
.outfit-era-tabs button[aria-pressed=true],.outfit-weapon-tabs button[aria-pressed=true] { background:#30563f; color:#fff1c4; border-color:#30563f; box-shadow:inset 0 -3px #d8b963; }
.outfit-weapon-tabs { grid-template-columns:repeat(3,minmax(0,1fr)); margin-top:10px; }
.outfit-weapon-tabs button { font-size:13px; }
.game-dialog .outfit-ready { color:#45613e; font:800 12px/1.4 Arial,sans-serif; margin:14px 0 8px; letter-spacing:.4px; }
.game-dialog .outfit-coming-soon { border-left:3px solid #b99551; padding:9px 12px; background:#eee2c9; border-radius:6px; color:#685438; font:800 12px/1.4 Arial,sans-serif; }
.outfit-coming-soon span { display:block; margin-top:4px; font-size:14px; font-weight:400; }
.outfit-hero { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.1fr); align-items:center; gap:4px; min-height:170px; border:1px solid #c6ceb1; border-radius:16px; padding:6px 12px 6px 2px; background:radial-gradient(ellipse at 25% 50%,#f5ebcd,#d4dfc1); }
.outfit-hero.outfit-egypt { background:radial-gradient(ellipse at 25% 50%,#f1dbaf,#d7ba8c); border-color:#ba9f71; }
.outfit-hero>img { display:block; width:100%; height:166px; object-fit:contain; transform:scale(1.35); pointer-events:none; }
.outfit-hero h3 { margin:5px 0 8px; color:#294632; font-size:21px; line-height:1.05; }
.outfit-equipped { color:#5c6a50; font:800 10px/1.3 Arial,sans-serif; letter-spacing:.7px; }
.game-dialog .outfit-hero p { font-size:13px; line-height:1.3; margin:7px 0; color:#625331; }
.outfit-hero .outfit-view { min-height:44px; font-size:13px; padding:8px 4px; background:#fff8e3c9; }
.outfit-perk { display:block; color:#47602c; font:800 14px/1.3 Arial,sans-serif; }
.game-dialog .wardrobe-options { gap:8px; margin:12px 0; grid-template-columns:1fr; }
.game-dialog .wardrobe-options .skin-choice { display:flex; align-items:center; gap:8px; min-height:85px; width:100%; text-align:left; padding:4px 10px 4px 3px; }
.wardrobe-options .outfit-preview { width:68px; height:74px; object-fit:contain; background:#e8dfc8; }
.wardrobe-options .outfit-details { flex:1; }
.game-dialog .wardrobe-options b { font-size:17px; }
.game-dialog .wardrobe-options small { font-size:13px; margin-top:3px; }
.wardrobe-options .outfit-perk { margin-top:3px; }
.game-dialog .outfit-rules,.game-dialog .outfit-weapon-note { font:14px/1.45 Arial,sans-serif; color:#627053; margin:12px 0; }
.game-dialog .outfit-weapon-note { font-size:13px; }
.combat-outfit { font-size:14px; color:#52713e; }
.stage[data-era=egypt] .era-card { background:linear-gradient(#586880,#2c3c58); border-color:#d0ad68; }
.stage[data-era=egypt] .level-tag,.stage[data-era=egypt] .era-caption { background:#54493c; }
.stage[data-era=egypt] .run-bonuses,.stage[data-era=egypt] .run-earnings { background:#293e58e8; border-color:#d9b56690; }
.stage[data-era=egypt] .bottom-nav { background:#293e58; }
.stage[data-era=egypt] .nav-home { background:#536785; }

/* Camp rewards have full-width touch targets and disappear during a hunt. */
.home-rewards { position:absolute; top:216px; left:12px; right:12px; display:grid; grid-template-columns:1fr 1fr; gap:8px; z-index:2; }
.home-rewards .reward-shortcut { position:relative; inset:auto; display:flex; align-items:center; gap:6px; min-width:0; width:100%; min-height:66px; padding:8px; border:2px solid #fff0be; border-radius:14px; background:#355a42; box-shadow:0 3px #223c2bd0; text-align:left; color:#fff5cf; text-shadow:none; }
.home-rewards .reward-shortcut svg { flex:none; width:42px; height:42px; }
.reward-shortcut>span { display:grid; gap:4px; min-width:0; }
.reward-shortcut b { font-size:16px; line-height:1.1; }
.reward-shortcut small { font:12px/1.2 Arial,sans-serif; }
.home-rewards .premium-button { background:linear-gradient(130deg,#725238,#46353b); border-color:#e7c169; }
.home-rewards .premium-button.active { background:#533b73; }
.chest-shortcut.ready::after { content:''; position:absolute; width:9px; height:9px; border-radius:50%; background:#b0ef71; top:7px; right:7px; border:1px solid #fff3b6; }
.evolution { top:300px; }
.tap-start { top:37%; }
.chest-hero,.premium-hero { text-align:center; padding:16px 10px; border:1px solid #c9b778; border-radius:18px; background:radial-gradient(ellipse at 50% 20%,#fff0b6,#e0c9a0); }
.chest-hero>svg,.premium-hero>svg { display:block; width:102px; height:94px; margin:0 auto 8px; filter:drop-shadow(0 5px 2px #4f37252b); }
.chest-hero.opened { background:radial-gradient(ellipse at 50% 20%,#fff4b0,#c4d8af); }
.reward-eyebrow { display:block; color:#766037; font:800 11px/1.3 Arial,sans-serif; letter-spacing:1px; }
.game-dialog .chest-hero h3,.game-dialog .premium-hero h3 { color:#4a3b2b; font-size:24px; margin:8px 0; }
.game-dialog .chest-hero p,.game-dialog .premium-hero p,.game-dialog .reward-caption { font:14px/1.4 Arial,sans-serif; color:#5b583e; }
.secret-card,.boost-inventory { padding:16px; margin:15px 0; background:#e5dfed; border:1px solid #c4b2cb; border-radius:14px; }
.secret-card h3,.boost-inventory h3 { color:#4e3d62; margin:6px 0; font-size:20px; }
.game-dialog .secret-card p,.game-dialog .boost-inventory p { font:14px/1.4 Arial,sans-serif; color:#59566a; margin:8px 0; }
.secret-card small { display:block; font:13px/1.4 Arial,sans-serif; margin-top:10px; color:#655970; }
.fragment-track { height:9px; background:#bcb0ca; border-radius:8px; overflow:hidden; }
.fragment-track i { display:block; height:100%; background:#8965b9; }
.boost-inventory { background:#e1e8d8; border-color:#b5c6a4; }
.boost-choices { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.boost-choices button { min-height:62px; padding:10px 6px; border:2px solid #c1caaf; border-radius:10px; background:#f8f4e3; color:#365237; }
.boost-choices button[aria-pressed=true] { background:#385b42; border-color:#cfad64; color:#fff2c5; }
.boost-choices b { display:block; font-size:14px; }.boost-choices span { display:block; font:12px/1.4 Arial; margin-top:5px; }
.boost-choices button:disabled { opacity:.6; }
.chest-odds summary { cursor:pointer; min-height:48px; padding:14px 6px; font-weight:800; color:#4b5c3e; }
.chest-odds ul { padding:0; margin:0; list-style:none; }.chest-odds li { display:flex; justify-content:space-between; gap:12px; padding:9px 0; border-bottom:1px solid #d3d4bd; font:14px/1.4 Arial; }
.game-dialog .chest-odds p { font:13px/1.45 Arial; color:#697057; }
.game-dialog .skin-choice.chest-locked { opacity:1; background:#e8e0ec; border-style:dashed; }.chest-locked .outfit-preview { opacity:.75; }
@container(max-height:720px) { .home-rewards { top:175px; }.home-rewards .reward-shortcut { min-height:60px; }.evolution { top:250px; }.tap-start { top:40%; } }
@container(max-height:610px) { .home-rewards { top:166px; left:8px; right:8px; gap:6px; }.home-rewards .reward-shortcut { padding:7px 5px; min-height:58px; gap:4px; }.home-rewards .reward-shortcut svg { width:32px; height:36px; }.reward-shortcut b { font-size:14px; }.reward-shortcut small { font-size:11px; }.evolution { top:243px; }.tap-start { top:43%; } }

@container (max-height:720px) {
  .era-heading { width:212px; }
  .era-card { height:68px; }
  .era-card h1 { font-size:23px; }
  .era-title { font-size:23px; }
  .era-avatar { width:83px; height:83px; }
  .era-select .era-caption { display:none; }
}
@container(max-height:610px) {
  .tap-start { top:40%; padding:7px 12px; font-size:23px; }
  .tap-start span { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); margin:0; }
}

.audio-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:10px 0 18px;text-align:left;width:100%}
.audio-controls button{min-height:44px;padding:9px 8px;width:100%;font-size:14px;white-space:normal}
.audio-controls button[aria-pressed=false]{opacity:.65}
.audio-channel{min-width:0}.audio-volume{display:block;margin-top:8px;font-size:12px}
.audio-volume span{display:flex;justify-content:space-between;gap:6px}.audio-volume output{white-space:nowrap}
.audio-volume input{display:block;width:100%;min-width:0;height:44px;margin:0;accent-color:#32764c;touch-action:pan-y}
.audio-controls>[data-audio-test],.audio-controls>[data-audio-test-status]{grid-column:1/-1}
.audio-controls>[data-audio-test-status]{display:block;font:12px/1.45 Arial,sans-serif;overflow-wrap:anywhere;text-align:center}

.north-attack{display:block;width:max-content;max-width:100%;margin-top:7px;padding:4px 9px;border:1px solid #d9cf9d;border-radius:5px;background:#243f49e6;color:#fff0be;font:900 11px/1.2 Arial,sans-serif;letter-spacing:.05em}.north-attack[hidden]{display:none}

/* Gold, era fragments and crowns are the persistent top-level resources. */
.hud .resources{gap:7px;min-width:0}
.fragment-total{height:30px;display:flex;align-items:center;gap:3px;min-width:48px;padding:0 7px 0 2px;margin-top:5px;border-radius:7px;background:#4c3c696e;color:#efdfff;font-size:16px;font-weight:900;text-shadow:0 1px #4c3566;font-variant-numeric:tabular-nums}
.fragment-total>svg{width:27px;height:27px;flex-shrink:0}
.run-earnings{gap:3px;padding:5px 3px}
.run-gold{display:flex;align-items:center;justify-content:center;gap:3px}
@container(max-width:360px){
 .hud .resources{gap:5px}
 .hud .coin-total{min-width:0;font-size:16px;padding-right:5px}
 .hud .coin-total>svg{width:30px;height:30px}
 .fragment-total{min-width:0;font-size:14px;padding-right:5px}
 .fragment-total>svg{width:24px;height:24px}
 .trophy-total{min-width:0;font-size:14px;padding-right:4px}
 .trophy-total>svg{width:23px;height:23px}
}

/* Short Android viewports still keep the camp actions apart from Start. */
@container(max-height:560px){
 .era-heading{top:60px;width:190px}
 .era-card{height:52px}
 .era-title{font-size:21px}
 .era-avatar{width:64px;height:64px}
 .home-rewards{top:142px}
 .home-rewards .reward-shortcut{min-height:56px}
 .tap-start{top:max(211px,40%);font-size:20px;padding:4px 10px}
 .evolution{display:none}
 .squad-label{font-size:10px;margin-bottom:7px}
 .upgrades{gap:4px;margin:0 8px 10px}
 .upgrade-card>strong{height:27px;font-size:10px;line-height:11px}
 .upgrade-picture{height:30px}
 .upgrade-picture>svg{width:28px;height:28px}
 .upgrade-card>small{font-size:10px;line-height:17px}
 .upgrade-cost{font-size:14px;line-height:22px;min-height:23px}
 .upgrade-cost svg{width:18px;height:18px}
 .bottom-nav{height:calc(52px + env(safe-area-inset-bottom))}
 .bottom-nav>button,.nav-home{min-height:46px;font-size:11px}
}
