/* The menu owns the viewport; the flight keeps its original 9:16 canvas. */
#game.menu-open { width: 100vw; height: 100dvh; aspect-ratio: auto; border: 0; border-radius: 0; }
#game.menu-open #scene { visibility: hidden; }
#home { --menu-line: #c7a76d55; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; padding: 0; overflow: hidden; background: #0c2339; }
.lobby-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(#06233e48, #081d35e8 75%),
    url("../assets/ui/lobby-bg-fal-384.webp?v=5.19.0-r21");
  background-image:
    linear-gradient(#06233e48, #081d35e8 75%),
    image-set(
      url("../assets/ui/lobby-bg-fal-384.webp?v=5.19.0-r21") 1x,
      url("../assets/ui/lobby-bg-fal-768.webp?v=5.19.0-r21") 2x
    );
  background-position: center, center 38%;
  background-size: auto, cover;
  background-repeat: no-repeat;
}
@media (min-width: 760px) {
  .lobby-backdrop {
    background-image:
      linear-gradient(#06233e48, #081d35e8 75%),
      url("../assets/lobby-bg.webp?v=5.19.0-r21");
  }
}
.lobby-header { position: relative; z-index: 3; width: 100%; padding: max(12px, env(safe-area-inset-top)) max(18px, calc((100vw - 1120px) / 2)) 12px; background: linear-gradient(#0b233ced, #0d2e47e6); border-bottom: 1px solid var(--menu-line); box-shadow: 0 6px 24px #00112440; }
.lobby-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.player-badge { display: flex; align-items: center; gap: 9px; }
.player-badge > img { width: 42px; height: 42px; object-fit: contain; }
.player-badge > span { display: grid; gap: 2px; }
.player-badge strong { font-size: 17px; color: #ffe6a7; letter-spacing: .06em; font-weight: 950; }
.player-badge small { color: #a7cbd8; font-size: 8px; letter-spacing: .24em; }
.lobby-top .icon { width: 44px; height: 44px; border: 1px solid var(--menu-line); border-radius: 14px; color: #f5ddaa; font-size: 21px; background: #14354f; }
.lobby-balances { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 10px; margin-top: 9px; }
.lobby-doge-wallet, .lobby-balances .wallet { display: flex; align-items: center; gap: 9px; min-width: 0; margin: 0; padding: 8px 12px; min-height: 58px; border: 1px solid var(--menu-line); border-radius: 15px; background: linear-gradient(120deg, #274657, #142e46); box-shadow: inset 0 1px #ffe5ac1c; text-align: left; }
.lobby-doge-wallet > img, .lobby-balances .wallet img { width: 36px; height: 36px; object-fit: contain; flex-shrink: 0; }
.lobby-doge-wallet > span, .lobby-balances .wallet > span { min-width: 0; }
.lobby-doge-wallet small, .lobby-balances .wallet small { display: block; color: #b7cdd6; font-size: 8px; letter-spacing: .12em; margin-bottom: 3px; }
.lobby-doge-wallet strong, .lobby-balances .wallet strong { display: block; color: #ffe4a0; font-size: 21px; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.lobby-doge-wallet em { font-size: 10px; font-style: normal; }
.lobby-doge-wallet strong { display: flex; align-items: baseline; gap: 4px; height: 24px; white-space: nowrap; }
.lobby-doge-wallet > span:nth-child(2) { flex: 1; }
#homeDogeBalance { min-width: 0; font-size: clamp(12px, 3.8vw, 20px); }
.balance-arrow { margin-left: auto; color: #d2ba80; font-size: 25px; }
.lobby-balances .wallet { background: #0b2639b3; border-color: #a4c6d633; }
.lobby-balances .wallet strong { color: #f4f1df; font-size: 19px; }
.lobby-scroll { position: relative; z-index: 2; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 16px 18px 24px; scroll-padding-block: 12px; scrollbar-width: thin; scrollbar-color: #82bcbb55 transparent; }
.lobby-layout { display: grid; gap: 24px; max-width: 1120px; margin: 0 auto; }
.lobby-feature, .lobby-preparation { min-width: 0; }
.lobby-arena { position: relative; min-height: 183px; height: 24dvh; max-height: 260px; margin: 0; isolation: isolate; overflow: clip; }
.lobby-arena::after { content: ""; position: absolute; right: 3%; bottom: 7%; width: 50%; height: 14%; border-radius: 50%; background: #66e4dc44; filter: blur(15px); z-index: -1; }
.lobby-title { position: absolute; top: 14%; left: 0; z-index: 2; width: 57%; text-shadow: 0 3px 12px #001227; }
.lobby-title > span { font-size: 8px; font-weight: 900; letter-spacing: .18em; color: #b1e9e6; }
#home .lobby-title h1 { font-size: clamp(36px, 7vw, 58px); line-height: .98; margin: 12px 0; font-weight: 950; letter-spacing: -.04em; color: #fff0be; font-style: italic; }
.lobby-title p { font-size: 10px; color: #d9e8e7; max-width: 145px; line-height: 1.5; margin: 0; }
.lobby-dog { position: absolute; right: 0; bottom: 2%; width: 65%; height: 100%; object-fit: contain; filter: drop-shadow(0 12px 10px #03172c80); }
.lobby-arena .lobby-decoration { z-index: -1; }
.battle-button { position: relative; display: flex; align-items: center; justify-content: center; gap: 30px; width: 100%; min-height: 68px; padding: 10px 22px; border: 1px solid #ffe79c; border-radius: 19px; color: #5b3111; background: linear-gradient(#ffe9a0, #f4c157 48%, #e5a43c); box-shadow: inset 0 2px #fff7d3, 0 5px 0 #90591e, 0 9px 23px #041a2c77; }
.battle-button > span:not(.notification-dot) { display: grid; gap: 3px; }
.battle-button small { font-size: 9px; font-weight: 800; letter-spacing: .05em; }
.battle-button strong { font-size: 24px; font-weight: 950; letter-spacing: .05em; }
.battle-button > span:last-child { font-size: 27px; }
.bonus-journey { position: relative; display: grid; grid-template-columns: 46px 1fr; gap: 0 10px; padding: 15px; margin-top: 22px; border: 1px solid var(--menu-line); border-radius: 19px; background: linear-gradient(120deg, #29454cd9, #152f47ee); box-shadow: inset 0 1px #fff0b810; }
.bonus-journey > img { width: 46px; height: 46px; align-self: center; }
.bonus-journey small { font-size: 8px; letter-spacing: .14em; color: #d2b986; }
.bonus-journey h2 { margin: 3px 0; color: #ffe8b4; font-size: 18px; }
.bonus-journey p { margin: 0; color: #bad0d8; font-size: 10px; line-height: 1.4; }
.bonus-steps { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 6px; padding: 12px 0 0; margin: 12px 0 0; border-top: 1px solid #ffe4a820; list-style: none; }
.bonus-steps li { font-size: 8px; color: #cbdcdf; display: flex; align-items: center; gap: 4px; }
.bonus-steps b { display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid #cfb17a66; border-radius: 50%; color: #ffe5a7; font-size: 8px; }
#resumeHomeBonus { grid-column: 1 / -1; margin-top: 12px; min-height: 44px; border: 1px solid #e3c27688; color: #ffe5a8; background: #385752; display: flex; align-items: center; justify-content: space-between; }
#home .mission-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 0 10px; margin: 0; border: 0; color: #e6eddf; }
#home .mission-heading > div:first-child { display: grid; gap: 4px; }
#home .mission-heading span { font-size: 10px; letter-spacing: .08em; font-weight: 850; }
#home .mission-heading small { color: #95b8c7; font-size: 9px; letter-spacing: 0; }
.mission-heading-tools { display: flex; align-items: center; gap: 8px; }
#home #totalPaws { color: #d8be8d; font-size: 8px; white-space: nowrap; }
.mission-controls { display: flex; align-items: center; gap: 2px; }
.mission-controls button { width: 44px; height: 44px; min-width: 44px; border-radius: 13px; background: #1c4059; border: 1px solid #a4ccd044; color: #e0f1ed; font-size: 25px; }
.mission-controls button:disabled { opacity: .35; }
#missionPosition { min-width: 32px; text-align: center; font-size: 9px; color: #adcfd3; }
#home #missions { display: flex; position: relative; gap: 12px; min-height: 132px; margin: 0; padding: 2px 0 10px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; touch-action: pan-x; scrollbar-width: none; }
#home .mission { flex: 0 0 calc(100% - 22px); min-width: 0; height: 122px; padding: 12px; margin: 0; border-radius: 19px; border: 1px solid #a4c9d344; background: linear-gradient(125deg, #24455cef, #102d46f5); scroll-snap-align: start; scroll-snap-stop: always; touch-action: pan-x; box-shadow: 0 4px 0 #071d32; }
#home .mission[aria-current="true"] { border-color: #cfb172aa; }
#home .mission.next { background: linear-gradient(120deg, #315860, #153149); }
#home .mission-art { width: 60px; height: 78px; border: 1px solid #d5bc8155; border-radius: 12px; }
#home .mission-detail { min-width: 0; }
#home .mission-detail strong { font-size: 17px; }
#home .mission-detail > span { font-size: 10px; line-height: 1.3; }
#home .mission-detail small { font-size: 8px; color: #c1a976; }
#home .mission-arrow { font-size: 20px; }
#home .loadout { margin: 15px 0 12px; padding: 14px; border: 1px solid #9cbfc433; border-radius: 19px; background: #112e46de; box-shadow: none; }
#home .loadout-heading { gap: 8px; }
#home .loadout-heading strong { font-size: 10px; letter-spacing: .06em; }
#home .loadout-heading > span { font-size: 9px; color: #9bb9c5; }
#home #elementOptions { margin-top: 10px; }
#home .element-option { min-height: 70px; padding: 5px 2px; }
#home .element-option .element-glyph { width: 30px; height: 30px; }
#home .element-option strong { font-size: 11px; }
#home #loadoutHint { font-size: 9px; line-height: 1.4; margin: 9px 0 0; min-height: 0; color: #b6cfd4; }
.daily-card { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 68px; padding: 6px 14px 6px 6px; border: 1px solid #b9cfd033; border-radius: 18px; background: #15374edb; text-align: left; }
.daily-card img, .daily-card canvas.animated-art { width: 56px; height: 56px; object-fit: contain; }
.daily-card > span:not(.notification-dot) { display: grid; gap: 4px; }
.daily-card small { font-size: 8px; color: #a7c5cc; letter-spacing: .12em; }
.daily-card strong { font-size: 12px; color: #ffe4aa; }
.daily-arrow { margin-left: auto; font-size: 26px; color: #c0d5d7; }
#home .lobby-nav { position: relative; z-index: 3; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; width: 100%; min-height: 68px; height: auto; padding: 7px max(12px, calc((100vw - 750px) / 2)) max(7px, env(safe-area-inset-bottom)); background: #0c253def; border-top: 1px solid var(--menu-line); box-shadow: 0 -6px 24px #00162966; }
.lobby-nav button { display: grid; align-content: center; justify-items: center; gap: 5px; min-height: 52px; border-radius: 13px; color: #a9c6d4; background: transparent; position: relative; }
.lobby-nav #navBattle { color: #ffe0a0; background: linear-gradient(#ffe4a51c, #ffe4a508); border: 1px solid #d7b26d4d; }
.lobby-nav button:hover, .lobby-nav button:focus-visible { background: #cfecf019; }
.lobby-nav button > span:first-child { font-size: 21px; font-weight: 850; line-height: 1; }
.lobby-nav svg { width: 22px; height: 22px; display: block; }
.lobby-nav small { font-size: 8px; font-weight: 800; letter-spacing: .09em; }
.lobby-nav .notification-dot { right: 18%; top: 5px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* An opaque handoff precedes the flight; no opacity or scale on the menu. */
.reward-flight { position: fixed; inset: 0; z-index: 150; overflow: hidden; pointer-events: auto; }
.reward-veil { position: absolute; inset: 0; background: #11314b; }
.reward-flight img { position: absolute; left: 0; top: 0; width: 42px; height: 42px; object-fit: contain; filter: drop-shadow(0 0 6px #ffc75488); will-change: transform, opacity; }
.reward-receipt { position: absolute; left: 50%; top: 65%; transform: translateX(-50%); width: max-content; max-width: 90vw; text-align: center; padding: 14px 25px; border: 1px solid #efcf8188; border-radius: 20px; background: #0d2e46f5; box-shadow: 0 10px 40px #00142688; }
.reward-receipt small, .reward-receipt span { display: block; color: #c3d8df; font-size: 10px; }
.reward-receipt small { letter-spacing: .17em; }
.reward-receipt strong { display: block; font-size: 29px; margin: 5px 0; color: #ffe19b; }
.lobby-doge-wallet.is-receiving { box-shadow: 0 0 24px #ffdd7099, inset 0 0 14px #ffdb6c44; border-color: #ffe6a0; }
@media (min-width: 760px) {
  .lobby-header { display: flex; align-items: center; justify-content: space-between; gap: 25px; padding-block: max(16px, env(safe-area-inset-top)) 16px; }
  .lobby-top { flex: 1; }
  .lobby-balances { width: 390px; margin: 0; }
  .lobby-scroll { padding-block: 30px; }
  .lobby-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: clamp(30px, 5vw, 80px); }
  .lobby-arena { height: 30dvh; max-height: 340px; min-height: 230px; }
  #home .lobby-title h1 { font-size: clamp(44px, 5vw, 68px); }
  .lobby-title p { font-size: 13px; max-width: 200px; }
  .lobby-title > span { font-size: 10px; }
  .bonus-journey { margin-top: 24px; padding: 20px; }
  .bonus-steps li { font-size: 10px; }
  #home .mission { height: 154px; }
  #home .mission-art { width: 75px; height: 100px; }
  #home .loadout { margin-top: 18px; padding: 18px; }
  #home .element-option { min-height: 84px; }
}
@media (max-width: 370px) {
  .lobby-header { padding-inline: 12px; }
  .lobby-scroll { padding-inline: 12px; }
  .lobby-balances { gap: 7px; }
  .lobby-doge-wallet, .lobby-balances .wallet { padding-inline: 8px; gap: 6px; }
  .lobby-doge-wallet strong { font-size: 19px; }
  .lobby-doge-wallet > img, .lobby-balances .wallet img { width: 30px; height: 30px; }
  #home #totalPaws { display: none; }
  #home .loadout { padding: 12px 9px; }
  .bonus-journey { padding: 12px; }
}
@media (max-height: 650px) and (max-width: 759px) {
  .lobby-header { padding-block: max(6px, env(safe-area-inset-top)) 8px; }
  .lobby-balances { margin-top: 5px; }
  .lobby-doge-wallet, .lobby-balances .wallet { min-height: 50px; padding-block: 6px; }
  .lobby-scroll { padding-top: 8px; }
  .lobby-arena { min-height: 153px; }
  .lobby-title { top: 6%; }
  #home .lobby-title h1 { font-size: 36px; margin-block: 8px; }
  .lobby-title p { font-size: 9px; line-height: 1.4; }
  .battle-button { min-height: 60px; }
  #home .lobby-nav { min-height: 62px; padding-block: 4px max(4px, env(safe-area-inset-bottom)); }
}
@media (max-height: 500px) and (min-width: 760px) {
  .lobby-header { padding-block: 6px; }
  .lobby-scroll { padding-block: 12px; }
  .lobby-arena { min-height: 175px; }
  .lobby-title { top: 3%; }
  #home .lobby-title h1 { font-size: 38px; margin-block: 8px; }
  .lobby-title p { font-size: 11px; }
  #home .lobby-nav { min-height: 58px; padding-block: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  .reward-flight img { display: none; }
}
