/* Angel Fish — interface refinements. Existing artwork and palette stay intact. */
.angel-fish-page button:focus-visible,
.angel-fish-page a:focus-visible,
.angel-fish-page input:focus-visible,
.angel-fish-page select:focus-visible,
.angel-fish-page textarea:focus-visible {
  outline: 3px solid var(--af-sea-600, #075f84);
  outline-offset: 3px;
}
.game-menu .missions-note,
.game-menu .settings-note,
.game-menu .gift-note {
  line-height: 1.5;
}
.menu-tile-label {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 0.7rem;
}
.menu-tile {
  text-transform: none;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
.game-choose {
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 0.95rem;
}
#startMenu.game-menu {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.88)),
    linear-gradient(165deg, var(--af-sky-400, #7fd0f5) 0%, var(--af-sea-500, #0a86b8) 55%, var(--af-lagoon-500, #14b0ac) 100%) !important;
  -webkit-backdrop-filter: blur(1.5px);
  backdrop-filter: blur(1.5px);
}
.home-world-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  max-width: 100%;
  margin: 0 auto 6px;
  padding: 4px 10px;
  border: 1px solid rgba(7, 95, 132, 0.28);
  border-radius: 999px;
  background: rgba(242, 250, 255, 0.94);
  color: var(--af-sea-700, #05506f);
  font-size: calc(0.76rem * var(--af-ui, 1));
  font-weight: 750;
  line-height: 1.2;
  box-shadow: 0 2px 0 rgba(7, 95, 132, 0.12);
}
.home-world-chip svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
}
.home-world-chip strong {
  color: var(--af-ink, #16343f);
  font-weight: 900;
}
.daily-stat-label,
.weekly-title {
  text-transform: none;
  letter-spacing: 0.01em;
}
.new-best-badge {
  text-transform: none;
  letter-spacing: 0.01em;
}
/* Authored casing — CSS uppercase was making every label shout. */
.btn-game,
.char-magic,
.skin-magic,
.skin-cat,
.magic-chip,
.world-group,
.badge-toast-copy strong {
  text-transform: none !important;
  letter-spacing: 0.01em;
}
/* Gold CTAs: sticker corners, not perfect pills. */
.btn-game {
  border-radius: 22px 26px 20px 24px;
}
.btn-game--muted,
.btn-game--install {
  border-radius: 18px 22px 16px 20px;
}
.next-unlock {
  border-radius: 14px 18px 12px 16px;
}
#startMenu .collect-pill:not([hidden]),
.collect-go {
  border-radius: 18px 22px 16px 20px;
}
/* List rows: soft sea accent, uneven corners — not identical SaaS cards. */
.news-row,
.shop-row,
.mission-row,
.badge-row {
  border-left: 4px solid var(--af-sea-400, #3aa8d8);
  border-radius: 12px 16px 14px 10px;
  background: linear-gradient(135deg, #ffffff 0%, var(--af-sky-50, #eef8fd) 100%);
}
.news-row:nth-child(even),
.shop-row:nth-child(even),
.mission-row:nth-child(even) {
  border-left-color: var(--af-lagoon-400, #14b0ac);
  border-radius: 14px 10px 16px 12px;
}
.skin-magic {
  color: var(--af-dusk-500, #6b4fd8);
}
.char-magic {
  letter-spacing: 0.01em;
}
.magic-chip,
.skin-magic {
  letter-spacing: 0.01em !important;
}
/* Tap hint: foam sticker, not a SaaS toast. */
.tap-hint {
  border-radius: 20px 24px 18px 22px;
}
.tap-hint-text {
  letter-spacing: 0.01em;
  text-transform: none;
}
/* Slightly irregular radii so cards feel cut by hand, not a design system. */
.game-menu:not(.game-help) {
  border-radius: 26px 30px 24px 28px;
}
.menu-tile {
  border-radius: 16px 18px 15px 17px;
}
.shop-row {
  border-radius: 16px 14px 18px 15px;
}
/* Collect pill: tiny bob so home feels alive */
@keyframes afGrabBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
/* Bob only — kill the old scale pulse so it doesn’t fight this motion. */
#startMenu .collect-pill:not([hidden]),
.btn-game.btn-collect {
  animation: afGrabBob 1.8s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  #startMenu .collect-pill:not([hidden]) { animation: none; }
}
html.af-reduce-motion #startMenu .collect-pill:not([hidden]) { animation: none; }
/* HUD chips: sticker look, slightly uneven — not full SaaS pills */
.game-ui .score-display,
.game-ui .level-display {
  border-radius: 16px 18px 14px 16px;
}
.game-ui .score-display--hero {
  border-radius: 16px 18px 15px 17px;
}
.game-ui .score-display--best,
.game-ui .level-chip,
.game-ui .lives-chip,
.game-ui .combo-chip,
.game-ui .magic-chip {
  border-radius: 14px 18px 12px 16px;
}
.menu-coins {
  border-radius: 14px 18px 12px 16px;
}
.world-tab,
.chars-tab,
.af-tab {
  border-radius: 14px 16px 12px 14px;
}
.magic-chip {
  letter-spacing: 0.01em !important;
}
.game-ui .combo-chip:not([hidden]) {
  animation: afComboPulse 1.4s ease-in-out infinite;
}
@keyframes afComboPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
@media (prefers-reduced-motion: reduce) {
  .game-ui .combo-chip:not([hidden]) { animation: none; }
}
html.af-reduce-motion .game-ui .combo-chip:not([hidden]) { animation: none; }
@media (hover: hover) {
  .menu-tile:hover { border-color: var(--af-sea-500); }
}
.char-detail {
  border-color: var(--af-sky-200);
  background: linear-gradient(135deg, var(--af-foam) 0%, var(--af-sky-100) 100%);
  border-radius: 18px 22px 16px 20px;
}
/* Kill leftover forest-green tags from the base sheet. */
.skin-tag--sel { background: var(--af-lagoon-500, #14b0ac) !important; }
.skin-tag--use { background: var(--af-sea-500, #0a86b8) !important; }
.skin-cell.is-selected {
  border-color: var(--af-lagoon-500, #14b0ac) !important;
}
.skin-cat,
.skin-star {
  border-radius: 8px 10px 7px 9px;
  letter-spacing: 0.01em;
}
/* Category tags: world tints — never forest green or hazard-red hero. */
.skin-cat--hero {
  color: var(--af-night-500, #3d5a9e) !important;
  background: #e2e9f8 !important;
}
.skin-cat--mythical {
  color: var(--af-dusk-700, #4a32a6) !important;
  background: var(--af-dusk-wash, #eef4fb) !important;
}
.skin-cat--celestial {
  color: var(--af-halo-ink, #5a3800) !important;
  background: var(--af-halo-100, #fff3cf) !important;
}
.chars-note { color: var(--af-ink-soft); text-align: end; }
.char-search {
  width: 100%;
  max-width: calc(300px * var(--af-ui, 1));
  margin: 2px auto 6px;
  text-align: start;
}
.char-search-label {
  display: block;
  margin-block-end: 5px;
  font-weight: 800;
  font-size: calc(12px * var(--af-ui, 1));
  color: var(--af-sea-600);
}
.char-search-field {
  display: flex;
  align-items: stretch;
  border: 2px solid var(--af-line);
  border-radius: 14px;
  background: var(--af-foam);
}
.char-search-field:focus-within { border-color: var(--af-sea-500); }
.char-search-input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  font: 600 16px/1.3 ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, sans-serif;
  color: var(--af-ink);
  touch-action: manipulation;
  -webkit-user-select: text !important;
  user-select: text !important;
}
.char-search-input::placeholder { color: var(--af-ink-soft); font-weight: 400; }
.char-search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.char-search-clear {
  flex: 0 0 44px;
  min-height: 44px;
  min-width: 44px;
  border: 0;
  border-inline-start: 1px solid var(--af-line);
  border-radius: 0 12px 12px 0;
  background: var(--af-sky-50);
  color: var(--af-sea-600);
  font: 600 24px/1 system-ui, sans-serif;
  cursor: pointer;
  transition: background 120ms ease;
}
.char-search-clear:active { background: var(--af-sky-200); }
.char-search-clear:disabled { opacity: 0.45; cursor: default; }
html[dir="rtl"] .char-search-clear { border-radius: 12px 0 0 12px; }
.char-search-status {
  min-height: 2.5em;
  margin: 5px 1px 0 !important;
  color: var(--af-ink-soft);
  font-size: calc(11px * var(--af-ui, 1));
  line-height: 1.25;
  font-weight: 600;
}
.skin-search-empty {
  grid-column: 1 / -1;
  align-self: start;
  padding: 18px 12px;
  border: 1px dashed var(--af-sky-200);
  border-radius: 14px;
  color: var(--af-ink-soft);
  font-size: 0.9rem;
  background: var(--af-sky-50);
}
/* Coral Crossing: quiet sticker chip — not a full-round SaaS pill. */
.course-chip,
#coral-course-btn.course-chip {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  margin: 10px auto 2px;
  padding: 8px 16px;
  border: 2px solid var(--af-lagoon-500, #14b0ac);
  border-radius: 16px 20px 14px 18px;
  background: linear-gradient(180deg, #ffffff 0%, var(--af-sky-50, #eef8fd) 100%);
  color: var(--af-sea-600, #075f84);
  font: inherit;
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  box-shadow: 0 3px 0 var(--af-lagoon-600, #0e8a86);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.course-chip:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--af-lagoon-600, #0e8a86);
}
.char-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
}
@media (max-height: 700px) {
  .game-menu.game-chars.show { overflow-y: auto; }
  .game-chars .skin-row { min-height: 88px; }
  .game-chars .char-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-block: 6px 10px;
  }
  .game-chars .char-actions .btn-game,
  html.app-standalone .game-chars .char-actions .btn-game {
    width: 100%;
    height: auto;
    min-height: 44px;
    margin: 0;
    padding: 6px;
    overflow-wrap: anywhere;
  }
  .game-chars .char-face { width: 62px; height: 62px; }
  .game-chars .char-preview { width: 58px; height: 58px; }
  .game-chars .char-detail { padding: 7px 9px; }
  .game-chars .char-search-label { margin-block-end: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  .menu-tile, .char-search-clear { transition: none; }
}
html.af-reduce-motion .menu-tile,
html.af-reduce-motion .char-search-clear { transition: none; }

/* ---- AdMob banner safe inset (native only; class toggled by af-ads.js) ----
   Adaptive banners are ~50–100px and sit ON TOP of the WebView. Shrink the
   game container so every menu/HUD is laid out above the ad — never under it. */
html {
  --af-ad-banner: 0px;
}
html.af-has-banner {
  /* Until the SDK reports the real height, keep a tall reserve so a tall banner
     never covers the game. */
  --af-ad-banner: max(90px, calc(72px + env(safe-area-inset-bottom, 0px)));
}
/* af-ads.js sets --af-ad-banner-h from the SDK's bannerAdSizeChanged event.
   The SDK pins the banner above the home indicator, so reserve that inset too. */
html.af-has-banner.af-banner-measured {
  --af-ad-banner: calc(var(--af-ad-banner-h) + env(safe-area-inset-bottom, 0px));
}
/* Native app: pull the playfield up so centered menus clear the banner strip. */
html.app-standalone.af-has-banner .game-container {
  bottom: var(--af-ad-banner);
  height: auto;
}
/* Non-standalone / web embed fallback: pad menus instead of resizing the shell. */
html.af-has-banner:not(.app-standalone) #startMenu,
html.af-has-banner:not(.app-standalone) #gameOverMenu,
html.af-has-banner:not(.app-standalone) #continueMenu,
html.af-has-banner:not(.app-standalone) #settingsMenu,
html.af-has-banner:not(.app-standalone) #charactersMenu,
html.af-has-banner:not(.app-standalone) #missionsMenu,
html.af-has-banner:not(.app-standalone) #dailyMenu,
html.af-has-banner:not(.app-standalone) #giftMenu,
html.af-has-banner:not(.app-standalone) #newsMenu,
html.af-has-banner:not(.app-standalone) #backupMenu,
html.af-has-banner:not(.app-standalone) #badgesMenu,
html.af-has-banner:not(.app-standalone) #logMenu,
html.af-has-banner:not(.app-standalone) #worldsMenu,
html.af-has-banner:not(.app-standalone) #shopMenu,
html.af-has-banner:not(.app-standalone) #rateMenu,
html.af-has-banner:not(.app-standalone) #helpSheet,
html.af-has-banner:not(.app-standalone) #pauseMenu {
  padding-bottom: calc(16px + var(--af-ad-banner));
  max-height: calc(100% - var(--af-ad-banner) - env(safe-area-inset-top, 0px));
}
html.af-has-banner #startMenu,
html.af-has-banner #gameOverMenu,
html.af-has-banner #shopMenu,
html.af-has-banner #settingsMenu {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
html.af-has-banner .continue-actions,
html.af-has-banner #gameOverMenu .btn-game {
  position: relative;
  z-index: 2;
}
/* Help sheet is edge-pinned — pin its bottom above the ad. */
html.af-has-banner .game-help {
  bottom: calc(var(--af-ad-banner) + 8px) !important;
  max-height: calc(100% - var(--sat, 0px) - var(--af-ad-banner) - 24px) !important;
}

/* ---- Settings: sections + sticky Done (keeps actions reachable) ---- */
.game-menu.game-settings.show {
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  max-height: calc(100% - var(--sat, 0px) - var(--sab, 0px) - 20px);
  padding-bottom: 12px;
}
.game-menu.game-settings > h2 {
  flex: 0 0 auto;
}
.settings-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  width: 100%;
  padding: 0 2px 8px;
}
.settings-list {
  gap: 8px;
  margin: 4px auto 12px;
  width: 100%;
  max-width: 300px;
}
.settings-section {
  margin: 12px 0 2px;
  padding: 0 6px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
  color: var(--af-sea-600, #075f84);
  text-align: start;
}
.settings-section:first-child {
  margin-top: 0;
}
.settings-row {
  padding: 11px 14px;
  border-radius: 14px;
  min-height: 48px;
  box-sizing: border-box;
}
.settings-label {
  font-size: 0.94rem;
  gap: 8px;
  text-align: start;
}
.settings-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 300px;
  margin: 4px auto 0;
  width: 100%;
}
.game-menu .btn-game.settings-reset {
  margin: 0;
  max-width: none;
  width: 100%;
}
.settings-foot {
  flex: 0 0 auto;
  width: 100%;
  max-width: 300px;
  margin: 8px auto 0;
  padding-top: 8px;
  border-top: 1px solid #d7e6ef;
}
.settings-foot .btn-game {
  width: 100%;
  max-width: none;
  margin: 0;
}
.game-menu p.settings-note {
  margin: 8px auto 8px;
  max-width: 300px;
  font-size: 0.78rem;
  text-align: start;
}
.settings-links {
  max-width: 300px;
}
.settings-version {
  max-width: 300px;
  margin: 4px auto 8px;
}

/* Home / Game Over: slightly tighter when the ad strip is reserving space */
html.af-has-banner #startMenu .menu-tiles {
  margin-top: 6px;
}
html.af-has-banner #startMenu .game-tagline {
  margin-bottom: 6px;
}
/* 900px, not 740px: on iPhone the page height includes the notch and home-indicator
   areas (an iPhone 17 Pro reports 874), so with a banner the second row of tiles
   only fits once the card tightens. Pro Max / Plus phones (930+) have room. */
@media (max-height: 900px) {
  html.af-has-banner #startMenu .game-title-img {
    width: min(56%, 154px);
  }
  html.af-has-banner #startMenu .menu-tiles {
    padding-top: 6px;
  }
  html.af-has-banner #startMenu .btn-diff {
    height: 44px; /* still a full 44 pt touch target */
  }
  html.af-has-banner #startMenu .menu-tile {
    min-height: 50px;
    padding-block: 6px;
  }
}

/* Handcrafted home: soft bob + staggered tile settle (skipped when reduce-motion). */
@keyframes afLogoBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes afTileIn {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
#startMenu .game-title-img {
  animation: afLogoBob 3.6s ease-in-out infinite;
}
/* Season pill: sticker, not a SaaS chip */
.season-pill {
  text-transform: none;
  letter-spacing: 0.01em;
  border-radius: 14px 18px 12px 16px;
  font-weight: 800;
}
.reward-row {
  border-radius: 12px 14px 10px 12px;
  border-left: 3px solid var(--af-halo-500, #ffb81c);
}
.reward-row:nth-child(even) {
  border-radius: 14px 10px 12px 14px;
}
/* Difficulty stars stay halo gold on the depth-colored buttons. */
.btn-diff .diff-stars {
  color: var(--af-halo-400, #ffcf4d);
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.3));
}
/* Last-played difficulty: quiet breathe, not a neon pulse. */
.btn-diff.is-last {
  animation-duration: 2.6s;
}
#startMenu .menu-tile {
  animation: afTileIn 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
#startMenu .menu-tile:nth-child(1) { animation-delay: 40ms; }
#startMenu .menu-tile:nth-child(2) { animation-delay: 90ms; }
#startMenu .menu-tile:nth-child(3) { animation-delay: 140ms; }
#startMenu .menu-tile:nth-child(4) { animation-delay: 190ms; }
#startMenu .menu-tile:nth-child(5) { animation-delay: 240ms; }
#startMenu .menu-tile:nth-child(6) { animation-delay: 290ms; }
@media (prefers-reduced-motion: reduce) {
  #startMenu .game-title-img,
  #startMenu .menu-tile { animation: none; }
}
html.af-reduce-motion #startMenu .game-title-img,
html.af-reduce-motion #startMenu .menu-tile { animation: none; }

/* Daily stats + world groups: quiet labels, sticker cards */
.daily-stat {
  border-radius: 14px 18px 12px 16px;
  border-color: var(--af-sky-200, #cfe0f5);
  background: linear-gradient(180deg, #ffffff 0%, var(--af-sky-50, #eef8fd) 100%);
}
.daily-stat-label,
.world-group,
.char-magic {
  letter-spacing: 0.01em !important;
}
.world-row {
  border-radius: 14px 16px 12px 14px;
}
.world-row.is-on {
  border-color: var(--af-lagoon-400, #14b0ac);
}

/* Icon buttons + log tabs: sticker, not chrome pills */
.game-icon-btn,
.game-menu-gear {
  border-radius: 16px 18px 14px 16px;
}
.log-tab {
  border-radius: 14px 18px 12px 16px;
}
.log-tab.is-on {
  background: linear-gradient(180deg, var(--af-sea-400, #3aa8d8) 0%, var(--af-sea-600, #075f84) 100%);
}
/* Epic = dusk magic, not a purple SaaS glow */
.skin-cell.is-epic {
  border-color: var(--af-dusk-500, #6b4fd8);
  box-shadow: 0 0 0 2px rgba(107, 79, 216, 0.22);
}
@keyframes newBestWiggle {
  0%, 100% { transform: scale(1) rotate(-1deg); }
  50% { transform: scale(1.03) rotate(1deg); }
}

/* Menu titles: sea stickers cut by hand */
.game-menu > h2,
.game-menu .chars-title h2 {
  border-radius: 20px 26px 18px 24px;
  letter-spacing: 0.01em;
}
.new-best-badge {
  border-radius: 16px 20px 14px 18px;
}
.char-buddy,
html.app-standalone .game-over .btn-game.char-buddy {
  border-radius: 14px 18px 12px 16px;
}
.trait-chip {
  border-radius: 10px 12px 9px 11px;
}
.trait-chip--epic {
  background: var(--af-dusk-wash, #eef4fb) !important;
  border-color: var(--af-dusk-500, #6b4fd8) !important;
  color: var(--af-dusk-700, #4a32a6) !important;
}

/* Help + tap stickers */
.game-help > h2,
.game-menu.game-help > h2 {
  border-radius: 18px 22px 16px 20px !important;
}
.tap-hint-text {
  border-radius: 16px 20px 14px 18px;
}
.btn-price,
.skin-tag {
  border-radius: 8px 10px 7px 9px;
}
.angel-fish-back {
  border-radius: 16px 20px 14px 18px;
}

/* Mystery box = dusk magic, not purple SaaS */
.skin-cell--box {
  border-color: var(--af-dusk-300, #9b85f0);
  background: linear-gradient(180deg, #ffffff 0%, var(--af-dusk-wash, #eef4fb) 100%);
}
.run-highlights {
  border-radius: 14px 18px 12px 16px;
}

/* Settings rows: sky wash, sticker corners — never indigo SaaS */
.settings-row {
  border-radius: 14px 18px 12px 16px;
  background: linear-gradient(180deg, #ffffff 0%, var(--af-sky-100, #e3f4fd) 100%);
  border-color: var(--af-sky-200, #bfe8ff);
}
.settings-row[aria-checked="true"] {
  border-color: var(--af-lagoon-400, #14b0ac);
}

/* Weekly box: sky foam sticker */
.weekly-box {
  border-radius: 16px 20px 14px 18px;
  background: linear-gradient(180deg, #ffffff 0%, var(--af-sky-100, #e3f4fd) 100%);
  border-color: var(--af-sky-200, #bfe8ff);
}
.weekly-title {
  color: var(--af-sea-600, #075f84);
  letter-spacing: 0.01em;
}

/* Language select: sky foam, not indigo wash */
.settings-select {
  background: var(--af-sky-50, #f2faff);
  border-color: var(--af-sky-200, #bfe8ff);
  border-radius: 12px 14px 11px 13px;
  color: var(--af-ink, #16343f);
}


/* Season pill: quiet breath — presence, not noise */
@keyframes afSeasonBreath {
  0%, 100% { opacity: 1; transform: translateY(0); }
  50% { opacity: 0.88; transform: translateY(-1px); }
}
#seasonPill:not([hidden]) {
  animation: afSeasonBreath 3.2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  #seasonPill:not([hidden]) { animation: none; }
}
html.af-reduce-motion #seasonPill:not([hidden]) { animation: none; }


/* Clinical pastels → sky foam tokens; dusk text never indigo SaaS */
.chars-note,
.skin-magic {
  color: var(--af-dusk-700, #4a32a6) !important;
}
.char-detail,
.mission-row {
  background: linear-gradient(180deg, #ffffff 0%, var(--af-sky-100, #e3f4fd) 100%) !important;
  border-color: var(--af-sky-200, #cfe0f5) !important;
  border-radius: 14px 18px 12px 16px;
}
.next-unlock,
.trait-chip {
  background: var(--af-sky-100, #e3f4fd) !important;
}
.badge-row .badge-icon {
  background: var(--af-sea-300, #7cc8f2);
}
.badge-row.is-on .badge-icon {
  background: var(--af-halo-500, #e0a82e);
}

/* Trait chips: quiet settle when a friend opens */
@keyframes afTraitIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.char-traits .trait-chip {
  animation: afTraitIn 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.char-traits .trait-chip:nth-child(2) { animation-delay: 40ms; }
.char-traits .trait-chip:nth-child(3) { animation-delay: 80ms; }
.char-traits .trait-chip:nth-child(4) { animation-delay: 120ms; }
@media (prefers-reduced-motion: reduce) {
  .char-traits .trait-chip { animation: none; }
}
html.af-reduce-motion .char-traits .trait-chip { animation: none; }


/* Gift box: quiet float — presence, not a bounce loop */
@keyframes afGiftFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-3px) rotate(1deg); }
}
#giftBox svg {
  animation: afGiftFloat 3.4s ease-in-out infinite;
  transform-origin: 50% 60%;
}
@media (prefers-reduced-motion: reduce) {
  #giftBox svg { animation: none; }
}
html.af-reduce-motion #giftBox svg { animation: none; }

/* New-best badge: soft settle when it appears */
@keyframes afBestIn {
  from { opacity: 0; transform: scale(0.92) rotate(-2deg); }
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}
.new-best-badge:not([hidden]) {
  animation: afBestIn 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  .new-best-badge:not([hidden]) { animation: none; }
}
html.af-reduce-motion .new-best-badge:not([hidden]) { animation: none; }


/* HUD lives chip: quiet pulse when you hold extra hearts */
@keyframes afLifeGlow {
  0%, 100% { box-shadow: 0 3px 0 rgba(180, 35, 74, 0.28); }
  50% { box-shadow: 0 3px 0 rgba(180, 35, 74, 0.18), 0 0 0 3px rgba(240, 120, 136, 0.18); }
}
.lives-chip:not([hidden]) {
  animation: afLifeGlow 2.8s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .lives-chip:not([hidden]) { animation: none; }
}
html.af-reduce-motion .lives-chip:not([hidden]) { animation: none; }

/* Switch knobs stay round; settings rows already sticker — dusk wash for mystery only */
.skin-cell--box {
  background: linear-gradient(180deg, #ffffff 0%, var(--af-sky-50, #f2faff) 70%, var(--af-dusk-wash, #eef4fb) 100%) !important;
}


/* Almost-level bar: quiet shimmer when you're close */
@keyframes afAlmostShimmer {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.08); }
}
.almost-fill {
  animation: afAlmostShimmer 2.2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .almost-fill { animation: none; }
}
html.af-reduce-motion .almost-fill { animation: none; }

/* Pause gear: tiny settle when menus open */
@keyframes afGearIn {
  from { opacity: 0.7; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}
.game-menu.show .game-menu-gear,
#startMenu.show .game-menu-gear {
  animation: afGearIn 280ms ease-out both;
}


/* Combo chip: quiet pulse while the streak lives */
@keyframes afComboSoft {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.04); opacity: 0.92; }
}
.combo-chip:not([hidden]) {
  animation: afComboSoft 1.6s ease-in-out infinite;
  border-radius: 12px 14px 10px 12px;
}
@media (prefers-reduced-motion: reduce) {
  .combo-chip:not([hidden]) { animation: none; }
}
html.af-reduce-motion .combo-chip:not([hidden]) { animation: none; }



/* Next friend hint: sticker, not a chrome pill */
.next-unlock {
  border-radius: 12px 14px 10px 12px;
  letter-spacing: 0.01em;
}


/* Rate sheet: soft settle — invitation, not a modal slam */
@keyframes afRateIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.game-rate.show,
#rateMenu:not([hidden]) {
  animation: afRateIn 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  .game-rate.show,
  #rateMenu:not([hidden]) { animation: none; }
}
html.af-reduce-motion .game-rate.show,
html.af-reduce-motion #rateMenu:not([hidden]) { animation: none; }

/* Char friend chip: sticker corners */
.char-buddy {
  border-radius: 12px 14px 10px 12px !important;
  letter-spacing: 0.01em;
}


/* Pause card: quiet settle — rest, not a modal slam */
@keyframes afPauseIn {
  from { opacity: 0; transform: translateY(6px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.game-pause.show,
#pauseMenu.show {
  animation: afPauseIn 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  .game-pause.show,
  #pauseMenu.show { animation: none; }
}
html.af-reduce-motion .game-pause.show,
html.af-reduce-motion #pauseMenu.show { animation: none; }

/* Collect Grab chip: sticker, not a full pill */
.collect-go {
  border-radius: 10px 12px 9px 11px;
  letter-spacing: 0.01em;
}


/* Scoop collect chip: quiet gold breath when coins wait */
@keyframes afScoopSoft {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}
.collect-pill:not([hidden]) .collect-go {
  animation: afScoopSoft 1.8s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .collect-pill:not([hidden]) .collect-go { animation: none; }
}
html.af-reduce-motion .collect-pill:not([hidden]) .collect-go { animation: none; }


/* Idle tip: quiet float in — presence, not a slap */
@keyframes afTipIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.tap-hint:not([hidden]) {
  animation: afTipIn 320ms ease-out both;
}
@media (prefers-reduced-motion: reduce) {
  .tap-hint:not([hidden]) { animation: none; }
}
html.af-reduce-motion .tap-hint:not([hidden]) { animation: none; }


/* Depth chips: quiet settle when home opens */
@keyframes afDiffIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
#startMenu .btn-diff {
  animation: afDiffIn 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
#startMenu .btn-diff:nth-child(1) { animation-delay: 30ms; }
#startMenu .btn-diff:nth-child(2) { animation-delay: 60ms; }
#startMenu .btn-diff:nth-child(3) { animation-delay: 90ms; }
@media (prefers-reduced-motion: reduce) {
  #startMenu .btn-diff { animation: none; }
}
html.af-reduce-motion #startMenu .btn-diff { animation: none; }


/* Sky-to-sea chip: quiet lagoon breath */
@keyframes afCrossSoft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
.course-chip:not([hidden]) {
  animation: afCrossSoft 2.4s ease-in-out infinite;
  border-radius: 12px 14px 10px 12px;
  letter-spacing: 0.01em;
}
@media (prefers-reduced-motion: reduce) {
  .course-chip:not([hidden]) { animation: none; }
}
html.af-reduce-motion .course-chip:not([hidden]) { animation: none; }


/* Swim-on CTA: quiet gold settle when continue opens */
@keyframes afSwimOn {
  from { opacity: 0; transform: translateY(5px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.game-continue .btn-game--cta,
#continueMenu .btn-game--cta {
  animation: afSwimOn 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  .game-continue .btn-game--cta,
  #continueMenu .btn-game--cta { animation: none; }
}
html.af-reduce-motion .game-continue .btn-game--cta,
html.af-reduce-motion #continueMenu .btn-game--cta { animation: none; }


/* Goal-done popup: soft rise, not a bang */
@keyframes afGoalPop {
  from { opacity: 0; transform: translateY(6px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.af-popup--goal {
  animation: afGoalPop 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  .af-popup--goal { animation: none; }
}
html.af-reduce-motion .af-popup--goal { animation: none; }


/* Share CTA: quiet foam settle on game-over */
@keyframes afShareIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
#share-score-btn {
  animation: afShareIn 380ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 120ms;
}
/* Combo chip: soft glow step, not a bang */
@keyframes afComboSoft {
  from { transform: scale(0.92); opacity: 0.7; }
  to { transform: scale(1); opacity: 1; }
}
#comboChip:not([hidden]) {
  animation: afComboSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #share-score-btn,
  #comboChip:not([hidden]) { animation: none; }
}
html.af-reduce-motion #share-score-btn,
html.af-reduce-motion #comboChip:not([hidden]) { animation: none; }


/* What's new rows: quiet staggered settle */
@keyframes afNewsIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.news-row {
  animation: afNewsIn 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.news-row:nth-child(2) { animation-delay: 40ms; }
.news-row:nth-child(3) { animation-delay: 80ms; }
.news-row:nth-child(4) { animation-delay: 120ms; }
.news-row:nth-child(5) { animation-delay: 160ms; }
.news-row:nth-child(6) { animation-delay: 200ms; }
.news-row:nth-child(7) { animation-delay: 240ms; }
.news-row:nth-child(8) { animation-delay: 280ms; }
.news-row:nth-child(9) { animation-delay: 320ms; }
.news-row:nth-child(10) { animation-delay: 360ms; }
@media (prefers-reduced-motion: reduce) {
  .news-row { animation: none; }
}
html.af-reduce-motion .news-row { animation: none; }


/* Help sheet: quiet foam settle */
@keyframes afHelpIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
#helpSheet.show {
  animation: afHelpIn 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #helpSheet.show { animation: none; }
}
html.af-reduce-motion #helpSheet.show { animation: none; }


/* Hard = night sea only (never hazard-red). Full glossy pills live later under .difficulty-select. */
.btn-diff--hard {
  background: linear-gradient(180deg, #4a6ec4 0%, #2f4ea0 48%, #1a326e 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 7px 0 #0d1d48, 0 14px 24px rgba(13, 29, 72, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.38) !important;
}
@media (hover: hover) {
  .btn-diff--hard:hover {
    box-shadow: 0 9px 0 #0d1d48, 0 18px 28px rgba(13, 29, 72, 0.46), inset 0 2px 0 rgba(255, 255, 255, 0.48) !important;
  }
}
.btn-diff--hard:active {
  box-shadow: 0 3px 0 #0d1d48, 0 6px 14px rgba(13, 29, 72, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.3) !important;
}
.btn-diff--hard .diff-stars { color: #c8d6e8; }

/* Settings sheet: quiet settle when opened */
@keyframes afSettingsIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
#settingsMenu.show {
  animation: afSettingsIn 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
/* Settings rows: sticker corners, not SaaS pills */
.settings-row {
  border-radius: 14px 12px 15px 11px;
}
@media (prefers-reduced-motion: reduce) {
  #settingsMenu.show { animation: none; }
}
html.af-reduce-motion #settingsMenu.show { animation: none; }


/* Tide met card: quiet foam settle */
@keyframes afTideMet {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
#gameOverMenu.show {
  animation: afTideMet 380ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
#gameOverMenu.show > h2 {
  animation: afTideMet 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 40ms;
}
@media (prefers-reduced-motion: reduce) {
  #gameOverMenu.show,
  #gameOverMenu.show > h2 { animation: none; }
}
html.af-reduce-motion #gameOverMenu.show,
html.af-reduce-motion #gameOverMenu.show > h2 { animation: none; }


/* Tide met extras: quiet next-friend settle */
@keyframes afOverExtra {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
#nextUnlock:not([hidden]) {
  animation: afOverExtra 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
#over-leaderboards-btn:not([hidden]) {
  animation: afOverExtra 400ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 60ms;
}
@media (prefers-reduced-motion: reduce) {
  #nextUnlock:not([hidden]),
  #over-leaderboards-btn:not([hidden]) { animation: none; }
}
html.af-reduce-motion #nextUnlock:not([hidden]),
html.af-reduce-motion #over-leaderboards-btn:not([hidden]) { animation: none; }


/* Friends detail: quiet action settle */
@keyframes afFriendAct {
  from { opacity: 0.72; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
#charactersMenu .char-action:not([hidden]),
#charactersMenu #charActionBtn {
  animation: afFriendAct 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #charactersMenu .char-action:not([hidden]),
  #charactersMenu #charActionBtn { animation: none; }
}
html.af-reduce-motion #charactersMenu .char-action:not([hidden]),
html.af-reduce-motion #charactersMenu #charActionBtn { animation: none; }


/* Daily gift: quiet box settle */
@keyframes afGiftSettle {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
#giftMenu.show .gift-box {
  animation: afGiftSettle 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
#giftMenu.show #giftLine {
  animation: afGiftSettle 380ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 40ms;
}
@media (prefers-reduced-motion: reduce) {
  #giftMenu.show .gift-box,
  #giftMenu.show #giftLine { animation: none; }
}
html.af-reduce-motion #giftMenu.show .gift-box,
html.af-reduce-motion #giftMenu.show #giftLine { animation: none; }


/* Still in? / pause: quiet foam settle */
@keyframes afBreathIn {
  from { opacity: 0; transform: translateY(7px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
#continueMenu.show,
#pauseMenu.show {
  animation: afBreathIn 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
#continueMenu.show > h2,
#pauseMenu.show > h2 {
  animation: afBreathIn 400ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 35ms;
}
@media (prefers-reduced-motion: reduce) {
  #continueMenu.show,
  #pauseMenu.show,
  #continueMenu.show > h2,
  #pauseMenu.show > h2 { animation: none; }
}
html.af-reduce-motion #continueMenu.show,
html.af-reduce-motion #pauseMenu.show,
html.af-reduce-motion #continueMenu.show > h2,
html.af-reduce-motion #pauseMenu.show > h2 { animation: none; }


/* Home choose-depth + waters note: quiet settle */
@keyframes afHomeSoft {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
#startMenu .game-choose {
  animation: afHomeSoft 380ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 80ms;
}
#worldsMenu.show > .missions-note {
  animation: afHomeSoft 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #startMenu .game-choose,
  #worldsMenu.show > .missions-note { animation: none; }
}
html.af-reduce-motion #startMenu .game-choose,
html.af-reduce-motion #worldsMenu.show > .missions-note { animation: none; }


/* Sky-to-sea chip: quiet foam settle */
@keyframes afCourseIn {
  from { opacity: 0; transform: translateY(4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
#coral-course-btn:not([hidden]) {
  animation: afCourseIn 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #coral-course-btn:not([hidden]) { animation: none; }
}
html.af-reduce-motion #coral-course-btn:not([hidden]) { animation: none; }


/* Settings legal links: quiet foam settle */
@keyframes afLegalIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
#settingsMenu.show .settings-links .settings-link {
  animation: afLegalIn 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
#settingsMenu.show .settings-links .settings-link:nth-child(1) { animation-delay: 40ms; }
#settingsMenu.show .settings-links .settings-link:nth-child(2) { animation-delay: 80ms; }
#settingsMenu.show .settings-links .settings-link:nth-child(3) { animation-delay: 120ms; }
#settingsMenu.show .settings-links .settings-link:nth-child(4) { animation-delay: 160ms; }
@media (prefers-reduced-motion: reduce) {
  #settingsMenu.show .settings-links .settings-link { animation: none; }
}
html.af-reduce-motion #settingsMenu.show .settings-links .settings-link { animation: none; }


/* Badge / tide-marks list: quiet row settle */
@keyframes afMarkRow {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
#badgesMenu.show .badge-list > * {
  animation: afMarkRow 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
#badgesMenu.show .badge-list > *:nth-child(1) { animation-delay: 30ms; }
#badgesMenu.show .badge-list > *:nth-child(2) { animation-delay: 60ms; }
#badgesMenu.show .badge-list > *:nth-child(3) { animation-delay: 90ms; }
#badgesMenu.show .badge-list > *:nth-child(4) { animation-delay: 120ms; }
#badgesMenu.show .badge-list > *:nth-child(5) { animation-delay: 150ms; }
@media (prefers-reduced-motion: reduce) {
  #badgesMenu.show .badge-list > * { animation: none; }
}
html.af-reduce-motion #badgesMenu.show .badge-list > * { animation: none; }


/* List settles. Fill is `backwards` so press/selected transforms still work after the
   settle ends. Each targets the real container in index.html (#worldsList,
   #skinRow, #missionList, #logList, #shopList, #rewardList, #missionDoneList). */

/* Waters list: quiet row settle */
@keyframes afWaterRow {
  from { opacity: 0; transform: translateY(4px) scale(1); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
#worldsMenu.show #worldsList > * {
  animation: afWaterRow 320ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
#worldsMenu.show #worldsList > *:nth-child(1) { animation-delay: 40ms; }
#worldsMenu.show #worldsList > *:nth-child(2) { animation-delay: 70ms; }
#worldsMenu.show #worldsList > *:nth-child(3) { animation-delay: 100ms; }
#worldsMenu.show #worldsList > *:nth-child(4) { animation-delay: 130ms; }
#worldsMenu.show #worldsList > *:nth-child(5) { animation-delay: 160ms; }
@media (prefers-reduced-motion: reduce) {
  #worldsMenu.show #worldsList > * { animation: none; }
}
html.af-reduce-motion #worldsMenu.show #worldsList > * { animation: none; }


/* Friends roster: quiet card settle (only on open; #skinRow re-renders on taps) */
@keyframes afFriendCard {
  from { opacity: 0; transform: translateY(5px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
#charactersMenu.show #skinRow.af-settle > * {
  animation: afFriendCard 340ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
#charactersMenu.show #skinRow.af-settle > *:nth-child(1) { animation-delay: 30ms; }
#charactersMenu.show #skinRow.af-settle > *:nth-child(2) { animation-delay: 55ms; }
#charactersMenu.show #skinRow.af-settle > *:nth-child(3) { animation-delay: 80ms; }
#charactersMenu.show #skinRow.af-settle > *:nth-child(4) { animation-delay: 105ms; }
#charactersMenu.show #skinRow.af-settle > *:nth-child(5) { animation-delay: 130ms; }
#charactersMenu.show #skinRow.af-settle > *:nth-child(6) { animation-delay: 155ms; }
@media (prefers-reduced-motion: reduce) {
  #charactersMenu.show #skinRow.af-settle > * { animation: none; }
}
html.af-reduce-motion #charactersMenu.show #skinRow.af-settle > * { animation: none; }


/* Goals list: quiet row settle */
@keyframes afGoalRow {
  from { opacity: 0; transform: translateY(4px) scale(1); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
#missionsMenu.show #missionList > * {
  animation: afGoalRow 300ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
#missionsMenu.show #missionList > *:nth-child(1) { animation-delay: 35ms; }
#missionsMenu.show #missionList > *:nth-child(2) { animation-delay: 65ms; }
#missionsMenu.show #missionList > *:nth-child(3) { animation-delay: 95ms; }
#missionsMenu.show #missionList > *:nth-child(4) { animation-delay: 125ms; }
@media (prefers-reduced-motion: reduce) {
  #missionsMenu.show #missionList > * { animation: none; }
}
html.af-reduce-motion #missionsMenu.show #missionList > * { animation: none; }


/* Tide book: quiet page settle (also on Sky/Sea tab switch) */
@keyframes afLogRow {
  from { opacity: 0; transform: translateY(3px) scale(1); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
#logMenu.show #logList > * {
  animation: afLogRow 300ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
#logMenu.show #logList > *:nth-child(1) { animation-delay: 30ms; }
#logMenu.show #logList > *:nth-child(2) { animation-delay: 60ms; }
#logMenu.show #logList > *:nth-child(3) { animation-delay: 90ms; }
#logMenu.show #logList > *:nth-child(4) { animation-delay: 120ms; }
#logMenu.show #logList > *:nth-child(5) { animation-delay: 150ms; }
@media (prefers-reduced-motion: reduce) {
  #logMenu.show #logList > * { animation: none; }
}
html.af-reduce-motion #logMenu.show #logList > * { animation: none; }


/* Coin cove packs: quiet gold settle */
@keyframes afShopRow {
  from { opacity: 0; transform: translateY(4px) scale(1); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
#shopMenu.show #shopList > * {
  animation: afShopRow 320ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
#shopMenu.show #shopList > *:nth-child(1) { animation-delay: 40ms; }
#shopMenu.show #shopList > *:nth-child(2) { animation-delay: 75ms; }
#shopMenu.show #shopList > *:nth-child(3) { animation-delay: 110ms; }
#shopMenu.show #shopList > *:nth-child(4) { animation-delay: 145ms; }
@media (prefers-reduced-motion: reduce) {
  #shopMenu.show #shopList > * { animation: none; }
}
html.af-reduce-motion #shopMenu.show #shopList > * { animation: none; }


/* Swim over: prize and goal rows settle in */
@keyframes afOverRow {
  from { opacity: 0; transform: translateY(3px) scale(1); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
#gameOverMenu.show #rewardList > *, #gameOverMenu.show #missionDoneList > * {
  animation: afOverRow 300ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
#gameOverMenu.show #rewardList > *:nth-child(1), #gameOverMenu.show #missionDoneList > *:nth-child(1) { animation-delay: 80ms; }
#gameOverMenu.show #rewardList > *:nth-child(2), #gameOverMenu.show #missionDoneList > *:nth-child(2) { animation-delay: 110ms; }
#gameOverMenu.show #rewardList > *:nth-child(3), #gameOverMenu.show #missionDoneList > *:nth-child(3) { animation-delay: 140ms; }
@media (prefers-reduced-motion: reduce) {
  #gameOverMenu.show #rewardList > *, #gameOverMenu.show #missionDoneList > * { animation: none; }
}
html.af-reduce-motion #gameOverMenu.show #rewardList > *,
html.af-reduce-motion #gameOverMenu.show #missionDoneList > * { animation: none; }


/* Progress bars: soft sticker track, not full SaaS pills */
.almost-bar,
.almost-fill,
.mission-track,
.mission-fill,
.goal-track,
.goal-fill,
.level-track,
.level-fill,
.xp-track,
.xp-fill {
  border-radius: 10px 12px 10px 12px !important;
}

/* Settings switch: sticker track, not a full SaaS pill */
.switch {
  border-radius: 14px 16px 12px 15px !important;
}
.switch-knob {
  border-radius: 40% 45% 42% 48% !important;
}

/* News / fest banner list: quiet settle */
@keyframes afNewsRow {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
#newsMenu.show .news-list > *,
#newsMenu.show .fest-list > *,
#newsMenu.show .event-list > *,
#newsPanel.show .news-list > * {
  animation: afNewsRow 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
#newsMenu.show .news-list > *:nth-child(1),
#newsMenu.show .fest-list > *:nth-child(1),
#newsMenu.show .event-list > *:nth-child(1) { animation-delay: 35ms; }
#newsMenu.show .news-list > *:nth-child(2),
#newsMenu.show .fest-list > *:nth-child(2),
#newsMenu.show .event-list > *:nth-child(2) { animation-delay: 65ms; }
#newsMenu.show .news-list > *:nth-child(3),
#newsMenu.show .fest-list > *:nth-child(3),
#newsMenu.show .event-list > *:nth-child(3) { animation-delay: 95ms; }
#newsMenu.show .news-list > *:nth-child(4),
#newsMenu.show .fest-list > *:nth-child(4),
#newsMenu.show .event-list > *:nth-child(4) { animation-delay: 125ms; }
@media (prefers-reduced-motion: reduce) {
  #newsMenu.show .news-list > *,
  #newsMenu.show .fest-list > *,
  #newsMenu.show .event-list > *,
  #newsPanel.show .news-list > * { animation: none; }
}
html.af-reduce-motion #newsMenu.show .news-list > *,
html.af-reduce-motion #newsMenu.show .fest-list > *,
html.af-reduce-motion #newsMenu.show .event-list > *,
html.af-reduce-motion #newsPanel.show .news-list > * { animation: none; }


/* Over / pause actions: quiet rise. The buttons sit directly in #gameOverMenu and
   #pauseMenu; Share and Leaderboards keep their own settles above. */
@keyframes afOverAct {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
#gameOverMenu.show > .btn-game:not(#share-score-btn):not(#over-leaderboards-btn),
#pauseMenu.show > .btn-game {
  animation: afOverAct 320ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
#gameOverMenu.show > #restart-game-btn { animation-delay: 120ms; }
#gameOverMenu.show > #go-home-btn { animation-delay: 180ms; }
#pauseMenu.show > #resume-btn { animation-delay: 60ms; }
#pauseMenu.show > #pause-settings-btn { animation-delay: 95ms; }
#pauseMenu.show > #pause-home-btn { animation-delay: 130ms; }
@media (prefers-reduced-motion: reduce) {
  #gameOverMenu.show > .btn-game,
  #pauseMenu.show > .btn-game { animation: none; }
}
html.af-reduce-motion #gameOverMenu.show > .btn-game,
html.af-reduce-motion #pauseMenu.show > .btn-game { animation: none; }


/* Continue panel: quiet note settle after a bump */
@keyframes afContinueIn {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
#continueMenu.show .continue-note {
  animation: afContinueIn 400ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: 60ms;
}
@media (prefers-reduced-motion: reduce) {
  #continueMenu.show .continue-note { animation: none; }
}
html.af-reduce-motion #continueMenu.show .continue-note { animation: none; }


/* Rate panel: quiet rise */
@keyframes afRateSoft {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
#rateMenu.show .rate-card,
#rateMenu.show .panel-card,
#ratePrompt.show .rate-card,
#rateMenu.show .menu-card {
  animation: afRateSoft 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
#rateMenu.show .rate-stars > *,
#ratePrompt.show .rate-stars > * {
  animation: afRateSoft 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
#rateMenu.show .rate-stars > *:nth-child(1) { animation-delay: 40ms; }
#rateMenu.show .rate-stars > *:nth-child(2) { animation-delay: 70ms; }
#rateMenu.show .rate-stars > *:nth-child(3) { animation-delay: 100ms; }
#rateMenu.show .rate-stars > *:nth-child(4) { animation-delay: 130ms; }
#rateMenu.show .rate-stars > *:nth-child(5) { animation-delay: 160ms; }
@media (prefers-reduced-motion: reduce) {
  #rateMenu.show .rate-card,
  #rateMenu.show .panel-card,
  #ratePrompt.show .rate-card,
  #rateMenu.show .menu-card,
  #rateMenu.show .rate-stars > *,
  #ratePrompt.show .rate-stars > * { animation: none; }
}
html.af-reduce-motion #rateMenu.show .rate-card,
html.af-reduce-motion #rateMenu.show .panel-card,
html.af-reduce-motion #ratePrompt.show .rate-card,
html.af-reduce-motion #rateMenu.show .menu-card,
html.af-reduce-motion #rateMenu.show .rate-stars > *,
html.af-reduce-motion #ratePrompt.show .rate-stars > * { animation: none; }


/* Daily / stash: quiet settle */
@keyframes afDailySoft {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
#dailyMenu.show .menu-card,
#dailyMenu.show .daily-card,
#dailyMenu.show .panel-inner,
#dailyMenu.show h2,
#backupMenu.show .menu-card,
#backupMenu.show .panel-inner,
#backupMenu.show h2 {
  animation: afDailySoft 380ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
#dailyMenu.show .daily-stat {
  animation: afDailySoft 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
#dailyMenu.show .daily-stat:nth-child(1) { animation-delay: 40ms; }
#dailyMenu.show .daily-stat:nth-child(2) { animation-delay: 70ms; }
#dailyMenu.show .daily-stat:nth-child(3) { animation-delay: 100ms; }
#dailyMenu.show .btn-game,
#backupMenu.show .btn-game {
  animation: afDailySoft 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 80ms;
}
@media (prefers-reduced-motion: reduce) {
  #dailyMenu.show .menu-card,
  #dailyMenu.show .daily-card,
  #dailyMenu.show .panel-inner,
  #dailyMenu.show h2,
  #dailyMenu.show .daily-stat,
  #dailyMenu.show .btn-game,
  #backupMenu.show .menu-card,
  #backupMenu.show .panel-inner,
  #backupMenu.show h2,
  #backupMenu.show .btn-game { animation: none; }
}
html.af-reduce-motion #dailyMenu.show .menu-card,
html.af-reduce-motion #dailyMenu.show .daily-card,
html.af-reduce-motion #dailyMenu.show .panel-inner,
html.af-reduce-motion #dailyMenu.show h2,
html.af-reduce-motion #dailyMenu.show .daily-stat,
html.af-reduce-motion #dailyMenu.show .btn-game,
html.af-reduce-motion #backupMenu.show .menu-card,
html.af-reduce-motion #backupMenu.show .panel-inner,
html.af-reduce-motion #backupMenu.show h2,
html.af-reduce-motion #backupMenu.show .btn-game { animation: none; }

/* Tide met → Again: quiet pulse settle */
@keyframes afAgainSoft {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
#gameOverMenu.show #restart-game-btn {
  animation: afAgainSoft 420ms cubic-bezier(0.22, 1, 0.36, 1) 120ms both;
}
@media (prefers-reduced-motion: reduce) {
  #gameOverMenu.show #restart-game-btn { animation: none; }
}
html.af-reduce-motion #gameOverMenu.show #restart-game-btn { animation: none; }

/* Waters menu: quiet settle */
@keyframes afWatersSoft {
  from { opacity: 0; transform: translateY(9px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
#worldsMenu.show h2,
#worldsMenu.show .missions-note,
#worldsMenu.show .world-star-total {
  animation: afWatersSoft 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
#worldsMenu.show .world-row {
  animation: afWatersSoft 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
#worldsMenu.show .world-row:nth-child(n+3) { animation-delay: 40ms; }
#worldsMenu.show .world-row:nth-child(n+6) { animation-delay: 70ms; }
#worldsMenu.show .world-row:nth-child(n+9) { animation-delay: 100ms; }
@media (prefers-reduced-motion: reduce) {
  #worldsMenu.show h2,
  #worldsMenu.show .missions-note,
  #worldsMenu.show .world-star-total,
  #worldsMenu.show .world-row { animation: none; }
}
html.af-reduce-motion #worldsMenu.show h2,
html.af-reduce-motion #worldsMenu.show .missions-note,
html.af-reduce-motion #worldsMenu.show .world-star-total,
html.af-reduce-motion #worldsMenu.show .world-row { animation: none; }

/* Weekly / daily titles: quiet settle */
@keyframes afWeeklySoft {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
#dailyMenu.show .weekly-title,
#dailyMenu.show h2,
#dailyMenu.show h3 {
  animation: afWeeklySoft 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
#dailyMenu.show #daily-play-btn,
#dailyMenu.show #weekly-play-btn {
  animation: afWeeklySoft 380ms cubic-bezier(0.22, 1, 0.36, 1) 60ms both;
}
@media (prefers-reduced-motion: reduce) {
  #dailyMenu.show .weekly-title,
  #dailyMenu.show h2,
  #dailyMenu.show h3,
  #dailyMenu.show #daily-play-btn,
  #dailyMenu.show #weekly-play-btn { animation: none; }
}
html.af-reduce-motion #dailyMenu.show .weekly-title,
html.af-reduce-motion #dailyMenu.show h2,
html.af-reduce-motion #dailyMenu.show h3,
html.af-reduce-motion #dailyMenu.show #daily-play-btn,
html.af-reduce-motion #dailyMenu.show #weekly-play-btn { animation: none; }

/* Reminder / tip toast: quiet foam */
@keyframes afRemindSoft {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.remind-note.show,
#remindNote.show,
.tip-toast.show,
#tipToast.show,
.af-toast.show {
  animation: afRemindSoft 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  .remind-note.show,
  #remindNote.show,
  .tip-toast.show,
  #tipToast.show,
  .af-toast.show { animation: none; }
}
html.af-reduce-motion .remind-note.show,
html.af-reduce-motion #remindNote.show,
html.af-reduce-motion .tip-toast.show,
html.af-reduce-motion #tipToast.show,
html.af-reduce-motion .af-toast.show { animation: none; }

/* Settings sections: quiet settle */
@keyframes afSettingsSec {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
#settingsMenu.show .settings-section {
  animation: afSettingsSec 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
#settingsMenu.show .settings-section:nth-of-type(2) { animation-delay: 40ms; }
#settingsMenu.show .settings-section:nth-of-type(3) { animation-delay: 70ms; }
#settingsMenu.show .settings-section:nth-of-type(4) { animation-delay: 100ms; }
@media (prefers-reduced-motion: reduce) {
  #settingsMenu.show .settings-section { animation: none; }
}
html.af-reduce-motion #settingsMenu.show .settings-section { animation: none; }

/* Diff row: quiet rise */
@keyframes afDiffSoft {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.start-menu.show .btn-diff,
#startMenu.show .btn-diff,
.menu-diff .btn-diff {
  animation: afDiffSoft 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.start-menu.show .btn-diff:nth-child(1),
#startMenu.show .btn-diff:nth-child(1) { animation-delay: 40ms; }
.start-menu.show .btn-diff:nth-child(2),
#startMenu.show .btn-diff:nth-child(2) { animation-delay: 70ms; }
.start-menu.show .btn-diff:nth-child(3),
#startMenu.show .btn-diff:nth-child(3) { animation-delay: 100ms; }
@media (prefers-reduced-motion: reduce) {
  .start-menu.show .btn-diff,
  #startMenu.show .btn-diff,
  .menu-diff .btn-diff { animation: none; }
}
html.af-reduce-motion .start-menu.show .btn-diff,
html.af-reduce-motion #startMenu.show .btn-diff,
html.af-reduce-motion .menu-diff .btn-diff { animation: none; }

/* Home coins: quiet settle */
@keyframes afHomeCoins {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.start-menu.show .menu-coins,
#startMenu.show .menu-coins {
  animation: afHomeCoins 380ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  .start-menu.show .menu-coins,
  #startMenu.show .menu-coins { animation: none; }
}
html.af-reduce-motion .start-menu.show .menu-coins,
html.af-reduce-motion #startMenu.show .menu-coins { animation: none; }

/* Home best line: quiet settle */
@keyframes afMenuBest {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.start-menu.show .menu-best,
#startMenu.show .menu-best,
.start-menu.show .menu-best.is-on,
#menuBest:not([hidden]) {
  animation: afMenuBest 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  .start-menu.show .menu-best,
  #startMenu.show .menu-best,
  #menuBest:not([hidden]) { animation: none; }
}
html.af-reduce-motion .start-menu.show .menu-best,
html.af-reduce-motion #startMenu.show .menu-best,
html.af-reduce-motion #menuBest:not([hidden]) { animation: none; }

/* Pause sheet: quiet settle */
@keyframes afPauseSoft {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
#pauseMenu.show .pause-panel,
.pause-menu.show .pause-panel,
#pauseOverlay.show .panel,
#pauseSheet:not([hidden]) {
  animation: afPauseSoft 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #pauseMenu.show .pause-panel,
  .pause-menu.show .pause-panel,
  #pauseOverlay.show .panel,
  #pauseSheet:not([hidden]) { animation: none; }
}
html.af-reduce-motion #pauseMenu.show .pause-panel,
html.af-reduce-motion .pause-menu.show .pause-panel,
html.af-reduce-motion #pauseOverlay.show .panel,
html.af-reduce-motion #pauseSheet:not([hidden]) { animation: none; }

/* Game over: quiet settle */
@keyframes afOverSoft {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
#gameOverMenu.show .over-panel,
.game-over.show .over-panel,
#gameOverMenu.show .panel,
#gameOverMenu.show .menu-card {
  animation: afOverSoft 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #gameOverMenu.show .over-panel,
  .game-over.show .over-panel,
  #gameOverMenu.show .panel,
  #gameOverMenu.show .menu-card { animation: none; }
}
html.af-reduce-motion #gameOverMenu.show .over-panel,
html.af-reduce-motion .game-over.show .over-panel,
html.af-reduce-motion #gameOverMenu.show .panel,
html.af-reduce-motion #gameOverMenu.show .menu-card { animation: none; }

/* Friends sheet: quiet settle */
@keyframes afCharSoft {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
#charactersMenu.show .char-panel,
#charactersMenu.show .panel,
.characters-menu.show .panel,
#charactersMenu.show .menu-card {
  animation: afCharSoft 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #charactersMenu.show .char-panel,
  #charactersMenu.show .panel,
  .characters-menu.show .panel,
  #charactersMenu.show .menu-card { animation: none; }
}
html.af-reduce-motion #charactersMenu.show .char-panel,
html.af-reduce-motion #charactersMenu.show .panel,
html.af-reduce-motion .characters-menu.show .panel,
html.af-reduce-motion #charactersMenu.show .menu-card { animation: none; }

/* Goals sheet: quiet settle */
@keyframes afGoalsSoft {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
#missionsMenu.show .missions-panel,
#missionsMenu.show .panel,
.missions-menu.show .panel,
#missionsMenu.show .menu-card {
  animation: afGoalsSoft 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #missionsMenu.show .missions-panel,
  #missionsMenu.show .panel,
  .missions-menu.show .panel,
  #missionsMenu.show .menu-card { animation: none; }
}
html.af-reduce-motion #missionsMenu.show .missions-panel,
html.af-reduce-motion #missionsMenu.show .panel,
html.af-reduce-motion .missions-menu.show .panel,
html.af-reduce-motion #missionsMenu.show .menu-card { animation: none; }

/* Marks sheet: quiet settle */
@keyframes afBadgeSoft {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
#badgesMenu.show .badges-panel,
#badgesMenu.show .panel,
.badges-menu.show .panel,
#badgesMenu.show .menu-card {
  animation: afBadgeSoft 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #badgesMenu.show .badges-panel,
  #badgesMenu.show .panel,
  .badges-menu.show .panel,
  #badgesMenu.show .menu-card { animation: none; }
}
html.af-reduce-motion #badgesMenu.show .badges-panel,
html.af-reduce-motion #badgesMenu.show .panel,
html.af-reduce-motion .badges-menu.show .panel,
html.af-reduce-motion #badgesMenu.show .menu-card { animation: none; }

/* Coin cove: quiet settle */
@keyframes afCoinSoft {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
#shopMenu.show .shop-panel,
#shopMenu.show .panel,
.shop-menu.show .panel,
#shopMenu.show .menu-card,
#coinCove.show .panel,
#storeMenu.show .panel {
  animation: afCoinSoft 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #shopMenu.show .shop-panel,
  #shopMenu.show .panel,
  .shop-menu.show .panel,
  #shopMenu.show .menu-card,
  #coinCove.show .panel,
  #storeMenu.show .panel { animation: none; }
}
html.af-reduce-motion #shopMenu.show .shop-panel,
html.af-reduce-motion #shopMenu.show .panel,
html.af-reduce-motion .shop-menu.show .panel,
html.af-reduce-motion #shopMenu.show .menu-card,
html.af-reduce-motion #coinCove.show .panel,
html.af-reduce-motion #storeMenu.show .panel { animation: none; }

/* Help / how-to: quiet settle */
@keyframes afHelpSoft {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
#helpMenu.show .help-panel,
#helpMenu.show .panel,
.help-menu.show .panel,
#howToMenu.show .panel,
#newsMenu.show .panel {
  animation: afHelpSoft 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #helpMenu.show .help-panel,
  #helpMenu.show .panel,
  .help-menu.show .panel,
  #howToMenu.show .panel,
  #newsMenu.show .panel { animation: none; }
}
html.af-reduce-motion #helpMenu.show .help-panel,
html.af-reduce-motion #helpMenu.show .panel,
html.af-reduce-motion .help-menu.show .panel,
html.af-reduce-motion #howToMenu.show .panel,
html.af-reduce-motion #newsMenu.show .panel { animation: none; }

/* Logbook / tide book: quiet settle */
@keyframes afLogSoft {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
#logbookMenu.show .log-panel,
#logbookMenu.show .panel,
.logbook-menu.show .panel,
#discoveriesMenu.show .panel,
#tideBook.show .panel {
  animation: afLogSoft 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #logbookMenu.show .log-panel,
  #logbookMenu.show .panel,
  .logbook-menu.show .panel,
  #discoveriesMenu.show .panel,
  #tideBook.show .panel { animation: none; }
}
html.af-reduce-motion #logbookMenu.show .log-panel,
html.af-reduce-motion #logbookMenu.show .panel,
html.af-reduce-motion .logbook-menu.show .panel,
html.af-reduce-motion #discoveriesMenu.show .panel,
html.af-reduce-motion #tideBook.show .panel { animation: none; }

/* Share / continue strip: quiet settle */
@keyframes afShareSoft {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
#gameOverMenu.show .share-row,
#gameOverMenu.show .continue-row,
#continueMenu.show .panel,
#continueMenu.show {
  animation: afShareSoft 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #gameOverMenu.show .share-row,
  #gameOverMenu.show .continue-row,
  #continueMenu.show .panel,
  #continueMenu.show { animation: none; }
}
html.af-reduce-motion #gameOverMenu.show .share-row,
html.af-reduce-motion #gameOverMenu.show .continue-row,
html.af-reduce-motion #continueMenu.show .panel,
html.af-reduce-motion #continueMenu.show { animation: none; }

/* Gift sheet panel: quiet settle */
@keyframes afGiftSoft {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
#giftMenu.show .panel,
#giftMenu.show .menu-card,
#giftMenu.show .gift-panel {
  animation: afGiftSoft 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #giftMenu.show .panel,
  #giftMenu.show .menu-card,
  #giftMenu.show .gift-panel { animation: none; }
}
html.af-reduce-motion #giftMenu.show .panel,
html.af-reduce-motion #giftMenu.show .menu-card,
html.af-reduce-motion #giftMenu.show .gift-panel { animation: none; }

/* Daily / week run sheet: quiet settle */
@keyframes afDailyOpen {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
#dailyMenu.show .panel,
#dailyMenu.show .menu-card,
#weeklyMenu.show .panel,
#weekMenu.show .panel {
  animation: afDailyOpen 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #dailyMenu.show .panel,
  #dailyMenu.show .menu-card,
  #weeklyMenu.show .panel,
  #weekMenu.show .panel { animation: none; }
}
html.af-reduce-motion #dailyMenu.show .panel,
html.af-reduce-motion #dailyMenu.show .menu-card,
html.af-reduce-motion #weeklyMenu.show .panel,
html.af-reduce-motion #weekMenu.show .panel { animation: none; }

/* Waters sheet: quiet settle */
@keyframes afWatersOpen {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
#worldsMenu.show .panel,
#worldsMenu.show .menu-card,
#watersMenu.show .panel,
.worlds-menu.show .panel {
  animation: afWatersOpen 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #worldsMenu.show .panel,
  #worldsMenu.show .menu-card,
  #watersMenu.show .panel,
  .worlds-menu.show .panel { animation: none; }
}
html.af-reduce-motion #worldsMenu.show .panel,
html.af-reduce-motion #worldsMenu.show .menu-card,
html.af-reduce-motion #watersMenu.show .panel,
html.af-reduce-motion .worlds-menu.show .panel { animation: none; }

/* Settings sheet: quiet settle */
@keyframes afSettingsSoft {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
#settingsMenu.show .panel,
#settingsMenu.show .menu-card,
.settings-menu.show .panel {
  animation: afSettingsSoft 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #settingsMenu.show .panel,
  #settingsMenu.show .menu-card,
  .settings-menu.show .panel { animation: none; }
}
html.af-reduce-motion #settingsMenu.show .panel,
html.af-reduce-motion #settingsMenu.show .menu-card,
html.af-reduce-motion .settings-menu.show .panel { animation: none; }

/* Stash / news sheets: quiet settle */
@keyframes afStashSoft {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
#backupMenu.show .panel,
#backupMenu.show .menu-card,
#newsMenu.show .panel,
#newsMenu.show .menu-card {
  animation: afStashSoft 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #backupMenu.show .panel,
  #backupMenu.show .menu-card,
  #newsMenu.show .panel,
  #newsMenu.show .menu-card { animation: none; }
}
html.af-reduce-motion #backupMenu.show .panel,
html.af-reduce-motion #backupMenu.show .menu-card,
html.af-reduce-motion #newsMenu.show .panel,
html.af-reduce-motion #newsMenu.show .menu-card { animation: none; }

/* Home brand: quiet settle */
@keyframes afBrandSoft {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
.start-menu.show .brand,
.start-menu.show .menu-title,
#startMenu.show .brand,
#startMenu.show h1,
#startMenu.show .game-title {
  animation: afBrandSoft 380ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  .start-menu.show .brand,
  .start-menu.show .menu-title,
  #startMenu.show .brand,
  #startMenu.show h1,
  #startMenu.show .game-title { animation: none; }
}
html.af-reduce-motion .start-menu.show .brand,
html.af-reduce-motion .start-menu.show .menu-title,
html.af-reduce-motion #startMenu.show .brand,
html.af-reduce-motion #startMenu.show h1,
html.af-reduce-motion #startMenu.show .game-title { animation: none; }

/* In-run HUD: quiet settle */
@keyframes afHudSoft {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
#gameHud.is-on,
#gameHud.show,
.game-hud.is-on,
#gameHud:not([hidden]) {
  animation: afHudSoft 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #gameHud.is-on,
  #gameHud.show,
  .game-hud.is-on,
  #gameHud:not([hidden]) { animation: none; }
}
html.af-reduce-motion #gameHud.is-on,
html.af-reduce-motion #gameHud.show,
html.af-reduce-motion .game-hud.is-on,
html.af-reduce-motion #gameHud:not([hidden]) { animation: none; }

/* Play canvas / tide pill: quiet settle */
@keyframes afCanvasSoft {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes afTidePill {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
#gameCanvas.is-on,
#gameCanvas.show,
.game-wrap.is-on #gameCanvas {
  animation: afCanvasSoft 280ms ease-out both;
}
#seasonPill:not([hidden]),
#tidePill:not([hidden]),
.tide-pill:not([hidden]) {
  animation: afTidePill 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #gameCanvas.is-on,
  #gameCanvas.show,
  .game-wrap.is-on #gameCanvas,
  #seasonPill:not([hidden]),
  #tidePill:not([hidden]),
  .tide-pill:not([hidden]) { animation: none; }
}
html.af-reduce-motion #gameCanvas.is-on,
html.af-reduce-motion #gameCanvas.show,
html.af-reduce-motion .game-wrap.is-on #gameCanvas,
html.af-reduce-motion #seasonPill:not([hidden]),
html.af-reduce-motion #tidePill:not([hidden]),
html.af-reduce-motion .tide-pill:not([hidden]) { animation: none; }

/* Power / toast / banner: quiet settle */
@keyframes afPowerSoft {
  from { opacity: 0; transform: translateY(5px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
#toast:not([hidden]),
.game-toast:not([hidden]),
#powerToast:not([hidden]),
#hudToast:not([hidden]),
.combo-banner:not([hidden]),
#banner:not([hidden]) {
  animation: afPowerSoft 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #toast:not([hidden]),
  .game-toast:not([hidden]),
  #powerToast:not([hidden]),
  #hudToast:not([hidden]),
  .combo-banner:not([hidden]),
  #banner:not([hidden]) { animation: none; }
}
html.af-reduce-motion #toast:not([hidden]),
html.af-reduce-motion .game-toast:not([hidden]),
html.af-reduce-motion #powerToast:not([hidden]),
html.af-reduce-motion #hudToast:not([hidden]),
html.af-reduce-motion .combo-banner:not([hidden]),
html.af-reduce-motion #banner:not([hidden]) { animation: none; }

/* Continue sheet: quiet settle */
@keyframes afContinueSoft {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
#continueMenu.show .panel,
#continueMenu.show .menu-card,
#continueMenu.show h2,
.game-continue.show .panel {
  animation: afContinueSoft 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #continueMenu.show .panel,
  #continueMenu.show .menu-card,
  #continueMenu.show h2,
  .game-continue.show .panel { animation: none; }
}
html.af-reduce-motion #continueMenu.show .panel,
html.af-reduce-motion #continueMenu.show .menu-card,
html.af-reduce-motion #continueMenu.show h2,
html.af-reduce-motion .game-continue.show .panel { animation: none; }

/* Tap hint: quiet settle */
@keyframes afTapHint {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
#tapHint:not([hidden]),
.tap-hint:not([hidden]),
#tapHint.show {
  animation: afTapHint 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #tapHint:not([hidden]),
  .tap-hint:not([hidden]),
  #tapHint.show { animation: none; }
}
html.af-reduce-motion #tapHint:not([hidden]),
html.af-reduce-motion .tap-hint:not([hidden]),
html.af-reduce-motion #tapHint.show { animation: none; }

/* Toast: quiet settle */
@keyframes afToastSoft {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
#powerToast:not([hidden]),
.power-toast:not([hidden]),
#afToast:not([hidden]),
.af-toast:not([hidden]),
#toast:not([hidden]) {
  animation: afToastSoft 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #powerToast:not([hidden]),
  .power-toast:not([hidden]),
  #afToast:not([hidden]),
  .af-toast:not([hidden]),
  #toast:not([hidden]) { animation: none; }
}
html.af-reduce-motion #powerToast:not([hidden]),
html.af-reduce-motion .power-toast:not([hidden]),
html.af-reduce-motion #afToast:not([hidden]),
html.af-reduce-motion .af-toast:not([hidden]),
html.af-reduce-motion #toast:not([hidden]) { animation: none; }

/* News / stash sheet: quiet settle */
@keyframes afNewsSoft {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
#newsSheet:not([hidden]) .sheet-panel,
#stashSheet:not([hidden]) .sheet-panel,
#newsModal:not([hidden]),
.news-sheet:not([hidden]) .sheet-panel {
  animation: afNewsSoft 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #newsSheet:not([hidden]) .sheet-panel,
  #stashSheet:not([hidden]) .sheet-panel,
  #newsModal:not([hidden]),
  .news-sheet:not([hidden]) .sheet-panel { animation: none; }
}
html.af-reduce-motion #newsSheet:not([hidden]) .sheet-panel,
html.af-reduce-motion #stashSheet:not([hidden]) .sheet-panel,
html.af-reduce-motion #newsModal:not([hidden]),
html.af-reduce-motion .news-sheet:not([hidden]) .sheet-panel { animation: none; }

/* Boss / tide meet sheet: quiet settle */
@keyframes afBossSoft {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
#bossSheet:not([hidden]) .sheet-panel,
#tideMetSheet:not([hidden]) .sheet-panel,
#levelComplete:not([hidden]) .sheet-panel,
.boss-sheet:not([hidden]) .sheet-panel {
  animation: afBossSoft 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #bossSheet:not([hidden]) .sheet-panel,
  #tideMetSheet:not([hidden]) .sheet-panel,
  #levelComplete:not([hidden]) .sheet-panel,
  .boss-sheet:not([hidden]) .sheet-panel { animation: none; }
}
html.af-reduce-motion #bossSheet:not([hidden]) .sheet-panel,
html.af-reduce-motion #tideMetSheet:not([hidden]) .sheet-panel,
html.af-reduce-motion #levelComplete:not([hidden]) .sheet-panel,
html.af-reduce-motion .boss-sheet:not([hidden]) .sheet-panel { animation: none; }

/* Tide chip / HUD pill: quiet settle */
@keyframes afLevelChip {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}
#levelChip,
.level-chip,
#tidePill,
.tide-pill,
.hud-tide {
  animation: afLevelChip 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #levelChip,
  .level-chip,
  #tidePill,
  .tide-pill,
  .hud-tide { animation: none; }
}
html.af-reduce-motion #levelChip,
html.af-reduce-motion .level-chip,
html.af-reduce-motion #tidePill,
html.af-reduce-motion .tide-pill,
html.af-reduce-motion .hud-tide { animation: none; }

/* Character pick sheet: quiet settle */
@keyframes afCharPick {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
#charactersMenu:not([hidden]) .sheet-panel,
#charactersMenu:not(.hidden) .sheet-panel,
#charactersMenu.open .sheet-panel {
  animation: afCharPick 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #charactersMenu:not([hidden]) .sheet-panel,
  #charactersMenu:not(.hidden) .sheet-panel,
  #charactersMenu.open .sheet-panel { animation: none; }
}
html.af-reduce-motion #charactersMenu:not([hidden]) .sheet-panel,
html.af-reduce-motion #charactersMenu:not(.hidden) .sheet-panel,
html.af-reduce-motion #charactersMenu.open .sheet-panel { animation: none; }

/* Coin cove / shop sheet: quiet settle */
@keyframes afShopSoft {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
#shopMenu:not([hidden]) .sheet-panel,
#shopMenu:not(.hidden) .sheet-panel,
#shopMenu.open .sheet-panel,
#shopMenu:not([hidden]) {
  animation: afShopSoft 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #shopMenu:not([hidden]) .sheet-panel,
  #shopMenu:not(.hidden) .sheet-panel,
  #shopMenu.open .sheet-panel,
  #shopMenu:not([hidden]) { animation: none; }
}
html.af-reduce-motion #shopMenu:not([hidden]) .sheet-panel,
html.af-reduce-motion #shopMenu:not(.hidden) .sheet-panel,
html.af-reduce-motion #shopMenu.open .sheet-panel,
html.af-reduce-motion #shopMenu:not([hidden]) { animation: none; }

/* Badges sheet: quiet settle */
@keyframes afBadgeMenu {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
#badgesMenu:not([hidden]) .sheet-panel,
#badgesMenu:not(.hidden) .sheet-panel,
#badgesMenu.open .sheet-panel,
#badgesMenu:not([hidden]) {
  animation: afBadgeMenu 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #badgesMenu:not([hidden]) .sheet-panel,
  #badgesMenu:not(.hidden) .sheet-panel,
  #badgesMenu.open .sheet-panel,
  #badgesMenu:not([hidden]) { animation: none; }
}
html.af-reduce-motion #badgesMenu:not([hidden]) .sheet-panel,
html.af-reduce-motion #badgesMenu:not(.hidden) .sheet-panel,
html.af-reduce-motion #badgesMenu.open .sheet-panel,
html.af-reduce-motion #badgesMenu:not([hidden]) { animation: none; }

/* Waters / worlds sheet: quiet settle */
@keyframes afWorldsSoft {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
#worldsMenu:not([hidden]) .sheet-panel,
#worldsMenu:not(.hidden) .sheet-panel,
#worldsMenu.open .sheet-panel,
#worldsMenu:not([hidden]) {
  animation: afWorldsSoft 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #worldsMenu:not([hidden]) .sheet-panel,
  #worldsMenu:not(.hidden) .sheet-panel,
  #worldsMenu.open .sheet-panel,
  #worldsMenu:not([hidden]) { animation: none; }
}
html.af-reduce-motion #worldsMenu:not([hidden]) .sheet-panel,
html.af-reduce-motion #worldsMenu:not(.hidden) .sheet-panel,
html.af-reduce-motion #worldsMenu.open .sheet-panel,
html.af-reduce-motion #worldsMenu:not([hidden]) { animation: none; }

/* Backup / stash sheet: quiet settle */
@keyframes afBackupSoft {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
#backupMenu:not([hidden]) .sheet-panel,
#backupMenu:not(.hidden) .sheet-panel,
#backupMenu.open .sheet-panel,
#backupMenu:not([hidden]) {
  animation: afBackupSoft 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #backupMenu:not([hidden]) .sheet-panel,
  #backupMenu:not(.hidden) .sheet-panel,
  #backupMenu.open .sheet-panel,
  #backupMenu:not([hidden]) { animation: none; }
}
html.af-reduce-motion #backupMenu:not([hidden]) .sheet-panel,
html.af-reduce-motion #backupMenu:not(.hidden) .sheet-panel,
html.af-reduce-motion #backupMenu.open .sheet-panel,
html.af-reduce-motion #backupMenu:not([hidden]) { animation: none; }

/* News menu sheet: quiet settle */
@keyframes afNewsMenu {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
#newsMenu:not([hidden]) .sheet-panel,
#newsMenu:not(.hidden) .sheet-panel,
#newsMenu.open .sheet-panel,
#newsMenu:not([hidden]) {
  animation: afNewsMenu 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #newsMenu:not([hidden]) .sheet-panel,
  #newsMenu:not(.hidden) .sheet-panel,
  #newsMenu.open .sheet-panel,
  #newsMenu:not([hidden]) { animation: none; }
}
html.af-reduce-motion #newsMenu:not([hidden]) .sheet-panel,
html.af-reduce-motion #newsMenu:not(.hidden) .sheet-panel,
html.af-reduce-motion #newsMenu.open .sheet-panel,
html.af-reduce-motion #newsMenu:not([hidden]) { animation: none; }

/* Home start menu: quiet settle */
@keyframes afStartSoft {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
#startMenu:not([hidden]) .sheet-panel,
#startMenu:not(.hidden) .sheet-panel,
#startMenu.open .sheet-panel,
#startMenu:not([hidden]) {
  animation: afStartSoft 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #startMenu:not([hidden]) .sheet-panel,
  #startMenu:not(.hidden) .sheet-panel,
  #startMenu.open .sheet-panel,
  #startMenu:not([hidden]) { animation: none; }
}
html.af-reduce-motion #startMenu:not([hidden]) .sheet-panel,
html.af-reduce-motion #startMenu:not(.hidden) .sheet-panel,
html.af-reduce-motion #startMenu.open .sheet-panel,
html.af-reduce-motion #startMenu:not([hidden]) { animation: none; }

/* Goals / missions sheet: quiet settle */
@keyframes afMissionsSoft {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
#missionsMenu:not([hidden]) .sheet-panel,
#missionsMenu:not(.hidden) .sheet-panel,
#missionsMenu.open .sheet-panel,
#missionsMenu:not([hidden]) {
  animation: afMissionsSoft 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #missionsMenu:not([hidden]) .sheet-panel,
  #missionsMenu:not(.hidden) .sheet-panel,
  #missionsMenu.open .sheet-panel,
  #missionsMenu:not([hidden]) { animation: none; }
}
html.af-reduce-motion #missionsMenu:not([hidden]) .sheet-panel,
html.af-reduce-motion #missionsMenu:not(.hidden) .sheet-panel,
html.af-reduce-motion #missionsMenu.open .sheet-panel,
html.af-reduce-motion #missionsMenu:not([hidden]) { animation: none; }

/* On-shore / game-over sheet: quiet settle */
@keyframes afOverMenu {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
#gameOverMenu:not([hidden]) .sheet-panel,
#gameOverMenu:not(.hidden) .sheet-panel,
#gameOverMenu.open .sheet-panel,
#gameOverMenu:not([hidden]) {
  animation: afOverMenu 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #gameOverMenu:not([hidden]) .sheet-panel,
  #gameOverMenu:not(.hidden) .sheet-panel,
  #gameOverMenu.open .sheet-panel,
  #gameOverMenu:not([hidden]) { animation: none; }
}
html.af-reduce-motion #gameOverMenu:not([hidden]) .sheet-panel,
html.af-reduce-motion #gameOverMenu:not(.hidden) .sheet-panel,
html.af-reduce-motion #gameOverMenu.open .sheet-panel,
html.af-reduce-motion #gameOverMenu:not([hidden]) { animation: none; }

/* Goal / tide-met toast: quiet settle */
@keyframes afGoalToast {
  from { opacity: 0; transform: translateY(5px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
#missionToast:not([hidden]),
#goalToast:not([hidden]),
.mission-toast:not([hidden]),
.goal-toast:not([hidden]),
#tideMetToast:not([hidden]) {
  animation: afGoalToast 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #missionToast:not([hidden]),
  #goalToast:not([hidden]),
  .mission-toast:not([hidden]),
  .goal-toast:not([hidden]),
  #tideMetToast:not([hidden]) { animation: none; }
}
html.af-reduce-motion #missionToast:not([hidden]),
html.af-reduce-motion #goalToast:not([hidden]),
html.af-reduce-motion .mission-toast:not([hidden]),
html.af-reduce-motion .goal-toast:not([hidden]),
html.af-reduce-motion #tideMetToast:not([hidden]) { animation: none; }

/* Shout / banner toast: quiet settle (no bangy bounce) */
@keyframes afShoutSoft {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
#shoutToast:not([hidden]),
.shout-toast:not([hidden]),
#bannerToast:not([hidden]),
.af-shout:not([hidden]),
#eventToast:not([hidden]) {
  animation: afShoutSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #shoutToast:not([hidden]),
  .shout-toast:not([hidden]),
  #bannerToast:not([hidden]),
  .af-shout:not([hidden]),
  #eventToast:not([hidden]) { animation: none; }
}
html.af-reduce-motion #shoutToast:not([hidden]),
html.af-reduce-motion .shout-toast:not([hidden]),
html.af-reduce-motion #bannerToast:not([hidden]),
html.af-reduce-motion .af-shout:not([hidden]),
html.af-reduce-motion #eventToast:not([hidden]) { animation: none; }

/* HUD coin tick: quiet settle */
@keyframes afCoinBump {
  from { opacity: 0.7; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
#menuCoins,
#shopCoins,
#charCoins,
#continueCoins,
#overCoins,
.hud-coins {
  animation: afCoinBump 240ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #menuCoins,
  #shopCoins,
  #charCoins,
  #continueCoins,
  #overCoins,
  .hud-coins { animation: none; }
}
html.af-reduce-motion #menuCoins,
html.af-reduce-motion #shopCoins,
html.af-reduce-motion #charCoins,
html.af-reduce-motion #continueCoins,
html.af-reduce-motion #overCoins,
html.af-reduce-motion .hud-coins { animation: none; }

/* Progress bars: sticker ends, not full pills */
.almost-bar,
.almost-fill,
.mission-bar,
.mission-fill,
.continue-bar,
.continue-fill {
  border-radius: 8px 10px 7px 9px !important;
}


/* Home tip line: quiet settle */
@keyframes afHomeTip {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
#startMenu .menu-tip,
#startMenu .tip,
.home-tip,
.menu-best {
  animation: afHomeTip 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #startMenu .menu-tip,
  #startMenu .tip,
  .home-tip,
  .menu-best { animation: none; }
}
html.af-reduce-motion #startMenu .menu-tip,
html.af-reduce-motion #startMenu .tip,
html.af-reduce-motion .home-tip,
html.af-reduce-motion .menu-best { animation: none; }

/* Power / head-start sheet: quiet settle */
@keyframes afPowerSheet {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
#powerMenu:not([hidden]) .sheet-panel,
#powerSheet:not([hidden]) .sheet-panel,
.head-start-sheet:not([hidden]),
#headStartMenu:not([hidden]) {
  animation: afPowerSheet 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #powerMenu:not([hidden]) .sheet-panel,
  #powerSheet:not([hidden]) .sheet-panel,
  .head-start-sheet:not([hidden]),
  #headStartMenu:not([hidden]) { animation: none; }
}
html.af-reduce-motion #powerMenu:not([hidden]) .sheet-panel,
html.af-reduce-motion #powerSheet:not([hidden]) .sheet-panel,
html.af-reduce-motion .head-start-sheet:not([hidden]),
html.af-reduce-motion #headStartMenu:not([hidden]) { animation: none; }

/* Head start / power HUD chip: quiet settle */
@keyframes afHeadStartChip {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}
#headStartChip,
.head-start-chip,
#powerChip,
.power-chip,
#tidePassChip {
  animation: afHeadStartChip 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #headStartChip,
  .head-start-chip,
  #powerChip,
  .power-chip,
  #tidePassChip { animation: none; }
}
html.af-reduce-motion #headStartChip,
html.af-reduce-motion .head-start-chip,
html.af-reduce-motion #powerChip,
html.af-reduce-motion .power-chip,
html.af-reduce-motion #tidePassChip { animation: none; }

/* Head-start control: quiet settle */
@keyframes afHeadStartBtn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
#head-start-btn,
.head-start-btn {
  animation: afHeadStartBtn 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #head-start-btn,
  .head-start-btn { animation: none; }
}
html.af-reduce-motion #head-start-btn,
html.af-reduce-motion .head-start-btn { animation: none; }

/* Rate actions: quiet settle */
@keyframes afRateBtnSoft {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
#rateMenu.show #rate-yes-btn,
#rateMenu.show #rate-later-btn,
#rateMenu:not([hidden]) #rate-yes-btn,
#rateMenu:not([hidden]) #rate-later-btn {
  animation: afRateBtnSoft 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
#rateMenu.show #rate-later-btn,
#rateMenu:not([hidden]) #rate-later-btn {
  animation-delay: 50ms;
}
@media (prefers-reduced-motion: reduce) {
  #rateMenu.show #rate-yes-btn,
  #rateMenu.show #rate-later-btn,
  #rateMenu:not([hidden]) #rate-yes-btn,
  #rateMenu:not([hidden]) #rate-later-btn { animation: none; }
}
html.af-reduce-motion #rateMenu.show #rate-yes-btn,
html.af-reduce-motion #rateMenu.show #rate-later-btn,
html.af-reduce-motion #rateMenu:not([hidden]) #rate-yes-btn,
html.af-reduce-motion #rateMenu:not([hidden]) #rate-later-btn { animation: none; }

/* Privacy / IAP actions: quiet settle */
@keyframes afPrivacyBtnSoft {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
#settings-privacy-btn:not([hidden]),
#char-iap-btn:not([hidden]) {
  animation: afPrivacyBtnSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #settings-privacy-btn:not([hidden]),
  #char-iap-btn:not([hidden]) { animation: none; }
}
html.af-reduce-motion #settings-privacy-btn:not([hidden]),
html.af-reduce-motion #char-iap-btn:not([hidden]) { animation: none; }

/* Gift actions: quiet settle */
@keyframes afGiftBtnSoft {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
#gift-open-btn,
#gift-close-btn {
  animation: afGiftBtnSoft 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
#gift-close-btn { animation-delay: 45ms; }
@media (prefers-reduced-motion: reduce) {
  #gift-open-btn,
  #gift-close-btn { animation: none; }
}
html.af-reduce-motion #gift-open-btn,
html.af-reduce-motion #gift-close-btn { animation: none; }

/* Settings actions: quiet settle */
@keyframes afSettingsActSoft {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
#settings-shop-btn,
#settings-restore-btn,
#settings-backup-btn,
#settings-news-btn,
#settings-feedback-btn,
#settings-reset-btn {
  animation: afSettingsActSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
#settings-restore-btn { animation-delay: 30ms; }
#settings-backup-btn { animation-delay: 55ms; }
#settings-news-btn { animation-delay: 80ms; }
#settings-feedback-btn { animation-delay: 105ms; }
#settings-reset-btn { animation-delay: 130ms; }
@media (prefers-reduced-motion: reduce) {
  #settings-shop-btn,
  #settings-restore-btn,
  #settings-backup-btn,
  #settings-news-btn,
  #settings-feedback-btn,
  #settings-reset-btn { animation: none; }
}
html.af-reduce-motion #settings-shop-btn,
html.af-reduce-motion #settings-restore-btn,
html.af-reduce-motion #settings-backup-btn,
html.af-reduce-motion #settings-news-btn,
html.af-reduce-motion #settings-feedback-btn,
html.af-reduce-motion #settings-reset-btn { animation: none; }

/* Next unlock chip: quiet settle */
@keyframes afNextUnlockSoft {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
#nextUnlock:not([hidden]) {
  animation: afNextUnlockSoft 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #nextUnlock:not([hidden]) { animation: none; }
}
html.af-reduce-motion #nextUnlock:not([hidden]) { animation: none; }

/* Pause Tune control: quiet settle */
@keyframes afPauseTuneSoft {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
#pause-settings-btn {
  animation: afPauseTuneSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #pause-settings-btn { animation: none; }
}
html.af-reduce-motion #pause-settings-btn { animation: none; }

/* Settings close: quiet settle */
@keyframes afSettingsCloseSoft {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
#settings-close-btn {
  animation: afSettingsCloseSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #settings-close-btn { animation: none; }
}
html.af-reduce-motion #settings-close-btn { animation: none; }

/* Waters / friends notes: quiet settle */
@keyframes afMissionsNoteSoft {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
.missions-note,
.chars-note,
#char-search-status {
  animation: afMissionsNoteSoft 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  .missions-note,
  .chars-note,
  #char-search-status { animation: none; }
}
html.af-reduce-motion .missions-note,
html.af-reduce-motion .chars-note,
html.af-reduce-motion #char-search-status { animation: none; }

/* Shop status + daily line: quiet settle */
@keyframes afShopDailySoft {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
#shopStatus:not(:empty),
#dailyDateLine {
  animation: afShopDailySoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #shopStatus:not(:empty),
  #dailyDateLine { animation: none; }
}
html.af-reduce-motion #shopStatus:not(:empty),
html.af-reduce-motion #dailyDateLine { animation: none; }

/* News sheet: quiet settle */
@keyframes afNewsMenuSoft {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
#newsMenu:not([hidden]) .sheet-panel,
#newsMenu:not(.hidden) .sheet-panel,
#newsMenu.open .sheet-panel,
#newsMenu:not([hidden]) {
  animation: afNewsMenuSoft 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #newsMenu:not([hidden]) .sheet-panel,
  #newsMenu:not(.hidden) .sheet-panel,
  #newsMenu.open .sheet-panel,
  #newsMenu:not([hidden]) { animation: none; }
}
html.af-reduce-motion #newsMenu:not([hidden]) .sheet-panel,
html.af-reduce-motion #newsMenu:not(.hidden) .sheet-panel,
html.af-reduce-motion #newsMenu.open .sheet-panel,
html.af-reduce-motion #newsMenu:not([hidden]) { animation: none; }

/* Backup sheet: quiet settle */
@keyframes afBackupMenuSoft {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
#backupMenu:not([hidden]) .sheet-panel,
#backupMenu:not(.hidden) .sheet-panel,
#backupMenu.open .sheet-panel,
#backupMenu:not([hidden]) {
  animation: afBackupMenuSoft 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #backupMenu:not([hidden]) .sheet-panel,
  #backupMenu:not(.hidden) .sheet-panel,
  #backupMenu.open .sheet-panel,
  #backupMenu:not([hidden]) { animation: none; }
}
html.af-reduce-motion #backupMenu:not([hidden]) .sheet-panel,
html.af-reduce-motion #backupMenu:not(.hidden) .sheet-panel,
html.af-reduce-motion #backupMenu.open .sheet-panel,
html.af-reduce-motion #backupMenu:not([hidden]) { animation: none; }

/* Worlds sheet: quiet settle */
@keyframes afWorldsMenuSoft {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
#worldsMenu:not([hidden]) .sheet-panel,
#worldsMenu:not(.hidden) .sheet-panel,
#worldsMenu.open .sheet-panel,
#worldsMenu:not([hidden]) {
  animation: afWorldsMenuSoft 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #worldsMenu:not([hidden]) .sheet-panel,
  #worldsMenu:not(.hidden) .sheet-panel,
  #worldsMenu.open .sheet-panel,
  #worldsMenu:not([hidden]) { animation: none; }
}
html.af-reduce-motion #worldsMenu:not([hidden]) .sheet-panel,
html.af-reduce-motion #worldsMenu:not(.hidden) .sheet-panel,
html.af-reduce-motion #worldsMenu.open .sheet-panel,
html.af-reduce-motion #worldsMenu:not([hidden]) { animation: none; }

/* Coin cove sheet: quiet settle */
@keyframes afShopMenuSoft {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
#shopMenu:not([hidden]) .sheet-panel,
#shopMenu:not(.hidden) .sheet-panel,
#shopMenu.open .sheet-panel,
#shopMenu:not([hidden]) {
  animation: afShopMenuSoft 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #shopMenu:not([hidden]) .sheet-panel,
  #shopMenu:not(.hidden) .sheet-panel,
  #shopMenu.open .sheet-panel,
  #shopMenu:not([hidden]) { animation: none; }
}
html.af-reduce-motion #shopMenu:not([hidden]) .sheet-panel,
html.af-reduce-motion #shopMenu:not(.hidden) .sheet-panel,
html.af-reduce-motion #shopMenu.open .sheet-panel,
html.af-reduce-motion #shopMenu:not([hidden]) { animation: none; }

/* Daily sheet: quiet settle */
@keyframes afDailyMenuSoft {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
#dailyMenu:not([hidden]) .sheet-panel,
#dailyMenu:not(.hidden) .sheet-panel,
#dailyMenu.open .sheet-panel,
#dailyMenu:not([hidden]) {
  animation: afDailyMenuSoft 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #dailyMenu:not([hidden]) .sheet-panel,
  #dailyMenu:not(.hidden) .sheet-panel,
  #dailyMenu.open .sheet-panel,
  #dailyMenu:not([hidden]) { animation: none; }
}
html.af-reduce-motion #dailyMenu:not([hidden]) .sheet-panel,
html.af-reduce-motion #dailyMenu:not(.hidden) .sheet-panel,
html.af-reduce-motion #dailyMenu.open .sheet-panel,
html.af-reduce-motion #dailyMenu:not([hidden]) { animation: none; }

/* Pause sheet: quiet settle */
@keyframes afPauseMenuSoft {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
#pauseMenu:not([hidden]) .sheet-panel,
#pauseMenu:not(.hidden) .sheet-panel,
#pauseMenu.open .sheet-panel,
#pauseMenu:not([hidden]) {
  animation: afPauseMenuSoft 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #pauseMenu:not([hidden]) .sheet-panel,
  #pauseMenu:not(.hidden) .sheet-panel,
  #pauseMenu.open .sheet-panel,
  #pauseMenu:not([hidden]) { animation: none; }
}
html.af-reduce-motion #pauseMenu:not([hidden]) .sheet-panel,
html.af-reduce-motion #pauseMenu:not(.hidden) .sheet-panel,
html.af-reduce-motion #pauseMenu.open .sheet-panel,
html.af-reduce-motion #pauseMenu:not([hidden]) { animation: none; }

/* Over sheet: quiet settle */
@keyframes afOverMenuSoft {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
#gameOverMenu:not([hidden]) .sheet-panel,
#gameOverMenu:not(.hidden) .sheet-panel,
#gameOverMenu.open .sheet-panel,
#gameOverMenu:not([hidden]) {
  animation: afOverMenuSoft 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #gameOverMenu:not([hidden]) .sheet-panel,
  #gameOverMenu:not(.hidden) .sheet-panel,
  #gameOverMenu.open .sheet-panel,
  #gameOverMenu:not([hidden]) { animation: none; }
}
html.af-reduce-motion #gameOverMenu:not([hidden]) .sheet-panel,
html.af-reduce-motion #gameOverMenu:not(.hidden) .sheet-panel,
html.af-reduce-motion #gameOverMenu.open .sheet-panel,
html.af-reduce-motion #gameOverMenu:not([hidden]) { animation: none; }

/* Continue sheet: quiet settle */
@keyframes afContinueMenuSoft {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
#continueMenu:not([hidden]) .sheet-panel,
#continueMenu:not(.hidden) .sheet-panel,
#continueMenu.open .sheet-panel,
#continueMenu.show,
#continueMenu:not([hidden]) {
  animation: afContinueMenuSoft 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #continueMenu:not([hidden]) .sheet-panel,
  #continueMenu:not(.hidden) .sheet-panel,
  #continueMenu.open .sheet-panel,
  #continueMenu.show,
  #continueMenu:not([hidden]) { animation: none; }
}
html.af-reduce-motion #continueMenu:not([hidden]) .sheet-panel,
html.af-reduce-motion #continueMenu:not(.hidden) .sheet-panel,
html.af-reduce-motion #continueMenu.open .sheet-panel,
html.af-reduce-motion #continueMenu.show,
html.af-reduce-motion #continueMenu:not([hidden]) { animation: none; }

/* New top badge: quiet settle */
@keyframes afNewTopSoft {
  from { opacity: 0; transform: translateY(4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
#newBestBadge:not([hidden]) {
  animation: afNewTopSoft 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #newBestBadge:not([hidden]) { animation: none; }
}
html.af-reduce-motion #newBestBadge:not([hidden]) { animation: none; }

/* Log sheet: quiet settle */
@keyframes afLogMenuSoft {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
#logMenu:not([hidden]) .sheet-panel,
#logMenu:not(.hidden) .sheet-panel,
#logMenu.open .sheet-panel,
#logMenu:not([hidden]) {
  animation: afLogMenuSoft 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #logMenu:not([hidden]) .sheet-panel,
  #logMenu:not(.hidden) .sheet-panel,
  #logMenu.open .sheet-panel,
  #logMenu:not([hidden]) { animation: none; }
}
html.af-reduce-motion #logMenu:not([hidden]) .sheet-panel,
html.af-reduce-motion #logMenu:not(.hidden) .sheet-panel,
html.af-reduce-motion #logMenu.open .sheet-panel,
html.af-reduce-motion #logMenu:not([hidden]) { animation: none; }

/* ---- Settings v1.1: compact Coin cove & help grid, even links, About block ---- */
.settings-actions.settings-actions--grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-width: 300px;
  margin: 4px auto 10px;
}
.settings-actions--grid .btn-game.settings-reset {
  height: auto;
  min-height: 44px;
  padding: 8px 6px;
  font-size: 0.82rem;
  line-height: 1.15;
  white-space: normal;
}
.settings-actions--grid .btn-game.settings-reset[hidden] { display: none !important; }
/* Four links make an even 2×2 grid; only an odd last link spans the row. */
.settings-links .settings-link:last-child { grid-column: auto; }
.settings-links .settings-link:last-child:nth-child(odd) { grid-column: 1 / -1; }
.settings-about {
  max-width: 300px;
  margin: 6px auto 4px;
  text-align: center;
}
.settings-about .settings-section { text-align: center; padding: 0; }
.game-menu .settings-about p.settings-version,
.game-menu .settings-about .settings-about-line {
  margin: 2px auto;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.35;
  color: #5d7480;
  text-align: center;
}
.settings-about .settings-email {
  color: var(--af-sea-600, #075f84);
  user-select: text;
  -webkit-user-select: text;
}
/* Reset is rare and can't be undone: a small red text button, last, away from the rest. */
.game-menu .btn-game.settings-reset.settings-reset--danger {
  display: block;
  width: auto;
  height: auto;
  min-height: 44px;
  margin: 6px auto 0;
  padding: 8px 14px;
  background: none;
  border: none;
  box-shadow: none;
  font-size: 0.82rem;
  text-decoration: underline;
  color: var(--af-coral-700, #c2323a);
}

/* Settings v1.1: help links match the action buttons; About sits close. */
#settingsMenu .settings-links { gap: 8px; margin: 0 auto 6px; }
html.app-standalone #settingsMenu .settings-link,
#settingsMenu .settings-link {
  min-height: 44px;
  padding: 8px 6px;
  font-size: 0.82rem;
  border-radius: 12px;
}
#settingsMenu .settings-about .settings-section { margin: 8px 0 2px; }

html #settingsMenu .settings-link { box-sizing: border-box; }
html #settingsMenu .settings-actions--grid .btn-game.settings-reset {
  box-sizing: border-box;
  font-size: 0.84rem;
  line-height: 1.15;
}
html #settingsMenu .btn-game.settings-reset.settings-reset--danger { font-size: 0.84rem; }
/* Five buttons: when Privacy choices is hidden, Contact us takes the whole last row. */
#settingsMenu .settings-actions--grid:has(#settings-privacy-btn[hidden]) #settings-feedback-btn {
  grid-column: 1 / -1;
}


/* Home Waters chip: quiet settle */
@keyframes afHomeWatersSoft {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
#worlds-home-btn {
  animation: afHomeWatersSoft 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #worlds-home-btn { animation: none; }
}
html.af-reduce-motion #worlds-home-btn { animation: none; }

/* Tide marks sheet: quiet settle */
@keyframes afBadgesMenuSoft {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
#badgesMenu.show,
#badgesMenu:not([hidden]) .sheet-panel,
#badgesMenu:not(.hidden) .sheet-panel,
#badgesMenu.open .sheet-panel {
  animation: afBadgesMenuSoft 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #badgesMenu.show,
  #badgesMenu:not([hidden]) .sheet-panel,
  #badgesMenu:not(.hidden) .sheet-panel,
  #badgesMenu.open .sheet-panel { animation: none; }
}
html.af-reduce-motion #badgesMenu.show,
html.af-reduce-motion #badgesMenu:not([hidden]) .sheet-panel,
html.af-reduce-motion #badgesMenu:not(.hidden) .sheet-panel,
html.af-reduce-motion #badgesMenu.open .sheet-panel { animation: none; }

/* Coin cove settings control: quiet settle */
@keyframes afCoinCoveSoft {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
#settings-shop-btn {
  animation: afCoinCoveSoft 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #settings-shop-btn { animation: none; }
}
html.af-reduce-motion #settings-shop-btn { animation: none; }

/* What's new titles: quiet settle */
@keyframes afNewsTitleSoft {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
#newsMenu.show .news-title,
#newsMenu:not([hidden]) .news-title {
  animation: afNewsTitleSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
#newsMenu.show .news-row:nth-child(1) .news-title { animation-delay: 30ms; }
#newsMenu.show .news-row:nth-child(2) .news-title { animation-delay: 50ms; }
#newsMenu.show .news-row:nth-child(3) .news-title { animation-delay: 70ms; }
#newsMenu.show .news-row:nth-child(4) .news-title { animation-delay: 90ms; }
#newsMenu.show .news-row:nth-child(5) .news-title { animation-delay: 110ms; }
@media (prefers-reduced-motion: reduce) {
  #newsMenu.show .news-title,
  #newsMenu:not([hidden]) .news-title { animation: none; }
}
html.af-reduce-motion #newsMenu.show .news-title,
html.af-reduce-motion #newsMenu:not([hidden]) .news-title { animation: none; }

/* Menu tiles: quiet settle */
@keyframes afMenuTileSoft {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
#startMenu.show .menu-tile,
#startMenu:not([hidden]) .menu-tile {
  animation: afMenuTileSoft 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
#startMenu.show .menu-tile:nth-child(1) { animation-delay: 40ms; }
#startMenu.show .menu-tile:nth-child(2) { animation-delay: 70ms; }
#startMenu.show .menu-tile:nth-child(3) { animation-delay: 100ms; }
#startMenu.show .menu-tile:nth-child(4) { animation-delay: 130ms; }
#startMenu.show .menu-tile:nth-child(5) { animation-delay: 160ms; }
#startMenu.show .menu-tile:nth-child(6) { animation-delay: 190ms; }
@media (prefers-reduced-motion: reduce) {
  #startMenu.show .menu-tile,
  #startMenu:not([hidden]) .menu-tile { animation: none; }
}
html.af-reduce-motion #startMenu.show .menu-tile,
html.af-reduce-motion #startMenu:not([hidden]) .menu-tile { animation: none; }

/* Sky-to-sea course chip: quiet settle */
@keyframes afCoralCourseSoft {
  from { opacity: 0; transform: translateY(4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
#coral-course-btn:not([hidden]) {
  animation: afCoralCourseSoft 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #coral-course-btn:not([hidden]) { animation: none; }
}
html.af-reduce-motion #coral-course-btn:not([hidden]) { animation: none; }

/* Resume CTA: quiet settle */
@keyframes afResumeSoft {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
#resume-btn {
  animation: afResumeSoft 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #resume-btn { animation: none; }
}
html.af-reduce-motion #resume-btn { animation: none; }

/* Wipe save control: quiet settle */
@keyframes afWipeSoft {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
#settings-reset-btn {
  animation: afWipeSoft 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #settings-reset-btn { animation: none; }
}
html.af-reduce-motion #settings-reset-btn { animation: none; }

/* Daily / week go buttons: quiet settle */
@keyframes afDailyPlaySoft {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
#daily-play-btn,
#weekly-play-btn {
  animation: afDailyPlaySoft 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
#weekly-play-btn { animation-delay: 40ms; }
@media (prefers-reduced-motion: reduce) {
  #daily-play-btn,
  #weekly-play-btn { animation: none; }
}
html.af-reduce-motion #daily-play-btn,
html.af-reduce-motion #weekly-play-btn { animation: none; }

/* Home from over: quiet settle */
@keyframes afGoHomeSoft {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
#go-home-btn {
  animation: afGoHomeSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #go-home-btn { animation: none; }
}
html.af-reduce-motion #go-home-btn { animation: none; }

/* Settings cove actions: quiet settle */
@keyframes afStashBtnSoft {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
#settings-backup-btn,
#settings-feedback-btn,
#settings-news-btn,
#settings-restore-btn,
#settings-shop-btn {
  animation: afStashBtnSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
#settings-shop-btn { animation-delay: 20ms; }
#settings-restore-btn { animation-delay: 40ms; }
#settings-backup-btn { animation-delay: 60ms; }
#settings-news-btn { animation-delay: 80ms; }
#settings-feedback-btn { animation-delay: 100ms; }
@media (prefers-reduced-motion: reduce) {
  #settings-backup-btn,
  #settings-feedback-btn,
  #settings-news-btn,
  #settings-restore-btn,
  #settings-shop-btn { animation: none; }
}
html.af-reduce-motion #settings-backup-btn,
html.af-reduce-motion #settings-feedback-btn,
html.af-reduce-motion #settings-news-btn,
html.af-reduce-motion #settings-restore-btn,
html.af-reduce-motion #settings-shop-btn { animation: none; }


/* Settings About + Ease section: quiet settle */
@keyframes afAboutSoft {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
#settingsMenu .settings-about,
#settingsMenu .settings-note {
  animation: afAboutSoft 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #settingsMenu .settings-about,
  #settingsMenu .settings-note { animation: none; }
}
html.af-reduce-motion #settingsMenu .settings-about,
html.af-reduce-motion #settingsMenu .settings-note { animation: none; }

/* Soft Privacy / help links: quiet settle */
@keyframes afPrivacySoft {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
#settings-privacy-btn {
  animation: afPrivacySoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #settings-privacy-btn { animation: none; }
}
html.af-reduce-motion #settings-privacy-btn { animation: none; }


/* Pause home + continue look: quiet settle */
@keyframes afPauseHomeSoft {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
#pause-home-btn {
  animation: afPauseHomeSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #pause-home-btn { animation: none; }
}
html.af-reduce-motion #pause-home-btn { animation: none; }

@keyframes afContinueLookSoft {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
#continue-ad-btn {
  animation: afContinueLookSoft 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #continue-ad-btn { animation: none; }
}
html.af-reduce-motion #continue-ad-btn { animation: none; }

@keyframes afGladlySoft {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
#rate-yes-btn {
  animation: afGladlySoft 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #rate-yes-btn { animation: none; }
}
html.af-reduce-motion #rate-yes-btn { animation: none; }

/* Another tide: quiet settle */
@keyframes afAnotherTideSoft {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
#rate-later-btn {
  animation: afAnotherTideSoft 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #rate-later-btn { animation: none; }
}
html.af-reduce-motion #rate-later-btn { animation: none; }

/* Continue note: quiet settle */
@keyframes afContinueNoteSoft {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
#continueMenu .continue-note {
  animation: afContinueNoteSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #continueMenu .continue-note { animation: none; }
}
html.af-reduce-motion #continueMenu .continue-note { animation: none; }

/* Clear this save: quiet settle */
@keyframes afClearSaveSoft {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
#settings-reset-btn {
  animation: afClearSaveSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #settings-reset-btn { animation: none; }
}
html.af-reduce-motion #settings-reset-btn { animation: none; }


/* Quieter motion row: quiet settle */
@keyframes afQuietMotionSoft {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
#set-motion {
  animation: afQuietMotionSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #set-motion { animation: none; }
}
html.af-reduce-motion #set-motion { animation: none; }


/* Waves / Melody / Soft buzz rows: quiet settle */
@keyframes afWavesRowSoft {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
#set-sound,
#set-music,
#set-vibrate {
  animation: afWavesRowSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
#set-music { animation-delay: 30ms; }
#set-vibrate { animation-delay: 60ms; }
@media (prefers-reduced-motion: reduce) {
  #set-sound, #set-music, #set-vibrate { animation: none; }
}
html.af-reduce-motion #set-sound,
html.af-reduce-motion #set-music,
html.af-reduce-motion #set-vibrate { animation: none; }

/* Go on continue: quiet settle */
@keyframes afGoOnSoft {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
#continue-btn {
  animation: afGoOnSoft 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #continue-btn { animation: none; }
}
html.af-reduce-motion #continue-btn { animation: none; }


/* Ease + Run + Cloud rows: quiet settle */
@keyframes afEaseRowSoft {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
#set-hazards,
#set-bigtext,
#set-shake,
#set-ghost,
#set-saver,
#set-remind,
#set-gates,
#set-cloud {
  animation: afEaseRowSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
#set-bigtext { animation-delay: 25ms; }
#set-shake { animation-delay: 50ms; }
#set-ghost { animation-delay: 40ms; }
#set-saver { animation-delay: 65ms; }
#set-remind { animation-delay: 90ms; }
#set-gates { animation-delay: 115ms; }
#set-cloud { animation-delay: 50ms; }
@media (prefers-reduced-motion: reduce) {
  #set-hazards, #set-bigtext, #set-shake, #set-ghost, #set-saver, #set-remind, #set-gates, #set-cloud { animation: none; }
}
html.af-reduce-motion #set-hazards,
html.af-reduce-motion #set-bigtext,
html.af-reduce-motion #set-shake,
html.af-reduce-motion #set-ghost,
html.af-reduce-motion #set-saver,
html.af-reduce-motion #set-remind,
html.af-reduce-motion #set-gates,
html.af-reduce-motion #set-cloud { animation: none; }


/* Write us: quiet settle */
@keyframes afWriteUsSoft {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
#settings-feedback-btn {
  animation: afWriteUsSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #settings-feedback-btn { animation: none; }
}
html.af-reduce-motion #settings-feedback-btn { animation: none; }

/* Stash code: quiet settle */
@keyframes afStashCodeSoft {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
#settings-backup-btn {
  animation: afStashCodeSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #settings-backup-btn { animation: none; }
}
html.af-reduce-motion #settings-backup-btn { animation: none; }

/* Tide build / version line: quiet settle */
@keyframes afTideBuildSoft {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
#settingsVersion {
  animation: afTideBuildSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #settingsVersion { animation: none; }
}
html.af-reduce-motion #settingsVersion { animation: none; }

/* Copy / Paste stash: quiet settle */
@keyframes afCopyStashSoft {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
#backup-copy-btn {
  animation: afCopyStashSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #backup-copy-btn { animation: none; }
}
html.af-reduce-motion #backup-copy-btn { animation: none; }

@keyframes afPasteStashSoft {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
#backup-restore-btn {
  animation: afPasteStashSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #backup-restore-btn { animation: none; }
}
html.af-reduce-motion #backup-restore-btn { animation: none; }

/* Stash your run title: quiet settle */
@keyframes afStashTitleSoft {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
#backupMenu > h2 {
  animation: afStashTitleSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #backupMenu > h2 { animation: none; }
}
html.af-reduce-motion #backupMenu > h2 { animation: none; }

/* Tide news button: quiet settle */
@keyframes afTideNewsSoft {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
#settings-news-btn {
  animation: afTideNewsSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #settings-news-btn { animation: none; }
}
html.af-reduce-motion #settings-news-btn { animation: none; }

/* Log book note: quiet settle */
@keyframes afLogNoteSoft {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
#logMenu .missions-note {
  animation: afLogNoteSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #logMenu .missions-note { animation: none; }
}
html.af-reduce-motion #logMenu .missions-note { animation: none; }

/* Daily shared run note: quiet settle */
@keyframes afDailyNoteSoft {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
#dailyDateLine {
  animation: afDailyNoteSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #dailyDateLine { animation: none; }
}
html.af-reduce-motion #dailyDateLine { animation: none; }

/* Privacy / Terms links: quiet settle */
@keyframes afLegalLinkSoft {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
#settingsMenu .settings-links .settings-link {
  animation: afLegalLinkSoft 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #settingsMenu .settings-links .settings-link { animation: none; }
}
html.af-reduce-motion #settingsMenu .settings-links .settings-link { animation: none; }

/* Shop cove note: quiet settle */
@keyframes afShopNoteSoft {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
#shopMenu .missions-note {
  animation: afShopNoteSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #shopMenu .missions-note { animation: none; }
}
html.af-reduce-motion #shopMenu .missions-note { animation: none; }

/* Today’s gift: quiet settle */
@keyframes afTodayGiftSoft {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
#gift-open-btn {
  animation: afTodayGiftSoft 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #gift-open-btn { animation: none; }
}
html.af-reduce-motion #gift-open-btn { animation: none; }

/* Bring back (shop): quiet settle */
@keyframes afBringBackShopSoft {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
#shop-restore-btn {
  animation: afBringBackShopSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #shop-restore-btn { animation: none; }
}
html.af-reduce-motion #shop-restore-btn { animation: none; }

/* Soft start chip pulse already exists — quiet settle on first show uses afHeadStartChip */

/* A few coins: quiet settle */
@keyframes afAFewCoinsSoft {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
#char-coins-btn {
  animation: afAFewCoinsSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #char-coins-btn { animation: none; }
}
html.af-reduce-motion #char-coins-btn { animation: none; }

/* Into the blue: quiet settle */
@keyframes afIntoBlueSoft {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
#news-close-btn {
  animation: afIntoBlueSoft 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #news-close-btn { animation: none; }
}
html.af-reduce-motion #news-close-btn { animation: none; }

/* Settings title: quiet settle */
@keyframes afSettingsTitleSoft {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
#settingsMenu > h2 {
  animation: afSettingsTitleSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #settingsMenu > h2 { animation: none; }
}
html.af-reduce-motion #settingsMenu > h2 { animation: none; }

/* With you / Friend: quiet settle */
@keyframes afWithYouSoft {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
#char-action-btn {
  animation: afWithYouSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #char-action-btn { animation: none; }
}
html.af-reduce-motion #char-action-btn { animation: none; }

@keyframes afFriendSoft {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
#char-buddy-btn {
  animation: afFriendSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #char-buddy-btn { animation: none; }
}
html.af-reduce-motion #char-buddy-btn { animation: none; }

/* Bring IAP (was Get): quiet settle — reuse afGetSoft selector already on #char-iap-btn */

/* Collect pill: quiet settle */
@keyframes afCoinsReadySoft {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
#menuCollect {
  animation: afCoinsReadySoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #menuCollect { animation: none; }
}
html.af-reduce-motion #menuCollect { animation: none; }

/* Treat labels: quiet settle */
@keyframes afTreatSoft {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
#dailyMenu .daily-stat-label {
  animation: afTreatSoft 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #dailyMenu .daily-stat-label { animation: none; }
}
html.af-reduce-motion #dailyMenu .daily-stat-label { animation: none; }

/* Gentle privacy: quiet settle */
@keyframes afGentlePrivacySoft {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
#settings-privacy-btn {
  animation: afGentlePrivacySoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #settings-privacy-btn { animation: none; }
}
html.af-reduce-motion #settings-privacy-btn { animation: none; }

/* Again: quiet settle */
@keyframes afAgainSoft {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
#restart-game-btn {
  animation: afAgainSoft 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #restart-game-btn { animation: none; }
}
html.af-reduce-motion #restart-game-btn { animation: none; }

/* Coralveil studio line: quiet settle */
@keyframes afCoralveilSoft {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
#settingsMenu .settings-about-line:last-of-type {
  animation: afCoralveilSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #settingsMenu .settings-about-line:last-of-type { animation: none; }
}
html.af-reduce-motion #settingsMenu .settings-about-line:last-of-type { animation: none; }

/* Get / IAP friend: quiet settle */
@keyframes afGetSoft {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
#char-iap-btn {
  animation: afGetSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #char-iap-btn { animation: none; }
}
html.af-reduce-motion #char-iap-btn { animation: none; }

/* Not now continue skip: quiet settle */
@keyframes afNotNowSoft {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
#continue-skip-btn {
  animation: afNotNowSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #continue-skip-btn { animation: none; }
}
html.af-reduce-motion #continue-skip-btn { animation: none; }

/* Studio note section: quiet settle */
@keyframes afStudioNoteSoft {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
#settingsMenu .settings-about .settings-section {
  animation: afStudioNoteSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #settingsMenu .settings-about .settings-section { animation: none; }
}
html.af-reduce-motion #settingsMenu .settings-about .settings-section { animation: none; }

/* Step back close buttons: quiet settle (Sky & Sea soft) */
@keyframes afStepBackSoft {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
#chars-close-btn, #missions-close-btn, #daily-close-btn, #log-close-btn,
#worlds-close-btn, #shop-close-btn, #badges-close-btn, #backup-close-btn,
#gift-close-btn, #settings-close-btn, #help-close-btn {
  animation: afStepBackSoft 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
/* Pause resume + erase save: quiet settle */
@keyframes afKeepGoingSoft {
  from { opacity: 0; transform: translateY(3px) scale(0.992); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes afEraseSaveSoft {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
#resume-btn {
  animation: afKeepGoingSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
#settings-reset-btn {
  animation: afEraseSaveSoft 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #resume-btn, #settings-reset-btn { animation: none; }
}
html.af-reduce-motion #resume-btn,
html.af-reduce-motion #settings-reset-btn { animation: none; }
@media (prefers-reduced-motion: reduce) {
  #chars-close-btn, #missions-close-btn, #daily-close-btn, #log-close-btn,
  #worlds-close-btn, #shop-close-btn, #badges-close-btn, #backup-close-btn,
  #gift-close-btn, #settings-close-btn, #help-close-btn { animation: none; }
}
html.af-reduce-motion #chars-close-btn,
html.af-reduce-motion #missions-close-btn,
html.af-reduce-motion #daily-close-btn,
html.af-reduce-motion #log-close-btn,
html.af-reduce-motion #worlds-close-btn,
html.af-reduce-motion #shop-close-btn,
html.af-reduce-motion #badges-close-btn,
html.af-reduce-motion #backup-close-btn,
html.af-reduce-motion #gift-close-btn,
html.af-reduce-motion #settings-close-btn,
html.af-reduce-motion #help-close-btn { animation: none; }


/* Go again CTA: quiet settle (Sky & Sea soft) */
@keyframes afGoAgainSoft {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
#restart-game-btn {
  animation: afGoAgainSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #restart-game-btn { animation: none; }
}
html.af-reduce-motion #restart-game-btn { animation: none; }


/* Dive wipe veil: quieter settle (Sky & Sea soft) */
@keyframes afDiveWipeSoft {
  from { opacity: 0.14; }
  to { opacity: 0; }
}
#diveWipe.af-show, #diveWipe.show, .af-dive-wipe.is-on {
  animation: afDiveWipeSoft 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #diveWipe.af-show, #diveWipe.show, .af-dive-wipe.is-on { animation: none; }
}
html.af-reduce-motion #diveWipe.af-show,
html.af-reduce-motion #diveWipe.show,
html.af-reduce-motion .af-dive-wipe.is-on { animation: none; }


/* Difficulty pills: glossy 3D stack (Easy sky · Medium lagoon · Hard night — never red) */
.difficulty-select {
  gap: 10px;
  max-width: 280px;
  filter: drop-shadow(0 10px 18px rgba(7, 60, 85, 0.18));
}
.difficulty-select .btn-diff,
.difficulty-select .btn-diff.btn-game {
  margin: 0;
  min-height: 52px;
  padding: 14px 48px 14px 28px;
  border-radius: 999px;
  border: 3px solid #ffffff;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #ffffff !important;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.28);
  transform: none;
}
.difficulty-select .btn-diff::after {
  /* no press ring — keep the clean pill silhouette */
  display: none;
}
.difficulty-select .btn-diff .diff-stars {
  right: 16px;
  gap: 2px;
  opacity: 1;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.28));
}
.difficulty-select .btn-diff .diff-stars svg {
  width: 15px;
  height: 15px;
}

/* Easy — bright sky blue + gold star */
.difficulty-select .btn-diff--easy,
.difficulty-select .btn-diff--easy[aria-pressed="true"],
.difficulty-select .btn-diff--easy.is-on {
  background: linear-gradient(180deg, #7ad0f5 0%, #3bb8ea 48%, #1a8fc4 100%) !important;
  box-shadow:
    0 7px 0 #0a5a80,
    0 14px 24px rgba(15, 111, 158, 0.32),
    inset 0 2px 0 rgba(255, 255, 255, 0.55) !important;
}
.difficulty-select .btn-diff--easy .diff-stars { color: #ffd54a; }

/* Medium — teal lagoon + two gold stars */
.difficulty-select .btn-diff--medium,
.difficulty-select .btn-diff--medium[aria-pressed="true"],
.difficulty-select .btn-diff--medium.is-on {
  background: linear-gradient(180deg, #6fe0d6 0%, #2bc0b8 48%, #129a94 100%) !important;
  box-shadow:
    0 7px 0 #0a6b68,
    0 14px 24px rgba(8, 105, 107, 0.32),
    inset 0 2px 0 rgba(255, 255, 255, 0.5) !important;
}
.difficulty-select .btn-diff--medium .diff-stars { color: #ffd54a; }

/* Hard — deep night sea + three silver stars (never hazard red) */
.difficulty-select .btn-diff--hard,
.difficulty-select .btn-diff--hard[aria-pressed="true"],
.difficulty-select .btn-diff--hard.is-on,
.difficulty-select [data-diff="hard"] {
  background: linear-gradient(180deg, #4a6ec4 0%, #2f4ea0 48%, #1a326e 100%) !important;
  box-shadow:
    0 7px 0 #0d1d48,
    0 14px 24px rgba(13, 29, 72, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.38) !important;
  color: #ffffff !important;
  border-color: #ffffff !important;
}
.difficulty-select .btn-diff--hard .diff-stars { color: #c8d6e8; }

@media (hover: hover) {
  .difficulty-select .btn-diff--easy:hover {
    box-shadow:
      0 9px 0 #0a5a80,
      0 18px 28px rgba(15, 111, 158, 0.38),
      inset 0 2px 0 rgba(255, 255, 255, 0.65) !important;
  }
  .difficulty-select .btn-diff--medium:hover {
    box-shadow:
      0 9px 0 #0a6b68,
      0 18px 28px rgba(8, 105, 107, 0.38),
      inset 0 2px 0 rgba(255, 255, 255, 0.6) !important;
  }
  .difficulty-select .btn-diff--hard:hover {
    box-shadow:
      0 9px 0 #0d1d48,
      0 18px 28px rgba(13, 29, 72, 0.46),
      inset 0 2px 0 rgba(255, 255, 255, 0.48) !important;
  }
}
.difficulty-select .btn-diff--easy:active {
  transform: translateY(4px);
  box-shadow:
    0 3px 0 #0a5a80,
    0 6px 14px rgba(15, 111, 158, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.4) !important;
}
.difficulty-select .btn-diff--medium:active {
  transform: translateY(4px);
  box-shadow:
    0 3px 0 #0a6b68,
    0 6px 14px rgba(8, 105, 107, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.35) !important;
}
.difficulty-select .btn-diff--hard:active {
  transform: translateY(4px);
  box-shadow:
    0 3px 0 #0d1d48,
    0 6px 14px rgba(13, 29, 72, 0.35),
    inset 0 2px 0 rgba(255, 255, 255, 0.3) !important;
}

/* Quiet settle on Hard only (depth cue, not alarm) */
@keyframes afNightDiffSoft {
  from { opacity: 0; transform: translateY(2px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.difficulty-select .btn-diff--hard {
  animation: afNightDiffSoft 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  .difficulty-select .btn-diff--hard { animation: none; }
}
html.af-reduce-motion .difficulty-select .btn-diff--hard { animation: none; }


/* Words picker: room for “This phone” — no truncated Match this… */
#settingsMenu .settings-row--select .settings-select,
#settingsMenu .settings-select {
  max-width: 58%;
  min-width: 7.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.92rem;
  padding: 6px 12px;
}
/* Build string is support-only (sr-only) — never paint as a studio ledger */
#settingsMenu .settings-about .settings-version.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}
#settingsMenu .settings-about {
  padding-top: 4px;
}
#settingsMenu .settings-about .settings-about-line {
  font-size: 0.85rem;
  opacity: 0.85;
}

/* ---- Card centring guard (keep LAST in this file) ----
   Every card below is centred with translate(-50%, -50%). Entrance animations
   that end on translateY(0) with fill-mode both wipe that out and park the card
   half off-screen. Whatever entrance a card was given above, it opens with the
   centring-safe afCardRise; the edge-pinned Help sheet uses afSheetRise. */
@keyframes afCardRise {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 8px)) scale(0.985); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes afSheetRise {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
#startMenu:not([hidden]),
#settingsMenu.show, #settingsMenu:not([hidden]),
#pauseMenu.show, .game-pause.show,
#continueMenu.show,
#gameOverMenu.show, #gameOverMenu:not([hidden]),
#rateMenu.show, #rateMenu:not([hidden]), .game-rate.show,
#charactersMenu:not([hidden]),
#shopMenu:not([hidden]),
#badgesMenu:not([hidden]),
#worldsMenu:not([hidden]),
#backupMenu:not([hidden]),
#newsMenu:not([hidden]),
#missionsMenu:not([hidden]),
#logMenu:not([hidden]),
#dailyMenu:not([hidden]),
#giftMenu:not([hidden]) {
  animation: afCardRise 340ms cubic-bezier(0.22, 1, 0.36, 1) both !important;
}
#helpSheet.show {
  animation: afSheetRise 340ms cubic-bezier(0.22, 1, 0.36, 1) both !important;
}
@media (prefers-reduced-motion: reduce) {
  #startMenu, #settingsMenu, #pauseMenu, #continueMenu, #gameOverMenu, #rateMenu,
  #charactersMenu, #shopMenu, #badgesMenu, #worldsMenu, #backupMenu, #newsMenu,
  #missionsMenu, #logMenu, #dailyMenu, #giftMenu, #helpSheet { animation: none !important; }
}
html.af-reduce-motion #startMenu, html.af-reduce-motion #settingsMenu, html.af-reduce-motion #pauseMenu,
html.af-reduce-motion #continueMenu, html.af-reduce-motion #gameOverMenu, html.af-reduce-motion #rateMenu,
html.af-reduce-motion #charactersMenu, html.af-reduce-motion #shopMenu, html.af-reduce-motion #badgesMenu,
html.af-reduce-motion #worldsMenu, html.af-reduce-motion #backupMenu, html.af-reduce-motion #newsMenu,
html.af-reduce-motion #missionsMenu, html.af-reduce-motion #logMenu, html.af-reduce-motion #dailyMenu,
html.af-reduce-motion #giftMenu, html.af-reduce-motion #helpSheet { animation: none !important; }

/* ---- One difficulty button: ‹ [ Easy ★ ] › ----
   Only the chosen mode shows (angel-fish-game.js toggles .diff-off); the arrows,
   a sideways swipe or the arrow keys change it, and a tap starts the run. */
/* Placed last in this file so it wins over the older stacked-pill rules below. */
#startMenu .difficulty-select.diff-carousel {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  /* Room for ‹ › and a button as wide as the old full-width pills (stars at the end). */
  width: 100%;
  max-width: 360px;
  /* The row-wide drop-shadow drew a faint panel behind the arrows in WebKit. */
  filter: none;
}
#startMenu .diff-carousel .diff-stage {
  filter: drop-shadow(0 10px 18px rgba(7, 60, 85, 0.18));
}
.diff-stage {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  /* Sideways swipes reach the game; up/down still scrolls the card. */
  touch-action: pan-y;
}
.diff-carousel .btn-diff {
  width: 100%;
}
.diff-carousel .btn-diff.diff-off {
  display: none !important;
}
.diff-arrow {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 2px solid #cfe3ee;
  border-radius: 50%;
  background: #ffffff;
  color: #0a6f99;
  box-shadow: 0 3px 0 #b7d3e2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.diff-arrow svg {
  width: 22px;
  height: 22px;
  pointer-events: none;
}
.diff-arrow:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #b7d3e2;
}
.diff-arrow:focus-visible {
  outline: 3px solid #ffd447;
  outline-offset: 2px;
}
[dir="rtl"] .diff-arrow svg {
  transform: scaleX(-1);
}
@keyframes afDiffFromEnd {
  from { opacity: 0; transform: translateX(26px); }
  to { opacity: 1; transform: none; }
}
@keyframes afDiffFromStart {
  from { opacity: 0; transform: translateX(-26px); }
  to { opacity: 1; transform: none; }
}
/* The new mode slides in from the side the player moved toward. */
.diff-carousel .btn-diff.diff-in-next {
  animation: afDiffFromEnd 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.diff-carousel .btn-diff.diff-in-prev {
  animation: afDiffFromStart 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
[dir="rtl"] .diff-carousel .btn-diff.diff-in-next {
  animation-name: afDiffFromStart;
}
[dir="rtl"] .diff-carousel .btn-diff.diff-in-prev {
  animation-name: afDiffFromEnd;
}
@media (prefers-reduced-motion: reduce) {
  .diff-carousel .btn-diff.diff-in-next,
  .diff-carousel .btn-diff.diff-in-prev {
    animation: none;
  }
}
html.af-reduce-motion .diff-carousel .btn-diff.diff-in-next,
html.af-reduce-motion .diff-carousel .btn-diff.diff-in-prev {
  animation: none;
}

/* Purchase news inside a sheet (Worlds, Friends): written where the player looks. */
.game-menu .sheet-status {
  margin: 6px auto 8px;
  font-weight: 700;
  color: #0a5f86;
}
.game-menu .sheet-status[hidden] {
  display: none !important;
}

/* Shop rows: "Buy $0.99" is longer than the bare price it replaced. Keep the
   button to its own width so the product name and line beside it stay readable
   (the general in-app button rules would stretch it across the row). */
#shopList .shop-row-text {
  flex: 1 1 auto;
  min-width: 0;
}
#shopList .shop-row .btn-game {
  flex: 0 0 auto;
  width: auto !important;
  min-width: 0 !important;
  max-width: 60%;
  margin: 0 !important;
  padding: 8px 12px;
  white-space: nowrap;
}

/* Game over fits on one screen, Home included, without scrolling.
   1. The card may use the whole height between the status bar and the ad (or
      the bottom edge). When the ad shows, the playfield already ends above it
      and above the home bar, so the bottom inset is not taken off twice.
   2. Score stays big; Level, Best and Distance are a size smaller (Best no
      longer wraps onto its own line), and the gaps between lines are tighter.
   3. Short phones get a little less space between things; tall phones keep the
      lines and buttons a little larger. Checked by npm run test:layout. */
html.app-standalone #gameOverMenu {
  --go-top: calc(var(--sat) + 8px);
  --go-bottom: calc(var(--sab) + 8px);
  max-height: calc(100% - var(--go-top) - var(--go-bottom));
  margin-top: calc((var(--go-top) - var(--go-bottom)) / 2);
  padding-top: calc(14px * var(--af-ui));
  padding-bottom: calc(12px * var(--af-ui));
}
html.app-standalone.af-has-banner #gameOverMenu {
  --go-bottom: 8px;
}
#gameOverMenu > h2 {
  margin-bottom: calc(6px * var(--af-ui));
}
#gameOverMenu .new-best-badge {
  margin: 0 0 calc(4px * var(--af-ui));
}
html.app-standalone #gameOverMenu .final-score {
  margin: calc(4px * var(--af-ui)) 0;
  line-height: 1.15;
}
html.app-standalone #gameOverMenu .final-score:not(.final-score--sub) {
  font-size: calc(2.2rem * var(--af-ui));
}
html.app-standalone #gameOverMenu {
  container-type: inline-size;
}
html.app-standalone #gameOverMenu .final-score--sub {
  /* Never wider than the card: "Niveau 120 · Record 140700" stays one line.
     cqi = the card's own width; older WebViews use the screen width instead. */
  font-size: min(calc(1.35rem * var(--af-ui)), 5.4vw);
  font-size: min(calc(1.35rem * var(--af-ui)), 6.4cqi);
}
#gameOverMenu .over-best {
  white-space: nowrap;
}
#gameOverMenu .final-distance {
  margin: 0 0 calc(8px * var(--af-ui));
}
#gameOverMenu .run-highlights {
  margin-bottom: calc(6px * var(--af-ui));
}
#gameOverMenu .almost-line {
  margin-bottom: calc(8px * var(--af-ui));
}
#gameOverMenu .almost-label {
  margin-bottom: 4px;
}
#gameOverMenu .coins-earned-line {
  margin: 2px 0 calc(8px * var(--af-ui));
}
#gameOverMenu .next-unlock {
  margin: 0 auto calc(6px * var(--af-ui));
  padding-top: calc(6px * var(--af-ui));
  padding-bottom: calc(6px * var(--af-ui));
}
/* Buttons: icon and words centred on one line. A long label (French "Regarder
   une pub : +15 pièces") is a little smaller; if it must still wrap, the
   button grows instead of the words spilling out. */
html.app-standalone #gameOverMenu .btn-game {
  display: flex;
  align-items: center;
  justify-content: center;
  height: auto;
  min-height: max(44px, calc(44px * var(--af-ui)));
  margin-top: calc(4px * var(--af-ui));
  margin-bottom: calc(4px * var(--af-ui));
  padding-left: calc(12px * var(--af-ui));
  padding-right: calc(12px * var(--af-ui));
  line-height: 1.15;
}
html.app-standalone #gameOverMenu .btn-game .btn-icon {
  flex: 0 0 auto;
  margin: 0;
  margin-inline-end: 6px;
}
html.app-standalone #gameOverMenu #over-reward-ad-btn {
  font-size: calc(var(--af-btn-font) * 0.92);
  letter-spacing: -0.01em;
}
/* Tall phones have room. */
@media (min-height: 800px) {
  html.app-standalone #gameOverMenu .final-score:not(.final-score--sub) {
    font-size: calc(2.4rem * var(--af-ui));
  }
  html.app-standalone #gameOverMenu .final-score--sub {
    font-size: min(calc(1.5rem * var(--af-ui)), 5.4vw);
    font-size: min(calc(1.5rem * var(--af-ui)), 6.4cqi);
  }
  html.app-standalone #gameOverMenu .btn-game {
    min-height: max(46px, calc(48px * var(--af-ui)));
    margin-top: calc(5px * var(--af-ui));
    margin-bottom: calc(5px * var(--af-ui));
  }
}
/* Short phones (about 640–700 px with the status bar and the ad). */
@media (max-height: 700px) {
  html.app-standalone #gameOverMenu {
    --go-top: calc(var(--sat) + 4px);
    --go-bottom: calc(var(--sab) + 4px);
    padding-top: calc(10px * var(--af-ui));
    padding-bottom: calc(8px * var(--af-ui));
  }
  html.app-standalone.af-has-banner #gameOverMenu {
    --go-bottom: 4px;
  }
  html.app-standalone #gameOverMenu .final-score {
    margin: calc(2px * var(--af-ui)) 0;
  }
  html.app-standalone #gameOverMenu .final-score:not(.final-score--sub) {
    font-size: calc(2rem * var(--af-ui));
  }
  html.app-standalone #gameOverMenu .btn-game {
    margin-top: calc(3px * var(--af-ui));
    margin-bottom: calc(3px * var(--af-ui));
  }
}
/* Short phones with Leaderboards (iPhone + Game Center): Leaderboards and
   Share share one row, so Home still fits. */
@media (max-height: 760px) {
  html.app-standalone #gameOverMenu #over-leaderboards-btn:not([hidden]),
  html.app-standalone #gameOverMenu #over-leaderboards-btn:not([hidden]) + #share-score-btn {
    display: inline-flex;
    vertical-align: top;
    width: calc(min(100%, var(--af-btn-max)) / 2 - 6px);
    margin-left: 2px;
    margin-right: 2px;
    padding-left: calc(8px * var(--af-ui));
    padding-right: calc(8px * var(--af-ui));
    font-size: calc(var(--af-btn-font) * 0.9);
    white-space: nowrap;
  }
}

/* Native ad card in the Worlds and Logbook lists (af-ads.js placeNative). The
   AdMob SDK draws Google's small layout on top of this row; the row only holds
   the space (the small layout needs at least 120 px). */
.badge-list .af-native-slot {
  flex: 0 0 auto;
  height: 120px;
  min-height: 120px;
  margin: 4px 0;
  border-radius: 16px;
  background: #ffffff;
  border: 2px solid #bfe8ff;
  box-sizing: border-box;
}
.badge-list .af-native-slot[hidden] {
  display: none !important;
}
