@font-face { font-family: "Fredoka"; src: url("assets/fonts/fredoka-latin-500-normal.woff2") format("woff2"); font-style: normal; font-weight: 500; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("assets/fonts/fredoka-latin-600-normal.woff2") format("woff2"); font-style: normal; font-weight: 600; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("assets/fonts/fredoka-latin-700-normal.woff2") format("woff2"); font-style: normal; font-weight: 700; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("assets/fonts/fraunces-latin-600-normal.woff2") format("woff2"); font-style: normal; font-weight: 600; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("assets/fonts/fraunces-latin-700-normal.woff2") format("woff2"); font-style: normal; font-weight: 700; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("assets/fonts/space-grotesk-latin-400-normal.woff2") format("woff2"); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("assets/fonts/space-grotesk-latin-500-normal.woff2") format("woff2"); font-style: normal; font-weight: 500; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("assets/fonts/space-grotesk-latin-600-normal.woff2") format("woff2"); font-style: normal; font-weight: 600; font-display: swap; }

:root {
  --ink: #2b231f;
  --deep: #1b2429;
  --sky: #fbf2ea;
  --mist: rgba(251, 242, 234, 0.78);
  --glass: linear-gradient(160deg, rgba(255, 252, 247, 0.94), rgba(255, 242, 228, 0.86));
  --leaf: #8fb7a0;
  --moss: #5f8775;
  --sun: #f3a35c;
  --clay: #e4c2a1;
  --rose: #e59a88;
  --shadow: rgba(43, 33, 24, 0.16);
  --stroke: rgba(67, 52, 41, 0.12);
  --stroke-strong: rgba(43, 33, 24, 0.22);
  --ui-font: "Space Grotesk", "Trebuchet MS", sans-serif;
  --title-font: "Fredoka", "Space Grotesk", sans-serif;
  --serif-font: "Fraunces", "Georgia", serif;
  --mobile-dock-height: 64px;
  --mobile-header-height: 0px;
}

.button-danger {
  border: 1px solid rgba(145, 42, 42, 0.45);
  border-radius: 999px;
  padding: 0.65rem 1rem;
  color: #7d2020;
  background: rgba(255, 236, 233, 0.92);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.button-danger:hover:not(:disabled),
.button-danger:focus-visible {
  background: #ffdcd6;
  border-color: #9d2d2d;
}

.button-danger:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.auth-danger-zone {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--stroke);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--ui-font);
  color: var(--ink);
  line-height: 1.55;
  background:
    radial-gradient(circle at 12% 12%, rgba(243, 163, 92, 0.25), transparent 46%),
    radial-gradient(circle at 88% 18%, rgba(143, 183, 160, 0.28), transparent 52%),
    radial-gradient(circle at 75% 78%, rgba(208, 221, 228, 0.28), transparent 48%),
    linear-gradient(160deg, #fbf1e8 0%, #f1dfce 46%, #ece4d6 100%);
  min-height: 100vh;
  overflow: hidden;
}

body[data-hide-vitality="true"] .mobile-vitality,
body[data-hide-vitality="true"] .panel-left .stat,
body[data-hide-vitality="true"] #vitality-note {
  display: none !important;
}

body.ui-hidden > :not(.world-frame):not(#world-loading):not(.first-use-splash):not(.welcome-screen):not(#auth-modal):not(.menu-overlay):not(#planet-delete-modal) {
  display: none !important;
}

body.ui-hidden .world-frame #name-tags,
body.ui-hidden .world-frame #invite-banner {
  display: none !important;
}

.opening-cinematic-ui-hidden {
  display: none !important;
}

.welcome-screen {
  position: fixed;
  inset: 0;
  z-index: 998;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 18px;
  padding: 24px;
  pointer-events: none;
}

.welcome-screen.is-menu {
  pointer-events: auto;
}

.startup-language-toggle {
  position: fixed;
  top: clamp(16px, 3vw, 28px);
  right: clamp(16px, 3vw, 28px);
  z-index: 2;
  min-width: 54px;
  padding: 7px 12px;
  border-color: rgba(255, 244, 231, 0.34);
  background: rgba(255, 244, 231, 0.84);
  color: rgba(43, 33, 24, 0.86);
  text-align: center;
  pointer-events: auto;
}

.welcome-screen.is-logo,
.welcome-screen.is-menu {
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 252, 247, 0.34), transparent 24%),
    radial-gradient(circle at 50% 56%, rgba(243, 163, 92, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 248, 239, 0.08), rgba(9, 11, 14, 0.18));
}

.welcome-screen-logo {
  width: min(360px, 72vw);
  max-width: 100%;
  opacity: 0;
  transform: translateY(18px) scale(0.94);
}

.welcome-screen-logo img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 44px rgba(43, 33, 24, 0.18));
}

.welcome-screen.is-logo .welcome-screen-logo {
  animation: startupLogoFade 1.6s ease both;
}

.welcome-screen.is-menu .welcome-screen-logo {
  width: min(240px, 58vw);
  opacity: 1;
  transform: none;
}

.welcome-screen-menu {
  width: min(420px, calc(100vw - 40px));
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 26px;
  border: 2px solid var(--stroke-strong);
  background: var(--glass);
  box-shadow:
    0 22px 50px var(--shadow),
    0 2px 0 rgba(255, 255, 255, 0.35) inset;
  backdrop-filter: blur(14px) saturate(1.1);
  pointer-events: auto;
}

.welcome-screen-action {
  width: 100%;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45em;
  border: 2px solid rgba(67, 52, 41, 0.18);
  border-radius: 999px;
  padding: 14px 18px;
  font-family: var(--title-font);
  font-size: clamp(1.05rem, 1.7vw, 1.35rem);
  letter-spacing: 0.01em;
  color: var(--ink);
  background: rgba(255, 244, 231, 0.82);
  box-shadow: 0 10px 0 rgba(43, 33, 24, 0.08);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.welcome-screen-action:hover,
.welcome-screen-action:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 213, 165, 0.56);
  box-shadow:
    0 12px 0 rgba(43, 33, 24, 0.08),
    0 16px 18px rgba(67, 52, 41, 0.14),
    0 0 0 4px rgba(243, 163, 92, 0.12);
}

.welcome-screen-action:disabled,
.welcome-screen-action.is-disabled {
  opacity: 0.48;
  color: rgba(43, 33, 24, 0.52);
  background: rgba(231, 224, 216, 0.64);
  box-shadow: none;
  cursor: not-allowed;
}

.welcome-screen-action:disabled:hover,
.welcome-screen-action:disabled:focus-visible,
.welcome-screen-action.is-disabled:hover,
.welcome-screen-action.is-disabled:focus-visible {
  transform: none;
  border-color: rgba(67, 52, 41, 0.18);
  box-shadow: none;
}

.welcome-screen-action.is-highlighted {
  border-color: rgba(60, 120, 102, 0.38);
  background: linear-gradient(135deg, rgba(183, 238, 202, 0.96), rgba(255, 246, 198, 0.94));
  box-shadow:
    0 10px 0 rgba(43, 33, 24, 0.1),
    0 16px 24px rgba(60, 120, 102, 0.16);
}

.welcome-screen-action strong {
  font-weight: 900;
  color: rgba(43, 33, 24, 0.96);
}

.welcome-screen-action .menu-noun {
  color: rgba(43, 33, 24, 0.72);
}

@keyframes startupLogoFade {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.94);
  }
  18% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  72% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-14px) scale(1.04);
  }
}

.world-frame {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #8bc5e6;
}

.world-loading {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  color: #fff7e8;
  background:
    radial-gradient(circle at 50% 31%, rgba(255, 238, 183, 0.34), transparent 18%),
    radial-gradient(ellipse at 18% 12%, rgba(209, 241, 225, 0.19), transparent 31%),
    radial-gradient(ellipse at 88% 64%, rgba(250, 197, 128, 0.18), transparent 29%),
    linear-gradient(165deg, #285f78 0%, #4e94a8 48%, #93c6bd 100%);
  box-shadow: inset 0 -120px 180px rgba(22, 75, 65, 0.13);
  opacity: 1;
  visibility: visible;
  transition: opacity 420ms ease, visibility 0s linear 420ms;
  pointer-events: auto;
}

.world-loading::before,
.world-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.world-loading::before {
  z-index: 0;
  background:
    radial-gradient(ellipse 17% 5% at 16% 24%, rgba(242, 248, 226, 0.14) 0 58%, transparent 62%),
    radial-gradient(ellipse 23% 6% at 79% 18%, rgba(245, 247, 218, 0.12) 0 56%, transparent 61%),
    radial-gradient(ellipse 12% 4% at 91% 42%, rgba(232, 245, 224, 0.11) 0 55%, transparent 61%),
    radial-gradient(circle at 31% 36%, rgba(255, 246, 195, 0.13) 0 1px, transparent 3px),
    radial-gradient(circle at 68% 29%, rgba(255, 244, 183, 0.11) 0 1px, transparent 3px);
  background-size: auto, auto, auto, 74px 83px, 91px 77px;
  filter: blur(0.35px);
  opacity: 0.9;
}

.world-loading::after {
  z-index: 1;
  top: auto;
  height: 36%;
  background:
    radial-gradient(ellipse 57% 110% at 4% 108%, rgba(48, 112, 78, 0.72) 0 49%, transparent 50%),
    radial-gradient(ellipse 52% 104% at 96% 112%, rgba(66, 132, 88, 0.69) 0 50%, transparent 51%),
    radial-gradient(ellipse 58% 77% at 52% 124%, rgba(91, 150, 96, 0.5) 0 51%, transparent 52%);
  opacity: 0.64;
  filter: saturate(0.88);
}

.world-loading.is-dead {
  background:
    radial-gradient(circle at 50% 44%, rgba(228, 126, 95, 0.18), transparent 24%),
    radial-gradient(circle at 18% 16%, rgba(121, 47, 55, 0.22), transparent 30%),
    linear-gradient(155deg, #271a25 0%, #5f2631 54%, #9f4850 100%);
}

.world-loading.is-dead::after {
  filter: grayscale(0.75) sepia(0.22) hue-rotate(310deg) brightness(0.58);
  opacity: 0.48;
}

.world-loading.is-ready {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.world-loading-stars {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.world-loading-stars span {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffedb1;
  box-shadow: 0 0 14px rgba(255, 232, 165, 0.72);
  animation: worldLoadingStar 2.4s ease-in-out infinite;
}

.world-loading-stars span:nth-child(1) { left: 12%; top: 18%; animation-delay: -0.4s; }
.world-loading-stars span:nth-child(2) { left: 24%; top: 72%; animation-delay: -1.6s; }
.world-loading-stars span:nth-child(3) { left: 42%; top: 10%; animation-delay: -0.9s; }
.world-loading-stars span:nth-child(4) { left: 68%; top: 78%; animation-delay: -2s; }
.world-loading-stars span:nth-child(5) { left: 84%; top: 22%; animation-delay: -1.1s; }
.world-loading-stars span:nth-child(6) { left: 92%; top: 62%; animation-delay: -0.2s; }

.world-loading-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(500px, calc(100vw - 40px));
  text-align: center;
  transition: transform 420ms ease, opacity 260ms ease;
}

.world-loading.is-ready .world-loading-content {
  opacity: 0;
  transform: translateY(-10px) scale(1.025);
}

.world-loading-scene {
  position: relative;
  width: 350px;
  height: 320px;
  display: grid;
  place-items: center;
  isolation: isolate;
  filter: drop-shadow(0 25px 26px rgba(27, 69, 54, 0.2));
}

.world-loading-scene::before,
.world-loading-scene::after {
  content: "";
  position: absolute;
  left: 50%;
  pointer-events: none;
}

.world-loading-scene::before {
  z-index: 0;
  bottom: -2px;
  width: 286px;
  height: 78px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 48% 34%, rgba(194, 213, 123, 0.74) 0 17%, transparent 47%),
    radial-gradient(ellipse at 50% 52%, #65975c 0 48%, #3e7656 65%, #315d4d 78%);
  box-shadow:
    0 18px 28px rgba(27, 70, 54, 0.27),
    inset 0 8px 12px rgba(220, 229, 157, 0.2);
  transform: translateX(-50%) scaleY(0.55);
}

.world-loading-scene::after {
  z-index: 0;
  top: 31px;
  width: 272px;
  height: 272px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 235, 168, 0.22) 0, rgba(222, 239, 184, 0.09) 45%, transparent 69%);
  transform: translateX(-50%);
}

.world-loading-tree-canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 330px;
  height: 307px;
  max-width: 100%;
  object-fit: contain;
  filter:
    drop-shadow(0 20px 18px rgba(14, 43, 39, 0.25))
    saturate(1.06)
    contrast(1.02);
}

.world-loading-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: min(440px, calc(100vw - 48px));
  padding: 19px 30px 17px;
  border: 1px solid rgba(255, 247, 218, 0.42);
  border-radius: 28px 28px 32px 32px;
  background:
    linear-gradient(145deg, rgba(36, 82, 74, 0.79), rgba(32, 74, 72, 0.66)),
    radial-gradient(circle at 20% 0%, rgba(255, 239, 187, 0.12), transparent 42%);
  box-shadow:
    0 21px 48px rgba(21, 60, 57, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -12px 26px rgba(23, 59, 53, 0.12);
  backdrop-filter: blur(12px) saturate(1.08);
}

.world-loading-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 12px;
  border: 1px solid rgba(255, 235, 179, 0.23);
  border-radius: 999px;
  color: #ffe5a8;
  background: rgba(23, 64, 57, 0.24);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

#world-loading-title {
  font-family: var(--title-font);
  color: #fff8df;
  font-size: clamp(1.5rem, 4vw, 2.08rem);
  line-height: 1.12;
  text-shadow: 0 2px 0 rgba(37, 71, 56, 0.24);
}

#world-loading-detail {
  color: rgba(245, 246, 222, 0.84);
  font-size: 0.92rem;
}

.world-loading-dots {
  display: flex;
  gap: 6px;
  min-height: 8px;
  margin-top: 8px;
}

.world-loading-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f9dda0;
  box-shadow: 0 2px 5px rgba(24, 58, 48, 0.22);
  animation: worldLoadingDot 1.1s ease-in-out infinite;
}

.world-loading-dots i:nth-child(2) {
  background: #b9d28b;
}

.world-loading-dots i:nth-child(2) { animation-delay: 0.15s; }
.world-loading-dots i:nth-child(3) { animation-delay: 0.3s; }

.world-loading.is-slow .world-loading-copy {
  border-color: rgba(255, 205, 135, 0.42);
}

body.world-loading-active canvas#world {
  opacity: 0;
}

@keyframes worldLoadingStar {
  0%, 100% { opacity: 0.28; transform: scale(0.7); }
  50% { opacity: 1; transform: scale(1.25); }
}

@keyframes worldLoadingDot {
  0%, 100% { opacity: 0.35; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

@media (max-width: 540px) {
  .world-loading-scene {
    width: 280px;
    height: 254px;
  }

  .world-loading-tree-canvas {
    width: 264px;
    height: 245px;
  }

  .world-loading-scene::before {
    bottom: -18px;
    width: 230px;
    height: 64px;
  }

  .world-loading-scene::after {
    top: 20px;
    width: 222px;
    height: 222px;
  }

  .world-loading-content {
    gap: 12px;
  }

  .world-loading-copy {
    min-width: min(360px, calc(100vw - 36px));
    padding: 16px 18px 15px;
    border-radius: 24px 24px 27px 27px;
  }
}

/* Logo loader: the brand mark carries the motion while the world wakes up. */
.world-loading {
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 222, 158, 0.2), transparent 24%),
    radial-gradient(circle at 18% 16%, rgba(126, 205, 218, 0.2), transparent 30%),
    radial-gradient(circle at 84% 82%, rgba(244, 164, 91, 0.16), transparent 28%),
    linear-gradient(155deg, #173b56 0%, #2f789b 52%, #75aec1 100%);
  box-shadow: none;
}

.world-loading::before,
.world-loading::after,
.world-loading-scene::before,
.world-loading-scene::after {
  display: none;
}

.world-loading-content {
  gap: 18px;
  width: min(460px, calc(100vw - 40px));
}

.world-loading-scene {
  width: 420px;
  height: 210px;
  filter: none;
}

.world-loading-logo {
  position: relative;
  width: 410px;
  height: 210px;
  max-width: calc(100vw - 40px);
  overflow: hidden;
  filter: drop-shadow(0 18px 28px rgba(14, 43, 39, 0.22));
}

.world-loading-logo::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 26px 42px 10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 223, 139, 0.2), transparent 68%);
  animation: worldLoadingLogoGlow 2.6s ease-in-out infinite;
}

.world-loading-logo img {
  position: absolute;
  z-index: 1;
  top: -25px;
  left: 50%;
  display: block;
  width: 500px;
  height: auto;
  transform: translateX(-50%);
  user-select: none;
}

.world-loading-logo-base {
  opacity: 0.36;
  filter: grayscale(1) sepia(0.28) saturate(0.7) brightness(1.25);
}

.world-loading-logo-fill {
  clip-path: inset(100% 0 0 0);
  animation: worldLoadingLogoFill 3.4s cubic-bezier(0.36, 0.04, 0.2, 1) infinite;
  will-change: clip-path;
}

.world-loading-copy {
  gap: 6px;
  min-width: 0;
  padding: 18px 24px;
  border: 1px solid rgba(255, 244, 225, 0.2);
  border-radius: 24px;
  background: rgba(14, 43, 61, 0.24);
  box-shadow: 0 18px 46px rgba(13, 38, 54, 0.16);
  backdrop-filter: blur(10px);
}

.world-loading-kicker {
  display: none;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: rgba(255, 228, 177, 0.86);
  background: transparent;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
}

#world-loading-title {
  color: #fff7e8;
  font-size: clamp(1.45rem, 4vw, 2rem);
  line-height: 1.15;
  text-shadow: none;
}

#world-loading-detail {
  color: rgba(255, 247, 232, 0.78);
}

.world-loading-dots i,
.world-loading-dots i:nth-child(2) {
  width: 6px;
  height: 6px;
  background: #ffe2a6;
  box-shadow: none;
}

@keyframes worldLoadingLogoFill {
  0%, 8% { clip-path: inset(100% 0 0 0); }
  76%, 100% { clip-path: inset(0 0 0 0); }
}

@keyframes worldLoadingLogoGlow {
  0%, 100% { opacity: 0.42; transform: scale(0.94); }
  55% { opacity: 0.9; transform: scale(1.04); }
}

@media (max-width: 540px) {
  .world-loading-content {
    gap: 12px;
  }

  .world-loading-scene {
    width: 330px;
    height: 176px;
  }

  .world-loading-logo {
    width: 330px;
    height: 176px;
  }

  .world-loading-logo img {
    top: -18px;
    width: 410px;
  }

  .world-loading-copy {
    min-width: 0;
    padding: 15px 18px;
    border-radius: 24px;
  }
}

.streak-progress-panel {
  position: fixed;
  left: 50%;
  bottom: calc(26px + env(safe-area-inset-bottom));
  width: min(420px, calc(100vw - 32px));
  transform: translateX(-50%);
  z-index: 2;
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(67, 52, 41, 0.18);
  border-radius: 18px;
  background: rgba(255, 248, 239, 0.84);
  box-shadow:
    0 18px 42px rgba(43, 33, 24, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.58) inset;
  backdrop-filter: blur(14px) saturate(1.08);
  pointer-events: auto;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.streak-progress-panel:hover,
.streak-progress-panel:focus-visible {
  transform: translateX(-50%) translateY(-2px);
  border-color: rgba(243, 163, 92, 0.48);
  box-shadow:
    0 20px 46px rgba(43, 33, 24, 0.2),
    0 0 0 4px rgba(243, 163, 92, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.62) inset;
  outline: none;
}

.streak-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(43, 33, 24, 0.78);
}

.streak-progress-track {
  position: relative;
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(67, 52, 41, 0.16);
  background: rgba(67, 52, 41, 0.08);
}

.streak-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8fb7a0, #f3a35c);
  background-size: 160% 100%;
  box-shadow: 0 0 18px rgba(243, 163, 92, 0.34);
  transition: width 0.35s ease;
}

.streak-progress-panel.is-hot {
  border-color: rgba(243, 163, 92, 0.56);
  box-shadow:
    0 20px 46px rgba(43, 33, 24, 0.2),
    0 0 26px rgba(243, 163, 92, 0.24),
    0 1px 0 rgba(255, 255, 255, 0.64) inset;
  animation: streakPanelPulse 1.25s ease-in-out infinite;
}

.streak-progress-panel.is-hot .streak-progress-fill,
.streak-progress-panel.is-complete .streak-progress-fill {
  background-image: linear-gradient(90deg, #8fb7a0, #f3a35c, #f7d772, #e59a88);
  animation: streakFillSweep 0.95s linear infinite;
}

.streak-progress-panel.is-complete {
  border-color: rgba(247, 215, 114, 0.78);
  box-shadow:
    0 22px 50px rgba(43, 33, 24, 0.22),
    0 0 34px rgba(247, 215, 114, 0.34),
    0 1px 0 rgba(255, 255, 255, 0.7) inset;
  animation: streakPanelComplete 0.9s ease-in-out infinite;
}

@keyframes streakFillSweep {
  from {
    background-position: 0% 50%;
  }
  to {
    background-position: 160% 50%;
  }
}

@keyframes streakPanelPulse {
  0%,
  100% {
    transform: translateX(-50%) translateY(0) scale(1);
  }
  50% {
    transform: translateX(-50%) translateY(-3px) scale(1.015);
  }
}

@keyframes streakPanelComplete {
  0%,
  100% {
    transform: translateX(-50%) translateY(-1px) scale(1);
  }
  50% {
    transform: translateX(-50%) translateY(-5px) scale(1.025);
  }
}

.streak-progress-days {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.streak-progress-day {
  border-right: 1px solid rgba(255, 255, 255, 0.48);
}

.streak-progress-day:last-child {
  border-right: 0;
}

.streak-progress-reward {
  min-height: 18px;
  overflow: hidden;
  color: rgba(43, 33, 24, 0.7);
  font-size: 0.82rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal.streak-reward-modal {
  width: min(720px, calc(100vw - 32px));
  max-width: min(720px, calc(100vw - 32px));
  overflow: hidden;
}

.streak-reward-preview {
  display: grid;
  grid-template-columns: minmax(210px, 280px) minmax(240px, 1fr);
  gap: 20px;
  align-items: stretch;
}

.streak-reward-stage {
  position: relative;
  width: 100%;
  min-height: 260px;
  aspect-ratio: 1 / 1.1;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(67, 52, 41, 0.14);
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.82), rgba(255, 244, 231, 0.34) 46%, rgba(143, 183, 160, 0.2)),
    linear-gradient(160deg, rgba(255, 249, 242, 0.94), rgba(255, 235, 212, 0.84));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  cursor: default;
}

.streak-reward-stage.is-character-preview {
  max-width: 218px;
  min-height: 218px;
  justify-self: center;
}

/* An unreached streak reward is a preview, not an unlocked character yet. */
.streak-reward-stage.is-character-preview canvas {
  opacity: 0.72;
  filter: grayscale(0.48) saturate(0.62) contrast(0.94);
}

.streak-reward-stage.is-gift-ready {
  cursor: pointer;
}

.streak-reward-stage.is-gift-ready:hover,
.streak-reward-stage.is-gift-ready:focus-within {
  border-color: rgba(243, 163, 92, 0.5);
  box-shadow:
    0 0 0 4px rgba(243, 163, 92, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.streak-reward-stage::before {
  content: "";
  position: absolute;
  inset: 16%;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(247, 215, 114, 0.24), transparent 66%);
  filter: blur(4px);
  opacity: 0.75;
  pointer-events: none;
}

.streak-reward-stage.is-opening {
  animation: rewardStagePop 0.9s ease both;
}

.streak-reward-stage.is-opening::after {
  content: "";
  position: absolute;
  inset: 50%;
  border: 2px solid rgba(247, 215, 114, 0.92);
  border-radius: 999px;
  pointer-events: none;
  animation: rewardRingBurst 0.9s ease-out both;
}

.streak-reward-preview canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  border: 0;
  background: transparent;
  outline: none;
}

.streak-reward-burst {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
}

.streak-reward-burst.is-active {
  opacity: 1;
}

.streak-reward-burst span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--spark-size, 8px);
  height: var(--spark-size, 8px);
  border-radius: 999px;
  background: hsl(var(--spark-hue, 43) 88% 64%);
  box-shadow: 0 0 14px hsl(var(--spark-hue, 43) 88% 64% / 0.6);
  transform: translate(-50%, -50%) scale(0.25);
  animation: rewardSparkFly 0.88s cubic-bezier(0.18, 0.85, 0.2, 1) forwards;
  animation-delay: var(--spark-delay, 0ms);
}

@keyframes rewardStagePop {
  0%,
  100% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.035);
  }
  70% {
    transform: scale(0.992);
  }
}

@keyframes rewardRingBurst {
  from {
    inset: 50%;
    opacity: 0.95;
  }
  to {
    inset: 10%;
    opacity: 0;
  }
}

@keyframes rewardSparkFly {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2) rotate(0deg);
  }
  14% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform:
      translate(calc(-50% + var(--spark-x, 0px)), calc(-50% + var(--spark-y, 0px)))
      scale(1)
      rotate(240deg);
  }
}

.streak-reward-preview-copy {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
  overflow: visible;
}

.streak-reward-open-button {
  justify-self: start;
  margin-top: 6px;
}

.streak-reward-preview-copy strong {
  display: block;
  color: var(--ink);
  font-family: var(--title-font);
  font-size: clamp(1.45rem, 2.6vw, 2.2rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.streak-reward-preview-copy .hint {
  overflow-wrap: anywhere;
}

.streak-reward-effects {
  display: grid;
  gap: 10px;
}

.streak-reward-effect-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.streak-reward-effect-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(95, 135, 117, 0.28);
  background: rgba(143, 183, 160, 0.16);
  color: rgba(43, 33, 24, 0.78);
  font-size: 0.82rem;
  font-weight: 700;
}

body.ui-hidden .streak-progress-panel,
body.opening-cinematic-active:not(.opening-cinematic-guide) .streak-progress-panel,
body.startup-welcome-active .streak-progress-panel,
body.startup-setup-active .streak-progress-panel {
  display: none !important;
}

.first-use-splash {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: end center;
  padding: 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom) + var(--keyboard-inset, 0px));
  background: #020203;
  opacity: 1;
  pointer-events: auto;
  transition:
    opacity 0.9s ease,
    background-color 2.4s ease;
}

.first-use-splash.is-fading {
  opacity: 0;
}

.opening-cinematic.is-revealing {
  background: rgba(2, 2, 3, 0.34);
}

.opening-cinematic-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 203, 144, 0.12), transparent 26%),
    radial-gradient(circle at 50% 58%, transparent 0, rgba(0, 0, 0, 0.46) 58%, rgba(0, 0, 0, 0.78) 100%);
  opacity: 0;
  transition: opacity 2.1s ease;
}

.opening-cinematic.is-revealing .opening-cinematic-vignette {
  opacity: 1;
}

.opening-cinematic-highlight-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.opening-cinematic-highlight-box {
  position: absolute;
  border: 3px solid rgba(255, 213, 165, 0.98);
  border-radius: 14px;
  box-shadow:
    0 0 0 6px rgba(243, 163, 92, 0.22),
    0 0 26px rgba(247, 215, 114, 0.32),
    0 18px 38px rgba(0, 0, 0, 0.18);
  animation: openingHighlightPulse 1.35s ease-in-out infinite;
}

.opening-cinematic-dialogue {
  position: relative;
  z-index: 2;
  width: min(680px, 100%);
  min-height: 118px;
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 239, 215, 0.26);
  background: linear-gradient(180deg, rgba(22, 18, 17, 0.94), rgba(8, 8, 10, 0.9));
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: rgba(255, 248, 236, 0.96);
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.55s ease,
    transform 0.55s ease,
    background 0.45s ease,
    color 0.45s ease;
}

.opening-cinematic.show-dialogue .opening-cinematic-dialogue {
  opacity: 1;
  transform: translateY(0);
}

.opening-cinematic.is-startup-prelude {
  place-items: center;
  background: #020203;
}

.opening-cinematic.is-startup-prelude::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 9% 18%, rgba(255, 255, 255, 0.78) 0 1px, transparent 1.8px),
    radial-gradient(circle at 18% 74%, rgba(255, 238, 197, 0.68) 0 1px, transparent 1.7px),
    radial-gradient(circle at 28% 31%, rgba(196, 224, 255, 0.78) 0 1px, transparent 1.8px),
    radial-gradient(circle at 42% 12%, rgba(255, 255, 255, 0.72) 0 1px, transparent 1.7px),
    radial-gradient(circle at 51% 64%, rgba(255, 238, 197, 0.62) 0 1px, transparent 1.9px),
    radial-gradient(circle at 67% 24%, rgba(218, 236, 255, 0.76) 0 1px, transparent 1.8px),
    radial-gradient(circle at 81% 51%, rgba(255, 255, 255, 0.7) 0 1px, transparent 1.7px),
    radial-gradient(circle at 91% 78%, rgba(255, 238, 197, 0.66) 0 1px, transparent 1.8px),
    radial-gradient(circle at 36% 86%, rgba(218, 236, 255, 0.7) 0 1px, transparent 1.8px),
    radial-gradient(circle at 73% 89%, rgba(255, 255, 255, 0.64) 0 1px, transparent 1.7px);
  opacity: 0;
  transform: scale(0.985);
  transition:
    opacity 3.8s ease,
    transform 6s ease;
  pointer-events: none;
}

.opening-cinematic.is-startup-prelude.is-stars::before {
  opacity: 1;
  transform: scale(1.02);
}

.opening-cinematic.is-startup-prelude.is-revealing {
  background: rgba(2, 2, 3, 0.22);
}

.opening-cinematic.is-startup-prelude.is-revealing::before {
  opacity: 0.72;
}

.opening-cinematic.is-startup-prelude .opening-cinematic-vignette,
.opening-cinematic.is-startup-prelude .opening-cinematic-header {
  display: none;
}

.opening-cinematic.is-startup-prelude .opening-cinematic-dialogue {
  width: min(760px, calc(100vw - 40px));
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.opening-cinematic.is-startup-prelude #opening-cinematic-line {
  min-height: 0;
  font-size: clamp(1.55rem, 4vw, 3.1rem);
  line-height: 1.24;
  color: rgba(255, 248, 236, 0.96);
  text-shadow: 0 18px 48px rgba(0, 0, 0, 0.62);
}

.opening-cinematic.is-guide {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: transparent;
}

.opening-cinematic.is-guide .opening-cinematic-vignette {
  display: none;
}

.opening-cinematic.is-guide .opening-cinematic-dialogue {
  width: min(680px, calc(100vw - 32px));
  min-height: 0;
  margin: 0;
  align-self: center;
}

.opening-cinematic-guide {
  position: relative;
  z-index: 2;
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100dvh - 180px - env(safe-area-inset-top) - env(safe-area-inset-bottom) - var(--keyboard-inset, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(67, 52, 41, 0.16);
  color: var(--ink);
  background: linear-gradient(160deg, rgba(255, 252, 247, 0.97), rgba(255, 242, 228, 0.94));
  box-shadow: 0 28px 74px rgba(0, 0, 0, 0.34);
}

.opening-cinematic-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.opening-cinematic-speaker {
  width: max-content;
  max-width: 100%;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(243, 163, 92, 0.16);
  color: #ffd5a5;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.opening-cinematic.is-guide .opening-cinematic-speaker {
  background: rgba(95, 135, 117, 0.13);
  color: var(--moss);
}

.opening-cinematic-skip {
  color: inherit;
  white-space: nowrap;
}

.opening-cinematic-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.opening-language-toggle {
  min-width: 44px;
  color: inherit;
  white-space: nowrap;
}

#opening-cinematic-line {
  min-height: 42px;
  margin: 0;
  font-size: clamp(18px, 3.4vw, 25px);
  line-height: 1.42;
}

body.opening-cinematic-active:not(.opening-cinematic-guide) .hud,
body.opening-cinematic-active:not(.opening-cinematic-guide) .mobile-header,
body.opening-cinematic-active:not(.opening-cinematic-guide) .mobile-dock,
body.opening-cinematic-active:not(.opening-cinematic-guide) .move-pad,
body.opening-cinematic-active:not(.opening-cinematic-guide) .water-pad,
body.opening-cinematic-active:not(.opening-cinematic-guide) #name-tags,
body.opening-cinematic-active:not(.opening-cinematic-guide) #invite-banner {
  opacity: 0;
  pointer-events: none;
}

.opening-cinematic-setup {
  display: grid;
  gap: 12px;
}

.opening-cinematic.is-planet-look-step {
  align-items: flex-start;
  padding-left: clamp(16px, 4vw, 64px);
  padding-right: clamp(16px, 4vw, 64px);
}

.opening-cinematic.is-planet-look-step .opening-cinematic-dialogue,
.opening-cinematic.is-planet-look-step .opening-cinematic-guide {
  width: min(410px, calc(100vw - 32px));
  align-self: flex-start;
}

.opening-cinematic.is-planet-look-step .opening-cinematic-guide {
  background: linear-gradient(160deg, rgba(255, 252, 247, 0.92), rgba(255, 242, 228, 0.88));
  backdrop-filter: blur(12px);
}

/* Praise beats ("X is prachtig" / "X is geweldig") pin the dialogue to the left,
   like the planet-colours step, so it never sits centred over the planet/avatar. */
.opening-cinematic.is-praise-beat {
  align-items: flex-start;
  padding-left: clamp(16px, 4vw, 64px);
  padding-right: clamp(16px, 4vw, 64px);
}

.opening-cinematic.is-praise-beat .opening-cinematic-dialogue {
  width: min(410px, calc(100vw - 32px));
  align-self: flex-start;
}

.planet-palette-note {
  font-size: 0.9rem;
}

.planet-palette-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.planet-color-choice {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 10px 6px;
  border: 1px solid rgba(67, 52, 41, 0.14);
  border-radius: 16px;
  background: rgba(255, 249, 242, 0.72);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.planet-color-choice input[type="color"] {
  width: 52px;
  height: 52px;
  padding: 3px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.planet-color-choice input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.planet-color-choice input[type="color"]::-webkit-color-swatch {
  border: 3px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(43, 33, 24, 0.2);
}

.planet-color-choice input[type="color"]::-moz-color-swatch {
  border: 3px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(43, 33, 24, 0.2);
}

.planet-palette-reset {
  justify-self: start;
}

@media (max-width: 720px) {
  .opening-cinematic.is-planet-look-step {
    justify-content: flex-end;
    align-items: center;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  }

  .opening-cinematic.is-planet-look-step .opening-cinematic-dialogue,
  .opening-cinematic.is-planet-look-step .opening-cinematic-guide {
    width: min(100%, 520px);
    align-self: center;
  }

  .opening-cinematic.is-planet-look-step .opening-cinematic-dialogue {
    display: none;
  }

  /* The planet-look step normally hides its dialogue on mobile to leave room
     for the colour controls. Praise beats reuse that step, but do need to show
     their short "X is prachtig" line. Keep it clear of the planet at the bottom. */
  .opening-cinematic.is-guide.is-praise-beat {
    justify-content: flex-end;
    align-items: center;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  }

  .opening-cinematic.is-guide.is-praise-beat .opening-cinematic-dialogue {
    display: grid;
    width: min(100%, 520px);
    min-height: 0;
    align-self: center;
    padding: 14px 16px;
  }

  .opening-cinematic.is-planet-look-step .opening-cinematic-guide {
    max-height: min(56dvh, 560px);
  }
}

.opening-cinematic-setup-field {
  display: grid;
  gap: 8px;
}

.opening-cinematic-setup-label {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(43, 33, 24, 0.58);
}

.opening-cinematic-setup-input,
.opening-cinematic-setup-textarea {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(67, 52, 41, 0.22);
  padding: 14px 16px;
  font: inherit;
  color: var(--ink);
  background: rgba(255, 249, 242, 0.96);
  box-shadow: inset 0 1px 4px rgba(43, 33, 24, 0.08);
}

.opening-cinematic-setup-textarea {
  min-height: 112px;
  resize: vertical;
}

.opening-cinematic-setup-input:focus,
.opening-cinematic-setup-textarea:focus {
  outline: none;
  border-color: rgba(243, 163, 92, 0.72);
  box-shadow:
    inset 0 1px 4px rgba(43, 33, 24, 0.08),
    0 0 0 4px rgba(243, 163, 92, 0.14);
}

.opening-cinematic-setup-note {
  margin: 0;
  color: rgba(43, 33, 24, 0.66);
  line-height: 1.5;
}

.opening-cinematic-setup-error {
  margin: 0;
  color: #a84e3d;
  font-weight: 600;
}

.opening-cinematic-title {
  margin: 0;
  color: var(--moss);
  font-family: var(--title-font);
  font-size: clamp(24px, 4vw, 34px);
  letter-spacing: 0;
  text-transform: uppercase;
}

.opening-cinematic-intro,
.opening-cinematic-reread {
  margin: 0;
}

.opening-cinematic-step-title {
  margin: 10px 0 0;
  font-size: clamp(20px, 3.4vw, 25px);
  line-height: 1.2;
}

.opening-cinematic-list {
  margin: 0;
  padding-left: 24px;
  font-size: clamp(16px, 2.8vw, 19px);
}

.opening-cinematic-list li {
  margin-bottom: 10px;
}

.opening-cinematic-actions {
  margin-top: 2px;
}

.daily-theme-splash {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.daily-theme-splash-inner {
  padding: 28px 26px;
  text-align: center;
}

.daily-theme-splash-text {
  font-family: var(--title-font);
  text-transform: uppercase;
  letter-spacing: 1.6px;
  font-weight: 900;
  font-size: clamp(28px, 4.2vw, 64px);
  line-height: 1.08;
  color: rgba(255, 252, 247, 0.96);
  text-shadow:
    0 18px 42px rgba(0, 0, 0, 0.45),
    0 2px 0 rgba(0, 0, 0, 0.12);
}

@keyframes dailyThemeSplashFade {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
    filter: blur(4px);
  }
  14% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
  72% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-10px) scale(1.01);
    filter: blur(4px);
  }
}

.daily-theme-splash.is-showing {
  animation: dailyThemeSplashFade 3.2s ease-out both;
}

canvas#world {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 1;
  transition: opacity 320ms ease;
}

.hud {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.mobile-header {
  display: none;
}

.mobile-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mobile-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.mobile-menu-toggle {
  font-size: 0.7rem;
  padding: 4px 10px;
  min-width: 72px;
  min-height: 44px;
  text-align: center;
}

.mobile-planet-row {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.mobile-planet-name {
  font-family: var(--serif-font);
  font-size: 1.35rem;
  letter-spacing: 0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-vitality {
  display: grid;
  gap: 6px;
}

.mobile-hearts-row {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.mobile-hearts-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(43, 33, 24, 0.65);
  font-weight: 700;
}

.mobile-hearts-row .hearts-display {
  font-size: 1.05rem;
  letter-spacing: 2px;
  text-shadow: 0 10px 16px rgba(0, 0, 0, 0.12);
}

.mobile-hearts-row .hearts-display .heart {
  font-size: 1.05rem;
}

.mobile-hearts-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mobile-streak-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(67, 52, 41, 0.18);
  background: rgba(255, 248, 239, 0.9);
  color: rgba(43, 33, 24, 0.82);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.3px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.12s ease;
}

.mobile-streak-chip[hidden] {
  display: none;
}

.mobile-streak-chip:active {
  transform: scale(0.96);
}

.mobile-streak-flame {
  font-size: 0.95rem;
  filter: grayscale(0.5) opacity(0.7);
  transition: filter 0.18s ease;
}

.mobile-streak-chip.is-hot {
  border-color: rgba(243, 163, 92, 0.55);
  background: rgba(255, 238, 221, 0.95);
}

.mobile-streak-chip.is-complete {
  border-color: rgba(243, 163, 92, 0.85);
  background: rgba(255, 231, 205, 0.98);
  color: #b5651d;
}

.mobile-streak-chip.is-hot .mobile-streak-flame,
.mobile-streak-chip.is-complete .mobile-streak-flame {
  filter: none;
}

.mobile-language-toggle {
  font-size: 0.7rem;
  padding: 4px 10px;
  min-width: 48px;
  min-height: 44px;
  text-align: center;
}

.mobile-sheet-header {
  display: none;
  align-items: center;
  gap: 12px;
}

.mobile-sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: rgba(43, 33, 31, 0.2);
  flex: 0 0 auto;
}

.mobile-sheet-title {
  flex: 1;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--moss);
  font-weight: 600;
}

.mobile-sheet-close {
  font-size: 0.65rem;
  padding: 4px 10px;
  min-height: 44px;
}

.mobile-dock,
.mobile-sheet-backdrop {
  display: none;
}

.name-tags {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.avatar-focus-note {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  z-index: 4;
  width: min(520px, calc(100vw - 32px));
  transform: translateX(-50%);
  padding: 12px 16px;
  border: 1px solid rgba(255, 239, 215, 0.3);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(22, 18, 17, 0.94), rgba(8, 8, 10, 0.9));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  color: rgba(255, 248, 236, 0.96);
  text-align: center;
  font-weight: 650;
  line-height: 1.45;
  pointer-events: none;
}

.avatar-focus-note.is-memorial {
  border-color: rgba(208, 221, 228, 0.38);
  background: linear-gradient(180deg, rgba(30, 34, 38, 0.95), rgba(10, 12, 15, 0.92));
}

@media (max-width: 900px), (max-height: 600px) and (pointer: coarse) {
  .avatar-focus-note {
    top: calc(var(--mobile-header-height, 0px) + 10px);
    bottom: auto;
    width: calc(100vw - 24px);
    padding: 10px 14px;
    font-size: 0.88rem;
  }
}

.name-tag {
  position: absolute;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 247, 236, 0.92);
  color: #2b231f;
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: 0 8px 16px rgba(43, 33, 24, 0.18);
  white-space: nowrap;
  transform: translate(-50%, -100%);
  transition: opacity 0.2s ease;
  opacity: 0;
}

.name-tag.name-tag-local {
  background: rgba(243, 163, 92, 0.92);
  border: 2px solid rgba(43, 33, 24, 0.18);
  color: rgba(43, 33, 24, 0.95);
  box-shadow:
    0 10px 20px rgba(243, 163, 92, 0.25),
    0 10px 18px rgba(43, 33, 24, 0.16);
}

.panel {
  background: var(--glass);
  border: 2px solid var(--stroke-strong);
  border-radius: 22px;
  padding: 22px;
  box-shadow:
    0 22px 50px var(--shadow),
    0 2px 0 rgba(255, 255, 255, 0.35) inset;
  backdrop-filter: blur(14px) saturate(1.1);
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: floatIn 0.8s ease both;
  pointer-events: auto;
}

.panel-left {
  position: absolute;
  left: 24px;
  top: 24px;
  width: 360px;
  max-height: calc(100vh - 48px);
  overflow: hidden auto;
}

.panel-right {
  position: absolute;
  right: 24px;
  top: 24px;
  width: 320px;
  max-height: calc(100vh - 48px);
  overflow: hidden auto;
}

/* A dead planet is a memorial, not an actionable daily-check-in state. */
body.planet-dead .panel-left,
body.planet-dead .mobile-header {
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 112, 112, 0.22), transparent 42%),
    linear-gradient(155deg, rgba(136, 30, 39, 0.94), rgba(71, 13, 22, 0.96));
  border-color: rgba(255, 151, 151, 0.72);
  box-shadow:
    0 24px 64px rgba(66, 6, 15, 0.46),
    0 2px 0 rgba(255, 214, 214, 0.2) inset;
  color: #fff2ef;
}

body.planet-dead .panel-left .title h1,
body.planet-dead .panel-left .subtitle,
body.planet-dead .panel-left .stat-header,
body.planet-dead .panel-left .meta,
body.planet-dead .panel-left .hint,
body.planet-dead .panel-left .status-row,
body.planet-dead .mobile-header,
body.planet-dead .mobile-header * {
  color: #fff2ef;
  text-shadow: 0 2px 12px rgba(35, 0, 7, 0.4);
}

body.planet-dead .panel-left .bar {
  background: rgba(35, 0, 7, 0.3);
  border-color: rgba(255, 205, 205, 0.32);
}

body.planet-dead #vitality-bar,
body.planet-dead #mobile-vitality-bar {
  background: linear-gradient(90deg, #ff5b63, #a7192b);
}

body.planet-dead .panel-left .heart-empty,
body.planet-dead .mobile-header .heart-empty {
  color: rgba(255, 230, 226, 0.34);
  text-shadow: none;
}

body.planet-dead .panel-left .streak-chip {
  background: rgba(42, 0, 8, 0.3);
  border-color: rgba(255, 207, 207, 0.32);
}

body.planet-dead .panel-left .button-inline,
body.planet-dead .mobile-header button {
  background: rgba(255, 240, 235, 0.94);
  border-color: rgba(255, 205, 205, 0.72);
  color: #4b0e18;
  text-shadow: none;
}

body.planet-dead #journal-section,
body.planet-dead #journal-entry-modal,
body.planet-dead #journal-modal,
body.planet-dead #personal-journal-modal,
body.planet-dead #campfire-modal,
body.planet-dead .mobile-dock-button[data-mobile-panel="send"],
body.planet-dead #streak-progress-panel,
body.planet-dead #mobile-streak-chip,
body.planet-dead #hearts-next {
  display: none !important;
}

@media (max-width: 900px) {
  body.planet-dead .mobile-dock {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.panel-right #journal-section {
  order: 1;
}

.panel-right #planet-section {
  order: 2;
}

.panel-right #member-section {
  order: 3;
}

.panel-right .feedback-section {
  order: 4;
}

.title h1 {
  font-family: var(--title-font);
  font-size: 2.45rem;
  margin: 6px 0 6px;
  letter-spacing: 0.2px;
  color: rgba(43, 33, 24, 0.92);
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.45),
    0 14px 28px rgba(43, 33, 24, 0.12);
}

.title-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.title-heading-row h1 {
  min-width: 0;
  overflow-wrap: anywhere;
}

.title-heading-row .title-help-button {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.05rem;
}

.planet-colors-modal {
  width: min(440px, calc(100vw - 32px));
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 2px;
  margin: 0;
  color: var(--moss);
}

.subtitle {
  margin: 0;
  color: rgba(43, 33, 31, 0.68);
  line-height: 1.5;
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
}

.bar {
  height: 10px;
  background: rgba(43, 33, 31, 0.12);
  border: 2px solid rgba(43, 33, 24, 0.18);
  border-radius: 999px;
  overflow: hidden;
}

#vitality-bar,
#mobile-vitality-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--sun), var(--leaf));
  transition: width 0.6s ease;
}

.meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 0.9rem;
  color: rgba(31, 27, 24, 0.7);
}

.meta-hearts-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 100%;
  padding-top: 8px;
}

.hearts-display {
  letter-spacing: 8px;
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.35),
    0 16px 28px rgba(0, 0, 0, 0.18);
  font-weight: 900;
  font-size: clamp(2.1rem, 3.2vw, 2.8rem);
  line-height: 1;
}

.hearts-display .heart {
  display: inline-block;
}

.hearts-display .heart-filled {
  color: #ff5f5f;
}

.hearts-display .heart-empty {
  color: rgba(31, 27, 24, 0.28);
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.25);
}

.hearts-next {
  flex: 1 1 100%;
  margin-top: 4px;
}

.streak-chip {
  background: rgba(243, 163, 92, 0.16);
  border: 1px solid rgba(243, 163, 92, 0.28);
  font-size: 0.9rem;
  padding: 7px 12px;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.account-button {
  margin-left: auto;
}

.account-label {
  margin-left: 0;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- V30 consolidated HUD menu ---- */
.menu-wrap {
  position: relative;
  display: inline-block;
  margin-left: auto;
}

.menu-toggle[aria-expanded="true"] {
  background: rgba(243, 163, 92, 0.18);
}

/* Centered overlay (welcome-screen style), placed at body level so the
   panel's overflow/backdrop-filter cannot clip it. */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  justify-items: center;
  align-content: center;
  padding: 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 252, 247, 0.18), transparent 32%),
    rgba(9, 11, 14, 0.34);
  backdrop-filter: blur(2px);
  animation: campfireBackdropIn 0.3s ease both;
}

.menu-card {
  position: relative;
  max-height: calc(
    100dvh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom) - var(--keyboard-inset, 0px)
  );
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  animation: campfireDialogueIn 0.34s cubic-bezier(0.21, 0.9, 0.2, 1) both;
}

.menu-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(67, 52, 41, 0.08);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.menu-close:hover {
  background: rgba(67, 52, 41, 0.16);
}

.menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease;
}

.menu-item:hover,
.menu-item:focus-visible {
  background: rgba(143, 183, 160, 0.2);
  outline: none;
}

.menu-divider {
  height: 1px;
  background: rgba(67, 52, 41, 0.14);
  margin: 6px 4px;
}

.menu-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.menu-caret {
  transition: transform 0.18s ease;
  font-size: 0.8em;
  opacity: 0.7;
}

.menu-section-toggle[aria-expanded="true"] .menu-caret {
  transform: rotate(180deg);
}

.menu-options {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  margin: 2px 0 0;
  border-radius: 16px;
  background: rgba(255, 244, 231, 0.55);
  border: 1px solid rgba(67, 52, 41, 0.12);
}

.menu-sub-item {
  font-weight: 600;
  border-radius: 12px;
}

.menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 12px;
}

.menu-row-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.menu-account-label {
  display: block;
  padding: 0 12px 6px;
  font-size: 0.78rem;
  max-width: none;
}

/* ---- V30 "Mijn planeten" gallery ---- */
.planets-card {
  width: min(780px, calc(100vw - 48px));
  max-height: calc(100dvh - 48px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.menu-gallery-title {
  margin: 2px 2px 0;
  font-family: var(--title-font);
  font-weight: 800;
  color: var(--ink);
  font-size: 1.05rem;
}

.planet-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  min-height: 0;
  padding: 4px 6px 12px 4px;
  margin: -4px -6px -12px -4px;
  overflow: hidden auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.planets-status {
  margin: 0;
  text-align: center;
  min-height: 1.1em;
}

#planet-delete-modal .planet-delete-confirm {
  background: #d64541;
  border-color: #d64541;
  color: #fff;
}

.planet-tile-wrap {
  position: relative;
  display: flex;
}

.planet-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 164px;
  padding: 18px 10px 14px;
  border-radius: 18px;
  border: 2px solid rgba(67, 52, 41, 0.16);
  background:
    radial-gradient(
      circle at 50% 32%,
      rgba(var(--planet-sky-rgb, 111, 179, 232), 0.32),
      rgba(var(--planet-sky-rgb, 111, 179, 232), 0.08) 42%,
      transparent 68%
    ),
    rgba(255, 249, 242, 0.9);
  box-shadow: 0 8px 0 rgba(43, 33, 24, 0.06);
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.planet-tile-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  justify-content: center;
  height: 44px;
  min-width: 44px;
  padding: 0 10px;
  border: none;
  border-radius: 22px;
  background: rgba(214, 69, 65, 0.14);
  color: #d64541;
  font: inherit;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.planet-tile-delete-icon {
  font-size: 16px;
  line-height: 1;
}

.planet-tile-delete-count {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.planet-tile-wrap:hover .planet-tile-delete,
.planet-tile-delete:hover,
.planet-tile-delete:focus-visible {
  opacity: 1;
  outline: none;
}

.planet-tile-delete:hover,
.planet-tile-delete:focus-visible {
  background: #d64541;
  color: #fff;
}

.planet-tile-delete.is-voting {
  opacity: 1;
  background: #d64541;
  color: #fff;
}

.planet-tile-delete.is-voting.is-mine {
  box-shadow: 0 0 0 2px rgba(214, 69, 65, 0.35);
}

.planet-tile:hover,
.planet-tile:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(243, 163, 92, 0.5);
  outline: none;
}

.planet-tile.is-active {
  border-color: rgba(95, 135, 117, 0.75);
  box-shadow: 0 8px 0 rgba(43, 33, 24, 0.06), 0 0 0 3px rgba(143, 183, 160, 0.35);
}

.planet-tile-active {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(95, 135, 117, 0.94);
  color: #fff;
  box-shadow: 0 4px 10px rgba(43, 33, 24, 0.14);
  font-family: var(--title-font);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.planet-tile-name {
  font-family: var(--title-font);
  font-weight: 800;
  font-size: 0.95rem;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planet-tile-members {
  font-size: 0.78rem;
  color: rgba(31, 27, 24, 0.6);
}

.planet-tile-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 0.76rem;
  color: rgba(31, 27, 24, 0.62);
}

.planet-tile-stat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.planet-tile-sub {
  font-size: 0.72rem;
  color: rgba(31, 27, 24, 0.5);
}

.planet-tile--new {
  border-style: dashed;
  background: rgba(255, 249, 242, 0.55);
  color: rgba(31, 27, 24, 0.72);
}

.planet-tile-plus {
  font-size: 30px;
  line-height: 1;
  font-weight: 800;
  color: rgba(95, 135, 117, 0.95);
}

.planet-tile--new.is-highlighted {
  border-style: solid;
  border-color: rgba(243, 163, 92, 0.75);
  background: linear-gradient(135deg, rgba(255, 234, 200, 0.95), rgba(255, 246, 220, 0.92));
  animation: planetTilePulse 2.2s ease-in-out infinite;
}

@keyframes planetTilePulse {
  0%, 100% { box-shadow: 0 8px 0 rgba(43, 33, 24, 0.06), 0 0 0 3px rgba(243, 163, 92, 0.22); }
  50% { box-shadow: 0 8px 0 rgba(43, 33, 24, 0.06), 0 0 0 7px rgba(243, 163, 92, 0.1); }
}

/* Spinning mini-planet */
.planet-orb {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;
  background: #3f7a40;
  box-shadow: inset -6px -8px 12px rgba(20, 50, 22, 0.5), 0 6px 12px rgba(40, 60, 30, 0.25);
}

.planet-orb::before {
  content: "";
  position: absolute;
  inset: -28%;
  background: repeating-conic-gradient(
    from 0deg,
    #5fa85f 0deg 22deg,
    #4f9450 22deg 44deg,
    #6fb86b 44deg 66deg,
    #4a8c4a 66deg 90deg
  );
  animation: planetOrbSpin 6s linear infinite;
}

.planet-orb::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.55), transparent 46%);
  pointer-events: none;
}

@keyframes planetOrbSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Real planet preview: a live 3D rotating planet drawn into this canvas
   (foliage sticks out past the rim, so we don't clip to a circle). */
.planet-orb-canvas {
  width: 82px;
  height: 82px;
  margin: -6px 0 -4px;
  filter: drop-shadow(0 5px 8px rgba(28, 48, 24, 0.28));
}

@media (hover: none), (pointer: coarse) {
  .planet-tile-delete {
    opacity: 1;
    background: rgba(214, 69, 65, 0.18);
  }
}

@media (max-width: 600px) {
  .planets-overlay {
    padding:
      calc(12px + env(safe-area-inset-top))
      12px
      calc(12px + env(safe-area-inset-bottom));
  }

  .planets-card {
    width: 100%;
    max-height: calc(
      100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)
    );
    gap: 12px;
    padding: 16px;
    border-radius: 22px;
  }

  .planet-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .planet-tile {
    min-height: 156px;
    padding-inline: 8px;
  }
}

/* ---- Shared options / planets / new-planet overlays (above menu z-50 and welcome z-998) ---- */
.options-overlay,
.planets-overlay,
.newplanet-overlay {
  z-index: 1000;
}

.options-card .menu-row {
  padding: 8px 4px;
}

.menu-volume {
  width: 130px;
  accent-color: var(--sun);
  cursor: pointer;
}

.js-fps-toggle.is-on {
  background: rgba(143, 183, 160, 0.4);
  color: var(--deep);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 10px rgba(243, 163, 92, 0.5);
  animation: pulse 2s ease-in-out infinite;
}

.section h2 {
  font-size: 1rem;
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--moss);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section h2::before {
  content: "✦";
  font-size: 0.9rem;
  color: rgba(95, 135, 117, 0.9);
}

#planet-section h2::before {
  content: "◌";
}

#member-section h2::before {
  content: "☺";
}

#journal-section h2::before {
  content: "✎";
}

.feedback-section h2::before {
  content: "✉";
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.collapsible-header {
  align-items: center;
}

.collapse-toggle {
  min-width: 44px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
}

.section-collapsible.is-expanded .collapse-toggle {
  transform: rotate(180deg);
}

.collapsible-body {
  display: grid;
  gap: 14px;
}

.journal-answer-block {
  display: grid;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(143, 183, 160, 0.2);
  color: var(--deep);
  font-size: 0.75rem;
  border: 2px solid rgba(67, 52, 41, 0.16);
  box-shadow: 0 8px 16px rgba(43, 33, 24, 0.08);
}

.journal-prompt {
  position: relative;
  margin: 4px 0 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background:
    radial-gradient(130% 120% at 0% 0%, rgba(255, 224, 186, 0.28), transparent 58%),
    linear-gradient(160deg, rgba(198, 134, 80, 0.96), rgba(150, 92, 50, 0.96));
  border: 1px solid rgba(150, 92, 50, 0.5);
  line-height: 1.5;
  color: rgba(255, 251, 246, 0.97);
  text-shadow: 0 1px 2px rgba(50, 28, 14, 0.45);
  font-family: var(--title-font);
  font-size: 1rem;
  overflow: hidden;
}

.journal-prompt::before {
  display: none;
}

.journal-prompt::after {
  display: none;
}

#campfire-prompt {
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 12px 14px;
  border-radius: 16px;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  background:
    radial-gradient(130% 120% at 0% 0%, rgba(255, 224, 186, 0.28), transparent 58%),
    linear-gradient(160deg, rgba(198, 134, 80, 0.96), rgba(150, 92, 50, 0.96));
  border: 1px solid rgba(150, 92, 50, 0.5);
  color: rgba(255, 251, 246, 0.97);
  text-shadow: 0 1px 2px rgba(50, 28, 14, 0.45);
  font-family: var(--title-font);
  font-weight: 800;
}

#campfire-prompt::before {
  display: none;
}

/* ---- V30 journal redesign: private vs planet cards ---- */
#journal-content-block {
  display: grid;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
}

/* The id selector above out-specifies the .hidden utility (id 1,0,0 beats
   class 0,1,0), so without this the prompts stay visible even when JS adds
   .hidden (e.g. before the planet has started). Keep the hide working. */
#journal-content-block.hidden {
  display: none;
}

/* Lifecycle call-to-action ("Nodig iemand uit om te starten" / "Klik op het
   papieren vliegtuig om te reflecteren") — make it read as an instruction,
   not a muted description, so it doesn't get lost. */
#journal-unlock-hint {
  font-weight: 700;
  font-size: 0.92rem;
  color: rgba(31, 27, 24, 0.85);
}

.journal-day-meta {
  margin: 2px 0 10px;
  font-size: 0.8rem;
  letter-spacing: 0.2px;
  color: rgba(31, 27, 24, 0.6);
}

.journal-card {
  position: relative;
  border-radius: 18px;
  padding: 14px 14px 12px;
  border: 2px solid rgba(67, 52, 41, 0.12);
  display: grid;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

#journal-section,
.journal-answer-block,
.journal-card > *,
.journal-answer-block > * {
  min-width: 0;
  max-width: 100%;
}

.journal-prompt,
.journal-answer-block label,
.journal-answer-block .hint {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Private = calm, cool, "just for you" paper look */
.journal-card--private {
  background: linear-gradient(180deg, rgba(247, 249, 250, 0.92), rgba(236, 241, 243, 0.92));
  border-color: rgba(94, 110, 120, 0.22);
}

/* Planet = warm, shared, "campfire" energy */
.journal-card--planet {
  background: linear-gradient(180deg, rgba(255, 246, 235, 0.94), rgba(252, 236, 220, 0.94));
  border-color: rgba(187, 120, 64, 0.26);
}

.journal-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.journal-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 1.15rem;
  line-height: 1;
}

.journal-tag--private {
  background: transparent;
}

.journal-tag--planet {
  background: transparent;
}

.planet-time-preview {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 249, 242, 0.58);
  border: 1px solid rgba(67, 52, 41, 0.12);
}

.planet-time-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
}

.planet-time-preview output {
  color: var(--moss-dark);
  font-variant-numeric: tabular-nums;
}

.planet-time-preview input[type="range"] {
  width: 100%;
  accent-color: var(--sun);
}

#journal-entry-modal {
  place-items: start center;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#journal-entry-modal .journal-entry-modal {
  max-height: calc(100dvh - 40px - var(--keyboard-inset, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.journal-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(67, 52, 41, 0.1);
  color: rgba(31, 27, 24, 0.62);
}

.journal-status-pill.is-done {
  background: rgba(143, 183, 160, 0.32);
  color: var(--deep);
}

/* Private prompt: lighter, no heavy cardboard ridges */
.journal-prompt--private {
  background: rgba(255, 255, 255, 0.6);
  border: 1px dashed rgba(94, 110, 120, 0.4);
  color: rgba(40, 48, 54, 0.92);
  text-shadow: none;
  font-size: 0.96rem;
}

.journal-prompt--private::after {
  display: none;
}

.journal-charcount {
  font-size: 0.72rem;
  text-align: right;
  color: rgba(31, 27, 24, 0.45);
  min-height: 1em;
}

.journal-charcount.is-short {
  color: rgba(180, 95, 60, 0.9);
}

/* Compact "saved/shared" confirmation instead of a giant checkmark box */
.journal-entry-saved {
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(143, 183, 160, 0.16);
  border: 1px solid rgba(143, 183, 160, 0.45);
  color: rgba(45, 60, 50, 0.92);
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.journal-entry-saved::before {
  content: "✓ ";
  font-weight: 900;
  color: var(--moss);
}

.journal-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* Campfire-ready glow only on the planet prompt now.
   Extra class raises specificity above the generic .journal-prompt rule below. */
#journal-section.campfire-ready .journal-card--private .journal-prompt--private {
  border-color: rgba(94, 110, 120, 0.4);
  box-shadow: none;
}

#journal-section.campfire-ready .journal-prompt {
  border-color: rgba(243, 163, 92, 0.34);
  box-shadow: 0 18px 32px rgba(243, 163, 92, 0.15);
}

#journal-section.campfire-ready #journal-meter-fill {
  background: linear-gradient(120deg, var(--sun), var(--leaf));
}

.journal-meter {
  position: relative;
  width: 100%;
  height: 10px;
  background: rgba(67, 52, 41, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0 4px;
}

#journal-meter-fill,
#personal-meter-fill,
#personal-entry-meter-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(120deg, var(--leaf), var(--moss));
  transition: width 0.3s ease;
}

.journal-meter-label {
  font-size: 0.8rem;
  color: rgba(31, 27, 24, 0.7);
  margin-bottom: 8px;
}

.journal-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.section-separator {
  height: 1px;
  width: 100%;
  background: rgba(67, 52, 41, 0.14);
  border-radius: 999px;
  margin: 14px 0 12px;
}

.journal-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 10px;
}

.journal-list li {
  background: rgba(255, 247, 236, 0.95);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(67, 52, 41, 0.12);
  box-shadow: 0 6px 14px rgba(43, 33, 24, 0.08);
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.list li {
  background: rgba(255, 249, 242, 0.85);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(67, 52, 41, 0.12);
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: fadeUp 0.4s ease both;
}

.list .meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: rgba(31, 27, 24, 0.6);
}

.composer label {
  font-size: 0.85rem;
  font-weight: 600;
}

.composer input,
.composer textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(67, 52, 41, 0.22);
  padding: 10px 12px;
  font-family: inherit;
  resize: none;
  background: rgba(255, 249, 242, 0.95);
  box-shadow: inset 0 1px 4px rgba(43, 33, 24, 0.08);
}

.composer input:focus,
.composer textarea:focus,
.member-form input[type="text"]:focus,
.feedback-form input[type="text"]:focus,
.feedback-form textarea:focus {
  outline: none;
  border-color: var(--sun);
  box-shadow: 0 0 0 3px rgba(243, 163, 92, 0.22);
}



.composer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

#journal-entry-input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(67, 52, 41, 0.22);
  padding: 10px 12px;
  font-family: inherit;
  resize: vertical;
  min-height: 96px;
  background: rgba(255, 249, 242, 0.95);
  box-shadow: inset 0 1px 4px rgba(43, 33, 24, 0.08);
}

#journal-entry-input:focus {
  outline: none;
  border-color: var(--sun);
  box-shadow: 0 0 0 3px rgba(243, 163, 92, 0.22);
}

.journal-entry-done {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(67, 52, 41, 0.22);
  padding: 10px 12px;
  min-height: 96px;
  background: rgba(255, 249, 242, 0.85);
  box-shadow: inset 0 1px 4px rgba(43, 33, 24, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 44px;
  color: rgba(67, 52, 41, 0.65);
  user-select: none;
}

.journal-entry-done-modal {
  min-height: 120px;
  font-size: 40px;
}

.button-primary {
  background: linear-gradient(140deg, var(--sun), #f7b27a);
  color: #fff;
  border: none;
  padding: 11px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0.3px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
  box-shadow:
    0 12px 0 rgba(43, 33, 24, 0.12),
    0 18px 28px rgba(243, 163, 92, 0.28);
  border: 2px solid rgba(43, 33, 24, 0.16);
  font-family: var(--title-font);
}

.button-primary:hover {
  transform: translateY(-2px);
  filter: saturate(1.05);
}

.button-primary:disabled {
  background: rgba(243, 163, 92, 0.4);
  cursor: not-allowed;
  box-shadow: none;
}

.hint {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(31, 27, 24, 0.6);
}

.preview {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 249, 242, 0.9);
  border: 1px dashed rgba(67, 52, 41, 0.18);
  min-height: 80px;
}

.feedback-section {
  display: grid;
  gap: 8px;
}

.feedback-form {
  display: grid;
  gap: 8px;
}

.feedback-form label {
  font-size: 0.8rem;
  font-weight: 600;
}

.feedback-form textarea,
.feedback-form input[type="text"] {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(67, 52, 41, 0.22);
  padding: 10px 12px;
  font-family: inherit;
  background: rgba(255, 249, 242, 0.95);
  box-shadow: inset 0 1px 4px rgba(43, 33, 24, 0.08);
  resize: none;
}

.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button-inline {
  align-self: flex-start;
  background: rgba(255, 244, 231, 0.8);
  border: 2px solid rgba(67, 52, 41, 0.18);
  color: var(--ink);
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  box-shadow: 0 10px 0 rgba(43, 33, 24, 0.08);
  font-family: var(--title-font);
}

.button-inline:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 0 rgba(43, 33, 24, 0.08),
    0 16px 18px rgba(67, 52, 41, 0.14);
}

.button-inline.active {
  background: var(--sun);
  border-color: var(--sun);
}

/* New-planet wizard confirm step (6/6): affirmative "Ja" reads green,
   decline "Nee" reads orange, and "Terug" sits on the far left. */
.button-primary.button-affirm {
  background: linear-gradient(140deg, var(--moss), #7fae93);
  box-shadow:
    0 12px 0 rgba(43, 33, 24, 0.12),
    0 18px 28px rgba(95, 135, 117, 0.32);
}

.button-inline.button-decline {
  background: linear-gradient(140deg, var(--sun), #f7b27a);
  border-color: rgba(43, 33, 24, 0.16);
  color: #fff;
}

.opening-cinematic-actions .is-back-left {
  margin-right: auto;
}

.language-switch {
  margin-left: 0;
  flex: 0 0 auto;
  min-width: 48px;
  text-align: center;
  align-self: center;
  font-size: 0.7rem;
  padding: 4px 10px;
}


.member-card {
  background: rgba(255, 249, 242, 0.82);
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(67, 52, 41, 0.12);
  display: grid;
  gap: 8px;
}

.planet-card {
  background: rgba(255, 249, 242, 0.82);
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(67, 52, 41, 0.12);
  display: grid;
  gap: 8px;
}

.planet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.planet-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.help-button {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  font-size: 0.85rem;
  line-height: 1;
  text-transform: none;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.member-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

#member-name-label {
  font-weight: 600;
}

.member-form {
  display: grid;
  gap: 12px;
}

.wizard-progress {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wizard-progress-bar {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: rgba(43, 33, 31, 0.12);
  border: 1px solid rgba(67, 52, 41, 0.16);
  overflow: hidden;
}

.wizard-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(120deg, var(--leaf), var(--moss));
  transition: width 0.25s ease;
}

.wizard-progress-count {
  min-width: 44px;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(31, 27, 24, 0.75);
}

.wizard-step {
  display: grid;
  gap: 10px;
  animation: uiModalIn 0.16s ease-out both;
}

.wizard-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.auth-divider {
  display: grid;
  place-items: center;
  margin: 12px 0;
  color: rgba(43, 33, 31, 0.55);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  position: relative;
}

.auth-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(43, 33, 31, 0.16);
}

.auth-divider span {
  position: relative;
  padding: 0 12px;
  background: rgba(255, 252, 247, 0.75);
  border-radius: 999px;
}

.auth-forgot {
  justify-self: start;
  margin-top: -4px;
  margin-bottom: 6px;
  font-size: 0.85rem;
}

.auth-login-view,
.auth-signup-view,
.auth-form,
.auth-account-view {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.auth-new-account {
  display: grid;
  justify-items: start;
  gap: 8px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(43, 33, 31, 0.14);
}

.auth-new-account p {
  margin: 0;
  color: rgba(43, 33, 31, 0.68);
  font-size: 0.86rem;
}

.auth-new-account button {
  width: 100%;
}

.auth-signup-actions {
  justify-content: space-between;
  margin-top: 6px;
}

.auth-form label,
.auth-recovery-block label {
  font-size: 0.86rem;
  font-weight: 600;
}

.auth-account-view {
  gap: 16px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(95, 135, 117, 0.24);
  background: rgba(143, 183, 160, 0.12);
}

.auth-account-identity {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.auth-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

#auth-modal .auth-actions button {
  min-height: 42px;
}

#auth-modal input:focus {
  outline: none;
  border-color: var(--sun);
  box-shadow: 0 0 0 3px rgba(243, 163, 92, 0.22);
}

#auth-modal button:disabled {
  cursor: wait;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.auth-hint:not(:empty) {
  padding-top: 2px;
}

.auth-recovery-block {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(67, 52, 41, 0.14);
  background: rgba(255, 249, 242, 0.82);
  margin: 8px 0 6px;
}

@media (max-width: 480px) {
  #auth-modal .auth-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  #auth-modal .auth-actions button {
    width: 100%;
  }

  #auth-signup-submit {
    order: -1;
  }
}

.planet-form {
  display: grid;
  gap: 12px;
}

.planet-modal-join-only .modal {
  max-width: 360px;
  gap: 10px;
}

.planet-modal-join-only #planet-modal-title {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.planet-modal-join-only .planet-tabs,
.planet-modal-join-only #planet-create-form,
.planet-modal-join-only #planet-created-code,
.planet-modal-join-only #planet-form-hint:empty {
  display: none;
}

.planet-modal-join-only #planet-join-form .composer-row {
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.planet-modal-join-only #planet-modal-close {
  order: 1;
}

.planet-modal-join-only #planet-join-button {
  order: 2;
  margin-left: auto;
}

body.planet-modal-active .hud,
body.planet-modal-active .mobile-header,
body.planet-modal-active .mobile-dock,
body.planet-modal-active .move-pad,
body.planet-modal-active .water-pad,
body.planet-modal-active #name-tags,
body.planet-modal-active #invite-banner,
body.planet-modal-active #death-countdown,
body.planet-modal-active #app-error,
body.planet-modal-active #setup-banner {
  display: none !important;
}

.planet-tabs {
  display: flex;
  gap: 8px;
}

.planet-tab {
  background: rgba(255, 244, 231, 0.8);
  border: 1px solid rgba(67, 52, 41, 0.2);
  color: var(--ink);
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.planet-tab:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 14px rgba(67, 52, 41, 0.16);
}

.planet-tab.active {
  background: var(--sun);
  border-color: var(--sun);
  color: #fff;
}

.member-form label {
  font-size: 0.8rem;
  font-weight: 600;
}

.member-form input[type="text"] {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(67, 52, 41, 0.22);
  padding: 10px 12px;
  font-family: inherit;
  background: rgba(255, 249, 242, 0.95);
  box-shadow: inset 0 1px 4px rgba(43, 33, 24, 0.08);
}

.member-form textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(67, 52, 41, 0.22);
  padding: 10px 12px;
  font-family: inherit;
  resize: vertical;
  min-height: 88px;
  background: rgba(255, 249, 242, 0.95);
  box-shadow: inset 0 1px 4px rgba(43, 33, 24, 0.08);
}

.modal input[type="email"],
.modal input[type="password"],
.planet-form input[type="text"],
.modal textarea,
.journal-answer-block textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(67, 52, 41, 0.22);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: rgba(255, 249, 242, 0.95);
  box-shadow: inset 0 1px 4px rgba(43, 33, 24, 0.08);
}

.modal textarea,
.journal-answer-block textarea {
  min-height: 88px;
  resize: vertical;
}

.modal input[type="email"]:focus-visible,
.modal input[type="password"]:focus-visible,
.planet-form input[type="text"]:focus-visible,
.modal textarea:focus-visible,
.journal-answer-block textarea:focus-visible {
  outline: none;
  border-color: var(--sun);
  box-shadow: 0 0 0 3px rgba(243, 163, 92, 0.22);
}

.character-picker {
  display: grid;
  gap: 8px;
}

.avatar-size-picker {
  display: grid;
  gap: 8px;
}

.avatar-size-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.avatar-size-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(67, 52, 41, 0.16);
  background: rgba(255, 249, 242, 0.9);
  cursor: pointer;
}

.avatar-size-option input {
  accent-color: var(--sun);
}

.avatar-size-option span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}

.avatar-size-option input:checked + span {
  color: var(--moss);
}

.avatar-size-option input:disabled + span {
  color: rgba(43, 33, 24, 0.38);
  cursor: not-allowed;
}

.character-label {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--moss);
}

.character-preview {
  background: rgba(255, 249, 242, 0.92);
  border: 1px solid rgba(67, 52, 41, 0.14);
  border-radius: 16px;
  padding: 10px;
  display: grid;
  gap: 6px;
  justify-items: center;
}

.character-preview canvas {
  width: 100%;
  height: 180px;
  border-radius: 12px;
  display: block;
  background: radial-gradient(circle at 50% 20%, #fffaf2, #f1e4d4 65%, #e6d4c2);
  touch-action: none;
  cursor: grab;
}

.character-preview canvas:active {
  cursor: grabbing;
}

.character-preview .hint {
  margin: 0;
}

.opening-character-preview {
  width: min(240px, 100%);
  margin: 0 auto 4px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(255, 249, 242, 0.72);
}

.opening-character-preview canvas {
  height: 154px;
}

.character-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.character-controls .button-inline {
  min-width: 96px;
}

.help-list {
  margin: 10px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: rgba(31, 27, 24, 0.75);
  font-size: 0.85rem;
}

.help-pages {
  display: grid;
  gap: 12px;
}

.help-page {
  display: grid;
  gap: 6px;
  animation: uiModalIn 0.16s ease-out both;
}

.help-title {
  margin: 6px 0 0;
  font-size: 1.02rem;
  font-weight: 800;
  color: rgba(43, 33, 24, 0.9);
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.character-option {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(67, 52, 41, 0.16);
  background: rgba(255, 249, 242, 0.9);
  color: var(--ink);
  font-size: 0.78rem;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.character-option:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 14px rgba(67, 52, 41, 0.16);
}

.character-option.taken {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.character-option.locked,
.character-option:disabled {
  opacity: 0.38;
  filter: grayscale(1);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.character-option.locked::before {
  content: "\1F512";
  margin-right: 5px;
  font-size: 0.72rem;
}

.character-option.selected {
  border-color: var(--sun);
  box-shadow: 0 0 0 2px rgba(243, 163, 92, 0.2);
}


.modal-wide {
  max-width: 380px;
}

#member-save-button {
  background: linear-gradient(140deg, var(--sun), #f7b27a);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#member-save-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(243, 163, 92, 0.35);
}

#member-save-button:disabled {
  background: rgba(243, 163, 92, 0.4);
  cursor: not-allowed;
  box-shadow: none;
}


.dev-panel {
  position: fixed;
  left: 24px;
  bottom: 24px;
  width: 260px;
  z-index: 3;
}

.dev-visuals-panel {
  left: 300px;
  width: 320px;
}

.dev-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dev-header-titles {
  display: grid;
  gap: 4px;
}

.dev-collapse {
  min-width: 38px;
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 14px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 1.1rem;
  box-shadow: inset 0 1px 2px rgba(43, 33, 24, 0.06);
}

.dev-panel.collapsed {
  padding: 16px 18px;
  gap: 0;
}

.dev-panel.collapsed .dev-body {
  display: none;
}

.dev-body {
  display: grid;
  gap: 12px;
}

.dev-scroll {
  max-height: min(64vh, 620px);
  overflow: hidden auto;
  padding-right: 4px;
}

.dev-group-title {
  margin: 10px 0 0;
  font-size: 0.78rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--moss);
}

.dev-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dev-actions button {
  flex: 1 1 120px;
  justify-content: center;
  text-align: center;
}

.dev-header h2 {
  margin: 0;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--moss);
}

.dev-buttons {
  display: grid;
  gap: 8px;
}

.dev-buttons button {
  width: 100%;
  text-align: left;
}

.dev-slider {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(67, 52, 41, 0.12);
  box-shadow: inset 0 1px 2px rgba(67, 52, 41, 0.08);
}

.dev-slider label {
  font-size: 0.78rem;
  color: var(--moss);
  letter-spacing: 0.02em;
}

.dev-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dev-slider-row input[type="range"] {
  flex: 1;
}

.dev-slider-row input[type="number"] {
  width: 78px;
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid rgba(67, 52, 41, 0.22);
  background: rgba(255, 255, 255, 0.76);
  font-variant-numeric: tabular-nums;
  color: var(--moss-dark);
}

.dev-slider-row input[type="text"] {
  width: 94px;
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid rgba(67, 52, 41, 0.22);
  background: rgba(255, 255, 255, 0.76);
  font-variant-numeric: tabular-nums;
  color: var(--moss-dark);
  text-transform: uppercase;
}

.dev-slider-row input[type="color"] {
  width: 44px;
  height: 34px;
  padding: 0;
  border: none;
  background: transparent;
}

.dev-slider-row span {
  min-width: 44px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--moss-dark);
  font-size: 0.78rem;
}

.dev-panel .eyebrow {
  margin-bottom: 4px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 21, 18, 0.35);
  display: grid;
  place-items: center;
  z-index: 4;
  padding: 20px;
  padding-bottom: calc(20px + var(--keyboard-inset, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@keyframes uiBackdropIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes uiModalIn {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-backdrop:not(.hidden) {
  animation: uiBackdropIn 0.14s ease-out both;
}

.modal-backdrop:not(.hidden) .modal {
  animation: uiModalIn 0.16s ease-out both;
}

#auth-modal.modal-backdrop {
  z-index: 1001;
}

/* The delete confirm opens from inside the planets overlay (z-1000), so it must sit above it. */
#planet-delete-modal.modal-backdrop {
  z-index: 1001;
}

.modal {
  background: linear-gradient(160deg, rgba(255, 252, 247, 0.96), rgba(255, 242, 228, 0.9));
  border-radius: 20px;
  padding: 20px 22px;
  border: 1px solid rgba(67, 52, 41, 0.16);
  box-shadow: 0 22px 44px rgba(26, 21, 18, 0.18);
  max-width: 320px;
  width: 100%;
  max-height: calc(
    100dvh - 40px - env(safe-area-inset-top) - env(safe-area-inset-bottom) - var(--keyboard-inset, 0px)
  );
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: grid;
  gap: 12px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header > .button-inline {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.campfire-modal {
  max-width: 720px;
}

.campfire-modal {
  position: relative;
  overflow: hidden;
}

#campfire-modal.modal-backdrop {
  place-items: end center;
  padding: 22px;
  padding-bottom: calc(22px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 188, 120, 0.1), rgba(26, 21, 18, 0.42) 60%),
    rgba(26, 21, 18, 0.28);
  animation: campfireBackdropIn 0.38s ease both;
}

#campfire-modal .modal {
  max-width: 920px;
  width: min(980px, 100%);
  border-radius: 18px;
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(255, 249, 241, 0.98), rgba(255, 237, 216, 0.92));
  border: 1px solid rgba(67, 52, 41, 0.22);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.34);
  animation: campfireDialogueIn 0.42s cubic-bezier(0.21, 0.9, 0.2, 1) both;
}

#auth-modal.auth-locked {
  background: rgba(26, 21, 18, 0.6);
}

#auth-modal.auth-locked #auth-close {
  display: none;
}

#campfire-modal .modal::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(circle at 40% 0%, rgba(255, 255, 255, 0.35), transparent 60%),
    radial-gradient(circle at 65% 120%, rgba(67, 52, 41, 0.14), transparent 55%);
  opacity: 0.8;
}

#campfire-modal .modal > * {
  position: relative;
}

.flumpie-modal {
  position: relative;
  overflow: hidden;
}

#flumpie-modal.modal-backdrop {
  place-items: end center;
  padding: 18px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
  background: rgba(26, 21, 18, 0.12);
}

#flumpie-modal .modal {
  width: min(680px, 100%);
  max-width: 680px;
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.22);
}

#flumpie-modal .campfire-entry-card {
  min-height: 78px;
  border-radius: 14px;
  border: 2px solid rgba(67, 52, 41, 0.22);
  background: rgba(255, 255, 255, 0.62);
}

.dialogue-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  letter-spacing: 0.2px;
}

@keyframes dialogueCaretBlink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

.dialogue-text.typing::after {
  content: "▌";
  margin-left: 2px;
  animation: dialogueCaretBlink 0.8s step-end infinite;
  opacity: 1;
}

.journal-entry-modal {
  max-width: 520px;
}

.journal-modal-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#journal-entry-meter-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(120deg, var(--leaf), var(--moss));
  transition: width 0.3s ease;
}

.campfire-entry-card {
  border-radius: 18px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(67, 52, 41, 0.18);
  box-shadow:
    0 16px 34px rgba(26, 21, 18, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  min-height: 92px;
  display: flex;
  align-items: center;
}

.campfire-entry-card p {
  margin: 0;
  font-size: 21px;
  line-height: 1.4;
  font-family: var(--body-font);
  color: rgba(26, 21, 18, 0.92);
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.campfire-nav {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--moss);
  font-family: var(--title-font);
}

.modal p {
  margin: 0;
  line-height: 1.4;
}

.death-countdown {
  position: fixed;
  left: 24px;
  bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #b50000;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 600;
  box-shadow: 0 18px 36px rgba(42, 0, 0, 0.35);
  z-index: 3;
  pointer-events: none;
  min-width: 280px;
}

.death-countdown-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.death-countdown-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.death-countdown-label {
  font-size: 0.8rem;
}

.death-countdown-time {
  font-size: 0.9rem;
  letter-spacing: 1.4px;
  white-space: nowrap;
}

.setup-banner {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: rgba(31, 27, 24, 0.85);
  color: #fff;
  padding: 12px 18px;
  border-radius: 999px;
  z-index: 3;
  pointer-events: none;
  font-size: 0.85rem;
  max-width: 90%;
  text-align: center;
}

.error-banner {
  background: rgba(192, 85, 60, 0.92);
}

.setup-banner code {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 6px;
}

.invite-banner {
  position: fixed;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  background: rgba(255, 247, 236, 0.94);
  border: 1px solid rgba(67, 52, 41, 0.22);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 16px;
  z-index: 2;
  pointer-events: auto;
  font-size: 0.9rem;
  font-weight: 650;
  max-width: min(640px, calc(100vw - 24px));
  text-align: center;
  box-shadow: 0 12px 24px rgba(43, 33, 24, 0.14);
}

.invite-banner code {
  background: rgba(243, 163, 92, 0.22);
  border: 1px solid rgba(243, 163, 92, 0.26);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 800;
}

.invite-banner .invite-copy {
  margin-left: 8px;
}

.hidden {
  display: none;
}

@keyframes campfireBackdropIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes campfireDialogueIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes openingHighlightPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.025);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

@media (min-width: 901px) and (max-width: 1180px),
  (min-width: 901px) and (max-height: 700px) {
  .panel {
    padding: 18px;
    gap: 16px;
  }

  .panel-left {
    left: 16px;
    top: 16px;
    width: clamp(300px, 32vw, 336px);
    max-height: calc(100dvh - 32px);
  }

  .panel-right {
    right: 16px;
    top: 16px;
    width: clamp(276px, 28vw, 300px);
    max-height: calc(100dvh - 32px);
  }

  .title h1 {
    font-size: 2.05rem;
  }

  .subtitle {
    font-size: 0.88rem;
    line-height: 1.45;
  }
}

@media (max-width: 900px), (max-height: 600px) and (pointer: coarse) {
  body {
    overflow: hidden;
    padding-bottom: 0;
  }

  .mobile-header {
    display: grid;
    gap: 8px;
    padding: calc(12px + env(safe-area-inset-top)) 16px 8px;
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 4;
    background: var(--glass);
    border-bottom: 1px solid var(--stroke);
    backdrop-filter: blur(10px) saturate(1.05);
  }

  .mobile-hearts-row {
    display: flex;
  }

  .world-frame {
    position: fixed;
    inset: 0;
    height: 100dvh;
    margin: 0;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
  }

  .hud {
    position: fixed;
    inset: 0;
    height: 100dvh;
    padding: 0;
    display: block;
    overflow: hidden;
    pointer-events: none;
  }

  .hud::before {
    content: none;
    display: none;
  }

  .invite-banner {
    top: calc(var(--mobile-header-height, 0px) + 12px);
    z-index: 3;
  }

  .panel {
    backdrop-filter: blur(8px);
    flex: 0 0 auto;
    min-height: 0;
  }

  .panel-left {
    display: none;
  }

  .panel-right {
    position: fixed;
    left: 12px;
    right: 12px;
    top: calc(var(--mobile-header-height, 0px) + 12px);
    bottom: calc(12px + env(safe-area-inset-bottom) + var(--keyboard-inset, 0px));
    width: auto;
    max-height: calc(
      100dvh - var(--mobile-header-height, 0px) - env(safe-area-inset-bottom) - var(--keyboard-inset, 0px) - 24px
    );
    overflow: hidden auto;
    -webkit-overflow-scrolling: touch;
    order: 1;
    transform: translateY(140%);
    transition: transform 0.25s ease;
    z-index: 4;
    animation: none;
    border-radius: 24px;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
  }

  .dev-panel {
    display: none;
  }

  .panel-left .title,
  .panel-left .stat,
  .panel-left #vitality-note {
    display: none;
  }

  .mobile-sheet-header {
    display: flex;
  }

  .panel-right .section,
  .panel-right .composer {
    display: none;
  }

  body[data-mobile-panel="send"] #journal-section {
    display: grid;
  }

  body[data-mobile-panel="planet"] #planet-section {
    display: grid;
  }

  /* The sheet header already reads "Planeet"; hide the inner collapse header
     (the section is force-expanded on mobile via setMobilePanel). */
  body[data-mobile-panel="planet"] #planet-section .collapsible-header {
    display: none;
  }

  body[data-mobile-panel="member"] #member-section {
    display: grid;
  }

  body[data-mobile-panel="info"] .feedback-section {
    display: grid;
  }

  body[data-mobile-panel] .panel-right {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
  }

  body[data-mobile-panel] .hud {
    pointer-events: none;
  }

  .mobile-sheet-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(26, 21, 18, 0.18);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 3;
  }

  body[data-mobile-panel] .mobile-sheet-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-dock {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    min-height: var(--mobile-dock-height);
    padding: 10px;
    border-radius: 18px;
    background: var(--glass);
    border: 1px solid var(--stroke);
    box-shadow: 0 18px 36px rgba(43, 33, 24, 0.18);
    backdrop-filter: blur(12px) saturate(1.1);
    z-index: 3;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .mobile-dock-button {
    background: rgba(255, 244, 231, 0.85);
    border: 1px solid rgba(67, 52, 41, 0.2);
    color: var(--ink);
    padding: 8px 10px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  .mobile-dock-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 14px rgba(67, 52, 41, 0.16);
  }

  .mobile-dock-button.active {
    background: var(--sun);
    border-color: var(--sun);
    color: #fff;
  }

  @keyframes mobileDockPulseSun {
    0%,
    100% {
      background: rgba(243, 163, 92, 0.26);
      box-shadow: 0 0 0 rgba(243, 163, 92, 0);
      transform: translateY(0);
    }
    50% {
      background: rgba(243, 163, 92, 0.46);
      box-shadow: 0 10px 18px rgba(243, 163, 92, 0.28);
      transform: translateY(-1px);
    }
  }

  .mobile-dock-button.mobile-dock-todo:not(.active) {
    border-color: rgba(243, 163, 92, 0.65);
    animation: mobileDockPulseSun 1.2s ease-in-out infinite;
  }

  .mobile-dock-button.mobile-dock-done:not(.active) {
    background: rgba(95, 135, 117, 0.22);
    border-color: rgba(95, 135, 117, 0.55);
    box-shadow: 0 8px 14px rgba(95, 135, 117, 0.16);
  }

  .mobile-dock-button.mobile-dock-done.active {
    background: rgba(95, 135, 117, 0.78);
    border-color: rgba(95, 135, 117, 0.85);
    color: #fff;
  }

  body[data-mobile-panel] .mobile-dock {
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
  }

  /* On mobile the streak lives as a compact chip in the header (see
     .mobile-streak-chip), so the floating panel is hidden here. */
  .streak-progress-panel {
    display: none;
  }

  body[data-mobile-panel] .streak-progress-panel {
    display: none;
  }

  .streak-reward-preview {
    grid-template-columns: 1fr;
  }

  .streak-reward-stage {
    min-height: 220px;
    max-height: 42vh;
  }

  .move-pad {
    position: fixed;
    left: 12px;
    bottom: calc(12px + var(--mobile-dock-height) + env(safe-area-inset-bottom));
    width: 148px;
    height: 148px;
    z-index: 2;
    pointer-events: auto;
    touch-action: none;
  }

  body[data-mobile-panel] .move-pad {
    display: none;
  }

  .water-pad {
    position: fixed;
    right: 12px;
    bottom: calc(12px + var(--mobile-dock-height) + env(safe-area-inset-bottom));
    width: 148px;
    height: 148px;
    z-index: 2;
    pointer-events: auto;
    touch-action: none;
  }

  body[data-mobile-panel] .water-pad {
    display: none;
  }

  .water-pad-base {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(67, 52, 41, 0.22);
    background: rgba(255, 244, 231, 0.7);
    box-shadow: 0 12px 26px rgba(43, 33, 24, 0.14);
    backdrop-filter: blur(6px);
    pointer-events: none;
  }

  .water-pad-button {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 72px;
    height: 72px;
    transform: translate(-50%, -50%);
    border-radius: 24px;
    border: 1px solid rgba(67, 52, 41, 0.22);
    background: rgba(255, 244, 231, 0.92);
    box-shadow: 0 10px 22px rgba(43, 33, 24, 0.18);
    color: var(--ink);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
  }

  .water-pad-button.active {
    background: rgba(243, 163, 92, 0.92);
    border-color: rgba(243, 163, 92, 0.9);
    color: #fff;
  }

  .water-pad-icon {
    font-size: 28px;
    line-height: 1;
  }

  .move-joystick {
    position: relative;
    width: 100%;
    height: 100%;
    touch-action: none;
    user-select: none;
  }

  .move-joystick-base {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(67, 52, 41, 0.22);
    background: rgba(255, 244, 231, 0.7);
    box-shadow: 0 12px 26px rgba(43, 33, 24, 0.14);
    backdrop-filter: blur(6px);
  }

  .move-joystick-knob {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 64px;
    height: 64px;
    transform: translate(-50%, -50%);
    border-radius: 24px;
    border: 1px solid rgba(67, 52, 41, 0.22);
    background: rgba(255, 244, 231, 0.92);
    box-shadow: 0 10px 22px rgba(43, 33, 24, 0.18);
    transition: transform 0.08s ease-out, background 0.08s ease-out, border-color 0.08s ease-out;
  }

  .move-joystick.dragging .move-joystick-knob {
    background: rgba(243, 163, 92, 0.92);
    border-color: rgba(243, 163, 92, 0.9);
  }

  .setup-banner {
    bottom: calc(var(--mobile-dock-height) + 28px + env(safe-area-inset-bottom));
  }

  .death-countdown {
    left: 12px;
    right: 12px;
    bottom: auto;
    top: calc(var(--mobile-header-height, 0px) + 8px);
    width: auto;
    padding: 10px 14px;
    border-radius: 12px;
    min-width: 0;
  }

  .death-countdown-label {
    font-size: 0.75rem;
  }

  .death-countdown-time {
    font-size: 0.85rem;
  }

  .modal-backdrop {
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: calc(20px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom) + var(--keyboard-inset, 0px));
  }

  .modal {
    max-height: calc(100dvh - 40px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .streak-reward-preview {
    grid-template-columns: 1fr;
  }

  .streak-reward-stage,
  .streak-reward-stage.is-character-preview {
    width: min(100%, 360px);
    justify-self: center;
  }

  .streak-reward-preview-copy {
    align-content: start;
  }

  #campfire-modal .campfire-entry-card {
    align-items: flex-start;
    max-height: min(44dvh, 320px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  #campfire-modal .campfire-entry-card p {
    font-size: clamp(16px, 4.8vw, 21px);
  }

  .opening-cinematic.is-guide {
    justify-content: flex-start;
    padding: calc(14px + env(safe-area-inset-top)) 12px calc(14px + env(safe-area-inset-bottom) + var(--keyboard-inset, 0px));
  }

  .opening-cinematic.is-guide .opening-cinematic-dialogue {
    width: min(100%, 420px);
  }

  .opening-cinematic-guide {
    width: min(100%, 420px);
    max-height: calc(100dvh - 196px - env(safe-area-inset-top) - env(safe-area-inset-bottom) - var(--keyboard-inset, 0px));
  }

  .opening-cinematic-header {
    align-items: flex-start;
  }
}


/* --- Mood check-in (5 smileys + optional "why") --- */
.mood-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 4px 0 10px;
}

.mood-btn {
  flex: 0 1 48px;
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 4px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  appearance: none;
  font-family: var(--ui-font);
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, filter 0.15s ease;
}

.mood-btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.1);
}

.mood-btn:focus-visible {
  outline: 2px solid rgba(95, 135, 117, 0.72);
  outline-offset: 2px;
}

.mood-btn:disabled {
  cursor: default;
}

.mood-btn.is-selected {
  border: 0;
  background: transparent;
  box-shadow: none;
  filter: drop-shadow(0 4px 5px rgba(95, 135, 117, 0.34));
  animation: mood-pop 0.35s ease;
}

.mood-btn.is-dimmed {
  opacity: 0.35;
}

.mood-btn-emoji {
  font-size: 1.85rem;
  line-height: 1.2;
}

.mood-btn-label {
  display: none;
}

@media (max-width: 900px), (max-height: 600px) and (pointer: coarse) {
  .panel-right {
    padding: 16px;
    overflow-x: hidden;
  }

  .panel-right .section,
  #journal-content-block,
  .journal-card,
  .journal-answer-block {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  #journal-section .section-header {
    flex-wrap: wrap;
  }

  #journal-section .mood-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
  }

  #journal-section .mood-btn {
    width: 100%;
    max-width: 48px;
    justify-self: center;
  }

  #journal-section .journal-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
    width: 100%;
  }

  #journal-section .journal-actions > button {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
}

@keyframes mood-pop {
  0% { transform: scale(0.85); }
  55% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* Warm, mood-specific response right after saving the check-in */
.mood-feedback {
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 8px;
  background: linear-gradient(120deg, rgba(243, 163, 92, 0.16), rgba(143, 183, 160, 0.18));
  border: 1px solid rgba(243, 163, 92, 0.35);
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.45;
}

.mood-feedback.pop {
  animation: mood-feedback-in 0.45s ease;
}

@keyframes mood-feedback-in {
  0% { opacity: 0; transform: translateY(6px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Celebration overlay after sharing the planet check-in --- */
.checkin-celebration {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(27, 36, 41, 0.35);
  backdrop-filter: blur(2px);
}

.checkin-celebration.hidden {
  display: none;
}

.checkin-celebration-card {
  max-width: 340px;
  margin: 16px;
  padding: 22px 26px;
  border-radius: 22px;
  background: var(--glass);
  border: 1px solid var(--stroke-strong);
  box-shadow: 0 24px 48px var(--shadow);
  text-align: center;
}

.checkin-celebration-card.pop {
  animation: celebration-pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.checkin-celebration-icon {
  font-size: 2.6rem;
  line-height: 1;
  margin-bottom: 8px;
  animation: celebration-glow 1.6s ease-in-out infinite;
}

.checkin-celebration-card h3 {
  margin: 0 0 6px;
  font-family: var(--title-font);
  color: var(--ink);
}

.checkin-celebration-card p {
  margin: 0;
  color: rgba(43, 35, 31, 0.8);
  font-size: 0.95rem;
  line-height: 1.45;
}

@keyframes celebration-pop {
  0% { opacity: 0; transform: scale(0.7); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes celebration-glow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
