:root {
  color-scheme: dark;
  --ink: #f3f4e9;
  --muted: #91a9b7;
  --gold: #f8c36e;
  --mint: #9be0cb;
  --panel: #172b40;
  --line: #b3cddd22;
  font-family: ui-rounded, "Segoe UI", system-ui, sans-serif;
}
* {
  box-sizing: border-box;
}
html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}
body {
  display: grid;
  place-content: center;
  background: radial-gradient(ellipse at 50% 40%, #27485b, #0a1727 72%);
  color: var(--ink);
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(#bce2e915 1px, transparent 1px);
  background-size: 26px 26px;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  border: 0;
}
button:disabled {
  cursor: default;
}
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--mint);
  outline-offset: 3px;
}
button:active:not(:disabled) {
  transform: translateY(2px);
}
[hidden] {
  display: none !important;
}
#game {
  position: relative;
  width: min(100vw, 56.25dvh, 480px);
  aspect-ratio: 9/16;
  overflow: hidden;
  isolation: isolate;
  container-type: inline-size;
  box-shadow: 0 30px 100px #0007;
  background: #162b42;
  touch-action: none;
}
#game.menu-open,
#game.menu-open #home {
  touch-action: pan-x pan-y;
}
#scene,
#scene canvas,
.screen,
#hud {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#scene canvas {
  display: block;
}
.screen {
  z-index: 10;
}
.interactive {
  touch-action: manipulation;
}
#home {
  display: flex;
  flex-direction: column;
  padding: 18px 20px 0;
  background: linear-gradient(150deg, #102638f9, #1c2e48f2 60%, #192b3df5);
  touch-action: pan-y;
}
.top {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}
.wordmark {
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0.32em;
  line-height: 1.1;
  color: #d8eeeb;
}
.wordmark span {
  display: block;
  letter-spacing: -0.035em;
  font-size: 23px;
  color: var(--gold);
  margin-top: 4px;
  font-style: italic;
}
.wallet {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  background: #ffffff0d;
  padding: 7px 9px;
  border-radius: 18px;
}
.wallet img {
  width: 21px;
  height: 21px;
  object-fit: contain;
}
.icon {
  width: 44px;
  min-width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #a5bfd514;
  color: #c2d8df;
  font-size: 23px;
  line-height: 1;
}
.hero {
  position: relative;
  padding: 24px 0 20px;
  flex-shrink: 0;
}
.eyebrow {
  font-size: 8px;
  letter-spacing: 0.17em;
  font-weight: 800;
  color: var(--mint);
}
h1 {
  position: relative;
  z-index: 2;
  font-size: 36px;
  line-height: 1.05;
  letter-spacing: -0.065em;
  margin: 12px 0 13px;
  max-width: 75%;
}
h1 em {
  color: var(--gold);
  font-style: normal;
}
.hero p {
  position: relative;
  z-index: 2;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}
.hero-art {
  position: absolute;
  right: -2px;
  top: 47px;
  width: 124px;
  height: 150px;
}
.hero-shard {
  position: absolute;
  width: 75px;
  height: 92px;
  object-fit: contain;
  right: 8px;
  top: 4px;
  transform: rotate(15deg);
  filter: drop-shadow(0 0 22px #ffd57920);
}
.hero-dog {
  position: absolute;
  width: 126px;
  bottom: 2px;
  left: -15px;
  transform: rotate(-12deg);
  filter: drop-shadow(0 8px 15px #08182a70);
}
.orbit {
  position: absolute;
  inset: 0;
  border: 1px solid #a1c7da26;
  border-radius: 50%;
  transform: rotate(-25deg);
}
.mission-heading {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding: 13px 0 10px;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.mission-heading strong {
  color: var(--gold);
  font-size: 9px;
}
#missions {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: #698493 transparent;
  padding: 2px 2px 8px;
}
.mission {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 109px;
  margin: 0 0 10px;
  border: 1px solid #b6d3db26;
  border-radius: 19px;
  padding: 14px 10px;
  text-align: left;
  background: linear-gradient(110deg, #284058, #23374c);
  overflow: hidden;
}
.mission.next {
  border-color: #d9b776a0;
  background: linear-gradient(110deg, #3d414b, #283b50);
}
.mission.endless {
  border-color: #9cddda70;
  background: linear-gradient(110deg, #173d50, #302d58);
}
.endless-best {
  margin-top: 7px;
  color: var(--gold);
  font-size: 8px;
  letter-spacing: 0.05em;
}
.mission:disabled {
  opacity: 0.66;
  filter: saturate(0.72);
}
.mission-art {
  width: 61px;
  height: 61px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 6px #0003);
}
.mission-detail {
  flex: 1;
  min-width: 0;
}
.mission-detail small {
  display: block;
  font-size: 8px;
  letter-spacing: 0.12em;
  color: #a2bdcc;
  margin-bottom: 5px;
}
.mission-detail strong {
  display: block;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.mission-detail > span {
  display: block;
  font-size: 9px;
  color: #a3bcc6;
  line-height: 1.4;
  margin-top: 5px;
}
.mission-arrow {
  font-size: 21px;
  color: var(--gold);
}
.paws {
  display: flex;
  gap: 3px;
  margin-top: 8px;
}
.paws img {
  width: 17px;
  height: 17px;
  object-fit: contain;
}
.paws .empty {
  filter: grayscale(1);
  opacity: 0.24;
}
.home-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  border-top: 1px solid var(--line);
  min-height: 57px;
  font-size: 9px;
  color: #91a8ba;
  flex-shrink: 0;
}
.home-footer button {
  min-height: 44px;
  background: transparent;
  color: var(--gold);
  font-size: 10px;
}
.modal {
  z-index: 30;
  background: #071628bc;
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  touch-action: pan-y;
}
.card {
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: thin;
  padding: 14px 18px 21px;
  background: linear-gradient(145deg, #233a50, #182b40);
  border: 1px solid #bad6e32b;
  border-radius: 25px;
  text-align: center;
  box-shadow: 0 20px 50px #0004;
}
.card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  gap: 6px;
}
#dialogArt > img,
#dialogArt > canvas.animated-art {
  width: 85px;
  height: 85px;
  object-fit: contain;
  margin-top: 5px;
}
#dialogTitle {
  font-size: 26px;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin: 10px 0;
}
#dialogText {
  font-size: 12px;
  line-height: 1.6;
  color: #acbdca;
  margin: 12px 0 16px;
}
#dialogActions {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}
.primary,
.secondary {
  min-height: 48px;
  border-radius: 14px;
  padding: 12px 9px;
  width: 100%;
  font-size: 12px;
  font-weight: 800;
  display: block;
}
.primary {
  background: linear-gradient(#ffdb8c, #edb85f);
  color: #3b321e;
  box-shadow: 0 4px 0 #bd8b40;
}
.secondary {
  background: #90b0ca18;
  color: #c0d6df;
  border: 1px solid #acd3df14;
}
.card[data-kind="wallet"] {
  background:
    radial-gradient(circle at 90% 0%, #f6be5325, transparent 38%),
    linear-gradient(145deg, #3b3a3b, #202d3d 62%, #172a40);
  border-color: #e7bb675e;
}
.card[data-kind="wallet"] #dialogText {
  color: #d4c8b0;
  margin-bottom: 13px;
}
.doge-wallet {
  text-align: left;
}
.doge-wallet-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 2px;
}
.doge-wallet-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.doge-wallet-coin {
  display: block;
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  filter: drop-shadow(0 5px 9px #090c126b);
}
.doge-wallet-coin svg {
  display: block;
  width: 100%;
  height: 100%;
}
.doge-wallet-brand-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.doge-wallet-brand-copy > strong {
  color: #ffe29a;
  font-size: 16px;
  letter-spacing: 0.08em;
  line-height: 1;
}
.doge-network-badge {
  width: max-content;
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid #f4ca7566;
  border-radius: 999px;
  background: #e9b94c1c;
  color: #f6d991;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.doge-wallet-balance {
  flex: 0 0 auto;
  text-align: right;
}
.doge-wallet-balance > span {
  display: block;
  color: #bcae97;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.doge-wallet-balance > strong {
  display: block;
  margin-top: 4px;
  color: #fff0bf;
  font-size: 20px;
  line-height: 1;
  white-space: nowrap;
}
.doge-wallet-balance small {
  color: #e6be68;
  font-size: 9px;
  letter-spacing: 0.08em;
}
.doge-wallet-rule {
  height: 1px;
  margin: 15px 0 16px;
  background: linear-gradient(90deg, transparent, #f4ca7564, transparent);
}
.doge-wallet-address > label {
  display: block;
  margin-bottom: 7px;
  color: #f0d594;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.doge-wallet-input-row {
  display: flex;
  align-items: stretch;
  gap: 7px;
}
.doge-wallet-input-row input {
  min-width: 0;
  min-height: 48px;
  flex: 1;
  border: 1px solid #c8d8e344;
  border-radius: 13px;
  padding: 11px 12px;
  background: #0e1c2dc9;
  color: #f5f3e9;
  font: inherit;
  font-size: 12px;
  outline: 0;
}
.doge-wallet-input-row input::placeholder {
  color: #849aaa;
}
.doge-wallet-input-row input:focus {
  border-color: #f4ca75;
  box-shadow: 0 0 0 3px #f4ca7533;
}
.doge-wallet-input-row input[readonly] {
  border-color: #e2bc6444;
  color: #f4d78f;
  text-overflow: ellipsis;
}
.doge-wallet-input-row input:disabled {
  opacity: 0.62;
}
.doge-wallet-edit {
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border: 1px solid #f4ca7552;
  background: #e8b9491c;
  color: #f8ce78;
}
.doge-wallet-edit svg {
  width: 21px;
  height: 21px;
}
.doge-wallet-error,
.doge-wallet-hint {
  min-height: 16px;
  margin: 7px 1px 0;
  font-size: 10px;
  line-height: 1.45;
}
.doge-wallet-error {
  color: #ff9e9e;
}
.doge-wallet-hint {
  color: #a6b7c1;
}
.doge-wallet-actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.doge-wallet-actions .primary,
.doge-wallet-actions .secondary {
  min-height: 48px;
}
.doge-wallet-withdraw {
  margin-top: 17px;
  padding-top: 14px;
  border-top: 1px solid #b9d0dc1f;
  text-align: center;
}
.doge-wallet-withdraw button {
  min-height: 48px;
  color: #b8c6ce;
}
.doge-wallet-withdraw button:disabled {
  background: #8597a318;
  border-color: #bdcbd51c;
  box-shadow: none;
  opacity: 0.62;
}
.doge-wallet-withdraw p {
  margin: 8px 0 0;
  color: #a2b1ba;
  font-size: 10px;
}
@container (max-width: 360px) {
  .doge-wallet-heading {
    display: grid;
    gap: 10px;
  }
  .doge-wallet-brand {
    width: 100%;
  }
  .doge-wallet-balance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e5bb6540;
    border-radius: 12px;
    background: #e8b94912;
    text-align: left;
  }
  .doge-wallet-balance > strong {
    margin-top: 0;
  }
}
.goal {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 10px;
  margin: 7px 0;
  border-radius: 13px;
  background: #b8d8d70b;
  border: 1px solid #b8d8d710;
}
.goal img {
  width: 29px;
  height: 29px;
}
.goal img.empty {
  filter: grayscale(1);
  opacity: 0.3;
}
.goal div {
  flex: 1;
  min-width: 0;
}
.goal strong {
  font-size: 12px;
  display: block;
}
.goal span {
  font-size: 10px;
  color: #9bb2c4;
  display: block;
  margin-top: 3px;
}
.goal b {
  font-size: 11px;
  color: var(--gold);
}
.rule {
  background: #bd8e3418;
  border: 1px solid #d6ac6827;
  color: #d6c39f;
  padding: 10px;
  border-radius: 12px;
  text-align: left;
  line-height: 1.5;
  font-size: 10px;
  margin-top: 12px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 14px 0;
}
.stats > div {
  background: #ffffff08;
  padding: 10px 3px;
  border-radius: 12px;
}
.stats strong {
  display: block;
  font-size: 24px;
  color: var(--gold);
}
.stats span {
  font-size: 8px;
  color: #9db6c6;
  line-height: 1.3;
  display: block;
  margin-top: 4px;
  letter-spacing: 0.07em;
}
.reward-note {
  font-size: 11px;
  color: var(--mint);
  line-height: 1.5;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  gap: 7px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.setting-row button {
  min-height: 44px;
  padding: 8px 15px;
  background: #99c8cf18;
  border-radius: 13px;
  font-size: 11px;
}
.help-row {
  display: flex;
  text-align: left;
  align-items: center;
  gap: 11px;
  margin: 14px 0;
  font-size: 11px;
  line-height: 1.5;
  color: #b4c7d0;
}
.help-row img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.help-row strong {
  display: block;
  color: #f2f0dc;
}
.subtle {
  font-size: 10px;
  line-height: 1.6;
  color: #91aabb;
}
.history {
  font-size: 10px;
  line-height: 1.5;
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
}
.history strong {
  color: var(--gold);
}
#hud {
  z-index: 5;
  pointer-events: none;
  padding: 10px;
}
.hud-row {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 5px 5px 7px;
  background: #172c43f2;
  border: 1px solid #c4e5e324;
  border-radius: 16px;
}
.counter {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 2px;
}
.counter img {
  width: 25px;
  height: 25px;
  object-fit: contain;
}
#coinPuzzle {
  position: relative;
  isolation: isolate;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}
#coinPuzzle img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}
.coin-outline {
  filter: grayscale(1);
  opacity: 0.2;
}
.coin-piece {
  opacity: 0;
  transition: opacity 0.2s;
}
.coin-piece.filled {
  opacity: 1;
}
.piece-0 {
  clip-path: polygon(50% 50%, 50% 0, 100% 0, 100% 78.8675%);
}
.piece-1 {
  clip-path: polygon(50% 50%, 100% 78.8675%, 100% 100%, 0 100%, 0 78.8675%);
}
.piece-2 {
  clip-path: polygon(50% 50%, 0 78.8675%, 0 0, 50% 0);
}
#coinPuzzle.complete {
  filter: drop-shadow(0 0 5px #ffd34f) drop-shadow(0 0 10px #ffae35);
  animation: complete-coin-glow 1.5s ease-in-out infinite;
}
#coinPuzzle.complete .coin-outline {
  opacity: 0;
}
#coinPuzzle.complete::before {
  content: "";
  position: absolute;
  inset: -8px;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(circle, #fff3a266 0 28%, #ffc34238 48%, transparent 72%);
  animation: complete-coin-halo 1.5s ease-in-out infinite;
}
#coinPuzzle.complete::after {
  content: "✦";
  position: absolute;
  z-index: 2;
  right: -5px;
  top: -8px;
  color: #fffce0;
  font-size: 17px;
  line-height: 1;
  text-shadow: 0 0 5px #fff, 0 0 9px #ffc536;
  animation: complete-coin-sparkle 1.1s ease-in-out infinite;
}
@keyframes complete-coin-glow {
  50% {
    filter: drop-shadow(0 0 8px #fff1a0) drop-shadow(0 0 14px #ffb52f);
  }
}
@keyframes complete-coin-halo {
  50% {
    opacity: 0.55;
    transform: scale(1.12);
  }
}
@keyframes complete-coin-sparkle {
  50% {
    opacity: 0.45;
    transform: scale(0.72) rotate(25deg);
  }
}
#coinAlert {
  position: absolute;
  z-index: 6;
  pointer-events: none;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  box-sizing: border-box;
  background: #fff;
  color: #273447;
  border: 1px solid #34435640;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 2px 3px #10203025;
}
#coinAlert::after {
  content: "";
  position: absolute;
  left: 9px;
  bottom: -5px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #fff;
}
#coinAlert b {
  display: block;
  font-size: 22px;
  line-height: 26px;
}
#coinAlert span {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .coin-piece {
    transition: none;
  }
  #coinPuzzle.complete,
  #coinPuzzle.complete::before,
  #coinPuzzle.complete::after {
    animation: none;
  }
}
.counter strong {
  font-size: 14px;
  line-height: 1.2;
  display: block;
}
.counter small,
.alarm > small {
  display: block;
  font-size: 7px;
  letter-spacing: 0.11em;
  color: #abc7d3;
}
.alarm {
  margin-left: auto;
}
.alarm > div {
  display: flex;
  gap: 3px;
  margin-top: 6px;
}
.alarm i {
  width: 9px;
  height: 11px;
  border-radius: 3px;
  background: #60778955;
}
.alarm i.on {
  background: #ff8f69;
  box-shadow: 0 0 9px #ff805b36;
}
#pause {
  pointer-events: auto;
  background: #a9d0db12;
  font-size: 18px;
}
#routeProgress {
  height: 3px;
  background: #ffffff16;
  margin: 6px 7px 0;
  overflow: hidden;
  border-radius: 4px;
}
#routeProgress i {
  display: block;
  height: 100%;
  width: 0;
  background: #b9dfd0;
  transition: width 0.08s;
}
#aimCue {
  font-size: 10px;
  letter-spacing: 0.08em;
  font-weight: 800;
  color: #b7ffff;
  text-align: center;
  margin: 9px 4px;
  padding: 8px;
  background: #133845e6;
  border: 1px solid #8debe581;
  border-radius: 10px;
}
.dock {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 9px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
#dash {
  pointer-events: auto;
  width: 70px;
  min-width: 56px;
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border-radius: 21px;
  border: 1px solid #ffe9b5;
  background: linear-gradient(#ffdc8c, #eab159);
  color: #594329;
  box-shadow: 0 4px 0 #ad7b35;
  padding: 3px;
}
#dash > img {
  width: 43px;
  height: 34px;
  object-fit: contain;
}
#dash > strong {
  font-size: 11px;
  letter-spacing: 0.07em;
}
#charges {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}
#charges i {
  width: 14px;
  height: 4px;
  border-radius: 3px;
  background: #82663455;
}
#charges i.on {
  background: #fff5c9;
  box-shadow: 0 0 5px #fff4be;
}
#dash:disabled {
  background: linear-gradient(#4f6573, #3b5060);
  box-shadow: 0 4px 0 #1a3244;
  border-color: #8db4c344;
  color: #9bb5c3;
}
#dash:disabled > img {
  filter: grayscale(1);
  opacity: 0.5;
}
#perfect {
  position: absolute;
  z-index: 20;
  left: 6%;
  right: 6%;
  top: 26%;
  text-align: center;
  pointer-events: none;
  animation: perfect 1s both;
}
#perfect strong {
  display: block;
  font-size: 39px;
  font-weight: 1000;
  letter-spacing: -0.055em;
  font-style: italic;
  color: #ffe19a;
  text-shadow:
    0 3px 0 #956a33,
    0 5px 22px #0007;
}
.paused #perfect {
  animation-play-state: paused;
}
#loading {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
  z-index: 50;
  background: #172d43;
  text-align: center;
  padding: 24px;
}
#loading .wordmark {
  font-size: 20px;
}
#loading .wordmark span {
  font-size: 38px;
}
#loading > img {
  width: 125px;
  animation: bob 1.6s ease-in-out infinite;
}
#loadText {
  font-size: 13px;
}
#loadDetail {
  font-size: 11px;
  color: #a1bbcb;
}
.loading-bar {
  height: 5px;
  width: 75%;
  background: #acced822;
  border-radius: 9px;
  overflow: hidden;
}
.loading-bar i {
  display: block;
  height: 100%;
  background: var(--gold);
  width: 0;
  transition: width 0.2s;
}
.desktop-note {
  position: absolute;
  bottom: 10px;
  left: 14px;
  right: 174px;
  text-align: left;
  pointer-events: none;
  color: #a9c1cfb8;
  letter-spacing: 0.18em;
  font-size: 9px;
  z-index: 4;
}
.desktop-note span {
  display: block;
  margin-top: 4px;
  letter-spacing: 0.03em;
  font-size: 9px;
}
@keyframes perfect {
  0% {
    opacity: 0;
    transform: scale(0.7);
  }
  15% {
    opacity: 1;
    transform: scale(1.08);
  }
  30%,
  80% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-12px);
  }
}
@keyframes bob {
  50% {
    transform: translateY(-8px) rotate(-6deg);
  }
}
@media (min-width: 700px) and (min-height: 650px) {
  #game {
    border-radius: 25px;
    border: 1px solid #b2d0e326;
  }
}
@media (max-width: 699px) {
  .desktop-note {
    display: none;
  }
}
@media (max-height: 680px) {
  #home {
    padding-top: 11px;
  }
  .hero {
    padding-top: 16px;
    padding-bottom: 13px;
  }
  .hero h1 {
    font-size: 29px;
    margin: 8px 0;
  }
  .hero-art {
    top: 24px;
    width: 105px;
    height: 127px;
  }
  .hero-dog {
    width: 110px;
  }
  .hero-shard {
    width: 60px;
  }
  .hero p {
    font-size: 10px;
  }
  .wordmark span {
    font-size: 20px;
  }
  .mission {
    min-height: 94px;
    padding: 9px;
    margin-bottom: 8px;
  }
  .mission-art {
    width: 50px;
    height: 50px;
  }
  .mission-detail strong {
    font-size: 13px;
  }
  .mission-detail > span {
    font-size: 8px;
  }
  .home-footer {
    min-height: 49px;
  }
  .mission-heading {
    padding: 10px 0 7px;
  }
  .card {
    padding: 10px 14px 17px;
  }
  #dialogArt > img,
#dialogArt > canvas.animated-art {
    width: 60px;
    height: 60px;
  }
  #dialogTitle {
    font-size: 23px;
  }
  .desktop-note {
    display: none;
  }
}
@container (max-width:280px) {
  #home {
    padding: 10px 12px 0;
  }
  .hero-art {
    opacity: 0.55;
    width: 80px;
    right: -5px;
  }
  .hero h1 {
    font-size: 27px;
    max-width: 100%;
  }
  .eyebrow {
    font-size: 6px;
  }
  .wordmark span {
    font-size: 18px;
  }
  .wallet {
    padding: 4px;
    gap: 2px;
    font-size: 10px;
  }
  .wallet img {
    width: 15px;
    height: 15px;
  }
  .top {
    gap: 3px;
  }
  .mission-art {
    width: 36px;
    height: 36px;
  }
  .mission-detail strong {
    font-size: 11px;
  }
  .mission-detail > span {
    display: none;
  }
  .mission-detail small {
    font-size: 7px;
  }
  .mission {
    gap: 6px;
    min-height: 86px;
  }
  .home-footer {
    font-size: 7px;
    gap: 3px;
  }
  .home-footer button {
    font-size: 9px;
  }
  .hud-row {
    gap: 3px;
    padding: 3px;
  }
  .counter {
    gap: 2px;
  }
  .counter img {
    width: 16px;
    height: 16px;
  }
  .counter strong {
    font-size: 10px;
  }
  .counter small,
  .alarm > small {
    font-size: 6px;
  }
  .alarm i {
    width: 6px;
    height: 8px;
  }
  #hud {
    padding: 5px;
  }
  #dash {
    width: 56px;
    height: 67px;
  }
  .dock {
    left: 5px;
    right: 5px;
    bottom: 5px;
    gap: 5px;
  }
  .modal {
    padding: 9px;
  }
  .card {
    padding: 9px;
  }
  #dialogTitle {
    font-size: 21px;
  }
  #dialogText {
    font-size: 11px;
  }
  .goal {
    flex-wrap: wrap;
  }
  .goal b {
    margin-left: 39px;
  }
  .stats strong {
    font-size: 17px;
  }
  .stats span {
    font-size: 7px;
  }
  #perfect strong {
    font-size: 26px;
  }
  #aimCue {
    font-size: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
/* Keep restart and navigation in reach while long reports scroll separately. */
.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.card > header,
#dialogActions {
  flex-shrink: 0;
}
#dialogContent {
  min-height: 0;
  overflow-y: auto;
  touch-action: pan-y;
  scrollbar-width: thin;
}
.card[data-kind="results"] #dialogArt {
  display: block;
}
.gate-counter {
  margin-left: auto;
  min-width: 64px;
  text-align: center;
}
.gate-counter small {
  display: block;
  font-size: 7px;
  letter-spacing: 0.06em;
  color: #b7cfda;
}
.gate-counter strong {
  display: block;
  font-size: 13px;
  margin-top: 4px;
}
#charges {
  display: block;
  font-size: 8px;
  letter-spacing: 0.06em;
  margin-top: 4px;
}
#dash.refilled {
  border-color: #b8ffff;
  box-shadow:
    0 0 18px #9cebdd88,
    0 4px 0 #ad7b35;
}
.hero-dog {
  width: 132px;
}
.home-footer span {
  font-size: 9px;
}
@container (max-width:280px) {
  .gate-counter {
    min-width: 39px;
  }
  .gate-counter small {
    font-size: 6px;
  }
  .gate-counter strong {
    font-size: 10px;
  }
}

/* v5.1: compact celebrations, crisp text and a soft illustrated atmosphere. */
#perfect {
  left: 10%;
  right: 10%;
  animation: perfect-pop 850ms both;
  filter: drop-shadow(0 4px 9px #2c163855);
}
#perfect[data-kind="loot"] {
  animation-duration: 1200ms;
}
#perfect::before,
#perfect::after {
  content: "✦";
  position: absolute;
  top: 17px;
  font-size: 26px;
  color: #b8fff0;
  text-shadow: 0 0 12px #68efbe80;
}
#perfect::before {
  left: 4%;
  transform: rotate(-12deg);
}
#perfect::after {
  right: 4%;
  transform: rotate(12deg);
}
#perfect strong {
  font-size: clamp(25px, 8.9cqw, 41px);
  color: #ffecab;
  -webkit-text-stroke: 1px #865135;
  paint-order: stroke fill;
  text-shadow:
    0 2px 0 #ab6036,
    0 4px 0 #754246,
    0 0 22px #ffce5e66;
}
.hud-row {
  background: linear-gradient(135deg, #172a41ee, #203c51d9);
  box-shadow: 0 5px 18px #0b163726;
}
#home {
  background: linear-gradient(150deg, #102638ee, #1c2e48c9 60%, #192b3de8);
}
#game::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(
    ellipse at 35% 43%,
    transparent 42%,
    #14263b1c 100%
  );
}
@keyframes perfect-pop {
  0% {
    opacity: 0;
    transform: translateY(5px) scale(0.65) rotate(-4deg);
  }
  17% {
    opacity: 1;
    transform: translateY(0) scale(1.08) rotate(-2deg);
  }
  32%,
  75% {
    opacity: 1;
    transform: scale(1) rotate(-2deg);
  }
  100% {
    opacity: 0;
    transform: translateY(-9px) scale(1.02) rotate(-2deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  #perfect {
    animation: none;
    filter: none;
  }
}
.dock {
  bottom: 7px;
}
#dash {
  height: 70px;
  border-radius: 18px;
}
#dash > img {
  height: 28px;
  width: 36px;
}
#dash > strong {
  font-size: 10px;
}
@container (max-width:280px) {
  #dash {
    height: 64px;
  }
  #perfect::before,
  #perfect::after {
    font-size: 17px;
  }
}

/* v5.1: reference cooldown meter and independently saved Dash effects. */
#dash {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
#dashCharge {
  position: absolute;
  inset: auto 0 0;
  width: 100%;
  height: 100%;
  background: #fff5c633;
  pointer-events: none;
  z-index: -1;
}
#dash.cooling {
  color: #e5f7ef;
}
.dash-skins {
  border: 0;
  padding: 12px 0 18px;
  margin: 0;
}
.dash-skins legend {
  font-weight: 800;
  padding: 0;
}
.dash-skins p {
  color: #aec2cd;
  font-size: 12px;
  margin: 4px 0 12px;
}
.dash-skin-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.dash-skin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 112px;
  padding: 12px 8px;
  border: 1px solid #829ead55;
  border-radius: 16px;
  color: #edf9ee;
  background: #173044;
}
.dash-skin[aria-pressed="true"] {
  border-color: #9bffe5;
  background: #234951;
  box-shadow: inset 0 0 0 1px #9bffe5;
}
.dash-skin img {
  width: 70px;
  height: 45px;
  object-fit: contain;
}
.dash-skin small {
  color: #bed2d8;
  font-size: 10px;
}

/* Elemental controls use names and distinct symbols to supplement color. */
[data-element="fire"] {
  --element: #ee8959;
  --element-dark: #783c2d;
  --element-light: #ffe4b9;
}
[data-element="water"] {
  --element: #75d5ee;
  --element-dark: #255979;
  --element-light: #ddf9ff;
}
[data-element="wind"] {
  --element: #8ee1be;
  --element-dark: #245f58;
  --element-light: #e6fff1;
}
[data-element="earth"] {
  --element: #dcbd79;
  --element-dark: #685236;
  --element-light: #fff0cd;
}
#home {
  overflow-y: auto;
}
#home .hero {
  padding: 15px 0 12px;
}
#home h1 {
  font-size: 30px;
  max-width: 78%;
  margin: 9px 0;
}
#home .hero-art {
  top: 23px;
  width: 99px;
  height: 115px;
  right: -4px;
  opacity: 0.9;
}
#home .hero-dog {
  width: 106px;
}
#home .hero-shard {
  width: 55px;
  height: 68px;
}
.loadout {
  flex-shrink: 0;
  padding: 10px;
  border: 1px solid #94babd30;
  border-radius: 16px;
  background: #0f263bcc;
  margin-bottom: 10px;
}
.loadout-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 9px;
}
.loadout-heading strong {
  letter-spacing: 0.08em;
  color: #e9e8d3;
}
.loadout-heading span {
  color: #adc3cf;
  font-size: 8px;
}
#elementOptions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.element-option {
  position: relative;
  min-height: 65px;
  border: 1px solid #67859a55;
  border-radius: 10px;
  padding: 5px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: #19354c;
  color: var(--element);
}
.element-option svg {
  width: 25px;
  height: 25px;
}
.element-option strong {
  font-size: 11px;
}
.element-option small {
  font-size: 7px;
  color: #a8c0cb;
  letter-spacing: 0.04em;
}
.element-option[aria-pressed="true"] {
  border-color: var(--element);
  background: var(--element-dark);
  box-shadow: inset 0 0 0 1px var(--element);
  color: var(--element-light);
}
.element-option[aria-pressed="true"] small {
  color: var(--element-light);
}
#loadoutHint {
  margin: 8px 0 0;
  font-size: 10px;
  line-height: 1.4;
  color: #c4dcd9;
  min-height: 14px;
}
#missions {
  flex: 1 0 auto;
  overflow: visible;
}
.mission {
  min-height: 88px;
  padding: 10px;
  margin-bottom: 8px;
}
.mission-art {
  width: 49px;
  height: 56px;
  object-fit: cover;
  border-radius: 10px;
}
.home-footer {
  flex-shrink: 0;
}
.duo-summary {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}
.duo-summary > span {
  flex: 1;
  border: 1px solid var(--element);
  border-radius: 12px;
  color: var(--element-light);
  background: var(--element-dark);
  padding: 9px;
  display: grid;
  grid-template-columns: 25px 1fr;
  align-items: center;
  gap: 5px;
}
.duo-summary svg {
  width: 24px;
  height: 24px;
}
.duo-summary b {
  font-size: 12px;
}
.duo-summary small {
  grid-column: 1 / -1;
  font-size: 10px;
}
.dock {
  align-items: stretch;
  gap: 6px;
  bottom: 6px;
  left: 8px;
  right: 8px;
}
.dash-duo {
  display: flex;
  align-items: stretch;
  gap: 6px;
  flex-shrink: 0;
}
#dash.element-dash,
#dash2.element-dash {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  pointer-events: auto;
  touch-action: none;
  width: 60px;
  min-width: 48px;
  height: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border: 1px solid var(--element);
  border-radius: 15px;
  background: var(--element-dark);
  color: var(--element-light);
  box-shadow: 0 3px 0 #0a1b2c;
  padding: 4px 2px;
}
.element-dash .dash-symbol {
  display: block;
  width: 25px;
  height: 25px;
  color: var(--element);
}
.dash-symbol svg {
  width: 100%;
  height: 100%;
}
#dash.element-dash > strong,
#dash2.element-dash > strong {
  font-size: 10px;
  letter-spacing: 0.04em;
}
.element-dash .charge-text,
#charges {
  font-size: 9px;
  margin: 0;
  display: block;
}
.element-dash kbd {
  font: 8px system-ui;
  color: var(--element-light);
  opacity: 0.8;
}
.element-dash .dash-charge {
  position: absolute;
  inset: auto 0 0;
  height: 100%;
  width: 100%;
  background: #ffffff15;
  z-index: -1;
  pointer-events: none;
}
#dash.element-dash:disabled,
#dash2.element-dash:disabled {
  background: #263c50;
  color: #b8c9d1;
  border-color: #67859a66;
  box-shadow: 0 3px 0 #102031;
}
.element-dash:disabled .dash-symbol {
  opacity: 0.55;
}
#dash.element-dash.recommended:not(:disabled),
#dash2.element-dash.recommended:not(:disabled) {
  border: 2px solid var(--element-light);
  box-shadow:
    0 0 0 2px var(--element-dark),
    0 0 15px #e9f7e126;
}
#dash2.refilled {
  border-color: #b8ffff;
  box-shadow: 0 0 18px #9cebdd88;
}
@container (max-width: 300px) {
  #home {
    padding: 12px 12px 0;
  }
  #home h1 {
    font-size: 25px;
  }
  #home .hero-art {
    width: 76px;
    height: 90px;
    top: 28px;
  }
  #home .hero-dog {
    width: 88px;
  }
  .loadout {
    padding: 8px;
  }
  .loadout-heading span {
    font-size: 7px;
  }
  #dash.element-dash,
  #dash2.element-dash {
    width: 49px;
    height: 73px;
  }
  .dash-duo {
    gap: 5px;
  }
}

.notification-dot {
  position: absolute !important;
  z-index: 5;
  right: 7px;
  top: 5px;
  width: 10px !important;
  height: 10px !important;
  border-radius: 50%;
  background: #ff4e5f;
  border: 2px solid #fff;
  box-shadow: 0 0 8px #ff354d;
}
.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  text-align: left;
}
.shop-item {
  position: relative;
  padding: 9px;
  border: 1px solid #a6dced3d;
  border-radius: 16px;
  background: linear-gradient(145deg, #183a55, #10293f);
  text-align: center;
}
.shop-item.equipped {
  border-color: #7ff4d2;
  box-shadow: inset 0 0 0 1px #7ff4d2;
}
.shop-item img {
  width: 78px;
  height: 78px;
  object-fit: contain;
  filter: drop-shadow(0 5px 6px #0005);
}
.shop-item strong {
  display: block;
  font-size: 13px;
  color: #fff4cf;
}
.shop-item p {
  min-height: 27px;
  margin: 4px 0 7px;
  font-size: 9px;
  color: #a9c4d0;
}
.shop-item button {
  width: 100%;
  min-height: 38px;
  border-radius: 11px;
  background: #f1a93e;
  color: #40220d;
  font-size: 10px;
  font-weight: 900;
}
.shop-item button.owned {
  background: #4fc6a5;
  color: #092b27;
}
.shop-item button:disabled {
  background: #384d5d;
  color: #8fa2ac;
}
.price {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.price img {
  width: 18px;
  height: 18px;
}
.event-card {
  padding: 12px;
  border: 1px solid #ffdc794c;
  border-radius: 18px;
  background: linear-gradient(145deg, #174663, #172f4d);
}
.event-card img {
  width: 145px;
  height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 8px 8px #0005);
}
.event-card strong {
  display: block;
  color: #ffe19a;
  font-size: 18px;
}
.event-card p {
  color: #b9cfda;
  font-size: 11px;
}
.task-list {
  display: grid;
  gap: 8px;
  text-align: left;
}
.task-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  grid-template-areas:
    "check copy reward"
    "check copy action";
  align-items: center;
  gap: 3px 9px;
  padding: 10px;
  border: 1px solid #9adbd338;
  border-radius: 15px;
  background: linear-gradient(145deg, #193f5b, #122c46);
}
.task-row.claimed {
  border-color: #79d8bc55;
  background: linear-gradient(145deg, #1a4a55, #143844);
}
.task-check {
  grid-area: check;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  color: #87e8d0;
  background: #8ce5d31b;
}
.task-check svg {
  width: 20px;
  height: 20px;
}
.task-copy {
  grid-area: copy;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.task-copy strong {
  color: #f5ebc7;
  font-size: 12px;
  line-height: 1.2;
}
.task-copy small {
  overflow: hidden;
  color: #9eb9c8;
  font-size: 9px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-copy em {
  color: #8be1cf;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.task-reward {
  grid-area: reward;
  align-self: start;
  color: #ffdc83;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.task-reward small {
  display: block;
  color: #b8b897;
  font-size: 7px;
  letter-spacing: 0.08em;
  text-align: right;
}
.task-action {
  grid-area: action;
  min-width: 94px;
  min-height: 44px;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 10px;
}
.task-action:disabled {
  opacity: 0.72;
}
.danger {
  border-color: #ff9c8c66;
  color: #ffd7cf;
  background: #6b2830;
}
.danger-row {
  border-color: #ff95813d;
}
.task-footnote {
  margin: 10px 2px 0;
  color: #9eb5c1;
  font-size: 9px;
  line-height: 1.45;
}
.doge-wallet-coming-soon {
  margin: 12px 0 0;
  color: #f4cf7d;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
}
/* Elemental VFX refresh: familiar colors, MOBA controls and cinematic loading. */
[data-element="fire"] {
  --element: #ff6a32;
  --element-dark: #5a1718;
  --element-light: #fff0b8;
}
[data-element="water"] {
  --element: #20bfff;
  --element-dark: #073d73;
  --element-light: #e7fbff;
}
[data-element="wind"] {
  --element: #35e0a1;
  --element-dark: #0b5048;
  --element-light: #e5fff5;
}
[data-element="earth"] {
  --element: #f2a33a;
  --element-dark: #5b321c;
  --element-light: #fff0c5;
}

.element-glyph {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 3px 4px #050d1780);
}
.element-option {
  min-height: 72px;
  border-radius: 14px;
  padding: 6px 3px 5px;
}
.element-option .element-glyph {
  width: 34px;
  height: 34px;
  margin-bottom: 1px;
}
.element-option[aria-pressed="true"] {
  box-shadow:
    inset 0 0 0 1px var(--element),
    0 0 16px color-mix(in srgb, var(--element) 25%, transparent);
}
.duo-summary .element-glyph {
  width: 27px;
  height: 27px;
}

.dock {
  left: auto;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  width: auto;
  align-items: flex-end;
  z-index: 5;
}
.dash-duo {
  align-items: flex-end;
  gap: 12px;
}
#flap.flap-control {
  position: relative;
  pointer-events: auto;
  display: grid;
  place-content: center;
  gap: 1px;
  width: 58px;
  min-width: 58px;
  height: 58px;
  padding: 5px;
  border: 2px solid #d5f7ff;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 28%, #ffffff4d, #237c9b 42%, #0b344d 76%);
  color: #f4ffff;
  box-shadow:
    inset 0 0 0 2px #071521b8,
    0 4px 0 #07131d,
    0 7px 18px #02091280;
  touch-action: none;
}
#flap.flap-control > span {
  font-size: 25px;
  font-weight: 900;
  line-height: 0.75;
}
#flap.flap-control > small {
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.1em;
}
#flap.flap-control:active {
  transform: translateY(2px) scale(0.96);
  box-shadow:
    inset 0 0 0 2px #071521b8,
    0 2px 0 #07131d,
    0 4px 12px #02091280;
}
#dash.element-dash,
#dash2.element-dash {
  --charge: 100%;
  width: 74px;
  min-width: 74px;
  height: 74px;
  border: 3px solid color-mix(in srgb, var(--element-light) 82%, white);
  border-radius: 50%;
  padding: 11px;
  overflow: visible;
  background:
    radial-gradient(circle at 36% 28%, #ffffff26 0 10%, transparent 11%),
    radial-gradient(
      circle at 50% 58%,
      color-mix(in srgb, var(--element) 48%, var(--element-dark)),
      var(--element-dark) 68%
    );
  color: var(--element-light);
  box-shadow:
    inset 0 0 0 3px #071521b8,
    inset 0 -9px 13px #02090f6b,
    0 5px 0 #07131d,
    0 9px 22px #0209128c,
    0 0 19px color-mix(in srgb, var(--element) 34%, transparent);
  transition:
    filter 0.16s,
    transform 0.12s,
    box-shadow 0.16s;
}
#dash.element-dash::before,
#dash2.element-dash::before {
  content: "";
  position: absolute;
  inset: 5px;
  z-index: 0;
  border: 1px solid #ffffff2d;
  border-radius: 50%;
  pointer-events: none;
}
#dashCharge,
#dash2 .dash-charge {
  position: absolute;
  inset: -7px;
  width: auto;
  height: auto;
  z-index: 1;
  border-radius: 50%;
  background: conic-gradient(
    from -90deg,
    var(--element-light) var(--charge),
    #09172599 0
  );
  -webkit-mask: radial-gradient(circle, transparent 60%, #000 62%);
  mask: radial-gradient(circle, transparent 60%, #000 62%);
  pointer-events: none;
  filter: drop-shadow(0 0 5px var(--element));
}
.element-dash .dash-symbol {
  position: relative;
  z-index: 2;
  display: block;
  width: 48px;
  height: 48px;
  color: var(--element);
  transition:
    transform 0.18s,
    opacity 0.18s,
    filter 0.18s;
}
.element-dash .ready-pip {
  position: absolute;
  z-index: 3;
  right: 3px;
  bottom: 5px;
  width: 13px;
  height: 13px;
  border: 3px solid #102031;
  border-radius: 50%;
  background: #dfffb4;
  box-shadow: 0 0 9px #9dff78;
}
#dash.element-dash:disabled,
#dash2.element-dash:disabled {
  border-color: #5f7581;
  background: radial-gradient(circle at 45% 34%, #4a5e6b, #1b2d3c 68%);
  color: #8395a0;
  box-shadow:
    inset 0 0 0 3px #071521b8,
    0 4px 0 #07131d,
    0 7px 16px #02091280;
  filter: saturate(0.28);
}
.element-dash:disabled .dash-symbol {
  opacity: 0.44;
  filter: grayscale(0.45);
}
.element-dash:disabled .ready-pip {
  background: #556975;
  box-shadow: none;
}
#dash.element-dash.recommended:not(:disabled),
#dash2.element-dash.recommended:not(:disabled) {
  border-color: white;
  box-shadow:
    inset 0 0 0 3px #071521b8,
    0 5px 0 #07131d,
    0 0 0 5px color-mix(in srgb, var(--element) 38%, transparent),
    0 0 28px var(--element);
  animation: ability-ready 0.82s ease-in-out infinite alternate;
}
#dash.refilled,
#dash2.refilled {
  animation: ability-refill 0.42s ease-out;
}

#loading {
  justify-content: flex-start;
  gap: 0;
  overflow: hidden;
  padding: 58px 28px 36px;
  background:
    radial-gradient(circle at 50% 42%, #345b71 0, #17344c 26%, #0a1729 70%),
    linear-gradient(#17344c, #091627);
}
#loading::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.42;
  background-image: radial-gradient(#c6fff0 1px, transparent 1px);
  background-size: 29px 29px;
  mask-image: linear-gradient(transparent, #000 25%, #000 80%, transparent);
}
#loading .wordmark {
  position: relative;
  z-index: 2;
  font-size: 13px;
  letter-spacing: 0.36em;
}
#loading .wordmark span {
  font-size: 29px;
  margin-top: 7px;
}
.splash-sky,
.splash-sky i {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.splash-sky i {
  width: 220px;
  height: 56px;
  margin: auto;
  border-radius: 50%;
  border-top: 1px solid #9fffe05e;
  transform: rotate(-13deg) translateY(-105px);
}
.splash-sky i:nth-child(2) {
  transform: rotate(21deg) translateY(84px);
  opacity: 0.55;
}
.splash-sky i:nth-child(3) {
  transform: rotate(90deg) translateY(142px);
  opacity: 0.3;
}
.splash-stage {
  position: relative;
  z-index: 1;
  width: 245px;
  height: 245px;
  margin: 39px auto 30px;
  flex: 0 0 auto;
}
.splash-stage::before,
.splash-stage::after {
  content: "";
  position: absolute;
  inset: 25px;
  border: 1px solid #a8e8de38;
  border-radius: 50%;
  box-shadow:
    0 0 35px #70e5cc1a,
    inset 0 0 26px #72e7d212;
}
.splash-stage::after {
  inset: 50px;
  border-style: dashed;
  animation: orbit-back 9s linear infinite;
}
.splash-orbit {
  position: absolute;
  inset: 0;
  animation: orbit 11s linear infinite;
}
.splash-orbit img {
  position: absolute;
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 0 9px #8dfce262);
  animation: rune-float 1.8s ease-in-out infinite alternate;
}
.splash-orbit .rune-fire {
  top: 0;
  left: 99px;
}
.splash-orbit .rune-water {
  top: 99px;
  right: 0;
  animation-delay: -0.45s;
}
.splash-orbit .rune-wind {
  bottom: 0;
  left: 99px;
  animation-delay: -0.9s;
}
.splash-orbit .rune-earth {
  top: 99px;
  left: 0;
  animation-delay: -1.35s;
}
.splash-core {
  position: absolute;
  inset: 63px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 45% 40%,
    #fffce8,
    #ffcc68 14%,
    #5de3d2 44%,
    #173d57 67%,
    transparent 70%
  );
  filter: blur(0.3px) drop-shadow(0 0 22px #8fffe2a3);
  animation: core-pulse 1.15s ease-in-out infinite alternate;
}
#loading .splash-doge {
  position: absolute;
  z-index: 3;
  width: 132px;
  height: 106px;
  object-fit: contain;
  left: 56px;
  top: 69px;
  animation: splash-dash 1.5s ease-in-out infinite;
  filter: drop-shadow(0 10px 12px #020b1690);
}
#loadText {
  position: relative;
  z-index: 2;
  font-size: 12px;
  letter-spacing: 0.03em;
}
.loading-shell {
  position: relative;
  z-index: 2;
  width: min(100%, 340px);
  margin: 16px auto 0;
  display: flex;
  align-items: center;
  gap: 11px;
}
.loading-bar {
  position: relative;
  flex: 1;
  width: auto;
  height: 12px;
  padding: 3px;
  border: 1px solid #b6f6e34d;
  border-radius: 999px;
  overflow: hidden;
  background: repeating-linear-gradient(
    90deg,
    #081827 0 15px,
    #142d3d 15px 17px
  );
  box-shadow:
    inset 0 1px 4px #0008,
    0 0 18px #68e9ce16;
}
.loading-bar i {
  position: relative;
  z-index: 1;
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #36dfa3, #73f3dc 55%, #ffe59b);
  box-shadow: 0 0 13px #83ffe8;
  transition: width 0.2s ease-out;
}
.loading-bar i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    #fff9 50%,
    transparent 70%
  );
  animation: load-shine 1s linear infinite;
}
.loading-bar b {
  display: none;
}
#loadPercent {
  width: 36px;
  color: #fff0bb;
  font-size: 10px;
  font-weight: 900;
  text-align: right;
}
#loadDetail {
  position: relative;
  z-index: 2;
  margin: 12px 0 0;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: #91bfc5;
}
#loading #reload {
  position: relative;
  z-index: 2;
  width: min(100%, 300px);
  margin-top: 20px;
}

@keyframes orbit {
  to {
    transform: rotate(360deg);
  }
}
@keyframes orbit-back {
  to {
    transform: rotate(-360deg);
  }
}
@keyframes rune-float {
  to {
    transform: scale(1.08);
    filter: drop-shadow(0 0 14px #c5fff1aa);
  }
}
@keyframes core-pulse {
  to {
    transform: scale(1.09);
    opacity: 0.82;
  }
}
@keyframes splash-dash {
  50% {
    transform: translate(5px, -5px) rotate(-4deg);
  }
}
@keyframes load-shine {
  from {
    transform: translateX(-120%);
  }
  to {
    transform: translateX(120%);
  }
}
@keyframes ability-ready {
  to {
    transform: translateY(-2px) scale(1.035);
  }
}
@keyframes ability-refill {
  45% {
    transform: scale(1.16);
    filter: brightness(1.45);
  }
}

@container (max-width:300px) {
  .dock {
    right: 9px;
    bottom: 10px;
  }
  .dash-duo {
    gap: 7px;
  }
  #dash.element-dash,
  #dash2.element-dash {
    width: 62px;
    min-width: 62px;
    height: 62px;
    padding: 9px;
  }
  .element-dash .dash-symbol {
    width: 40px;
    height: 40px;
  }
  #flap.flap-control {
    width: 48px;
    min-width: 48px;
    height: 48px;
  }
  #flap.flap-control > span {
    font-size: 21px;
  }
  .splash-stage {
    width: 210px;
    height: 210px;
    margin-top: 28px;
  }
  .splash-orbit .rune-fire,
  .splash-orbit .rune-wind {
    left: 83px;
  }
  .splash-orbit .rune-water,
  .splash-orbit .rune-earth {
    top: 83px;
  }
  #loading .splash-doge {
    left: 39px;
    top: 52px;
  }
}

/* Atlas artwork shares image layout; decoration ignores input. */
.animated-art { pointer-events: none; }
.lobby-decoration { position: absolute; pointer-events: none; z-index: 1; object-fit: contain; }
.lobby-decoration.cloud { width: 96px; height: 96px; opacity: .45; bottom: 7px; }
.lobby-decoration.cloud.left { left: -12px; }
.lobby-decoration.cloud.right { right: -14px; bottom: 42px; }
.lobby-decoration.crystal { width: 36px; height: 36px; opacity: .75; top: 29px; }
.lobby-decoration.crystal.left { left: 36%; }
.lobby-decoration.crystal.right { right: 7px; top: 9px; }

/* Compact result reports and the three-tier bonus board. */
.card[data-kind="results"],
.card[data-kind="doge-roll"] {
  background: radial-gradient(ellipse at 50% 0, #355467 0, #193044 55%, #142738 100%);
  border-color: #a9d4da45;
  padding: 14px 20px 20px;
}
.card[data-kind="results"] #dialogArt,
.card[data-kind="doge-roll"] #dialogArt { display: none; }
.card[data-kind="results"] #dialogTitle { margin: 10px 0 6px; font-size: 29px; }
.card[data-kind="results"] #dialogText,
.card[data-kind="doge-roll"] #dialogText { margin: 8px auto 12px; max-width: 280px; line-height: 1.5; }
.card[data-kind="results"] #dialogActions { margin-top: 18px; }
.card[data-kind="results"] #dialogActions .secondary,
.card[data-kind="doge-roll"] #dialogActions .secondary {
  background: transparent; border-color: transparent; min-height: 44px;
}
.result-summary { display: grid; justify-items: center; }
.result-pieces { position: relative; width: 168px; height: 156px; margin: 4px auto 8px; perspective: 650px; }
.result-coin { position: absolute; inset: 10px 16px; transform-style: preserve-3d; }
.result-coin > div, .result-coin-cracks, .result-coin-sheen { position: absolute; inset: 0; width: 100%; height: 100%; }
.result-coin img { display: block; width: 100%; height: 100%; object-fit: contain; }
.result-coin-base { filter: grayscale(1); opacity: .13; }
.result-piece { opacity: 0; }
.result-piece.is-collected { opacity: 1; filter: drop-shadow(0 3px 3px #0005); }
.result-piece.piece-0 { clip-path: polygon(50% 0,100% 0,100% 80%,50% 50%); transform: translate(3px,-2px); }
.result-piece.piece-1 { clip-path: polygon(50% 50%,100% 80%,100% 100%,0 100%,0 80%); transform: translateY(4px); }
.result-piece.piece-2 { clip-path: polygon(0 0,50% 0,50% 50%,0 80%); transform: translate(-3px,-2px); }
.result-coin-cracks { fill: none; stroke: #775020; stroke-width: 1.3; pointer-events: none; opacity: 0; }
.result-coin-whole { opacity: 0; display: grid; place-items: center; }
.doge-whole-symbol {
  display: block; width: 100%; height: 100%; aspect-ratio: 1;
  object-fit: contain; border: 0; background: none; box-shadow: none;
}
.result-coin-glow { position: absolute; inset: -6px; border-radius: 50%; opacity: 0; background: radial-gradient(circle, #ffd86470, #ffda5930 40%, transparent 68%); }
.result-coin-sheen { border-radius: 50%; overflow: hidden; pointer-events: none; opacity: 0; background: linear-gradient(115deg, transparent 30%, #fff9daca 48%, transparent 65%); }
.result-spark { position: absolute; color: #ffe397; opacity: 0; font-size: 29px; }
.spark-one { left: 0; top: 18px; }
.spark-two { right: 1px; bottom: 10px; font-size: 21px; }
.result-piece-count { margin: 0 0 17px; font-size: 9px; font-weight: 700; letter-spacing: .12em; color: #b7cbd3; }
.result-piece-count strong { display: block; margin-bottom: 5px; font-size: 26px; letter-spacing: -.04em; color: #ffe1a0; }
.result-piece-count strong span { color: #91a9b7; font-size: 20px; }
.result-cookie-total { display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid #e8c27625; background: #ffdc8a09; border-radius: 14px; padding: 10px 18px; width: 100%; }
.result-cookie-total img { width: 26px; height: 26px; object-fit: contain; }
.result-cookie-total strong { color: #ffe1a0; font-size: 19px; }
.result-cookie-total span { font-size: 11px; color: #c1d1d8; }
.result-footnote { margin: 12px 0 0; max-width: 240px; color: #a4bcc8; font-size: 10px; line-height: 1.5; }
.result-distance { padding: 22px; }
.result-distance strong { display: block; font-size: 52px; color: #ffe1a0; }
.result-distance span { font-size: 10px; letter-spacing: .15em; }
.is-complete .result-piece { animation: result-assemble .7s cubic-bezier(.2,.75,.2,1) both; }
.is-complete .result-coin { animation: result-coin-turn .9s .7s cubic-bezier(.45,0,.2,1) both; }
.is-complete .result-coin-whole { animation: result-repair .35s 1.65s both; }
.is-complete .result-coin-cracks { animation: result-cracks .35s 1.65s both; }
.is-complete .result-coin-glow { animation: result-shine .7s 2s both; }
.is-complete .result-coin-sheen { animation: result-sheen .65s 2s both; }
.is-complete .result-spark { animation: result-spark .6s 2.05s both; }
@keyframes result-assemble { from { opacity: 0; translate: 0 14px; scale: 1.12; } to { opacity: 1; transform: translate(0,0); translate: 0 0; scale: 1; } }
@keyframes result-coin-turn { from { transform: rotateY(0); } to { transform: rotateY(720deg); } }
@keyframes result-repair { from { opacity: 0; } to { opacity: 1; } }
@keyframes result-cracks { from { opacity: 1; } to { opacity: 0; } }
@keyframes result-shine { 0% { opacity: 0; scale: .7; } 50% { opacity: 1; scale: 1.12; } 100% { opacity: .6; scale: 1; } }
@keyframes result-sheen { 0% { opacity: 0; translate: -20% 0; } 45% { opacity: .9; } 100% { opacity: 0; translate: 20% 0; } }
@keyframes result-spark { 0% { opacity: 0; scale: .4; } 55% { opacity: 1; scale: 1.1; } 100% { opacity: .6; scale: 1; } }
@container (max-width: 340px) {
  .card[data-kind="results"] { padding: 10px 12px 14px; }
  .card[data-kind="results"] #dialogTitle { font-size: 25px; }
  .result-pieces { width: 140px; height: 134px; }
  .result-coin { inset: 12px 15px; }
  .result-piece-count { margin-bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .is-complete .result-piece { transform: none; }
  .is-complete .result-coin-whole, .is-complete .result-coin-glow { opacity: 1; }
  .is-complete .result-coin-cracks, .is-complete .result-coin-sheen, .is-complete .result-spark { opacity: 0; }
}
.audio-settings { display: grid; gap: 12px; text-align: left; margin: 14px 0 20px; padding: 14px; border: 1px solid #94bbc344; border-radius: 14px; background: #102c40; }
.audio-slider { display: grid; grid-template-columns: minmax(85px, 1fr) minmax(70px, 1.3fr) 36px; gap: 8px; align-items: center; font-size: 11px; }
.audio-slider input { width: 100%; min-width: 0; min-height: 44px; touch-action: pan-y; accent-color: #f2c56f; }
.audio-slider output { text-align: right; font-variant-numeric: tabular-nums; }
.audio-preset { display: grid; gap: 6px; font-size: 11px; }
.audio-preset select { max-width: 100%; width: 100%; min-height: 44px; border-radius: 9px; padding: 8px; background: #183b51; color: #fff1c9; border: 1px solid #94bbc344; }
.audio-caption { position: fixed; bottom: max(108px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 150; pointer-events: none; padding: 6px 14px; border-radius: 20px; color: #fff0bf; background: #0d243ada; font-weight: 800; font-size: 16px; }
#pendingDogeRolls:empty { display: none; }
#pendingDogeRolls { margin-top: 12px; }

.rotate-hint {
  display: none;
}
@media (orientation: landscape) and (max-height: 500px) and (min-width: 600px) and (max-width: 1000px) {
  body:has(#hud:not([hidden])) .rotate-hint {
    position: fixed;
    left: 22px;
    top: 50%;
    display: grid;
    width: min(250px, calc((100vw - 56.25dvh) / 2 - 44px));
    min-width: 150px;
    translate: 0 -50%;
    gap: 7px;
    padding: 18px;
    border: 1px solid #c4e5e33b;
    border-radius: 18px;
    background: #102b43e8;
    box-shadow: 0 14px 40px #020b1680;
    color: #d8eeeb;
    pointer-events: none;
  }
  .rotate-hint > span {
    color: #ffe1a0;
    font-size: 34px;
    line-height: 1;
  }
  .rotate-hint strong {
    color: #fff0be;
    font-size: 16px;
  }
  .rotate-hint small {
    color: #a9c8d4;
    font-size: 10px;
    line-height: 1.5;
  }
}
