:root {
  color-scheme: dark;
  --space-950: #070318;
  --space-900: #0d0728;
  --space-800: #160d3d;
  --space-700: #221458;
  --space-600: #33206f;
  --sun: #ffd447;
  --tangerine: #ff9f45;
  --berry: #ff5fa2;
  --grape: #a06bff;
  --neon: #4de1ff;
  --mint: #57f2a5;
  --text: #f6f1ff;
  --muted: rgba(255, 255, 255, 0.6);
  --faint: rgba(255, 255, 255, 0.45);
  --line: rgba(255, 255, 255, 0.15);
  --display:
    "Baloo 2", "Fredoka", ui-rounded, "Segoe UI", system-ui, sans-serif;
  --body: "Nunito", ui-rounded, "Segoe UI", system-ui, sans-serif;
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  min-height: 100%;
}
html {
  background-color: #070318;
}
body {
  font-family: var(--body);
  color: var(--text);
  background-color: var(--space-950);
  background:
    radial-gradient(
      120% 80% at 12% 0%,
      rgba(160, 107, 255, 0.35) 0%,
      transparent 55%
    ),
    radial-gradient(
      90% 70% at 92% 8%,
      rgba(77, 225, 255, 0.28) 0%,
      transparent 60%
    ),
    radial-gradient(
      120% 90% at 50% 110%,
      rgba(255, 95, 162, 0.24) 0%,
      transparent 60%
    ),
    linear-gradient(180deg, #0d0728, #070318 55%, #0b0526);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button {
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
}
input {
  font-family: inherit;
}
h1,
h2,
h3,
.display {
  font-family: var(--display);
}
@keyframes float {
  50% {
    transform: translateY(-10px);
  }
}
@keyframes pop {
  0% {
    transform: scale(0.7);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes slide-up {
  0% {
    transform: translateY(18px);
    opacity: 0;
  }
}
@keyframes wiggle {
  0%,
  to {
    transform: rotate(-6deg);
  }
  50% {
    transform: rotate(6deg);
  }
}
@keyframes twinkle {
  0%,
  to {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}
.float {
  animation: float 3.6s ease-in-out infinite;
}
.pop {
  animation: pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.slide-up {
  animation: slide-up 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.wiggle {
  animation: wiggle 1.6s ease-in-out infinite;
  display: inline-block;
}
.page {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}
.star-field:before {
  content: "";
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  background-image:
    radial-gradient(
      1.6px 1.6px at 20% 30%,
      rgba(255, 255, 255, 0.9),
      transparent
    ),
    radial-gradient(
      1.4px 1.4px at 70% 18%,
      rgba(255, 212, 71, 0.85),
      transparent
    ),
    radial-gradient(
      1.8px 1.8px at 42% 72%,
      rgba(77, 225, 255, 0.8),
      transparent
    ),
    radial-gradient(
      1.2px 1.2px at 86% 62%,
      rgba(255, 255, 255, 0.75),
      transparent
    ),
    radial-gradient(
      1.5px 1.5px at 10% 84%,
      rgba(255, 95, 162, 0.7),
      transparent
    ),
    radial-gradient(
      1.3px 1.3px at 58% 44%,
      rgba(255, 255, 255, 0.6),
      transparent
    );
  background-size: 420px 420px;
  animation: twinkle 4s ease-in-out infinite;
}
.header {
  position: relative;
  z-index: 2;
  padding-left: max(16px, env(safe-area-inset-left, 0px)) !important;
  padding-right: max(16px, env(safe-area-inset-right, 0px)) !important;
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 16px 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: 21px;
  line-height: 1;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #4de1ffcc;
  margin-top: 3px;
}
.nav {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.nav button {
  border-radius: 999px;
  background: #ffffff1a;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 800;
  color: #ffffffd1;
}
.nav button:hover {
  background: #fff3;
}
.nav button.on {
  background: #ffffff38;
  color: #fff;
}
.nav button.hot {
  background: linear-gradient(90deg, var(--grape), var(--berry));
  color: #fff;
}
.layout {
  position: relative;
  z-index: 1;
  padding-left: max(16px, env(safe-area-inset-left, 0px)) !important;
  padding-right: max(16px, env(safe-area-inset-right, 0px)) !important;
  max-width: 1280px;
  margin: 0 auto;
  padding: 6px 16px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}
.main-col,
.side-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .header {
    padding-block: 10px 4px;
  }
  .layout {
    padding-block: 4px 20px;
  }
  .nav {
    margin-left: 0;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .nav button {
    flex-shrink: 0;
  }
}
.panel,
.card {
  background: linear-gradient(180deg, #33206fb8, #0d0728d1);
  border: 1px solid rgba(160, 107, 255, 0.35);
  box-shadow:
    0 20px 50px -22px #000000e6,
    inset 0 1px #ffffff1f;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-radius: 24px;
}
.card {
  padding: 14px;
}
.card h3,
.panel-title {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 800;
  color: #ffffffe6;
}
.sub-box {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #07031880;
  border-radius: 18px;
  padding: 10px 12px;
}
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 22px;
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
  color: var(--space-950);
  background: linear-gradient(180deg, var(--sun), var(--tangerine));
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    0 6px #00000059,
    0 14px 30px -8px #0009,
    inset 0 2px #ffffff73;
  transition:
    transform 90ms ease,
    box-shadow 90ms ease,
    filter 0.16s ease;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
.btn:hover {
  filter: brightness(1.08) saturate(1.05);
}
.btn:active {
  transform: translateY(5px) scale(0.985);
  box-shadow:
    0 1px #00000059,
    0 6px 14px -6px #0009,
    inset 0 2px #ffffff59;
}
.btn.big {
  font-size: 23px;
  padding: 15px 26px;
}
.btn.mint {
  background: linear-gradient(180deg, var(--mint), var(--neon));
}
.btn.sky {
  background: linear-gradient(180deg, #9fe9ff, var(--neon));
}
.btn.pink {
  background: linear-gradient(180deg, #ff9cc8, var(--berry));
  color: #fff;
}
.btn.grape {
  background: linear-gradient(180deg, var(--grape), var(--space-600));
  color: #fff;
}
.btn.ghost {
  background: #ffffff26;
  color: #fff;
  font-size: 16px;
  padding: 11px 18px;
}
.btn.danger {
  background: linear-gradient(180deg, #ff8fa3, #e8405f);
  color: #fff;
}
.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}
.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 17px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: #ffffff26;
  flex-shrink: 0;
  transition: transform 0.1s;
}
.icon-btn:hover {
  background: #ffffff40;
}
.icon-btn:active {
  transform: scale(0.9);
}
.icon-btn.off {
  border-color: #ffffff1a;
  background: #ffffff0d;
  opacity: 0.6;
}
.icon-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.chip-label {
  border-radius: 999px;
  border: 1px solid;
  padding: 4px 12px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
}
.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chips.scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.chip {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: #ffffff0d;
  color: #ffffffb3;
  transition: all 0.15s;
}
.chip:hover {
  border-color: #fff6;
}
.chip.on {
  border-color: var(--sun);
  background: #ffd44733;
  color: var(--sun);
}
kbd {
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: #ffffff1a;
  padding: 1px 6px;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  color: #ffffffd9;
}
.text-outline {
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.45),
    0 0 22px rgba(160, 107, 255, 0.55);
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
}
.tiny {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.grow {
  flex: 1;
  min-width: 0;
}
.center {
  text-align: center;
}
.scroll-slim::-webkit-scrollbar,
.chips.scroll::-webkit-scrollbar {
  height: 6px;
  width: 8px;
}
.scroll-slim::-webkit-scrollbar-thumb,
.chips.scroll::-webkit-scrollbar-thumb {
  background: #a06bff80;
  border-radius: 999px;
}
.hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 12px 16px;
}
.hearts span {
  font-size: 19px;
  transition: all 0.2s;
}
.hearts .lost {
  opacity: 0.25;
  filter: grayscale(1);
  transform: scale(0.9);
  display: inline-block;
}
.score {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 800;
  color: var(--sun);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.lvbar {
  width: 90px;
  height: 8px;
  border-radius: 999px;
  background: #ffffff1a;
  overflow: hidden;
}
.lvbar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--neon), var(--mint));
  transition: width 0.3s;
}
.mission {
  position: relative;
  overflow: hidden;
  min-height: 86px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}
.mission:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: linear-gradient(180deg, var(--accent, var(--mint)), transparent);
}
.mission .pic {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  background: #07031899;
  display: grid;
  place-items: center;
  font-size: 36px;
  flex-shrink: 0;
}
.mission .mode {
  display: inline-block;
  border-radius: 999px;
  background: #ffffff1a;
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #ffffffa6;
}
.mission .main {
  font-family: var(--display);
  font-size: 25px;
  font-weight: 800;
  line-height: 1.15;
}
.mission .clue {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}
.mission .reveal {
  font-size: 13px;
  font-weight: 800;
  color: var(--mint);
}
.speak-btn {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  font-size: 22px;
  color: #fff;
  background: linear-gradient(180deg, var(--grape), var(--space-600));
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    0 5px #00000059,
    inset 0 2px #fff6;
  flex-shrink: 0;
}
.speak-btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px #00000059;
}
.field {
  position: relative;
  width: 100%;
  height: min(62vh, 580px);
  min-height: 380px;
  overflow: hidden;
  border-radius: 30px;
  border: 2px solid rgba(160, 107, 255, 0.4);
  box-shadow: 0 30px 80px -30px #000000f2;
  touch-action: none;
  background: #0d0728;
}
.field canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
@media (max-width: 640px) {
  .field {
    height: calc(100svh - 270px);
    min-height: 420px;
    border-radius: 24px;
  }
}
.field-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 12px;
}
.beam-btn {
  pointer-events: auto;
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: 24px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(77, 225, 255, 0.7);
  background: #4de1ff33;
  box-shadow: 0 0 26px -4px #4de1ffe6;
  color: var(--neon);
}
.beam-btn:active {
  transform: scale(0.9);
}
.beam-btn:disabled {
  border-color: #ffffff26;
  background: #ffffff0d;
  box-shadow: none;
  opacity: 0.6;
}
.beam-btn b {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--space-950);
  color: var(--sun);
  font-size: 11px;
  box-shadow: 0 0 0 2px #ffd44780;
}
.key-hint {
  border-radius: 16px;
  background: #0703188c;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  color: #ffffffb3;
}
@media (max-width: 640px) {
  .key-hint {
    display: none;
  }
}
.overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: flex;
  overflow-y: auto;
  background: #070318c7;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.overlay.fixed {
  position: fixed;
}
.overlay-inner {
  margin: auto;
  width: 100%;
  max-width: 760px;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  animation: slide-up 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.overlay-inner.narrow {
  max-width: 460px;
}
.big-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(34px, 7vw, 58px);
  line-height: 1;
  letter-spacing: -0.02em;
}
.tier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
}
@media (max-width: 640px) {
  .tier-grid {
    grid-template-columns: 1fr;
  }
}
.tier-card {
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: #0d072899;
  padding: 10px 12px;
  text-align: left;
  transition: all 0.15s;
}
.tier-card:hover {
  border-color: #fff6;
}
.tier-card.on {
  border-color: #fffc;
  background: #ffffff26;
  box-shadow: 0 0 28px -6px #fff9;
}
.tier-card .t {
  font-family: var(--display);
  font-weight: 800;
  font-size: 17px;
}
.tier-card .a {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--faint);
}
.tier-card .d {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.3;
  color: #ffffffbf;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
}
.stat-grid.three {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 640px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-grid.three {
    grid-template-columns: repeat(3, 1fr);
  }
}
.stat {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #07031880;
  padding: 8px 10px;
  text-align: left;
}
.stat .l {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
}
.stat .v {
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.mini-stat {
  border-radius: 16px;
  background: #07031880;
  padding: 8px 4px;
  text-align: center;
}
.mini-stat .e {
  font-size: 17px;
}
.mini-stat .v {
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
  line-height: 1.1;
}
.mini-stat .l {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--faint);
}
.stars-row {
  font-size: 46px;
  letter-spacing: 6px;
  line-height: 1;
}
.stars-row .dim {
  filter: grayscale(1);
  opacity: 0.3;
}
.word-pill {
  border-radius: 999px;
  background: #a06bff4d;
  padding: 5px 11px;
  font-size: 13px;
  font-weight: 800;
  color: #ffffffeb;
}
.word-pill:active {
  transform: scale(0.95);
}
.xp-bar {
  height: 10px;
  border-radius: 999px;
  background: #ffffff1a;
  overflow: hidden;
}
.xp-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--sun),
    var(--tangerine),
    var(--berry)
  );
  transition: width 0.5s;
}
.avatar {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 36px;
  background: linear-gradient(135deg, #a06bff66, #4de1ff33);
  flex-shrink: 0;
}
.badge-shelf {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.badge-shelf span {
  aspect-ratio: 1;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 17px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #07031880;
}
.badge-shelf span.lock {
  filter: grayscale(1);
  opacity: 0.3;
}
.badge-shelf span.got {
  border-color: #ffd44780;
  background: #ffd4471f;
  box-shadow: 0 0 14px -4px #ffd447cc;
}
.tabs {
  display: flex;
  border-radius: 999px;
  background: #07031899;
  padding: 4px;
  gap: 2px;
}
.tabs button {
  flex: 1;
  padding: 7px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: var(--faint);
  white-space: nowrap;
}
.tabs button.on {
  background: #4de1ff33;
  color: var(--neon);
}
.board {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.board li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  color: #fffc;
}
.board li:nth-child(1) {
  background: #ffd4471f;
}
.board li.me {
  outline: 2px solid rgba(87, 242, 165, 0.6);
  color: #fff;
}
.board .medal {
  width: 26px;
  text-align: center;
}
.board .sc {
  font-family: var(--display);
  color: var(--sun);
  font-variant-numeric: tabular-nums;
}
.parent-tips p {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.45;
  color: #ffffffb8;
}
.parent-tips b {
  font-weight: 800;
}
.subpage {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: slide-up 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar h2 {
  margin: 0;
  flex: 1;
  font-size: 24px;
  font-weight: 800;
}
.choice {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  border-radius: 20px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: #0d072899;
  padding: 12px;
}
.choice.on {
  border-color: #fffc;
  background: #ffffff1f;
}
.choice .em {
  font-size: 32px;
}
.field-input {
  width: 100%;
  padding: 12px 18px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: #070318b3;
  color: #fff;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  outline: none;
}
.field-input:focus {
  border-color: var(--neon);
}
.avatar-pick {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.avatar-pick button {
  aspect-ratio: 1;
  font-size: 30px;
  border-radius: 16px;
  background: #07031880;
  border: 2px solid transparent;
}
.avatar-pick button.on {
  border-color: var(--sun);
  background: #ffd44726;
}
.word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
}
.word-card {
  position: relative;
  border-radius: 18px;
  padding: 10px 6px 8px;
  text-align: center;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: #0d072899;
}
.word-card:hover {
  border-color: #ffffff59;
}
.word-card:active {
  transform: scale(0.95);
}
.word-card .em {
  font-size: 38px;
  line-height: 1.15;
}
.word-card b {
  display: block;
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.1;
  margin-top: 2px;
}
.word-card span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.word-card .tag {
  position: absolute;
  top: 5px;
  right: 7px;
  font-size: 12px;
}
.word-card.learned {
  border-color: #57f2a58c;
}
.word-card.mastered {
  border-color: var(--sun);
  background: #ffd4471a;
}
.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.badge {
  display: flex;
  gap: 10px;
  align-items: center;
  border-radius: 18px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #07031880;
}
.badge .em {
  font-size: 30px;
}
.badge.locked .em {
  filter: grayscale(1);
  opacity: 0.3;
}
.badge b {
  display: block;
  font-size: 14px;
}
.badge span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.mem-grid {
  display: grid;
  gap: 10px;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}
.mem-card {
  aspect-ratio: 3/4;
  perspective: 600px;
}
.mem-card .in {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.35s;
  transform-style: preserve-3d;
}
.mem-card.up .in {
  transform: rotateY(180deg);
}
.mem-card .face {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  place-items: center;
  border-radius: 18px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 2px solid rgba(255, 255, 255, 0.3);
}
.mem-card .back {
  font-size: 30px;
  background: linear-gradient(150deg, var(--grape), var(--berry));
  box-shadow: inset 0 2px #ffffff59;
}
.mem-card .front {
  transform: rotateY(180deg);
  background: #fff;
  color: var(--space-800);
  font-family: var(--display);
  font-weight: 800;
  padding: 4px;
  line-height: 1.05;
}
.mem-card.done .front {
  background: #d9ffe9;
  border-color: var(--mint);
}
.toggle {
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: #fff3;
  position: relative;
  flex-shrink: 0;
}
.toggle:after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.2s;
}
.toggle.on {
  background: var(--mint);
}
.toggle.on:after {
  left: 26px;
}
.about {
  position: relative;
  z-index: 1;
  padding-left: max(16px, env(safe-area-inset-left, 0px)) !important;
  padding-right: max(16px, env(safe-area-inset-right, 0px)) !important;
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 16px 40px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}
@media (max-width: 980px) {
  .about {
    grid-template-columns: 1fr;
  }
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (max-width: 640px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }
}
.feature {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #07031873;
  padding: 12px;
}
.feature .t {
  font-family: var(--display);
  font-weight: 800;
  font-size: 16px;
}
.feature p {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: #ffffffb3;
}
.controls li {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
  font-size: 13px;
}
.controls {
  list-style: none;
  margin: 0;
  padding: 0;
}
.controls code {
  min-width: 128px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--neon);
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 #ffd447b3;
  }
  to {
    box-shadow: 0 0 0 18px #ffd44700;
  }
}
@keyframes hover-ufo {
  50% {
    transform: translate(-50%, -6px);
  }
}
.journey-head {
  padding: 16px;
}
.journey-bar {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: #ffffff1a;
  margin: 12px 18px 4px 0;
}
.journey-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--neon), var(--mint), var(--sun));
  transition: width 0.6s;
}
.journey-bar .flag {
  position: absolute;
  right: -18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
}
.mini-stat.chest {
  border: 2px solid transparent;
  cursor: pointer;
}
.mini-stat.chest.ready {
  border-color: var(--sun);
  animation: pulse-ring 1.4s infinite;
}
.friends {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 52px));
  justify-content: center;
  gap: 6px;
}
.friend-slot {
  aspect-ratio: 1;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: #07031880;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  filter: grayscale(1);
  opacity: 0.5;
}
.friend-slot.ok {
  filter: none;
  opacity: 1;
  border: 2px solid var(--mint);
  background: #57f2a51f;
  font-size: 26px;
}
.world {
  position: relative;
  border-radius: 26px;
  padding: 14px 14px 18px;
  background:
    radial-gradient(
      120% 70% at 50% 0%,
      color-mix(in srgb, var(--wc, #a06bff) 26%, transparent),
      transparent 70%
    ),
    linear-gradient(180deg, #33206f8c, #0d0728bf);
  border: 1px solid color-mix(in srgb, var(--wc, #a06bff) 45%, transparent);
}
.world.locked {
  filter: saturate(0.35);
  opacity: 0.75;
}
.world.goal {
  --wc: #ffd447;
}
.world-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.planet {
  font-size: 46px;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 30%,
    #ffffff59,
    color-mix(in srgb, var(--wc, #a06bff) 55%, transparent)
  );
  flex-shrink: 0;
}
.path {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 36px;
}
.node-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 120px;
}
.node {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  font-family: var(--display);
  font-weight: 800;
  font-size: 24px;
  color: var(--space-950);
  background: linear-gradient(
    180deg,
    #fff,
    color-mix(in srgb, var(--wc, #a06bff) 70%, white)
  );
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 6px #00000059,
    inset 0 2px #fff9;
  display: grid;
  place-items: center;
  transition: transform 0.1s;
}
.node:active {
  transform: translateY(4px);
}
.node.done {
  background: linear-gradient(180deg, #fff6c2, var(--sun));
}
.node.boss {
  width: 78px;
  height: 78px;
  font-size: 34px;
  background: linear-gradient(180deg, #ffd0e6, var(--berry));
}
.node.boss.done {
  background: linear-gradient(180deg, #d6fff0, var(--mint));
}
.node.locked {
  background: #ffffff1f;
  border-color: #fff3;
  color: #fff;
  font-size: 20px;
  box-shadow: none;
  cursor: not-allowed;
}
.node.current {
  animation: pulse-ring 1.4s infinite;
  border-color: var(--sun);
}
.node .you {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translate(-50%);
  font-size: 26px;
  animation: hover-ufo 1.6s ease-in-out infinite;
}
.node-stars {
  font-size: 12px;
  font-weight: 800;
  color: var(--sun);
  min-height: 16px;
  letter-spacing: 1px;
}
.node-words {
  font-size: 13px;
  opacity: 0.85;
  white-space: nowrap;
}
.learn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 640px;
}
.learn-card {
  border-radius: 20px;
  padding: 12px 6px 10px;
  background: #ffffff14;
  border: 3px solid rgba(255, 255, 255, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all 0.2s;
}
.learn-card .em {
  font-size: 46px;
  line-height: 1.1;
}
.learn-card b {
  font-family: var(--display);
  font-size: 21px;
  line-height: 1.1;
}
.learn-card span:last-child {
  font-size: 12.5px;
  color: var(--muted);
}
.learn-card.seen {
  border-color: #57f2a58c;
}
.learn-card.on {
  border-color: var(--sun);
  background: #ffd44729;
  transform: scale(1.06);
}
.boss-cage {
  position: relative;
  width: 128px;
  height: 128px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  background: #ff5fa226;
  border: 3px solid var(--berry);
}
.cage-bars {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: 26px;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 18px,
    rgba(220, 220, 255, 0.75) 18px 23px
  );
}
.rescued {
  position: relative;
  display: grid;
  place-items: center;
}
.rescued .friend {
  font-size: 92px;
  animation: float 2s ease-in-out infinite;
}
.rescued .hearts-fly {
  font-size: 26px;
  letter-spacing: 8px;
}
.reward-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 560px;
}
.reward {
  border-radius: 18px;
  padding: 8px;
  background: #0703188c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.reward .e {
  font-size: 26px;
}
.reward b {
  font-family: var(--display);
  font-size: 24px;
  line-height: 1.1;
  color: var(--sun);
}
.reward span:last-child {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--faint);
}
.certificate {
  width: 100%;
  border-radius: 22px;
  padding: 22px 18px;
  background: radial-gradient(circle at 50% 0%, #fffbe6, #ffe9a8);
  border: 6px double #d4a017;
  box-shadow: 0 20px 60px #00000080;
  color: #4a2a00;
}
.cert-top {
  font-family: var(--display);
  font-weight: 800;
  font-size: 30px;
  color: #b8860b;
}
.cert-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: 34px;
  color: #c2186b;
  margin: 4px 0;
}
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.shop-item {
  border-radius: 20px;
  padding: 12px;
  background: #0d072899;
  border: 2px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.shop-item.on {
  border-color: var(--mint);
  background: #57f2a514;
}
.shop-item b {
  font-size: 13.5px;
}
.shop-item .tag {
  font-size: 13px;
  font-weight: 800;
  color: var(--mint);
  padding: 7px 0;
}
.ufo {
  position: relative;
  width: 96px;
  height: 64px;
}
.ufo .hull {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--h1), var(--h2) 50%, var(--h3));
  border: 2px solid rgba(60, 16, 80, 0.5);
}
.ufo .dome {
  position: absolute;
  left: 50%;
  top: 2px;
  transform: translate(-50%);
  width: 50px;
  height: 34px;
  border-radius: 50px 50px 6px 6px;
  background: var(--dome);
  display: grid;
  place-items: center;
  font-size: 20px;
  z-index: 1;
}
.pet-img {
  display: inline-grid;
  place-items: center;
  line-height: 0;
}
.pet-img svg {
  display: block;
}
.pet-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px;
  border-radius: 20px;
  background: radial-gradient(120% 120% at 15% 50%, #57f2a52e, #07031859);
  border: 1px solid rgba(87, 242, 165, 0.35);
}
.pet-img.big {
  flex-shrink: 0;
  animation: float 3s ease-in-out infinite;
}
@media (max-width: 520px) {
  .pet-panel {
    flex-direction: column;
    text-align: center;
  }
  .pet-stages {
    justify-content: center;
  }
}
.pet-stages {
  display: flex;
  gap: 4px;
  margin: 6px 0 4px;
  flex-wrap: wrap;
}
.pet-stages span {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #07031880;
  filter: grayscale(1) brightness(0.5);
  opacity: 0.6;
}
.pet-stages span.on {
  filter: none;
  opacity: 1;
  background: #57f2a526;
}
.evolve {
  width: 100%;
  max-width: 460px;
  border-radius: 22px;
  padding: 12px;
  background: radial-gradient(circle at 50% 30%, #57f2a540, #07031899);
  border: 2px solid var(--mint);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.evolve-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.evolve .arrow {
  font-size: 30px;
  color: var(--sun);
}
@media (max-width: 520px) {
  .pet-stages span {
    width: 31px;
    height: 31px;
  }
  .pet-stages {
    gap: 3px;
  }
}
.fire-btn {
  pointer-events: auto;
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 26px;
  line-height: 1;
  color: #fff;
  background: radial-gradient(
    circle at 35% 30%,
    #ff9cc8,
    var(--berry) 60%,
    #b5175f
  );
  border: 3px solid rgba(255, 255, 255, 0.7);
  box-shadow:
    0 6px #00000059,
    0 0 26px -4px #ff5fa2e6;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
.fire-btn b {
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.08em;
  margin-top: -14px;
}
.fire-btn:active {
  transform: translateY(4px) scale(0.95);
  box-shadow: 0 2px #00000059;
}
@media (hover: hover) and (pointer: fine) {
  .fire-btn {
    display: none;
  }
}
.voice-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
}
.voice-item {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 6px 8px 6px 12px;
  border-radius: 14px;
  background: #07031880;
  border: 2px solid transparent;
}
.voice-item.on {
  border-color: var(--mint);
  background: #57f2a51a;
}
.voice-item .icon-btn {
  width: 36px;
  height: 36px;
  font-size: 14px;
}
.vbadge {
  margin-left: 6px;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 99px;
}
.vbadge.good {
  background: #57f2a533;
  color: var(--mint);
}
.vbadge.old {
  background: #ff5f7e2e;
  color: #ff9db0;
}
.stage-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  touch-action: none;
}
.stage-head {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.speak-card {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 16px 28px 14px;
  border-radius: 28px;
  background: linear-gradient(180deg, #ff7ad92e, #0703188c);
  border: 2px solid rgba(255, 122, 217, 0.45);
  min-width: min(320px, 100%);
}
.speak-card .em {
  font-size: 76px;
  line-height: 1.1;
}
.speak-word {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(38px, 8vw, 60px);
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--sun);
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.4);
}
.mic-btn {
  display: grid;
  justify-items: center;
  gap: 2px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  align-content: center;
  background: radial-gradient(
    circle at 35% 30%,
    #ff9cc8,
    var(--berry) 60%,
    #b2186b
  );
  border: 4px solid rgba(255, 255, 255, 0.5);
  box-shadow:
    0 8px #00000059,
    0 18px 40px -10px #ff5fa2b3;
  color: #fff;
  transition: transform 0.1s ease;
}
.mic-btn span {
  font-size: 52px;
  line-height: 1;
}
.mic-btn b {
  font-family: var(--display);
  font-size: 15px;
  line-height: 1.1;
  padding: 0 10px;
}
.mic-btn:active {
  transform: translateY(4px);
}
.mic-btn.on {
  animation: mic-pulse 1s ease-out infinite;
  background: radial-gradient(
    circle at 35% 30%,
    #b8fff0,
    var(--mint) 60%,
    #1fb37a
  );
  color: var(--space-950);
}
@keyframes mic-pulse {
  0% {
    box-shadow: 0 0 #57f2a5b3;
  }
  to {
    box-shadow: 0 0 0 26px #57f2a500;
  }
}
.score-box {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  border-radius: 22px;
  border: 2px solid;
  background: #07031899;
  max-width: 560px;
}
.score-ring {
  --p: 0%;
  --c: var(--mint);
  width: 84px;
  height: 84px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--c) var(--p), rgba(255, 255, 255, 0.12) 0);
  position: relative;
}
.score-ring:before {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  bottom: 8px;
  left: 8px;
  border-radius: 50%;
  background: var(--space-900);
}
.score-ring b {
  position: relative;
  font-family: var(--display);
  font-size: 30px;
  font-weight: 800;
}
.build-prompt {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-radius: 22px;
  background: #0703188c;
  border: 1px solid rgba(77, 225, 255, 0.35);
  max-width: 560px;
  width: 100%;
}
.build-prompt .em {
  font-size: 54px;
}
.build-prompt > div {
  flex: 1;
}
.timebar {
  position: relative;
  width: 100%;
  max-width: 520px;
  height: 22px;
  border-radius: 99px;
  background: #ffffff1a;
  overflow: hidden;
}
.timebar i {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--sun), var(--tangerine));
  transition: width 0.25s linear;
}
.timebar span {
  position: relative;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 22px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 8px;
}
.slot {
  width: clamp(40px, 9vw, 54px);
  height: clamp(48px, 10.5vw, 62px);
  border-radius: 14px;
  border: 3px dashed rgba(255, 255, 255, 0.4);
  background: #07031880;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(24px, 5vw, 34px);
  text-transform: lowercase;
}
.slots.words .slot {
  width: auto;
  min-width: 64px;
  padding: 0 10px;
  font-size: clamp(17px, 3.6vw, 22px);
  text-transform: none;
  height: 50px;
}
.slot.filled {
  border-style: solid;
  border-color: var(--mint);
  background: linear-gradient(180deg, #57f2a559, #4de1ff33);
}
.slot.bad {
  border-color: #ff5f7e;
  background: #ff5f7e40;
  animation: shake 0.4s;
}
.slot .ghost {
  opacity: 0.28;
}
.slot-gap {
  width: 18px;
}
.slot-dot {
  font-family: var(--display);
  font-size: 34px;
  font-weight: 800;
  align-self: flex-end;
}
.slots.done .slot {
  border-color: var(--sun);
  animation: pop 0.35s both;
}
.tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  max-width: 600px;
  padding: 6px;
}
.tile {
  min-width: clamp(46px, 10vw, 58px);
  height: clamp(50px, 11vw, 62px);
  padding: 0 10px;
  border-radius: 16px;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(24px, 5vw, 32px);
  color: var(--space-950);
  background: linear-gradient(180deg, #fff6c9, var(--sun));
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    0 5px #00000059,
    inset 0 2px #ffffffb3;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  cursor: grab;
}
.tiles.words .tile {
  font-size: clamp(17px, 3.6vw, 22px);
  height: 50px;
  background: linear-gradient(180deg, #d9f7ff, var(--neon));
}
.tile.used {
  visibility: hidden;
}
.tile.drag-src {
  opacity: 0.3;
}
.tile.bad {
  animation: shake 0.4s;
  background: linear-gradient(180deg, #ffd0d8, #ff7a94);
}
.tile.drag {
  position: fixed;
  z-index: 200;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1.15);
  display: grid;
  place-items: center;
  box-shadow: 0 16px 30px #00000080;
}
.tile.drag.word {
  font-size: 22px;
  height: 50px;
  background: linear-gradient(180deg, #d9f7ff, var(--neon));
}
@keyframes shake {
  20%,
  60% {
    transform: translate(-6px);
  }
  40%,
  80% {
    transform: translate(6px);
  }
}
.stage-sum {
  display: grid;
  gap: 4px;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  padding: 10px 14px;
  border-radius: 16px;
  background: #07031880;
  border: 1px solid rgba(255, 255, 255, 0.12);
  max-width: 560px;
  width: 100%;
}
.stage-plan {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
}
.stage-plan span {
  padding: 4px 10px;
  border-radius: 99px;
  background: #ffffff1a;
}
.farm-col {
  gap: 12px;
}
.farm-head {
  padding: 14px;
  display: grid;
  gap: 10px;
  background: linear-gradient(180deg, #4aa0468c, #0d0728d9);
  border-color: #8bd34f80;
}
.farm-title {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 1 1 220px;
}
.farm-lv {
  width: 160px;
  margin-top: 4px;
}
.res-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.res-bar span {
  padding: 6px 10px;
  border-radius: 99px;
  background: #0703188c;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-weight: 800;
  font-size: 15px;
}
.farm-alerts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 800;
}
.farm-alerts span {
  padding: 4px 10px;
  border-radius: 99px;
  background: #ffffff1a;
}
.farm-alerts .warn,
.warn {
  color: #ffcf6b;
}
.farm-alerts .good,
.good {
  color: var(--mint);
}
.bad {
  color: #ff8fa3;
}
.farm-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.farm-tabs button {
  display: grid;
  padding: 8px 4px;
  border-radius: 16px;
  background: #07031873;
  border: 2px solid transparent;
  line-height: 1.15;
}
.farm-tabs button b {
  font-family: var(--display);
  font-size: 15px;
}
.farm-tabs button span {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 700;
}
.farm-tabs button.on {
  border-color: var(--sun);
  background: #ffd44729;
}
@media (max-width: 560px) {
  .farm-tabs button b {
    font-size: 12.5px;
  }
}
.farm-scene {
  padding: 14px;
}
.farm-scene.grass {
  background:
    radial-gradient(
      60% 40% at 20% 0%,
      rgba(255, 240, 160, 0.25),
      transparent 70%
    ),
    linear-gradient(180deg, #4f9e3f, #2f7a35 60%, #23602b);
  border-color: #a0e66e8c;
}
.farm-scene.soil {
  background: linear-gradient(180deg, #7bb662, #5a8f45);
  border-color: #a0e66e8c;
}
.farm-scene.barn,
.farm-scene.market,
.farm-scene.orders {
  background: linear-gradient(180deg, #9652288c, #0d0728d9);
  border-color: #e0a96d80;
}
.pens,
.plots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 12px;
}
.pen,
.plot {
  position: relative;
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 12px 10px 10px;
  border-radius: 22px;
  background: linear-gradient(180deg, #f6e2b8, #e2c08a);
  color: #4a2c0c;
  border: 3px solid #b27a3f;
  box-shadow: 0 6px #00000040;
  text-align: center;
}
.pen.friend {
  background: linear-gradient(180deg, #fff3c4, #ffd98a);
  border-color: #e0a12a;
}
.pen.sad,
.pen.hungry,
.pen.thirsty {
  background: linear-gradient(180deg, #e9ddd0, #cdbba6);
}
.pen.empty {
  border-style: dashed;
  background: #ffffff26;
  color: #fff;
  min-height: 200px;
  align-content: center;
}
.pen-pet {
  font-size: 64px;
  line-height: 1.05;
  animation: float 2.6s ease-in-out infinite;
}
.pen.sad .pen-pet {
  filter: grayscale(0.7);
  animation: none;
  transform: rotate(-8deg);
}
.pen.hungry .pen-pet,
.pen.thirsty .pen-pet {
  animation: wiggle 1.2s ease-in-out infinite;
}
.pen-name {
  display: grid;
  line-height: 1.15;
}
.pen-name b {
  font-family: var(--display);
  font-size: 17px;
}
.pen-name span,
.plot-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #7a5228;
}
.need {
  display: flex;
  gap: 6px;
  align-items: center;
  width: 100%;
}
.need i {
  flex: 1;
  height: 10px;
  border-radius: 99px;
  background: #0000002e;
  overflow: hidden;
}
.need em {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #57d977, #9df27a);
  border-radius: 99px;
}
.need em.low {
  background: linear-gradient(90deg, #ff7a6b, #ffb36b);
}
.mood-line {
  font-size: 12px;
  font-weight: 800;
  min-height: 30px;
}
.pen .warn,
.plot .warn {
  color: #c2410c;
}
.pen .good {
  color: #157f3c;
}
.pen .bad {
  color: #b4233c;
}
.pen-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.mini-btn {
  padding: 7px 12px;
  border-radius: 99px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 14px;
  color: #3a2208;
  background: linear-gradient(180deg, #fff1a8, var(--sun));
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 3px #0000004d;
}
.mini-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px #0000004d;
}
.mini-btn:disabled {
  opacity: 0.45;
}
.mini-btn.blue {
  background: linear-gradient(180deg, #c9f3ff, #4dc8ff);
}
.mini-btn.green {
  background: linear-gradient(180deg, #d4ffc4, #6fdc5a);
}
.mini-btn.gem {
  background: linear-gradient(180deg, #e5dcff, #a88bff);
}
.mini-btn.wood {
  background: linear-gradient(180deg, #f3cf9b, #c98a4b);
}
.mini-btn.pulse {
  animation: pulse-ring 1.2s ease-out infinite;
}
.bubble {
  position: absolute;
  top: -12px;
  right: -8px;
  z-index: 2;
  font-size: 26px;
  padding: 6px 10px;
  border-radius: 20px;
  background: #fff;
  color: #4a2c0c;
  font-weight: 800;
  border: 3px solid var(--sun);
  box-shadow: 0 6px 14px #0000004d;
  animation: float 1.6s ease-in-out infinite;
}
.farm-foot {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-top: 12px;
}
.farm-foot .muted {
  color: #ffffffd9;
}
.plot {
  background: linear-gradient(180deg, #9a6a3f, #6f4524);
  border-color: #4f2f15;
  color: #fff;
  min-height: 190px;
  align-content: start;
}
.plot.dry {
  background: linear-gradient(180deg, #b89069, #8b6440);
}
.plot .plot-name {
  color: #ffe9c9;
}
.plot .warn {
  color: #ffd27a;
}
.plot-empty {
  display: grid;
  gap: 2px;
  justify-items: center;
  align-content: center;
  height: 100%;
  min-height: 160px;
  width: 100%;
  color: #fff;
}
.plot-empty span {
  font-size: 46px;
}
.plot-empty b {
  font-family: var(--display);
  font-size: 18px;
}
.plot-crop {
  font-size: 58px;
  line-height: 1.1;
}
.plot.ready .plot-crop {
  animation: float 1.8s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(255, 230, 120, 0.8));
}
.barn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.barn-item {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 10px 8px;
  border-radius: 18px;
  background: #fff4dc1f;
  border: 1px solid rgba(255, 220, 170, 0.3);
  text-align: center;
}
.barn-item.locked {
  opacity: 0.6;
}
.barn-item .em {
  font-size: 40px;
  line-height: 1.1;
}
.barn-item b {
  font-family: var(--display);
  font-size: 16px;
}
.barn-item .count {
  font-weight: 800;
  color: var(--sun);
  font-size: 14px;
}
.feed-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
}
.feed-grid.wide {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.feed-opt {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 12px 8px;
  border-radius: 20px;
  background: #ffffff1a;
  border: 2px solid rgba(255, 255, 255, 0.2);
}
.feed-opt span {
  font-size: 44px;
  line-height: 1.1;
}
.feed-opt b {
  font-family: var(--display);
  font-size: 19px;
}
.feed-opt small {
  color: var(--muted);
  font-weight: 700;
}
.feed-opt:hover {
  border-color: var(--sun);
}
.feed-opt.bad {
  border-color: #ff5f7e;
  animation: shake 0.4s;
}
.feed-opt.locked {
  opacity: 0.5;
}
.order-list {
  display: grid;
  gap: 10px;
}
.order {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 18px;
  background: #fff4dc1f;
  border: 1px solid rgba(255, 220, 170, 0.3);
}
.order.done {
  opacity: 0.6;
}
.order-text {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  color: #fff3c9;
}
.word-pill.ok {
  background: #57f2a540;
}
.farm-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%);
  z-index: 120;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 18px;
  background: #070318eb;
  border: 2px solid var(--sun);
  font-weight: 800;
  box-shadow: 0 16px 40px #00000080;
}
.farm-toast {
  animation: toast-in 0.3s ease both;
}
@keyframes toast-in {
  0% {
    opacity: 0;
    transform: translate(-50%, 16px);
  }
}
.stage-overlay {
  z-index: 50;
  background:
    radial-gradient(
      90% 60% at 50% 0%,
      rgba(160, 107, 255, 0.35),
      transparent 70%
    ),
    #070318f0;
}
.stage-overlay .overlay-inner {
  padding: max(18px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.login-card {
  width: 100%;
  max-width: 480px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.login-label {
  align-self: flex-start;
  font-weight: 800;
  margin-top: 6px;
}
.login-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  background: #070318b3;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}
.login-input:focus {
  outline: none;
  border-color: var(--neon);
}
.login-input.code {
  text-align: center;
  font-size: 34px;
  letter-spacing: 12px;
  font-family: var(--display);
}
.link-btn {
  color: var(--neon);
  font-weight: 800;
  text-decoration: underline;
  padding: 6px;
}
@media (max-width: 520px) {
  .pens,
  .plots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .pen,
  .plot {
    padding: 10px 6px 8px;
    border-radius: 18px;
  }
  .pen-pet {
    font-size: 48px;
  }
  .plot-crop {
    font-size: 46px;
  }
  .mini-btn {
    padding: 6px 9px;
    font-size: 13px;
  }
  .pen.empty {
    min-height: 150px;
  }
  .barn-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .reward-row {
    grid-template-columns: repeat(2, 1fr);
  }
}
.ipa {
  font-family:
    Segoe UI,
    Lucida Sans Unicode,
    Arial Unicode MS,
    Noto Sans,
    system-ui,
    sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--neon);
  letter-spacing: 0.02em;
}
.ipa.inline {
  font-size: 14px;
}
.ipa.small-ipa {
  font-size: 13px;
  font-style: normal;
}
.farm3d {
  position: relative;
  height: clamp(300px, 46vw, 440px);
  border-radius: 24px;
  overflow: hidden;
  border: 3px solid rgba(160, 230, 110, 0.6);
  box-shadow: 0 18px 40px -18px #000c;
  -webkit-user-select: none;
  user-select: none;
}
.f3-sky {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 45%;
  left: 0;
  background: linear-gradient(180deg, #6ec8ff, #bfe9ff 70%, #e9f8ff);
}
.f3-sun {
  position: absolute;
  right: 9%;
  top: 12%;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    #fff7b0 0,
    #fff7b0 45%,
    #ffd447 60%,
    #ffd44700 72%
  );
  animation: float 6s ease-in-out infinite;
}
.f3-cloud {
  position: absolute;
  width: 110px;
  height: 34px;
  border-radius: 40px;
  background: #fff;
  opacity: 0.95;
  animation: cloud 38s linear infinite;
}
.f3-cloud:before,
.f3-cloud:after {
  content: "";
  position: absolute;
  background: #fff;
  border-radius: 50%;
}
.f3-cloud:before {
  width: 50px;
  height: 50px;
  left: 18px;
  top: -24px;
}
.f3-cloud:after {
  width: 36px;
  height: 36px;
  left: 56px;
  top: -14px;
}
.f3-cloud.c1 {
  top: 14%;
  left: -20%;
}
.f3-cloud.c2 {
  top: 28%;
  left: -40%;
  transform: scale(0.7);
  animation-duration: 52s;
  animation-delay: -18s;
}
.f3-cloud.c3 {
  top: 8%;
  left: -60%;
  transform: scale(0.85);
  animation-duration: 46s;
  animation-delay: -30s;
}
@keyframes cloud {
  to {
    left: 120%;
  }
}
.f3-hills {
  position: absolute;
  left: -10%;
  right: -10%;
  top: 34%;
  height: 30%;
  background:
    radial-gradient(60% 100% at 20% 100%, #5fbf4f 0 60%, transparent 61%),
    radial-gradient(55% 90% at 70% 100%, #4fae45 0 60%, transparent 61%),
    radial-gradient(40% 80% at 100% 100%, #6cc95a 0 60%, transparent 61%);
}
.f3-ground {
  position: absolute;
  left: -30%;
  right: -30%;
  top: 50%;
  bottom: -20%;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.06) 0 60px,
      transparent 60px 120px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.05) 0 60px,
      transparent 60px 120px
    ),
    linear-gradient(180deg, #7ed36a, #5cb84a, #46a03a);
  transform: perspective(600px) rotateX(48deg);
  transform-origin: 50% 0;
}
.f3-sign {
  position: absolute;
  left: 3%;
  top: 44%;
  z-index: 5;
  padding: 6px 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, #c98a4b, #9a6230);
  color: #fff6e0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(13px, 2vw, 17px);
  border: 3px solid #6b3f17;
  box-shadow: 0 6px #00000040;
}
.f3-prop {
  position: absolute;
  pointer-events: none;
}
.f3-prop.barn {
  right: 3%;
  top: 18%;
  width: clamp(120px, 20vw, 200px);
  z-index: 560;
}
.f3-prop.tree1 {
  left: 16%;
  top: 14%;
  width: clamp(90px, 14vw, 150px);
  z-index: 520;
}
.f3-prop.tree2 {
  left: 58%;
  top: 20%;
  width: clamp(70px, 10vw, 110px);
  z-index: 515;
}
.f3-prop.mill {
  left: 37%;
  top: 22%;
  width: clamp(70px, 10vw, 110px);
  z-index: 510;
}
.f3-prop.well {
  left: 3%;
  top: 56%;
  width: clamp(60px, 9vw, 95px);
  z-index: 600;
}
.f3-prop.hay {
  right: 4%;
  top: 70%;
  width: clamp(60px, 9vw, 100px);
  z-index: 950;
}
.f3-fence {
  position: absolute;
  left: 0;
  right: 0;
  top: 51%;
  height: 22px;
  z-index: 540;
  background:
    repeating-linear-gradient(90deg, #d9a35b 0 8px, transparent 8px 40px),
    linear-gradient(
      180deg,
      transparent 0 5px,
      #c98a4b 5px 9px,
      transparent 9px 14px,
      #c98a4b 14px 18px,
      transparent 18px
    );
  opacity: 0.9;
}
.f3-animal {
  position: absolute;
  cursor: pointer;
  display: grid;
  justify-items: center;
  transform-origin: 50% 100%;
  width: 120px;
}
.f3-pic {
  height: 110px;
  display: grid;
  place-items: end center;
  transition: transform 0.2s;
}
.f3-pic img {
  max-height: 110px;
  max-width: 120px;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.2));
}
.f3-pic span {
  font-size: 84px;
  line-height: 1;
}
.f3-animal.sad .f3-pic {
  filter: grayscale(0.6);
}
.f3-shadow {
  width: 70px;
  height: 14px;
  margin-top: -8px;
  border-radius: 50%;
  background: #00000038;
}
.f3-bubble {
  position: absolute;
  top: -18px;
  right: 6px;
  font-size: 26px;
  background: #fff;
  border-radius: 18px;
  padding: 3px 8px;
  border: 3px solid var(--sun);
  box-shadow: 0 6px 12px #00000040;
  animation: float 1.6s ease-in-out infinite;
}
.f3-name {
  margin-top: 2px;
  padding: 1px 8px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  background: #1e3c1499;
  white-space: nowrap;
}
.pen-pet img {
  height: 84px;
  width: auto;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.2));
}
@media (max-width: 520px) {
  .pen-pet img {
    height: 64px;
  }
}
.pen.hl {
  outline: 4px solid var(--sun);
  outline-offset: 2px;
}
.cast {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
}
.cast img {
  height: 120px;
  width: auto;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.35));
  animation: float 3.2s ease-in-out infinite;
}
.cast img.mid {
  height: 104px;
  animation-delay: -1.2s;
}
.cast img:last-child {
  animation-delay: -2s;
}
.cast.small img {
  height: 92px;
}
.coach {
  height: 86px;
  width: auto;
  flex-shrink: 0;
}
@media (max-width: 520px) {
  .coach {
    display: none;
  }
}

/* ===== v5: chặng đọc bắt buộc + màn gọi tên trùm ===== */
.bv-dots{display:flex;gap:6px;flex-wrap:wrap;justify-content:center}
.bv-dots span{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;font-family:var(--display);font-weight:800;font-size:14px;background:#ffffff1a;border:2px solid #ffffff33;color:#ffffffaa}
.bv-dots span.ok{background:var(--mint);border-color:#fff;color:#073}
.bv-dots span.now{border-color:var(--sun);color:var(--sun);animation:pulse-ring 1.4s infinite}
.bv-goal{position:relative;width:100%;max-width:420px;display:grid;gap:6px;justify-items:center}
.bv-goal i{display:block;width:100%;height:16px;border-radius:99px;background:#ffffff1f;overflow:hidden;border:2px solid #ffffff2e}
.bv-goal em{display:block;height:100%;border-radius:99px;background:linear-gradient(90deg,#ff9f45,#ffd447);transition:width .5s ease}
.bv-goal.ok em{background:linear-gradient(90deg,#57f2a5,#4de1ff)}
.bv-goal-mark{position:absolute;top:-4px;width:4px;height:24px;margin-left:-2px;border-radius:3px;background:#fff;box-shadow:0 0 6px #fff}
.bv-goal b{font-family:var(--display);font-size:15px;color:var(--sun)}
.bv-goal.ok b{color:var(--mint)}
.bv-mic-block{display:grid;justify-items:center;gap:8px;max-width:520px;padding:16px 18px;border-radius:22px;background:#ff5f7e22;border:2px dashed #ff8fa3;text-align:center}
.bv-mic-ico{font-size:44px;line-height:1}
.bv-gate{display:grid;gap:8px;justify-items:center;padding:12px 16px;border-radius:18px;background:#07031899;border:1px solid #ffffff33;max-width:420px;text-align:center}
.bv-gate-in{width:90px;padding:8px 10px;border-radius:12px;border:2px solid #ffffff55;background:#ffffff14;color:#fff;font-size:18px;font-weight:800;text-align:center}
.bv-gate-link{background:none;border:0;color:#ffffff99;font-size:13px;font-weight:700;text-decoration:underline;cursor:pointer;padding:4px}
.bv-hearts{display:flex;gap:2px;font-size:22px}
.bv-hearts .lost{filter:grayscale(1);opacity:.35;transform:scale(.8)}
.bv-cage-wrap{position:relative;display:flex;align-items:flex-end;justify-content:center;gap:10px;height:200px;width:100%;max-width:420px}
.bv-cage-wrap.shake .bv-cage{animation:shake .45s}
.bv-boss{font-size:84px;line-height:1;animation:float 2.2s ease-in-out infinite;filter:drop-shadow(0 8px 10px #0008)}
.bv-rescue.won .bv-boss{animation:bv-fly-away 1.2s ease-in forwards}
@keyframes bv-fly-away{to{transform:translate(-160px,-120px) rotate(-40deg) scale(.4);opacity:0}}
.bv-cage{position:relative;width:170px;height:180px;border-radius:24px 24px 14px 14px;display:grid;place-items:center;background:radial-gradient(circle at 50% 70%,#ffd44733,#2a184f 75%);border:5px solid #b9c0e6;box-shadow:inset 0 -10px 0 #0004,0 12px 24px -6px #000a}
.bv-cage:before{content:"";position:absolute;left:-10px;right:-10px;top:-14px;height:18px;border-radius:10px;background:linear-gradient(180deg,#d9def5,#8d93b8);border:3px solid #6e7399}
.bv-friend{position:relative;z-index:1;max-width:120px;max-height:130px;filter:drop-shadow(0 6px 6px #0006)}
.bv-friend-emoji{position:absolute;font-size:80px;z-index:0;opacity:0}
.bv-friend[style*="none"]+.bv-friend-emoji{opacity:1;z-index:1}
.bv-bars{position:absolute;inset:0;z-index:2;border-radius:20px;background:repeating-linear-gradient(90deg,transparent 0 22px,#dfe4ff 22px 29px);box-shadow:inset 0 0 0 3px #8d93b8;transition:transform .6s ease,opacity .6s ease}
.bv-cracks{position:absolute;inset:0;z-index:3;pointer-events:none;opacity:0;transition:opacity .3s;background:
 linear-gradient(62deg,transparent 47%,#fff 48%,#fff 50%,transparent 51%) 20% 30%/60px 60px no-repeat,
 linear-gradient(-48deg,transparent 47%,#fff 48%,#fff 50%,transparent 51%) 70% 60%/70px 70px no-repeat,
 linear-gradient(15deg,transparent 47%,#fff 48%,#fff 50%,transparent 51%) 40% 80%/80px 50px no-repeat}
.bv-cage.crack1 .bv-cracks{opacity:.45}
.bv-cage.crack2 .bv-cracks{opacity:.75}
.bv-cage.crack3 .bv-cracks{opacity:1}
.bv-cage.crack2 .bv-bars{transform:skewX(-3deg)}
.bv-cage.broken .bv-bars{transform:translateY(-40px) rotate(-12deg) scale(1.2);opacity:0}
.bv-cage.broken .bv-cracks{opacity:0}
.bv-cage.broken{border-color:var(--mint);box-shadow:0 0 0 6px #57f2a555,0 0 40px #57f2a5aa}
.bv-cage.broken .bv-friend{animation:bv-jump .7s ease-in-out infinite alternate}
@keyframes bv-jump{to{transform:translateY(-14px) scale(1.05)}}
.bv-cage.gone{animation:bv-drag 1.4s ease-in forwards}
.bv-rescue.lost .bv-boss{animation:bv-drag 1.4s ease-in forwards}
@keyframes bv-drag{to{transform:translate(220px,-60px) rotate(18deg) scale(.5);opacity:0}}
.bv-burst{position:absolute;top:-24px;left:50%;transform:translate(-50%);z-index:4;font-size:30px;white-space:nowrap;animation:pop .5s ease-out}
.bv-timer{position:relative;width:100%;max-width:420px;display:flex;align-items:center;gap:10px}
.bv-timer i{flex:1;height:18px;border-radius:99px;background:#ffffff1f;overflow:hidden;border:2px solid #ffffff33}
.bv-timer em{display:block;height:100%;background:linear-gradient(90deg,#57f2a5,#ffd447);transition:width .1s linear}
.bv-timer b{font-family:var(--display);font-size:18px;min-width:56px;text-align:right}
.bv-timer.hurry em{background:linear-gradient(90deg,#ff5f7e,#ff9f45)}
.bv-timer.hurry b{color:#ff7a9c;animation:wiggle .5s infinite}

/* ===== v5: nông trại 3D chia khu ===== */
.farm3d.f4{height:clamp(360px,62vw,560px);background:linear-gradient(180deg,#bfe9ff 0 45%,#5cb84a 45%,#3f9434);--tilt:56deg;--rz:-20deg;touch-action:pan-y;cursor:grab}
.farm3d.f4:active{cursor:grabbing}
.f4 .f3-sky{bottom:52%}
.f4 .f3-hills{top:26%;height:26%}
.f4 .f3-sign{top:3%;left:3%;z-index:20}
.f4-rot{position:absolute;right:10px;top:10px;z-index:20;display:flex;gap:6px}
.f4-rot button{width:40px;height:40px;border-radius:50%;border:3px solid #6b3f17;background:linear-gradient(180deg,#e7b06a,#b77a3c);color:#fff;font-size:20px;font-weight:800;box-shadow:0 4px #0005;cursor:pointer}
.f4-rot button:active{transform:translateY(3px);box-shadow:0 1px #0005}
.f4-hint{position:absolute;left:50%;bottom:8px;transform:translate(-50%);z-index:20;padding:3px 12px;border-radius:99px;background:#1e3c14aa;color:#fff;font-size:12px;font-weight:700;white-space:nowrap;pointer-events:none}
.f4-stage{position:absolute;inset:0;perspective:1100px;perspective-origin:50% 0%;overflow:hidden}
.f4-world{position:absolute;left:50%;top:53%;width:min(66%,520px);aspect-ratio:1;transform:translate(-50%,-50%) rotateX(var(--tilt)) rotateZ(var(--rz));transform-style:preserve-3d}
.f4-ground{position:absolute;inset:-6%;border-radius:8%;background:
 radial-gradient(circle at 30% 20%,#ffffff14 0 2px,transparent 3px) 0 0/34px 34px,
 linear-gradient(135deg,#7fd36a,#5cb84a 55%,#4aa63c);box-shadow:0 0 0 10px #3d8a31,0 30px 0 10px #6b4426}
.f4-zone{position:absolute;border-radius:14px;transform-style:preserve-3d}
.f4-zone.dirt{background:radial-gradient(circle at 30% 30%,#ffffff22 0 2px,transparent 3px) 0 0/18px 18px,linear-gradient(135deg,#d9b77e,#c49a5c)}
.f4-zone.water{border-radius:45%;background:radial-gradient(ellipse at 40% 35%,#bff2ff 0 8%,#5cc8f0 30%,#2b8fd0 75%);box-shadow:inset 0 0 0 6px #8fd6a0,inset 0 0 18px #0004;animation:bv-water 4s ease-in-out infinite}
.f4-zone.water .f4-fence{display:none}
@keyframes bv-water{50%{filter:brightness(1.12)}}
.f4-zone.yard{background:linear-gradient(135deg,#9ad97a,#7cc463)}
.f4-zone.grass{background:repeating-linear-gradient(90deg,#ffffff10 0 14px,transparent 14px 28px),linear-gradient(135deg,#8ee070,#62c04d)}
.f4-zone.flower{background:
 radial-gradient(circle,#ff8fd8 0 3px,transparent 4px) 0 0/40px 40px,
 radial-gradient(circle,#ffd447 0 3px,transparent 4px) 20px 20px/40px 40px,
 linear-gradient(135deg,#a5ec8a,#7fd36a)}
.f4-zone.empty:after{content:"";position:absolute;inset:0;border-radius:inherit;background:#0000001a}
.f4-fence{position:absolute;transform-origin:0 100%;transform-style:preserve-3d;background:
 repeating-linear-gradient(90deg,#8a5a2b 0 5px,transparent 5px 26px),
 linear-gradient(180deg,transparent 0 25%,#c98a4b 25% 40%,transparent 40% 62%,#c98a4b 62% 77%,transparent 77%)}
.f4-fence.t,.f4-fence.b{left:0;right:0;height:16px;transform:rotateX(-90deg)}
.f4-fence.t{top:-16px}
.f4-fence.b{bottom:0}
.f4-fence.l,.f4-fence.r{top:0;bottom:0;width:16px;background:
 repeating-linear-gradient(180deg,#8a5a2b 0 5px,transparent 5px 26px),
 linear-gradient(90deg,transparent 0 25%,#c98a4b 25% 40%,transparent 40% 62%,#c98a4b 62% 77%,transparent 77%)}
.f4-fence.l{left:0;transform-origin:0 0;transform:rotateY(90deg)}
.f4-fence.r{right:0;transform-origin:100% 0;transform:rotateY(-90deg)}
.f4-bb{position:absolute;width:0;height:0;transform-style:preserve-3d}
.f4-up{position:absolute;left:0;top:0;display:grid;justify-items:center;transform-origin:50% 100%;transform:translate(-50%,-100%) rotateZ(calc(var(--rz) * -1)) rotateX(calc(var(--tilt) * -1));pointer-events:none}
.f4-bb.animal .f4-up{pointer-events:auto;cursor:pointer}
.f4-pic{height:calc(62px * var(--s));display:grid;place-items:end center}
.f4-pic img{max-height:calc(62px * var(--s));max-width:calc(74px * var(--s));filter:drop-shadow(0 3px 3px #0003)}
.f4-pic span{font-size:calc(46px * var(--s));line-height:1}
.f4-bb.friend .f4-pic{height:calc(72px * var(--s))}
.f4-bb.friend .f4-pic img{max-height:calc(72px * var(--s));max-width:calc(84px * var(--s))}
.f4-bb.sad .f4-pic{filter:grayscale(.6)}
.f4 .f3-name{display:none}
.f4 .f3-bubble{top:-12px;right:-6px;font-size:calc(20px * var(--s) + 2px);padding:1px 6px}
.f4-shadow{position:absolute;left:0;top:0;width:calc(40px * var(--s));height:calc(20px * var(--s));transform:translate(-50%,-50%);border-radius:50%;background:#00000033}
.f4-prop{display:block;width:auto;filter:drop-shadow(0 4px 4px #0003);pointer-events:none}
.f4-zsign{display:grid;justify-items:center;padding:3px 10px;border-radius:9px;background:linear-gradient(180deg,#e4ad69,#b77a3c);border:2px solid #6b3f17;color:#fff8e6;box-shadow:0 3px #0004;white-space:nowrap;line-height:1.15;margin-bottom:-2px}
.f4-zsign b{font-family:var(--display);font-size:calc(11px * var(--s) + 3px)}
.f4-zsign span{font-size:calc(9px * var(--s) + 3px);font-weight:700;opacity:.9}
@media (max-width:520px){.f4-world{width:88%;top:55%}.f4-zsign span{display:none}.f4-hint{font-size:10px}.f4-rot button{width:34px;height:34px;font-size:17px}}
