:root {
  color-scheme: light;
  --ink: #243046;
  --muted: #7c879c;
  --glass: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --line: rgba(255, 255, 255, 0.74);
  --pink: #ff8db7;
  --mint: #72dfca;
  --sky: #92d5ff;
  --lemon: #ffe59a;
  --lav: #c5b6ff;
  --peach: #ffb79d;
  --shadow: 0 24px 70px rgba(102, 126, 157, 0.22);
  --soft-shadow: 0 12px 36px rgba(102, 126, 157, 0.16);
  --prestige-primary: #72dfca;
  --prestige-accent: #ffe59a;
  --prestige-glow: rgba(114, 223, 202, 0.28);
  --mochi-ease: cubic-bezier(0.2, 1.65, 0.34, 0.96);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  overscroll-behavior: none;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.68), transparent 25%),
    linear-gradient(115deg, rgba(115, 213, 228, 0.38), transparent 38%),
    linear-gradient(250deg, rgba(48, 153, 199, 0.28), transparent 42%),
    linear-gradient(180deg, #eafcff 0%, #c9f2f7 45%, #9fdce9 100%);
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    repeating-radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.18) 0 2px, transparent 3px 20px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 46%, rgba(255, 255, 255, 0.1));
  background-position: 0 0, 0 0;
  background-size: 180px 54px, 100% 100%;
  opacity: 0.22;
  animation: lakeDrift 16s linear infinite;
}

body::after {
  content: "";
  position: fixed;
  inset: -18%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 24% 72%, rgba(255, 255, 255, 0.16), transparent 34%),
    radial-gradient(ellipse at 72% 20%, rgba(125, 224, 236, 0.14), transparent 36%),
    repeating-linear-gradient(168deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 2px 46px);
  opacity: 0.32;
  transform: rotate(-3deg);
  animation: surfaceSwell 9s ease-in-out infinite alternate;
}

button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.app-shell {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 34px);
  min-height: calc(100svh - 34px);
  padding: 16px 14px;
  padding: max(16px, env(safe-area-inset-top)) 14px max(16px, env(safe-area-inset-bottom));
}

.game-panel {
  width: min(440px, 100%);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.82), rgba(219, 246, 252, 0.52)),
    linear-gradient(180deg, rgba(118, 218, 226, 0.2), rgba(69, 167, 205, 0.12));
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(22px) saturate(1.24);
  backdrop-filter: blur(22px) saturate(1.24);
}

.game-panel::before {
  content: "";
  position: absolute;
  left: -28%;
  right: -28%;
  bottom: 82px;
  height: 82px;
  pointer-events: none;
  opacity: 0.14;
  background:
    repeating-linear-gradient(105deg, transparent 0 22px, rgba(255, 255, 255, 0.48) 22px 25px),
    linear-gradient(90deg, rgba(40, 171, 191, 0.3), rgba(84, 196, 224, 0.34), rgba(255, 255, 255, 0.2));
  transform: skewY(-4deg);
}

.game-panel > * {
  position: relative;
  z-index: 1;
}

.topbar {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 46px;
  align-items: start;
  gap: 10px;
}

.title-block {
  display: grid;
  justify-items: center;
  gap: 5px;
  text-align: center;
}

.kicker {
  display: block;
  color: #ff779f;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1,
h2 {
  font-family: "Baloo 2", Inter, sans-serif;
  letter-spacing: 0;
}

h1 {
  font-size: 0.86rem;
  line-height: 1;
}

.title-block .kicker {
  color: var(--ink);
  font-family: "Baloo 2", Inter, sans-serif;
  font-size: clamp(1.78rem, 7vw, 2.35rem);
  line-height: 0.96;
}

.title-block h1 {
  display: inline-grid;
  min-height: 26px;
  place-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.54);
  color: var(--muted);
  box-shadow: 0 8px 24px rgba(102, 126, 157, 0.12);
  backdrop-filter: blur(14px);
}

.icon-button,
.glass-button,
.primary-button {
  min-height: 44px;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 850;
  white-space: nowrap;
  transition: transform 150ms ease, filter 150ms ease, box-shadow 150ms ease;
}

.icon-button {
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.54);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(16px);
}

.icon-button span {
  font-size: 1.45rem;
  letter-spacing: 0;
}

.icon-button.is-on {
  background: linear-gradient(135deg, var(--mint), var(--sky));
  color: #fff;
}

.scorebar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin: 13px 0 8px;
}

.journey-strip {
  display: grid;
  grid-template-columns: minmax(78px, 0.82fr) minmax(78px, 0.78fr) minmax(92px, 1fr) minmax(90px, 0.92fr);
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.journey-strip > div,
.chest-button {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(18px);
}

.tiny-label,
.chest-button span {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 850;
}

.journey-strip strong,
.chest-button strong {
  display: block;
  margin-top: 3px;
  font-size: 0.86rem;
  line-height: 1;
}

.milestone-track {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  align-items: center;
  gap: 3px;
}

.milestone-track i {
  display: block;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 3px rgba(102, 126, 157, 0.12);
}

.milestone-track i.is-done {
  background: linear-gradient(135deg, var(--mint), var(--sky));
}

.milestone-track i.is-current {
  transform: translateY(-2px);
  box-shadow: 0 0 0 4px rgba(114, 223, 202, 0.18);
}

.chest-button {
  text-align: left;
}

.chest-button.is-ready {
  background: linear-gradient(135deg, rgba(255, 229, 154, 0.82), rgba(255, 141, 183, 0.38));
}

.scorebar article {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(18px);
}

.scorebar span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.scorebar strong {
  display: block;
  margin-top: 3px;
  font-size: 1.36rem;
  line-height: 1;
}

.score-card strong {
  color: #ff779f;
}

.streak-card.is-fire {
  animation: firePulse 680ms ease-in-out infinite alternate;
}

.streak-card.is-fire strong::after {
  content: " ROW";
  color: #ff779f;
  font-size: 0.58rem;
  vertical-align: middle;
}

.hint-line {
  min-height: 22px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
}

.goal-strip {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 60px;
  margin-bottom: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.46);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(18px);
}

.goal-strip #goalIcon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.goal-strip strong {
  display: block;
  font-size: 0.9rem;
  line-height: 1.08;
}

.goal-strip p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.25;
}

.board-card {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(298px, 54vh, 402px);
  min-height: clamp(298px, 54svh, 402px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(219, 248, 252, 0.32)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.2) 0 2px, transparent 2px 22px),
    linear-gradient(135deg, rgba(122, 224, 221, 0.24), rgba(122, 190, 240, 0.24));
  box-shadow: inset 0 1px 18px rgba(255, 255, 255, 0.4);
  overflow: hidden;
}

.board-card::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 46px;
  height: 38px;
  pointer-events: none;
  opacity: 0.2;
  border-radius: 999px;
  background:
    radial-gradient(circle at 12% 50%, rgba(255, 95, 143, 0.62) 0 5px, transparent 6px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.58) 0 26px, rgba(58, 183, 207, 0.2) 26px 38px),
    linear-gradient(90deg, rgba(64, 190, 204, 0.3), rgba(106, 203, 238, 0.3));
}

.board-card::after {
  content: "";
  position: absolute;
  inset: auto -14% -22% -14%;
  height: 42%;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(255, 255, 255, 0.5), transparent 30%),
    radial-gradient(ellipse at 70% 0%, rgba(255, 255, 255, 0.42), transparent 34%),
    linear-gradient(180deg, rgba(90, 211, 224, 0), rgba(71, 174, 207, 0.28));
  opacity: 0.52;
  transform: translateY(18%);
  transition: transform 420ms ease, opacity 420ms ease;
}

.is-level-failed .board-card::after {
  opacity: 0.96;
  transform: translateY(-32%);
  animation: floodWash 1.1s ease-in-out both;
}

.board,
.progress-chip,
.mochi-progress {
  position: relative;
  z-index: 1;
}

.progress-chip {
  position: absolute;
  bottom: 14px;
  left: 22px;
  right: 22px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.44);
  box-shadow: inset 0 1px 12px rgba(255, 255, 255, 0.62), 0 10px 28px rgba(102, 126, 157, 0.12);
  font-weight: 850;
  backdrop-filter: blur(14px);
}

.mochi-progress {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: center;
  gap: 7px;
  z-index: 4;
}

.mochi-progress i {
  width: 18px;
  height: 15px;
  border-radius: 45% 45% 48% 48%;
  background: rgba(255, 255, 255, 0.62);
  box-shadow:
    inset 0 6px 8px rgba(255, 255, 255, 0.4),
    0 5px 12px rgba(102, 126, 157, 0.1);
  transition: transform 340ms var(--mochi-ease), background 340ms ease;
}

.mochi-progress i.is-done {
  background: var(--dot);
  transform: translateY(-3px) scale(1.08, 0.94);
}

.progress-chip::before {
  content: "";
  position: absolute;
  inset: 2px auto 2px 2px;
  width: var(--progress, 0%);
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(255, 141, 183, 0.82), rgba(114, 223, 202, 0.9), rgba(146, 213, 255, 0.88)),
    repeating-linear-gradient(120deg, rgba(255, 255, 255, 0.22) 0 9px, transparent 9px 18px);
  box-shadow: 0 0 18px rgba(114, 223, 202, 0.32);
  transition: width 420ms var(--mochi-ease);
}

.progress-chip span {
  position: relative;
  z-index: 1;
  padding-right: 10px;
  color: var(--ink);
  font-size: 0.78rem;
}

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(46px, 66px));
  grid-template-columns: repeat(var(--cols), minmax(46px, 66px));
  gap: 12px;
  align-items: end;
  justify-content: center;
  width: 100%;
  padding: 86px 16px 78px;
}

.board.cols-3 {
  grid-template-columns: repeat(3, minmax(46px, 66px));
}

.board.cols-4 {
  grid-template-columns: repeat(4, minmax(46px, 66px));
}

.board.cols-5 {
  grid-template-columns: repeat(5, minmax(46px, 66px));
}

.tube {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 8px;
  height: clamp(162px, 27vw, 220px);
  padding: 29px 9px 24px;
  border: 2px solid var(--dragon-glow, rgba(108, 190, 210, 0.52));
  border-radius: 34px 34px 50px 50px / 20px 20px 58px 58px;
  overflow: visible;
  background:
    radial-gradient(ellipse at 50% -8%, rgba(255, 236, 151, 0.86) 0 18px, transparent 19px),
    linear-gradient(90deg, var(--dragon-deep, #25556f) 0 5px, var(--dragon, #72dfca) 6px 10px, rgba(255, 255, 255, 0.52) 11px calc(100% - 11px), var(--dragon, #72dfca) calc(100% - 10px) calc(100% - 6px), var(--dragon-deep, #25556f) calc(100% - 5px)),
    repeating-linear-gradient(135deg, var(--dragon-scale, rgba(255, 255, 255, 0.16)) 0 5px, transparent 6px 14px),
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.88) 0,
      rgba(255, 255, 255, 0.88) calc(25% - 9px),
      rgba(48, 135, 170, 0.13) calc(25% - 9px),
      rgba(48, 135, 170, 0.13) 25%
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(221, 249, 252, 0.5));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.62),
    0 10px 22px rgba(76, 129, 155, 0.12),
    0 0 18px var(--dragon-soft, rgba(114, 223, 202, 0.16));
  backdrop-filter: blur(16px);
  touch-action: none;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  user-select: none;
  -webkit-user-select: none;
}

.tube::after {
  content: "";
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: -30px;
  z-index: 0;
  height: 52px;
  border-radius: 10px 10px 999px 999px / 8px 8px 84% 84%;
  background:
    radial-gradient(ellipse at 14% 70%, rgba(255, 238, 151, 0.94) 0 7px, transparent 8px),
    radial-gradient(ellipse at 86% 70%, rgba(255, 238, 151, 0.94) 0 7px, transparent 8px),
    linear-gradient(90deg, transparent 0 6%, var(--dragon-gold, #f6d66f) 7% 12%, transparent 13% 88%, var(--dragon-gold, #f6d66f) 89% 94%, transparent 95%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0 4px, transparent 5px 12px),
    repeating-linear-gradient(90deg, var(--dragon-deep, #25556f) 0 7px, var(--dragon-gold, #f6d66f) 7px 10px, var(--dragon, #72dfca) 10px 18px),
    linear-gradient(90deg, var(--dragon-soft, rgba(57, 176, 209, 0.22)), rgba(255, 255, 255, 0.58), var(--dragon-soft, rgba(57, 176, 209, 0.2)));
  clip-path: polygon(4% 18%, 18% 6%, 50% 0, 82% 6%, 96% 18%, 90% 70%, 68% 94%, 32% 94%, 10% 70%);
  opacity: 0.96;
  transform: perspective(90px) rotateX(18deg) translateY(0);
  filter:
    drop-shadow(0 8px 10px rgba(55, 145, 176, 0.2))
    drop-shadow(0 0 14px var(--dragon-glow, rgba(114, 223, 202, 0.18)));
  animation: dragonTailDrift 3.8s ease-in-out infinite;
}

.tube::before {
  content: "";
  position: absolute;
  top: -61px;
  left: 50%;
  width: 116px;
  height: 86px;
  z-index: 3;
  background:
    radial-gradient(circle at 37% 49%, var(--dragon-eye, #ffef7a) 0 3px, var(--dragon-deep, #143451) 4px 7px, transparent 8px),
    radial-gradient(circle at 63% 49%, var(--dragon-eye, #ffef7a) 0 3px, var(--dragon-deep, #143451) 4px 7px, transparent 8px),
    linear-gradient(90deg, transparent 0 8%, var(--dragon-gold, #f6d66f) 9% 16%, transparent 17% 83%, var(--dragon-gold, #f6d66f) 84% 91%, transparent 92%),
    linear-gradient(36deg, transparent 0 15%, var(--dragon-gold, #f6d66f) 16% 27%, transparent 28%),
    linear-gradient(-36deg, transparent 0 15%, var(--dragon-gold, #f6d66f) 16% 27%, transparent 28%),
    radial-gradient(ellipse at 50% 6%, var(--dragon-fire, #ff3f61) 0 16%, var(--dragon-gold, #f6d66f) 17% 34%, transparent 35%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.28) 0 3px, transparent 4px 10px),
    radial-gradient(circle at 50% 25%, rgba(255, 255, 255, 0.68), transparent 19px),
    linear-gradient(180deg, var(--dragon-gold, #f6d66f) 0 12%, var(--dragon, #72dfca) 13% 64%, var(--dragon-deep, #25556f) 100%);
  clip-path: polygon(50% 0, 58% 10%, 71% 4%, 69% 22%, 96% 7%, 84% 34%, 100% 48%, 78% 58%, 90% 86%, 64% 78%, 50% 100%, 36% 78%, 10% 86%, 22% 58%, 0 48%, 16% 34%, 4% 7%, 31% 22%, 29% 4%, 42% 10%);
  opacity: 0.96;
  transform: translateX(-50%) scale(0.96);
  filter:
    drop-shadow(0 3px 0 rgba(255, 255, 255, 0.55))
    drop-shadow(0 8px 12px rgba(79, 136, 159, 0.28))
    drop-shadow(0 0 16px var(--dragon-glow, rgba(255, 219, 107, 0.22)));
  box-shadow:
    -43px 24px 0 -28px var(--dragon-deep, rgba(37, 85, 111, 0.82)),
    43px 24px 0 -28px var(--dragon-deep, rgba(37, 85, 111, 0.82)),
    -54px 33px 0 -36px var(--dragon-gold, rgba(246, 214, 111, 0.9)),
    54px 33px 0 -36px var(--dragon-gold, rgba(246, 214, 111, 0.9)),
    -24px -8px 0 -15px var(--dragon-fire, rgba(255, 63, 97, 0.88)),
    24px -8px 0 -15px var(--dragon-fire, rgba(255, 63, 97, 0.88)),
    0 -15px 0 -9px rgba(255, 235, 142, 0.96);
  animation: dragonHeadIdle 3.8s ease-in-out infinite;
  transition: opacity 180ms ease, transform 180ms ease, filter 180ms ease;
}

.tube.has-dragon-color {
  border-color: var(--dragon-glow, rgba(114, 223, 202, 0.58));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.68),
    0 10px 22px rgba(76, 129, 155, 0.12),
    0 0 26px var(--dragon-soft, rgba(114, 223, 202, 0.24));
}

.tube.has-dragon-color .block {
  box-shadow:
    inset 0 -8px 12px rgba(255, 255, 255, 0.26),
    inset 0 2px 8px rgba(255, 255, 255, 0.34),
    0 10px 18px var(--dragon-soft, rgba(114, 223, 202, 0.16));
}

.tube.has-dragon-color[data-tier="2"],
.tube.has-dragon-color[data-tier="3"],
.tube.has-dragon-color[data-tier="4"] {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.72),
    0 14px 30px rgba(76, 129, 155, 0.16),
    0 0 34px var(--dragon-glow, rgba(114, 223, 202, 0.48));
}

.tube.has-dragon-color[data-tier="3"]::before,
.tube.has-dragon-color[data-tier="4"]::before {
  animation: dragonHeadIdle 3.2s ease-in-out infinite, dragonPrestigePulse 1.8s ease-in-out infinite alternate;
}

.tube.has-dragon-color[data-tier="4"]::after {
  filter: drop-shadow(0 10px 12px rgba(53, 139, 171, 0.16)) drop-shadow(0 0 16px var(--prestige-glow));
}

.tube.is-empty-boat {
  border-color: rgba(186, 218, 228, 0.48);
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.58) 0,
      rgba(255, 255, 255, 0.58) calc(25% - 7px),
      rgba(119, 197, 216, 0.1) calc(25% - 7px),
      rgba(119, 197, 216, 0.1) 25%
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(229, 250, 252, 0.28));
}

.tube.is-empty-boat::before,
.tube.is-empty-boat::after {
  opacity: 0.36;
  filter: grayscale(0.25) drop-shadow(0 8px 10px rgba(55, 145, 176, 0.14));
}

.tube:hover,
.tube:focus-visible,
.tube.is-selected {
  border-color: rgba(255, 141, 183, 0.95);
  outline: 0;
  transform: translateY(-6px);
  box-shadow: 0 0 0 5px rgba(255, 141, 183, 0.16), var(--soft-shadow);
}

.tube.is-suggested-to {
  border-color: rgba(114, 223, 202, 0.98);
  box-shadow: 0 0 0 5px rgba(114, 223, 202, 0.18), var(--soft-shadow);
}

.tube.is-suggested-to::before,
.tube.is-magnetic::before {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px) scale(1.08);
  filter:
    drop-shadow(0 0 0 rgba(255, 255, 255, 0.8))
    drop-shadow(0 0 14px rgba(114, 223, 202, 0.72))
    drop-shadow(0 10px 14px rgba(79, 136, 159, 0.28));
}

.tube.is-magnetic {
  border-color: rgba(114, 223, 202, 1);
  transform: translateY(-10px) scale(1.035);
  box-shadow:
    0 0 0 7px rgba(114, 223, 202, 0.24),
    0 18px 38px rgba(114, 223, 202, 0.24),
    var(--soft-shadow);
}

.tube.is-magnetic .block:last-child {
  transform: scale(1.05, 0.95);
}

.tube.is-suggested-from {
  border-color: rgba(197, 182, 255, 0.98);
  box-shadow: 0 0 0 5px rgba(197, 182, 255, 0.18), var(--soft-shadow);
}

.tube.is-bad-target {
  animation: tubeNope 260ms ease;
  border-color: rgba(255, 132, 132, 0.98);
  box-shadow: 0 0 0 5px rgba(255, 132, 132, 0.18), var(--soft-shadow);
}

.tube.is-complete {
  border-color: rgba(151, 222, 166, 0.98);
  animation: completedDragonBoatSail 1120ms var(--mochi-ease) both;
}

.tube.is-complete::before {
  animation: dragonHeadGlow 1120ms ease-out both;
}

.tube.is-complete::after {
  animation: wakeTrail 1120ms ease-out both;
}

.tube.is-capsized {
  animation: boatCapsize 780ms ease-in both;
  transform-origin: 50% 88%;
  border-color: rgba(79, 139, 177, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.32),
    0 16px 32px rgba(29, 91, 122, 0.22);
}

.block {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
  border-radius: 11px;
  clip-path: none;
  background-color: #ff8db7;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.04) 46%, rgba(21, 48, 66, 0.1) 100%),
    var(--block, #ff8db7);
  transform-origin: center bottom;
  box-shadow:
    inset 0 8px 12px rgba(255, 255, 255, 0.32),
    inset 0 -8px 12px rgba(42, 65, 85, 0.12),
    0 6px 12px rgba(75, 113, 138, 0.14);
}

.block::before {
  content: none;
}

.block::after {
  content: "";
  position: relative;
  z-index: 2;
  color: rgba(255, 255, 255, 0.94);
  width: 40%;
  height: 40%;
  border-radius: 50%;
  background: currentColor;
  filter: drop-shadow(0 2px 5px rgba(44, 68, 92, 0.14));
}

.shape-spark::after {
  width: 42%;
  height: 42%;
  clip-path: polygon(50% 0, 61% 35%, 100% 50%, 61% 64%, 50% 100%, 38% 64%, 0 50%, 38% 35%);
  border-radius: 0;
}

.shape-gem::after {
  width: 34%;
  height: 34%;
  border-radius: 4px;
  transform: rotate(45deg);
}

.shape-bar::after {
  width: 52%;
  height: 16%;
  border-radius: 999px;
}

.shape-leaf::after {
  width: 40%;
  height: 28%;
  border-radius: 90% 10% 90% 10%;
  transform: rotate(-28deg);
}

.shape-moon::after {
  width: 38%;
  height: 38%;
  background: transparent;
  box-shadow: inset 8px 0 0 rgba(255, 255, 255, 0.78);
}

.shape-ring::after {
  width: 42%;
  height: 42%;
  border: 5px solid rgba(255, 255, 255, 0.78);
  background: transparent;
}

.block.is-pop {
  animation: mochiLand 420ms var(--mochi-ease);
}

.block.is-floating {
  animation: floatMochi 1.25s ease-in-out infinite;
  box-shadow:
    inset 0 11px 18px rgba(255, 255, 255, 0.42),
    inset 0 -12px 18px rgba(75, 58, 82, 0.12),
    0 0 0 4px rgba(255, 255, 255, 0.68),
    0 12px 28px rgba(255, 141, 183, 0.32);
}

.block.is-grabbed {
  animation: mochiGrab 360ms var(--mochi-ease);
}

.tube.is-complete .block {
  animation: dragonBoatRowAway 720ms var(--mochi-ease);
}

.drag-ghost {
  position: fixed;
  z-index: 80;
  width: 48px;
  height: 48px;
  pointer-events: none;
  transform: translate(-50%, -78%) scale(1.05);
  opacity: 0.96;
  box-shadow:
    inset 0 11px 18px rgba(255, 255, 255, 0.42),
    inset 0 -12px 18px rgba(75, 58, 82, 0.12),
    0 0 0 6px rgba(255, 255, 255, 0.62),
    0 18px 42px rgba(255, 141, 183, 0.32);
  animation: dragBreath 620ms var(--mochi-ease) infinite alternate;
}

.is-dragging-mochi {
  cursor: grabbing;
}

.action-row {
  display: grid;
  grid-template-columns: 92px 1fr 92px;
  gap: 8px;
  margin-top: 11px;
}

.glass-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.54);
  backdrop-filter: blur(16px);
}

.primary-button {
  background: linear-gradient(135deg, var(--pink), var(--peach) 48%, var(--lemon));
  color: #fff;
  box-shadow: 0 14px 30px rgba(255, 141, 183, 0.3);
}

.thumb-button,
.reward-button {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  font-weight: 850;
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(16px);
}

.thumb-button span,
.thumb-button strong {
  display: block;
  line-height: 1.05;
}

.thumb-button span {
  color: var(--muted);
  font-size: 0.72rem;
}

.thumb-button strong {
  margin-top: 4px;
}

.reward-button {
  background: linear-gradient(135deg, var(--mint), var(--sky));
  color: #fff;
}

.reward-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.55);
  opacity: 0.58;
}

.more-menu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.more-menu[hidden] {
  display: none;
}

.icon-button:hover,
.glass-button:hover,
.primary-button:hover,
.thumb-button:hover,
.reward-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
}

.glass-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.thumb-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.guide-layer,
.win-layer,
.level-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(238, 248, 255, 0.62);
  backdrop-filter: blur(18px);
}

.guide-layer[hidden],
.win-layer[hidden],
.level-layer[hidden] {
  display: none;
}

.guide-card,
.win-card,
.level-card {
  position: relative;
  width: min(390px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(1.2);
  text-align: center;
}

.guide-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  font-size: 1.25rem;
}

.guide-card h2,
.win-card h2,
.level-card h2 {
  margin: 4px 0 12px;
  font-size: 2rem;
  line-height: 1;
}

.level-card {
  width: min(520px, 100%);
  text-align: left;
}

.level-card > p {
  margin: 0 42px 14px 0;
  color: var(--muted);
  line-height: 1.45;
}

.level-actions {
  display: grid;
  grid-template-columns: 1fr 145px;
  gap: 8px;
  margin-bottom: 14px;
}

.danger-button {
  color: #e84c7e;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 7px;
  max-height: min(48vh, 360px);
  overflow: auto;
  padding: 4px 2px 2px;
}

.level-pill {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  font-weight: 850;
  box-shadow: 0 8px 18px rgba(91, 119, 142, 0.1);
}

.level-pill.is-current {
  border-color: rgba(255, 141, 183, 0.72);
  background: linear-gradient(135deg, rgba(255, 141, 183, 0.95), rgba(255, 211, 123, 0.9));
  color: #fff;
}

.level-pill.is-locked {
  color: rgba(116, 128, 150, 0.58);
  background: rgba(255, 255, 255, 0.34);
  box-shadow: none;
}

.level-pill.is-locked::before,
.level-pill.is-locked::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.level-pill.is-locked::before {
  top: 10px;
  width: 13px;
  height: 11px;
  border: 2px solid rgba(116, 128, 150, 0.42);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.level-pill.is-locked::after {
  top: 18px;
  width: 18px;
  height: 13px;
  border-radius: 5px;
  background: rgba(116, 128, 150, 0.36);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.38);
}

.timer-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  margin-top: 5px;
  padding: 4px 12px;
  overflow: hidden;
  border-radius: 999px;
  color: #234258;
  font-size: 0.78rem;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72), 0 8px 18px rgba(69, 128, 156, 0.12);
}

.timer-pill::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--time-left, 100%);
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(115, 216, 203, 0.68), rgba(137, 213, 246, 0.46));
  transition: width 220ms linear;
}

.is-time-low .timer-pill {
  color: #b3284f;
  animation: pulseTimer 740ms ease-in-out infinite alternate;
}

@media (max-width: 520px) {
  .level-actions {
    grid-template-columns: 1fr;
  }

  .level-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* Overseas launch polish: a bright festival-jewel system for cozy sort players. */
:root {
  --ink: #18344c;
  --muted: #61758d;
  --pink: #f4558d;
  --mint: #23c8b0;
  --sky: #39a9e9;
  --lemon: #f3bd3d;
  --lav: #9a76e8;
  --peach: #ff7b55;
  --line: rgba(255, 255, 255, 0.86);
  --shadow: 0 24px 64px rgba(37, 101, 134, 0.22);
  --soft-shadow: 0 10px 26px rgba(53, 104, 137, 0.14);
}

body {
  background:
    linear-gradient(138deg, rgba(255, 255, 255, 0.74) 0 15%, transparent 15% 100%),
    linear-gradient(46deg, rgba(255, 125, 153, 0.2) 0 13%, transparent 13% 78%, rgba(154, 118, 232, 0.16) 78% 100%),
    linear-gradient(180deg, #dbfbfa 0%, #bdeef4 48%, #80d1e2 100%);
}

body::before {
  background-image:
    repeating-linear-gradient(168deg, rgba(255, 255, 255, 0.2) 0 2px, transparent 2px 30px),
    repeating-linear-gradient(12deg, rgba(33, 170, 188, 0.08) 0 1px, transparent 1px 42px);
  background-size: 100% 72px, 100% 96px;
  opacity: 0.42;
}

body::after {
  background:
    repeating-linear-gradient(90deg, transparent 0 88px, rgba(255, 255, 255, 0.1) 88px 90px),
    linear-gradient(168deg, transparent 0 43%, rgba(255, 255, 255, 0.16) 43% 45%, transparent 45% 100%);
  opacity: 0.34;
}

.game-panel {
  width: min(472px, 100%);
  border-color: rgba(255, 255, 255, 0.94);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.91), rgba(226, 249, 250, 0.72)),
    linear-gradient(90deg, rgba(244, 85, 141, 0.08), rgba(35, 200, 176, 0.1) 48%, rgba(154, 118, 232, 0.08));
  box-shadow:
    0 0 0 1px rgba(255, 193, 105, 0.2),
    0 24px 64px rgba(31, 100, 132, 0.24);
}

.title-block .kicker {
  color: #174c62;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.9), 0 6px 18px rgba(35, 200, 176, 0.2);
}

.title-block h1,
.icon-button {
  border-color: rgba(255, 196, 94, 0.48);
  background: rgba(255, 255, 255, 0.76);
}

.journey-strip > div,
.chest-button,
.scorebar article {
  border-color: rgba(255, 255, 255, 0.94);
  background: rgba(255, 255, 255, 0.68);
}

.score-card strong {
  color: #e93f79;
}

.chest-button.is-ready {
  border-color: rgba(243, 189, 61, 0.7);
  background: linear-gradient(135deg, rgba(255, 226, 139, 0.94), rgba(244, 85, 141, 0.3));
  box-shadow: 0 10px 24px rgba(218, 146, 40, 0.2);
}

.goal-strip {
  border-color: rgba(243, 189, 61, 0.54);
  background:
    linear-gradient(105deg, rgba(255, 247, 211, 0.9), rgba(255, 255, 255, 0.72) 44%, rgba(226, 252, 247, 0.82));
  box-shadow: 0 10px 24px rgba(62, 113, 139, 0.13);
}

.goal-strip strong {
  color: #174c62;
}

.board-card {
  border-color: rgba(255, 255, 255, 0.94);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.2) 0 2px, transparent 2px 24px),
    linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(185, 243, 238, 0.46) 48%, rgba(187, 213, 255, 0.48));
  box-shadow:
    inset 0 1px 22px rgba(255, 255, 255, 0.7),
    0 12px 26px rgba(36, 120, 150, 0.12);
}

.progress-chip::before {
  background:
    linear-gradient(90deg, #f4558d, #f3bd3d 34%, #23c8b0 68%, #39a9e9),
    repeating-linear-gradient(120deg, rgba(255, 255, 255, 0.24) 0 8px, transparent 8px 16px);
  box-shadow: 0 0 18px rgba(35, 200, 176, 0.38);
}

.milestone-track i.is-done {
  background: linear-gradient(135deg, #f3bd3d, #f4558d 52%, #9a76e8);
}

.tube .block.orb {
  width: clamp(27px, 3.5vw, 34px);
  height: clamp(27px, 3.5vw, 34px);
  border: 0;
  background:
    radial-gradient(ellipse at 29% 22%, rgba(255, 255, 255, 0.98) 0 8%, rgba(255, 255, 255, 0.58) 9% 16%, transparent 17%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.5) 0 18%, transparent 42%, rgba(7, 39, 60, 0.24) 100%),
    var(--block, #f4558d);
  box-shadow:
    inset 4px 5px 8px rgba(255, 255, 255, 0.34),
    inset -5px -7px 10px rgba(16, 51, 75, 0.24),
    0 0 0 2px rgba(255, 255, 255, 0.98),
    0 0 0 4px rgba(245, 196, 85, 0.88),
    0 7px 13px rgba(33, 88, 119, 0.24),
    0 0 15px color-mix(in srgb, var(--block, #f4558d) 46%, transparent);
  filter: saturate(1.12) contrast(1.04);
}

.tube .block.orb::before {
  content: "";
  position: absolute;
  left: 22%;
  top: 18%;
  width: 29%;
  height: 15%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.84);
  transform: rotate(-32deg);
  box-shadow: none;
  opacity: 0.9;
}

.tube .block.orb::after {
  content: "";
  position: absolute;
  right: 13%;
  top: 12%;
  width: 8px;
  height: 8px;
  border-radius: 0;
  background: #fff9cf;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  opacity: 0.9;
  filter: drop-shadow(0 0 4px rgba(255, 225, 110, 0.95));
}

.tube.is-selected .block.orb:last-child,
.tube.is-suggested-from .block.orb:last-child {
  box-shadow:
    inset 4px 5px 8px rgba(255, 255, 255, 0.38),
    inset -5px -7px 10px rgba(16, 51, 75, 0.22),
    0 0 0 2px #fff,
    0 0 0 5px rgba(244, 85, 141, 0.55),
    0 0 24px color-mix(in srgb, var(--block, #f4558d) 66%, transparent);
}

.primary-button {
  background: linear-gradient(135deg, #f4558d, #ff7b55 48%, #f3bd3d);
  color: #fff;
  box-shadow: 0 10px 24px rgba(227, 80, 119, 0.28);
}

.thumb-button {
  border: 1px solid rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.72);
}

.win-card {
  border-color: rgba(243, 189, 61, 0.68);
  background:
    linear-gradient(145deg, rgba(255, 250, 226, 0.98), rgba(255, 255, 255, 0.96) 44%, rgba(220, 250, 245, 0.96));
  box-shadow: 0 28px 70px rgba(33, 92, 125, 0.3), 0 0 0 5px rgba(255, 255, 255, 0.3);
}

.win-card h2 {
  color: #d93671;
}

@media (max-width: 520px) {
  .tube.has-dragon-color .block.orb,
  .tube.is-empty-boat .block.orb {
    width: 24px;
    height: 24px;
  }

  .tube .block.orb::after {
    width: 6px;
    height: 6px;
  }
}

.animated-guide {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 172px;
  margin: 8px 0 12px;
}

.mini-tube {
  display: grid;
  grid-template-rows: repeat(4, 32px);
  gap: 5px;
  width: 52px;
  padding: 7px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.36);
  box-shadow: var(--soft-shadow);
}

.tube-a {
  margin-right: 70px;
}

.tube-b {
  margin-left: 0;
}

.mini-block,
.flying-block {
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  font-style: normal;
  font-weight: 850;
  box-shadow: inset 0 10px 14px rgba(255, 255, 255, 0.32);
}

.mini-block::after,
.flying-block::after {
  content: "";
  width: 34%;
  height: 34%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 2px 8px rgba(77, 73, 98, 0.12);
}

.mini-block.shape-spark::after,
.flying-block.shape-spark::after {
  width: 42%;
  height: 42%;
  clip-path: polygon(50% 0, 61% 35%, 100% 50%, 61% 64%, 50% 100%, 38% 64%, 0 50%, 38% 35%);
  border-radius: 0;
}

.mini-block.shape-gem::after,
.flying-block.shape-gem::after {
  width: 34%;
  height: 34%;
  border-radius: 4px;
  transform: rotate(45deg);
}

.pink {
  background: var(--pink);
}

.mint {
  background: var(--mint);
}

.flying-block {
  position: absolute;
  left: calc(50% - 68px);
  bottom: 34px;
  width: 38px;
  height: 38px;
  background: var(--mint);
  animation: guideMove 2.2s ease-in-out infinite;
}

.guide-copy {
  display: grid;
  gap: 7px;
  margin: 0 0 14px;
  padding-left: 1.25rem;
  color: var(--muted);
  text-align: left;
  font-size: 0.92rem;
  line-height: 1.5;
}

.win-card p {
  margin-bottom: 14px;
  color: var(--muted);
}

.win-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.perfect-badge {
  display: inline-grid;
  place-items: center;
  min-height: 32px;
  margin: -4px 0 10px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--lemon), var(--pink));
  color: #fff;
  font-weight: 850;
  box-shadow: 0 12px 26px rgba(255, 141, 183, 0.28);
  animation: perfectPop 920ms var(--mochi-ease) infinite alternate;
}

.perfect-badge[hidden] {
  display: none;
}

.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 35;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -18px;
  left: var(--x);
  width: var(--size);
  height: calc(var(--size) * 0.62);
  border-radius: 4px;
  background: var(--color);
  opacity: 0.92;
  transform: rotate(var(--rot));
  animation: confettiFall var(--duration) ease-out forwards;
  animation-delay: var(--delay);
}

.firework-layer {
  position: fixed;
  inset: 0;
  z-index: 36;
  pointer-events: none;
  overflow: hidden;
}

.firework-spark {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color);
  box-shadow: 0 0 10px var(--color), 0 0 18px rgba(255, 255, 255, 0.7);
  animation: fireworkBloom 940ms cubic-bezier(0.16, 0.72, 0.25, 1) forwards;
  animation-delay: var(--delay);
}

.burst-layer {
  position: fixed;
  z-index: 70;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.burst-piece {
  position: absolute;
  left: 0;
  top: 0;
  width: 12px;
  height: 9px;
  border-radius: 8px;
  background: var(--color);
  box-shadow: inset 0 4px 7px rgba(255, 255, 255, 0.42), 0 8px 18px rgba(100, 123, 155, 0.16);
  animation: mochiBurst 780ms var(--mochi-ease) forwards;
  animation-delay: var(--delay);
}

.reward-burst {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 1000;
  width: min(320px, calc(100vw - 40px));
  padding: 18px 20px 16px;
  border-radius: 18px;
  text-align: center;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.74) 56%, rgba(226, 250, 255, 0.66)),
    linear-gradient(135deg, rgba(255, 141, 183, 0.18), rgba(255, 229, 154, 0.18), rgba(114, 223, 202, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow:
    0 28px 80px rgba(75, 122, 154, 0.28),
    0 0 34px var(--prestige-glow, rgba(114, 223, 202, 0.28));
  transform: translate(-50%, -50%) scale(0.88);
  opacity: 0;
  pointer-events: none;
  animation: rewardBurstIn 1.35s ease forwards;
}

.reward-burst::before {
  content: "";
  position: absolute;
  inset: -12px;
  z-index: -1;
  border-radius: 24px;
  background:
    conic-gradient(from 20deg, rgba(255, 141, 183, 0), rgba(255, 141, 183, 0.5), rgba(255, 229, 154, 0.55), rgba(114, 223, 202, 0.52), rgba(255, 141, 183, 0));
  filter: blur(16px);
  opacity: 0.78;
}

.reward-burst strong {
  display: block;
  font-size: 1.2rem;
  letter-spacing: 0;
}

.reward-burst span {
  display: block;
  margin-top: 6px;
  font-weight: 900;
  color: var(--pink);
}

.reward-burst small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.35;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 50;
  width: min(340px, calc(100% - 28px));
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-weight: 850;
  text-align: center;
  backdrop-filter: blur(20px);
  animation: toastIn 220ms var(--mochi-ease);
}

.toast[hidden] {
  display: none;
}

.legal-footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: -2px 0 max(8px, env(safe-area-inset-bottom));
  color: rgba(101, 115, 141, 0.78);
  font-size: 12px;
  font-weight: 750;
  pointer-events: none;
}

.legal-footer a {
  color: rgba(38, 48, 71, 0.76);
  text-decoration: none;
  pointer-events: auto;
}

.legal-footer a:hover {
  text-decoration: underline;
}

.is-pulsing {
  animation: guidePulse 820ms var(--mochi-ease);
}

body[data-skin="fruit"] .block {
  border-radius: 11px;
  filter: saturate(1.04);
}

body[data-skin="dream"] .block {
  border-radius: 11px;
  filter: saturate(1.06);
}

@keyframes guideMove {
  0%,
  20% {
    transform: translate(0, 0) scale(1);
    opacity: 0;
  }
  28% {
    opacity: 1;
  }
  70% {
    transform: translate(108px, -18px) scale(1.04);
    opacity: 1;
  }
  86%,
  100% {
    transform: translate(108px, -18px) scale(0.92);
    opacity: 0;
  }
}

@keyframes tubeNope {
  0%,
  100% {
    transform: translateX(0);
  }
  28% {
    transform: translateX(-6px);
  }
  58% {
    transform: translateX(6px);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes guidePulse {
  0%,
  100% {
    box-shadow: var(--soft-shadow);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(255, 141, 183, 0.2), 0 16px 34px rgba(255, 141, 183, 0.22);
  }
}

@keyframes mochiGrab {
  0% {
    transform: scale(1, 1);
  }
  42% {
    transform: scale(1.14, 0.82) translateY(4px);
  }
  100% {
    transform: scale(1, 1);
  }
}

@keyframes mochiLand {
  0% {
    transform: scale(1.02, 0.9) translateY(8px);
  }
  42% {
    transform: scale(0.88, 1.16) translateY(-6px);
  }
  74% {
    transform: scale(1.08, 0.94) translateY(2px);
  }
  100% {
    transform: scale(1, 1) translateY(0);
  }
}

@keyframes floatMochi {
  0%,
  100% {
    transform: translateY(-4px) scale(1);
    filter: brightness(1.02);
  }
  50% {
    transform: translateY(-10px) scale(1.035);
    filter: brightness(1.08);
  }
}

@keyframes completeWiggle {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  35% {
    transform: translateY(-4px) scale(1.04, 0.96);
  }
  70% {
    transform: translateY(2px) scale(0.98, 1.04);
  }
}

@keyframes dragonBoatRowAway {
  0% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
  45% {
    transform: translateX(10px) translateY(-4px) scale(1.02, 0.96);
    opacity: 1;
  }
  100% {
    transform: translateX(92px) translateY(-12px) scale(0.92);
    opacity: 0;
  }
}

@keyframes completedDragonBoatSail {
  0% {
    transform: translateX(0) translateY(0) rotate(0deg);
    opacity: 1;
    filter: saturate(1);
  }
  28% {
    transform: translateX(8px) translateY(-7px) rotate(-1deg);
    opacity: 1;
    filter: saturate(1.15) brightness(1.06);
  }
  58% {
    transform: translateX(28px) translateY(-11px) rotate(2deg);
    opacity: 1;
    filter: saturate(1.24) brightness(1.12);
  }
  100% {
    transform: translateX(148px) translateY(-24px) rotate(5deg);
    opacity: 0;
    filter: saturate(1.3) brightness(1.18);
  }
}

@keyframes dragonHeadIdle {
  0%, 100% {
    transform: translateX(-50%) translateY(0) scale(0.96);
    filter:
      drop-shadow(0 3px 0 rgba(255, 255, 255, 0.55))
      drop-shadow(0 8px 12px rgba(79, 136, 159, 0.28))
      drop-shadow(0 0 12px rgba(255, 219, 107, 0.2));
  }
  50% {
    transform: translateX(-50%) translateY(-2px) scale(1);
    filter:
      drop-shadow(0 3px 0 rgba(255, 255, 255, 0.62))
      drop-shadow(0 9px 14px rgba(79, 136, 159, 0.3))
      drop-shadow(0 0 20px var(--dragon-glow, rgba(114, 223, 202, 0.28)));
  }
}

@keyframes dragonPrestigePulse {
  from {
    filter:
      drop-shadow(0 3px 0 rgba(255, 255, 255, 0.55))
      drop-shadow(0 0 10px var(--prestige-glow, rgba(114, 223, 202, 0.32)))
      drop-shadow(0 12px 12px rgba(78, 137, 158, 0.18));
  }
  to {
    filter:
      drop-shadow(0 3px 0 rgba(255, 255, 255, 0.72))
      drop-shadow(0 0 24px var(--prestige-glow, rgba(114, 223, 202, 0.56)))
      drop-shadow(0 16px 18px rgba(78, 137, 158, 0.28));
  }
}

@keyframes dragonTailDrift {
  0%, 100% {
    transform: perspective(90px) rotateX(18deg) translateX(0);
    opacity: 0.72;
  }
  50% {
    transform: perspective(90px) rotateX(18deg) translateX(-3px);
    opacity: 0.88;
  }
}

@keyframes dragonHeadGlow {
  0% {
    transform: translateX(-50%) scale(0.98);
    filter:
      drop-shadow(0 3px 0 rgba(255, 255, 255, 0.55))
      drop-shadow(0 8px 12px rgba(79, 136, 159, 0.28));
  }
  42% {
    transform: translateX(-50%) translateY(-5px) scale(1.16);
    filter:
      drop-shadow(0 0 0 rgba(255, 255, 255, 0.92))
      drop-shadow(0 0 18px rgba(255, 221, 139, 0.92))
      drop-shadow(0 0 30px var(--dragon-glow, rgba(114, 223, 202, 0.62)));
  }
  100% {
    transform: translateX(-50%) translateY(-7px) scale(1.08);
    filter:
      drop-shadow(0 0 20px rgba(255, 221, 139, 0.7))
      drop-shadow(0 0 34px rgba(114, 223, 202, 0.46));
  }
}

@keyframes wakeTrail {
  0% {
    transform: translateX(0) scaleX(0.82);
    opacity: 0.5;
  }
  55% {
    transform: translateX(-26px) scaleX(2.15);
    opacity: 0.94;
  }
  100% {
    transform: translateX(-56px) scaleX(3.1);
    opacity: 0;
  }
}

@keyframes boatCapsize {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  45% {
    transform: translateY(8px) rotate(-11deg);
    opacity: 0.9;
  }
  100% {
    transform: translateY(38px) rotate(-84deg);
    opacity: 0.34;
  }
}

@keyframes floodWash {
  0% {
    transform: translateY(18%);
  }
  70% {
    transform: translateY(-38%);
  }
  100% {
    transform: translateY(-32%);
  }
}

@keyframes lakeDrift {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 180px 54px, 0 0;
  }
}

@keyframes surfaceSwell {
  from {
    transform: translate3d(-1.5%, -1%, 0) rotate(-3deg) scale(1);
  }
  to {
    transform: translate3d(1.5%, 1%, 0) rotate(-1deg) scale(1.03);
  }
}

@keyframes pulseTimer {
  from {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72), 0 8px 18px rgba(69, 128, 156, 0.12);
  }
  to {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.9), 0 0 0 5px rgba(255, 85, 134, 0.14), 0 10px 24px rgba(178, 40, 79, 0.2);
  }
}

@keyframes dragBreath {
  from {
    transform: translate(-50%, -78%) scale(1.06, 0.98);
    filter: brightness(1.02);
  }
  to {
    transform: translate(-50%, -84%) scale(1.16, 0.9);
    filter: brightness(1.08);
  }
}

@keyframes perfectPop {
  from {
    transform: translateY(0) scale(1);
  }
  to {
    transform: translateY(-2px) scale(1.05);
  }
}

@keyframes firePulse {
  from {
    box-shadow: var(--soft-shadow);
    transform: translateY(0);
  }
  to {
    box-shadow: 0 0 0 4px rgba(255, 141, 183, 0.18), 0 16px 34px rgba(255, 141, 183, 0.26);
    transform: translateY(-1px);
  }
}

@keyframes confettiFall {
  0% {
    transform: translate3d(0, -18px, 0) rotate(var(--rot));
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--drift), 110vh, 0) rotate(calc(var(--rot) + 420deg));
    opacity: 0;
  }
}

@keyframes fireworkBloom {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3);
  }
  14% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.7);
  }
}

@keyframes mochiBurst {
  0% {
    transform: rotate(var(--angle)) translateX(0) scale(0.8);
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  100% {
    transform: rotate(var(--angle)) translateX(var(--distance)) scale(0.2);
    opacity: 0;
  }
}

@keyframes rewardBurstIn {
  0% {
    transform: translate(-50%, -50%) scale(0.82);
    opacity: 0;
  }
  18% {
    transform: translate(-50%, -50%) scale(1.04);
    opacity: 1;
  }
  78% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -58%) scale(0.98);
    opacity: 0;
  }
}

@media (min-width: 461px) and (max-height: 760px) {
  .app-shell {
    align-items: start;
    padding: 8px 12px;
    padding: max(8px, env(safe-area-inset-top)) 12px max(8px, env(safe-area-inset-bottom));
  }

  .game-panel {
    width: min(390px, 100%);
    padding: 10px;
  }

  .topbar {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    gap: 7px;
  }

  .icon-button,
  .glass-button,
  .primary-button,
  .thumb-button,
  .reward-button {
    min-height: 36px;
  }

  .title-block .kicker {
    font-size: clamp(1.42rem, 3.2vw, 1.9rem);
    line-height: 0.92;
  }

  .title-block h1 {
    min-height: 20px;
    padding: 0 9px;
    font-size: 0.72rem;
  }

  .journey-strip {
    grid-template-columns: minmax(64px, 0.82fr) minmax(64px, 0.78fr) minmax(78px, 1fr) minmax(74px, 0.92fr);
    gap: 6px;
    margin-top: 8px;
  }

  .journey-strip > div,
  .chest-button {
    min-height: 42px;
    padding: 6px 8px;
  }

  .tiny-label,
  .chest-button span {
    font-size: 0.58rem;
  }

  .journey-strip strong,
  .chest-button strong {
    font-size: 0.78rem;
  }

  .scorebar {
    gap: 6px;
    margin: 8px 0 5px;
  }

  .scorebar article {
    min-height: 42px;
    padding: 5px 7px;
  }

  .scorebar span {
    font-size: 0.62rem;
  }

  .scorebar strong {
    font-size: 1rem;
  }

  .hint-line {
    min-height: 18px;
    margin-bottom: 4px;
    font-size: 0.82rem;
  }

  .goal-strip {
    grid-template-columns: 34px minmax(0, 1fr);
    min-height: 48px;
    gap: 8px;
    margin-bottom: 5px;
    padding: 6px 8px;
  }

  .goal-strip #goalIcon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
  }

  .goal-strip strong {
    font-size: 0.78rem;
  }

  .goal-strip p {
    font-size: 0.66rem;
  }

  .board-card {
    min-height: clamp(224px, 38vh, 292px);
    min-height: clamp(224px, 38svh, 292px);
  }

  .board {
    grid-template-columns: repeat(var(--cols), minmax(34px, 50px));
    gap: 7px;
    padding: 66px 8px 62px;
  }

  .tube {
    height: clamp(112px, 17vh, 148px);
    padding: 7px 6px;
    gap: 4px;
  }

  .mochi {
    min-height: 0;
  }

  .progress-chip {
    right: 14px;
    bottom: 10px;
    left: 14px;
    height: 18px;
  }

  .action-row {
    grid-template-columns: 74px 1fr 74px;
    margin-top: 7px;
  }

  .thumb-button,
  .reward-button {
    min-height: 40px;
  }

  .legal-footer {
    bottom: 4px;
    font-size: 0.66rem;
  }
}

@media (max-width: 460px) {
  .app-shell {
    align-items: start;
    padding: 6px 8px 8px;
    padding: max(6px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
  }

  .game-panel {
    padding: 8px;
  }

  .topbar {
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    gap: 6px;
  }

  .icon-button,
  .glass-button,
  .primary-button,
  .thumb-button,
  .reward-button {
    min-height: 36px;
  }

  .icon-button span {
    font-size: 1.22rem;
  }

  .journey-strip,
  .scorebar,
  .action-row {
    gap: 6px;
  }

  .journey-strip {
    grid-template-columns: 1fr 1fr;
    margin-top: 7px;
  }

  .milestone-track {
    grid-column: 1 / -1;
    min-height: 28px;
  }

  .chest-button {
    grid-column: 1 / -1;
    min-height: 38px;
  }

  .title-block .kicker {
    font-size: clamp(1.38rem, 7vw, 1.78rem);
  }

  .title-block h1 {
    min-height: 20px;
    padding: 0 8px;
    font-size: 0.7rem;
  }

  .journey-strip > div,
  .chest-button {
    min-height: 40px;
    padding: 6px 8px;
  }

  .tiny-label,
  .chest-button span {
    font-size: 0.6rem;
  }

  .journey-strip strong,
  .chest-button strong {
    margin-top: 2px;
    font-size: 0.78rem;
  }

  .scorebar {
    margin: 8px 0 5px;
  }

  .scorebar article {
    min-height: 42px;
    padding: 5px 6px;
  }

  .scorebar span {
    font-size: 0.62rem;
  }

  .scorebar strong {
    font-size: 1rem;
  }

  .hint-line {
    min-height: 18px;
    margin-bottom: 4px;
    font-size: 0.82rem;
  }

  .goal-strip {
    grid-template-columns: 34px minmax(0, 1fr);
    min-height: 48px;
    gap: 8px;
    margin-bottom: 5px;
    padding: 6px 8px;
  }

  .goal-strip #goalIcon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
  }

  .goal-strip strong {
    font-size: 0.78rem;
  }

  .goal-strip p {
    font-size: 0.66rem;
  }

  .board-card {
    display: grid;
    align-items: end;
    min-height: clamp(250px, 45vh, 360px);
    min-height: clamp(250px, 45svh, 360px);
  }

  .board {
    grid-template-columns: repeat(4, minmax(32px, 50px));
    grid-template-columns: repeat(var(--cols), minmax(32px, 50px));
    gap: 7px;
    align-self: end;
    padding: 74px 8px 64px;
  }

  .board.cols-3 {
    grid-template-columns: repeat(3, minmax(32px, 50px));
  }

  .board.cols-4 {
    grid-template-columns: repeat(4, minmax(32px, 50px));
  }

  .board.cols-5 {
    grid-template-columns: repeat(5, minmax(32px, 50px));
  }

  .tube {
    height: clamp(120px, 31vw, 158px);
    padding: 7px 6px;
    gap: 4px;
  }

  .drag-ghost {
    width: 42px;
    height: 42px;
  }

  .mochi-progress {
    top: 10px;
    gap: 5px;
  }

  .mochi-progress i {
    width: 14px;
    height: 12px;
  }

  .progress-chip {
    right: 14px;
    bottom: 10px;
    left: 14px;
    height: 18px;
  }

  .action-row {
    grid-template-columns: 72px 1fr 72px;
    margin-top: 7px;
  }

  .thumb-button,
  .reward-button {
    min-height: 42px;
  }

  .thumb-button span {
    font-size: 0.64rem;
  }

  .thumb-button strong {
    margin-top: 2px;
  }

  .guide-card,
  .win-card {
    padding: 16px;
  }
}

/* Cute dragon boat skin: readable lanes with friendly polished dragon faces. */
.tube.has-dragon-color,
.tube.is-empty-boat {
  overflow: visible;
  isolation: isolate;
  border-color: transparent;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.22)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.2), var(--dragon-soft, rgba(114, 223, 202, 0.24)), rgba(255, 255, 255, 0.2));
  box-shadow: 0 18px 34px rgba(30, 111, 142, 0.13);
}

.tube.has-dragon-color::before,
.tube.is-empty-boat::before {
  content: "";
  position: absolute;
  left: 50%;
  top: clamp(-48px, -7vw, -34px);
  z-index: 4;
  width: clamp(74px, 10vw, 104px);
  height: clamp(56px, 7.6vw, 76px);
  border: 0;
  border-radius: 44% 44% 50% 50%;
  background:
    radial-gradient(circle at 34% 45%, var(--dragon-eye, #25546d) 0 4px, #fff8d9 4.5px 8px, transparent 8.5px),
    radial-gradient(circle at 66% 45%, var(--dragon-eye, #25546d) 0 4px, #fff8d9 4.5px 8px, transparent 8.5px),
    radial-gradient(circle at 38% 62%, var(--dragon-cheek, rgba(255, 143, 185, 0.72)) 0 6px, transparent 6.5px),
    radial-gradient(circle at 62% 62%, var(--dragon-cheek, rgba(255, 143, 185, 0.72)) 0 6px, transparent 6.5px),
    radial-gradient(circle at 50% 72%, rgba(74, 45, 58, 0.7) 0 4px, transparent 4.5px),
    radial-gradient(circle at 50% 30%, var(--dragon-fire, #ff9db8) 0 13px, transparent 13.5px),
    conic-gradient(from 210deg at 50% 0%, transparent 0 18deg, var(--dragon-gold, #ffd166) 18deg 72deg, transparent 72deg 105deg, var(--dragon-gold, #ffd166) 105deg 156deg, transparent 156deg),
    linear-gradient(135deg, var(--dragon-face, #fff8ed), var(--dragon, #72dfca) 48%, var(--dragon-face, #fff8ed));
  clip-path: polygon(50% 0, 61% 14%, 78% 8%, 75% 28%, 94% 35%, 78% 48%, 86% 72%, 61% 68%, 50% 92%, 39% 68%, 14% 72%, 22% 48%, 6% 35%, 25% 28%, 22% 8%, 39% 14%);
  box-shadow:
    -34px 10px 0 -24px var(--dragon-gold, #ffd166),
    34px 10px 0 -24px var(--dragon-gold, #ffd166),
    inset 0 0 0 2px rgba(255, 255, 255, 0.56),
    inset 0 -10px 18px rgba(21, 78, 105, 0.18),
    0 10px 18px rgba(26, 92, 122, 0.2),
    0 0 18px var(--dragon-glow, rgba(114, 223, 202, 0.35));
  pointer-events: none;
  transform: translateX(-50%) scale(0.96);
  filter: drop-shadow(0 8px 10px rgba(24, 87, 114, 0.16));
  transition: opacity 180ms ease, transform 180ms ease, filter 180ms ease;
  animation: cuteDragonHeadIdle 3.8s ease-in-out infinite;
}

.tube.has-dragon-color::after,
.tube.is-empty-boat::after {
  content: "";
  position: absolute;
  left: 50%;
  top: clamp(3px, 1.2vw, 10px);
  bottom: clamp(-34px, -5vw, -24px);
  z-index: 1;
  width: clamp(58px, 8.2vw, 78px);
  display: block;
  border-radius: 999px 999px 38px 38px;
  background:
    radial-gradient(ellipse at 50% 12%, rgba(255, 255, 255, 0.92) 0 22%, transparent 23%),
    radial-gradient(ellipse at 50% 34%, rgba(255, 255, 255, 0.88) 0 20%, transparent 21%),
    radial-gradient(ellipse at 50% 56%, rgba(255, 255, 255, 0.84) 0 20%, transparent 21%),
    radial-gradient(ellipse at 50% 78%, rgba(255, 255, 255, 0.78) 0 20%, transparent 21%),
    repeating-linear-gradient(90deg, var(--dragon, #72dfca) 0 8px, var(--dragon-deep, #3aa692) 8px 16px),
    linear-gradient(180deg, var(--dragon, #72dfca), var(--dragon-deep, #3aa692));
  box-shadow:
    inset 0 0 0 2px var(--dragon-gold, #ffd166),
    inset 0 0 18px rgba(255, 255, 255, 0.24),
    0 14px 22px rgba(23, 103, 133, 0.16);
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 180ms ease, transform 180ms ease;
}

.tube.has-dragon-color .block,
.tube.is-empty-boat .block {
  position: relative;
  z-index: 5;
  width: min(100%, 38px);
  justify-self: center;
  border-radius: 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 9px 16px rgba(33, 111, 150, 0.12);
}

.tube.is-empty-boat::before {
  opacity: 0.32;
  filter: grayscale(0.08) saturate(0.72) brightness(1.12);
}

.tube.is-empty-boat::after {
  opacity: 0.24;
}

.tube.is-suggested-to::before,
.tube.is-magnetic::before {
  transform: translateX(-50%) translateY(-5px) scale(1.04);
  filter:
    drop-shadow(0 15px 20px rgba(25, 99, 135, 0.24))
    drop-shadow(0 0 26px var(--dragon-glow, rgba(114, 223, 202, 0.38)));
}

.tube.is-launching {
  pointer-events: none;
}

.tube.is-launching::before,
.tube.is-launching::after {
  animation: cuteDragonBoatSail 1.05s ease-in forwards;
}

.tube.is-launched {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-26px) scale(0.88);
}

.tube.is-launched::before,
.tube.is-launched::after,
.tube.is-launched .block {
  opacity: 0;
  animation: none;
}

@keyframes cuteDragonHeadIdle {
  0%,
  100% {
    transform: translateX(-50%) translateY(0) scale(0.96);
  }

  50% {
    transform: translateX(-50%) translateY(-4px) scale(1);
  }
}

@keyframes cuteDragonBoatSail {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }

  40% {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px) scale(1.06);
  }

  100% {
    opacity: 0;
    transform: translateX(128%) translateY(-30px) scale(0.82) rotate(7deg);
  }
}

@media (max-width: 520px) {
  .tube.has-dragon-color::before,
  .tube.is-empty-boat::before {
    top: clamp(-40px, -10vw, -30px);
    width: clamp(64px, 16vw, 84px);
    height: clamp(48px, 12vw, 64px);
  }

  .tube.has-dragon-color::after,
  .tube.is-empty-boat::after {
    width: clamp(50px, 14vw, 64px);
    bottom: clamp(-28px, -7vw, -20px);
  }

  .tube.has-dragon-color .block,
  .tube.is-empty-boat .block {
    width: min(100%, 32px);
  }
}

/* Final visual override: keep the detailed dragon-boat artwork, then soften the head. */
.tube.has-dragon-color,
.tube.is-empty-boat {
  isolation: isolate;
  overflow: visible;
  padding: clamp(24px, 4vw, 38px) 9px clamp(18px, 2.5vw, 26px);
  gap: clamp(4px, 0.7vw, 6px);
  border-color: var(--dragon-glow, rgba(114, 223, 202, 0.58));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(228, 250, 252, 0.34)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.22), var(--dragon-soft, rgba(114, 223, 202, 0.20)), rgba(255, 255, 255, 0.22));
  box-shadow: 0 18px 34px rgba(30, 111, 142, 0.13);
}

.tube.has-dragon-color::before,
.tube.is-empty-boat::before {
  content: "";
  position: absolute;
  left: 50%;
  top: clamp(-62px, -8vw, -44px);
  bottom: clamp(-36px, -5vw, -24px);
  z-index: 1;
  width: clamp(86px, 11.4vw, 118px);
  height: auto;
  display: block;
  border: 0;
  border-radius: 0;
  background-image: url("./images/dragon-boat-lane-gentle-transparent-v2.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: contain;
  clip-path: none;
  box-shadow: none;
  pointer-events: none;
  opacity: 0.94;
  transform: translateX(-50%) scale(0.98);
  filter:
    var(--dragon-asset-filter, none)
    saturate(0.82)
    brightness(1.11)
    contrast(0.9)
    drop-shadow(0 12px 18px rgba(29, 97, 126, 0.18))
    drop-shadow(0 0 18px var(--dragon-glow, rgba(114, 223, 202, 0.22)));
  transition: opacity 180ms ease, transform 180ms ease, filter 180ms ease;
  animation: premiumCuteDragonFloat 4.2s ease-in-out infinite;
}

.tube.has-dragon-color::after,
.tube.is-empty-boat::after {
  content: "";
  position: absolute;
  left: 50%;
  top: clamp(-62px, -8vw, -44px);
  bottom: clamp(-36px, -5vw, -24px);
  z-index: 5;
  width: clamp(86px, 11.4vw, 118px);
  height: auto;
  display: block;
  border: 0;
  border-radius: 0;
  background-image: url("./images/dragon-boat-lane-gentle-transparent-v2.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: contain;
  clip-path: inset(0 0 72% 0);
  box-shadow: none;
  pointer-events: none;
  opacity: 0.98;
  transform: translateX(-50%) scale(0.98);
  filter:
    var(--dragon-asset-filter, none)
    saturate(0.9)
    brightness(1.12)
    contrast(0.92)
    drop-shadow(0 10px 16px rgba(29, 97, 126, 0.16));
  transition: opacity 180ms ease, transform 180ms ease;
  animation: premiumCuteDragonFloat 4.2s ease-in-out infinite;
}

.tube.has-dragon-color .block,
.tube.is-empty-boat .block {
  position: relative;
  z-index: 3;
  align-self: center;
  width: clamp(20px, 3vw, 30px);
  height: clamp(20px, 3vw, 30px);
  justify-self: center;
  overflow: visible;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.95) 0 16%, rgba(255, 255, 255, 0.42) 17% 28%, transparent 29%),
    radial-gradient(circle at 66% 70%, rgba(255, 255, 255, 0.34) 0 16%, transparent 17%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.34), transparent 45%, rgba(35, 66, 88, 0.16)),
    var(--block, #ff8db7);
  box-shadow:
    inset -4px -7px 12px rgba(26, 58, 82, 0.16),
    inset 5px 6px 11px rgba(255, 255, 255, 0.35),
    0 0 0 2px rgba(255, 237, 169, 0.52),
    0 8px 14px rgba(33, 111, 150, 0.13),
    0 0 14px rgba(255, 237, 169, 0.32);
}

.tube.has-dragon-color .block::after,
.tube.is-empty-boat .block::after {
  width: 48%;
  height: 48%;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 248, 216, 0.9) 0 20%, rgba(255, 215, 96, 0.5) 21% 42%, transparent 43%),
    conic-gradient(from 45deg, transparent 0 16%, rgba(255, 255, 255, 0.78) 17% 21%, transparent 22% 49%, rgba(255, 238, 154, 0.72) 50% 56%, transparent 57%);
  clip-path: none;
  transform: none;
  opacity: 0.72;
}

/* Board pieces use one stable orb treatment so color is the only recognition cue. */
.tube .block.orb {
  position: absolute;
  left: 50%;
  top: var(--slot-center, 78.3%);
  translate: -50% -50%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 25%, rgba(255, 255, 255, 0.92) 0 14%, rgba(255, 255, 255, 0.38) 15% 24%, transparent 25%),
    radial-gradient(circle at 68% 72%, rgba(18, 54, 76, 0.14) 0 17%, transparent 18%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), transparent 45%, rgba(24, 64, 86, 0.18)),
    var(--block, #ff8db7);
  box-shadow:
    inset -4px -6px 10px rgba(20, 54, 76, 0.18),
    inset 4px 5px 9px rgba(255, 255, 255, 0.34),
    0 0 0 2px rgba(255, 255, 255, 0.72),
    0 7px 12px rgba(33, 111, 150, 0.15);
}

/* The art has four painted bays; each orb is anchored to that matching bay,
   not to the remaining height of a CSS grid. */
.tube.has-dragon-color .block.orb,
.tube.is-empty-boat .block.orb {
  justify-self: auto;
  align-self: auto;
}

.tube .block.orb::after {
  content: none;
}

.goal-strip #goalIcon.block,
.drag-ghost.block {
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.95) 0 16%, rgba(255, 255, 255, 0.42) 17% 28%, transparent 29%),
    radial-gradient(circle at 66% 70%, rgba(255, 255, 255, 0.34) 0 16%, transparent 17%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.34), transparent 45%, rgba(35, 66, 88, 0.16)),
    var(--block, #ff8db7);
  box-shadow:
    inset -5px -8px 13px rgba(26, 58, 82, 0.16),
    inset 6px 7px 12px rgba(255, 255, 255, 0.35),
    0 0 0 2px rgba(255, 237, 169, 0.56),
    0 10px 20px rgba(33, 111, 150, 0.16),
    0 0 18px rgba(255, 237, 169, 0.34);
}

.goal-strip #goalIcon.block::after,
.drag-ghost.block::after {
  width: 48%;
  height: 48%;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 248, 216, 0.9) 0 20%, rgba(255, 215, 96, 0.5) 21% 42%, transparent 43%),
    conic-gradient(from 45deg, transparent 0 16%, rgba(255, 255, 255, 0.78) 17% 21%, transparent 22% 49%, rgba(255, 238, 154, 0.72) 50% 56%, transparent 57%);
  clip-path: none;
  transform: none;
  opacity: 0.72;
}

.tube.is-empty-boat::before {
  opacity: 0.35;
  filter:
    grayscale(0.08)
    saturate(0.56)
    brightness(1.16)
    contrast(0.86)
    drop-shadow(0 10px 16px rgba(29, 97, 126, 0.12));
}

.tube.is-empty-boat::after {
  opacity: 0.22;
}

.tube.is-suggested-to::before,
.tube.is-magnetic::before {
  transform: translateX(-50%) translateY(-6px) scale(1.03);
  filter:
    var(--dragon-asset-filter, none)
    saturate(0.94)
    brightness(1.18)
    contrast(0.92)
    drop-shadow(0 16px 22px rgba(25, 99, 135, 0.25))
    drop-shadow(0 0 28px var(--dragon-glow, rgba(114, 223, 202, 0.38)));
}

.tube.is-suggested-to::after,
.tube.is-magnetic::after {
  transform: translateX(-50%) translateY(-6px) scale(1);
  opacity: 0.82;
}

.tube.is-launching {
  pointer-events: none;
}

.tube.is-launching::before {
  animation: premiumCuteDragonSail 1.05s ease-in forwards;
}

.tube.is-launching::after {
  animation: premiumCuteDragonFaceSail 1.05s ease-in forwards;
}

.tube.is-launched {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-26px) scale(0.88);
}

.tube.is-launched::before,
.tube.is-launched::after,
.tube.is-launched .block {
  opacity: 0;
  animation: none;
}

@keyframes premiumCuteDragonFloat {
  0%, 100% { transform: translateX(-50%) translateY(0) scale(0.98); }
  50% { transform: translateX(-50%) translateY(-4px) scale(1.01); }
}

@keyframes premiumCuteDragonFace {
  0%, 100% { transform: translateX(-50%) translateY(0) scale(0.94); opacity: 0.68; }
  50% { transform: translateX(-50%) translateY(-4px) scale(1); opacity: 0.78; }
}

@keyframes premiumCuteDragonSail {
  0% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  42% { opacity: 1; transform: translateX(-50%) translateY(-12px) scale(1.05); }
  100% { opacity: 0; transform: translateX(128%) translateY(-34px) scale(0.84) rotate(7deg); }
}

@keyframes premiumCuteDragonFaceSail {
  0% { opacity: 0.72; transform: translateX(-50%) translateY(0) scale(0.94); }
  42% { opacity: 0.82; transform: translateX(-50%) translateY(-12px) scale(1); }
  100% { opacity: 0; transform: translateX(128%) translateY(-34px) scale(0.72) rotate(7deg); }
}

@media (max-width: 520px) {
  .tube.has-dragon-color::before,
  .tube.is-empty-boat::before {
    top: clamp(-52px, -13vw, -38px);
    bottom: clamp(-30px, -7vw, -20px);
    width: clamp(76px, 18vw, 96px);
  }

  .tube.has-dragon-color::after,
  .tube.is-empty-boat::after {
    top: clamp(-52px, -13vw, -38px);
    bottom: clamp(-30px, -7vw, -20px);
    width: clamp(76px, 18vw, 96px);
  }

  .tube.has-dragon-color .block,
  .tube.is-empty-boat .block {
    width: 20px;
    height: 20px;
  }
}

/* Keep the canonical jewel-pearl component last so every skin uses one rendering. */
.tube .block.orb {
  position: absolute;
  left: 50%;
  top: var(--slot-center, 78.3%);
  translate: -50% -50%;
  width: clamp(27px, 3.5vw, 34px);
  height: clamp(27px, 3.5vw, 34px);
  overflow: visible;
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 29% 22%, rgba(255, 255, 255, 0.98) 0 8%, rgba(255, 255, 255, 0.58) 9% 16%, transparent 17%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.5) 0 18%, transparent 42%, rgba(7, 39, 60, 0.24) 100%),
    var(--block, #f4558d);
  box-shadow:
    inset 4px 5px 8px rgba(255, 255, 255, 0.34),
    inset -5px -7px 10px rgba(16, 51, 75, 0.24),
    0 0 0 2px rgba(255, 255, 255, 0.98),
    0 0 0 4px rgba(245, 196, 85, 0.88),
    0 7px 13px rgba(33, 88, 119, 0.24),
    0 0 15px color-mix(in srgb, var(--block, #f4558d) 46%, transparent);
  filter: saturate(1.12) contrast(1.04);
}

.tube .block.orb::before {
  content: "";
  position: absolute;
  left: 22%;
  top: 18%;
  width: 29%;
  height: 15%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.84);
  transform: rotate(-32deg);
  box-shadow: none;
  opacity: 0.9;
}

.tube .block.orb::after {
  content: "";
  position: absolute;
  right: 13%;
  top: 12%;
  width: 8px;
  height: 8px;
  border-radius: 0;
  background: #fff9cf;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  opacity: 0.9;
  filter: drop-shadow(0 0 4px rgba(255, 225, 110, 0.95));
}

.tube.is-selected .block.orb:last-child,
.tube.is-suggested-from .block.orb:last-child {
  box-shadow:
    inset 4px 5px 8px rgba(255, 255, 255, 0.38),
    inset -5px -7px 10px rgba(16, 51, 75, 0.22),
    0 0 0 2px #fff,
    0 0 0 5px rgba(244, 85, 141, 0.55),
    0 0 24px color-mix(in srgb, var(--block, #f4558d) 66%, transparent);
}

@media (max-width: 520px) {
  .tube.has-dragon-color .block.orb,
  .tube.is-empty-boat .block.orb {
    width: 24px;
    height: 24px;
  }

  .tube .block.orb::after {
    width: 6px;
    height: 6px;
  }
}
