* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #08080f;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  font-family: monospace;
}

#game-wrap {
  position: relative;
  width: 100vw;
  height: 100vh;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── HUD ── */
#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255,255,255,0.5);
  font-size: 1.1rem;
  line-height: 1;
}

/* ── Status Bar (full-width bottom bar) ── */
#status-hub {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0.45rem 1.4rem;
  background: rgba(4, 4, 14, 0.86);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  gap: 1.4rem;
  z-index: 1;
}

#hub-meta {
  display: flex;
  flex-direction: column;
  gap: 0.06rem;
  min-width: 72px;
}

#level-display {
  color: rgba(180,210,255,0.58);
  font-size: 0.58rem;
  letter-spacing: 0.22em;
}

#score-display {
  color: rgba(255,220,80,0.92);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
}

/* Energy bar — central, flexible width */
#hub-energy {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.sb-energy-label {
  font-size: 0.54rem;
  letter-spacing: 0.2em;
  color: rgba(180,210,255,0.6);
  white-space: nowrap;
}

.sb-energy-track {
  flex: 1;
  height: 9px !important;
  background: rgba(255,255,255,0.09) !important;
  border-radius: 5px !important;
}

/* Powerups section — right side, horizontal */
#hub-powerups {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#hub-powerups .sb-track {
  width: 48px;
  flex: none;
}

.sb-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.sb-hidden { display: none; }

.sb-label {
  font-size: 0.5rem;
  letter-spacing: 0.14em;
  color: rgba(180,210,255,0.52);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.18rem;
}

.sb-key {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 3px;
  padding: 0.03rem 0.18rem;
  font-family: monospace;
  font-size: 0.44rem;
  letter-spacing: 0;
  min-width: 0;
}

.sb-track {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.07);
  border-radius: 3px;
  overflow: hidden;
}

.sb-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg,#3af,#7ef);
  border-radius: 3px;
  transition: width 0.12s, background 0.35s;
}

.fluff-charges-ind {
  font-size: 0.58rem;
  color: rgba(220,160,255,0.9);
  letter-spacing: 0.06em;
  min-width: 1rem;
  text-align: left;
}

.sb-torch-on {
  font-size: 0.52rem;
  letter-spacing: 0.2em;
  color: rgba(255,245,150,0.98);
  text-shadow: 0 0 8px rgba(255,240,60,0.6);
}
.sb-torch-off {
  font-size: 0.52rem;
  letter-spacing: 0.2em;
  color: rgba(180,150,40,0.42);
}
.sb-torch-stolen {
  font-size: 0.52rem;
  letter-spacing: 0.2em;
  color: rgba(255,80,60,0.96);
  text-shadow: 0 0 8px rgba(255,60,40,0.55);
  animation: stolen-pulse 0.9s ease-in-out infinite;
}
@keyframes stolen-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.flutter-badge {
  color: rgba(255,185,30,0.95);
  text-shadow: 0 0 6px rgba(255,160,10,0.6);
  font-size: 0.5rem;
  margin-left: 0.15em;
}
.sb-mozzie-ready {
  font-size: 0.52rem;
  letter-spacing: 0.2em;
  color: rgba(60,255,180,0.96);
  text-shadow: 0 0 8px rgba(40,220,150,0.55);
}
.sb-mozzie-used {
  font-size: 0.52rem;
  letter-spacing: 0.2em;
  color: rgba(80,100,90,0.42);
}

#food-hint {
  position: absolute;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(160,255,160,0.92);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.25s;
}

#food-hint.show { opacity: 1; }

#light-hint {
  position: absolute;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,230,120,0.8);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  opacity: 0;
  transition: opacity 0.5s;
}

#light-hint.show { opacity: 1; }

#frog-warn {
  position: absolute;
  top: 3.8rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,80,70,0.92);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
}
#frog-warn.show { opacity: 1; }

#trout-warn {
  position: absolute;
  top: 5.6rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(60,170,240,0.92);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
}
#trout-warn.show { opacity: 1; }

#pond-warn {
  position: absolute;
  bottom: 6rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(60,170,240,0.72);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
}
#pond-warn.show { opacity: 1; }

#zapper-warn {
  position: absolute;
  top: 7.4rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(180,80,255,0.95);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
}
#zapper-warn.show { opacity: 1; }

#rain-warn {
  position: absolute;
  top: 8.4rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(100,180,255,0.95);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
}
#rain-warn.show { opacity: 1; }

.hud-msg {
  position: absolute;
  top: 36%;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(200,245,210,0.95);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
  text-shadow: 0 0 14px rgba(80,220,100,0.35);
}
.hud-msg.show   { opacity: 1; }
.hud-msg.danger { color: rgba(255,100,80,0.98); text-shadow: 0 0 14px rgba(255,60,40,0.45); }

#fluff-flash {
  position: absolute;
  inset: 0;
  background: rgba(220,200,255,1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s;
  z-index: 10;
}

/* ── Screens ── */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6,6,18,0.88);
}

.screen.hidden { display: none; }

#screen-start {
  background: rgba(3,3,12,0.84);
}

.screen-inner {
  text-align: center;
  color: #c8d8f8;
  padding: 1.4rem 1.6rem;
  max-width: 400px;
  width: min(400px, 92vw);
  position: relative;
  z-index: 2;
}

h1 {
  font-family: serif;
  font-size: clamp(2.6rem, 8vw, 5rem);
  letter-spacing: clamp(0.2em, 2.2vw, 0.55em);
  color: #ffe898;
  text-shadow: 0 0 30px rgba(255,220,80,0.9),
               0 0 60px rgba(255,180,20,0.5),
               0 0 100px rgba(255,120,0,0.2);
  margin-bottom: 0.3rem;
  padding: 0.18em 0.1em 0;
  animation: title-breathe 3.5s ease-in-out infinite;
}

@keyframes title-breathe {
  0%, 100% {
    text-shadow: 0 0 30px rgba(255,220,80,0.85),
                 0 0 60px rgba(255,180,20,0.45),
                 0 0 100px rgba(255,120,0,0.18);
  }
  50% {
    text-shadow: 0 0 45px rgba(255,230,100,1.0),
                 0 0 90px rgba(255,190,30,0.65),
                 0 0 140px rgba(255,140,0,0.3);
  }
}

h2 {
  font-family: serif;
  font-size: 2.4rem;
  letter-spacing: 0.2em;
  color: #ffe898;
  text-shadow: 0 0 24px rgba(255,220,80,0.4);
  margin-bottom: 1rem;
}

.tagline {
  font-family: serif;
  font-size: clamp(1.15rem, 3.4vw, 1.7rem);
  letter-spacing: 0.2em;
  color: rgba(255,236,160,0.95);
  text-shadow: 0 0 14px rgba(255,212,80,0.65),
               0 0 30px rgba(255,170,30,0.4),
               0 0 50px rgba(255,130,0,0.18);
  margin-bottom: 0.8rem;
  animation: tagline-glow 3.2s ease-in-out infinite;
}

@keyframes tagline-glow {
  0%, 100% {
    text-shadow: 0 0 14px rgba(255,212,80,0.55),
                 0 0 30px rgba(255,170,30,0.32),
                 0 0 50px rgba(255,130,0,0.15);
  }
  50% {
    text-shadow: 0 0 20px rgba(255,224,100,0.85),
                 0 0 42px rgba(255,185,40,0.5),
                 0 0 70px rgba(255,140,0,0.24);
  }
}

.start-natural-time {
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  color: rgba(160,210,160,0.55);
  margin-bottom: 0.8rem;
  font-family: monospace;
}

.note {
  font-size: 0.7rem;
  color: rgba(160,200,180,0.58);
  margin-bottom: 1.4rem;
  line-height: 1.65;
}

p {
  font-size: 0.8rem;
  color: rgba(190,210,255,0.65);
  line-height: 1.7;
  margin-bottom: 0.5rem;
}

.score-text {
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: rgba(255,220,80,0.88);
  margin: 0.35rem 0;
}
.score-text.dim { font-size: 0.82rem; color: rgba(200,220,255,0.6); }

.controls {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.4rem;
}

.controls div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  font-size: 0.75rem;
  color: rgba(180,200,255,0.75);
}

kbd {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 4px;
  padding: 0.1rem 0.5rem;
  font-family: monospace;
  font-size: 0.72rem;
  min-width: 82px;
  text-align: center;
}

button {
  margin-top: 0.7rem;
  padding: 0.55rem 1.8rem;
  background: rgba(255,220,80,0.1);
  border: 1px solid rgba(255,220,80,0.35);
  color: #ffe898;
  font-family: monospace;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s, border-color 0.2s;
}

button:hover {
  background: rgba(255,220,80,0.22);
  border-color: rgba(255,220,80,0.65);
}

/* ── Start screen light glow ── */
.start-light-glow {
  width: 200px;
  height: 60px;
  background: radial-gradient(ellipse at center,
    rgba(255,230,100,0.45) 0%,
    rgba(255,180,30,0.15) 50%,
    transparent 75%);
  margin: -0.5rem auto 0.8rem;
  filter: blur(4px);
  animation: glow-pulse 3s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.65; transform: scaleX(1.0); }
  50%       { opacity: 1.0;  transform: scaleX(1.2); }
}

/* ── Start screen actions ── */
.start-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  margin-top: 0.8rem;
}

.btn-main-action {
  margin-top: 0;
  padding: 0.8rem 3.2rem;
  width: 100%;
  box-sizing: border-box;
  background: rgba(255,210,50,0.1);
  border: 1px solid rgba(255,210,50,0.55);
  color: #ffe898;
  font-family: monospace;
  font-size: 1rem;
  letter-spacing: 0.25em;
  cursor: pointer;
  border-radius: 5px;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  animation: main-btn-glow 2.8s ease-in-out infinite;
}
.btn-main-action:hover {
  background: rgba(255,210,50,0.22);
  border-color: rgba(255,210,50,0.85);
  box-shadow: 0 0 24px rgba(255,210,50,0.35);
}
@keyframes main-btn-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(255,210,50,0.18); }
  50%       { box-shadow: 0 0 22px rgba(255,210,50,0.38); }
}

.btn-sub-action {
  margin-top: 0;
  padding: 0.48rem 1.8rem;
  width: 100%;
  box-sizing: border-box;
  background: rgba(80,180,255,0.07);
  border: 1px solid rgba(80,180,255,0.32);
  color: rgba(140,210,255,0.88);
  font-family: monospace;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s, border-color 0.2s;
}
.btn-sub-action:hover {
  background: rgba(80,180,255,0.18);
  border-color: rgba(80,180,255,0.62);
}
.btn-sub-action.hidden { display: none !important; }

/* ── Start screen decorations ── */
#start-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

/* Flying creature polys drifting upward toward the light */
.dpoly {
  position: absolute;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0;
  pointer-events: none;
  animation: dm-path var(--dur, 8s) var(--del, 0s) infinite ease-in;
  filter: brightness(0.85) saturate(0.85) drop-shadow(0 0 7px rgba(150,175,255,0.3));
}

/* Ground creature polys hopping at the bottom */
.dpoly-ground {
  position: absolute;
  bottom: 7%;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center bottom;
  opacity: 0.62;
  pointer-events: none;
  filter: brightness(0.72) saturate(0.8) drop-shadow(0 0 6px rgba(90,180,90,0.28));
  animation: frog-hop var(--hd, 3.2s) var(--del, 0s) infinite;
}

/* Orbiting creature polys circling the title */
.dpoly-orbit {
  position: absolute;
  pointer-events: none;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.55;
  filter: brightness(0.66) saturate(0.78) drop-shadow(0 0 6px rgba(150,170,255,0.26));
}

@keyframes dm-path {
  0%   { transform: translate(0, 0) scale(var(--sz, 1)) rotate(0deg);   opacity: 0; }
  8%   { opacity: 0.75; }
  88%  { opacity: 0.55; }
  100% { transform: translate(var(--tx, 30px), -90vh) scale(var(--sz, 1)) rotate(var(--rot, 300deg)); opacity: 0; }
}

/* Firefly dots */
.df {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #c8ff40;
  box-shadow: 0 0 7px 3px rgba(170,255,40,0.75);
  opacity: 0;
  animation: df-float var(--dur, 3s) var(--del, 0s) infinite ease-in-out;
}

@keyframes df-float {
  0%  { opacity: 0;   transform: translate(0, 0); }
  18% { opacity: 1; }
  50% { opacity: 0.55; transform: translate(var(--tx, 12px), var(--ty, -20px)); }
  82% { opacity: 0.9; }
  100%{ opacity: 0;   transform: translate(calc(var(--tx, 12px) * 1.8), calc(var(--ty, -20px) * 1.8)); }
}

@keyframes frog-hop {
  0%, 50%, 100% { transform: translateY(0) scaleY(1.0); }
  18%  { transform: translateY(-26px) scaleY(1.08); }
  35%  { transform: translateY(-14px) scaleY(0.96); }
  43%  { transform: translateY(-3px)  scaleY(1.04); }
}

/* ── Leaderboard ── */
.leaderboard {
  margin: 0.6rem auto 0.2rem;
  max-width: 280px;
  font-size: 0.72rem;
}

.lb-row {
  display: flex;
  gap: 0.7rem;
  padding: 0.24rem 0.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.lb-rank  { color: rgba(255,220,80,0.5); min-width: 1.1rem; text-align: right; }
.lb-name  { flex: 1; text-align: left; color: rgba(200,220,255,0.8); }
.lb-score { color: rgba(255,220,80,0.88); }
.lb-empty { color: rgba(180,200,255,0.32); font-size: 0.68rem; padding: 0.4rem; }
.lb-you .lb-name { color: rgba(140,255,180,0.9); }

/* ── Start screen right-side widget panel (controls → radio → clock) ── */
#start-right-panel {
  position: absolute;
  right: clamp(0.6rem, 2.5vw, 1.8rem);
  bottom: clamp(0.6rem, 2vh, 1.4rem);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  pointer-events: auto;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,0.5));
}

/* Controls widget */
.start-widget {
  width: clamp(148px, 14vw, 192px);
  background: rgba(8,8,22,0.88);
  border: 1px solid rgba(180,200,255,0.11);
  border-radius: 7px;
  padding: 0.55rem 0.65rem 0.6rem;
}

.start-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  font-size: 0.5rem;
  letter-spacing: 0.22em;
  color: rgba(180,200,255,0.5);
}

.start-widget-more-btn {
  margin: 0;
  padding: 0.08rem 0.38rem;
  background: rgba(80,80,140,0.1);
  border: 1px solid rgba(160,160,220,0.2);
  color: rgba(140,170,235,0.55);
  font-family: monospace;
  font-size: 0.46rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.15s, color 0.15s;
}
.start-widget-more-btn:hover {
  background: rgba(100,100,180,0.2);
  color: rgba(200,215,255,0.88);
}

.start-widget-controls {
  display: flex;
  flex-direction: column;
  gap: 0.26rem;
  color: rgba(200, 220, 255, 0.9);
}

.start-widget-controls > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.start-widget-controls kbd {
  font-size: 0.5rem;
  min-width: unset;
  padding: 0.05rem 0.28rem;
  white-space: nowrap;
}

.start-widget-controls span {
  text-align: right;
  flex: 1;
  font-size: 0.52rem;
  color: rgba(185,210,250,0.82);
}

/* Radio inside right panel — match widget width */
.start-radio-widget .radio-leaf-shell {
  width: clamp(148px, 14vw, 192px) !important;
}

/* Natural clock as inline widget inside right panel */
.nc-widget-inline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.nc-widget-clock {
  width: clamp(148px, 14vw, 192px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(8,10,22,0.55);
  box-shadow: inset 0 0 0 1px rgba(180,200,255,0.10),
              0 0 22px rgba(120,150,255,0.10);
}

.nc-widget-label {
  font-size: 0.5rem;
  letter-spacing: 0.22em;
  color: rgba(180,200,255,0.44);
  text-align: center;
}

/* Hide on narrow viewports */
@media (max-width: 780px) {
  #start-right-panel { display: none; }
}

/* ── Start screen centred layout ── */
.start-inner {
  max-width: min(420px, 96vw) !important;
  width: min(420px, 96vw);
  max-height: 100vh;
  /* overflow visible so the title/tagline glow is not clipped;
     body has overflow:hidden so this never adds page scrolling */
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding-top: clamp(0.6rem, 3vh, 1.6rem);
}

.col-header {
  font-size: 0.6rem;
  letter-spacing: 0.26em;
  color: rgba(255,220,80,0.52);
  margin-bottom: 0.55rem;
  text-align: center;
  border-bottom: 1px solid rgba(255,220,80,0.14);
  padding-bottom: 0.3rem;
}

/* Prominent leaderboard on start screen */
.start-lb-main {
  max-width: 300px;
  margin: 0.4rem auto 0.8rem;
  font-size: 0.82rem;
}

.start-lb-main .lb-row {
  padding: 0.32rem 0.5rem;
  font-size: 0.82rem;
}

/* Controls popup */
.popup-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4,4,16,0.94);
  z-index: 20;
}

.popup-overlay.hidden { display: none; }

.popup-inner {
  text-align: center;
  color: #c8d8f8;
  padding: 1.5rem 1.8rem 1.2rem;
  max-width: min(420px, 94vw);
  width: 94vw;
  max-height: min(84vh, 640px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,220,80,0.25) transparent;
  background: rgba(8,8,20,0.98);
  border: 1px solid rgba(255,220,80,0.25);
  border-radius: 10px;
  box-shadow: 0 0 40px rgba(255,200,60,0.08), 0 8px 32px rgba(0,0,0,0.6);
}

.popup-inner::-webkit-scrollbar { width: 5px; }
.popup-inner::-webkit-scrollbar-track { background: transparent; }
.popup-inner::-webkit-scrollbar-thumb { background: rgba(255,220,80,0.22); border-radius: 3px; }

.popup-inner .controls {
  margin-bottom: 0.8rem;
}

/* Controls open button */
.btn-controls-btn {
  margin-top: 0;
  padding: 0.3rem 1rem;
  background: rgba(80,80,140,0.1);
  border: 1px solid rgba(160,160,220,0.22);
  color: rgba(155,180,235,0.62);
  font-family: monospace;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.btn-controls-btn:hover {
  background: rgba(100,100,180,0.2);
  color: rgba(200,215,255,0.9);
  border-color: rgba(180,190,255,0.38);
}

/* Bug Vision ambient tint (shown during superposition heat-vision) */
#bug-vision-overlay {
  position: absolute;
  inset: 0;
  display: none;
  pointer-events: none;
  z-index: 2;
  box-shadow: inset 0 0 80px rgba(110,50,200,0.18);
}

#bug-vision-overlay.active { display: block; }

/* ── Pause screen ── */
.pause-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 0.8rem;
}

.pause-inner {
  max-width: 360px !important;
  overflow-y: auto;
  max-height: 92vh;
  scrollbar-width: none;
}
.pause-inner::-webkit-scrollbar { display: none; }

/* ── Leaf Radio ── */

.radio-leaf-wrap {
  margin-top: 0.7rem;
  display: flex;
  justify-content: center;
}

.radio-leaf-shell {
  position: relative;
  width: min(230px, 70vw);
  background: linear-gradient(155deg, #1e3a16 0%, #0d1c0b 52%, #152910 100%);
  border: 1px solid rgba(90, 175, 65, 0.30);
  border-radius: 4px 78% 4px 78% / 78% 4px 78% 4px;
  transform: rotate(-9deg);
  box-shadow:
    0 0 28px rgba(35, 100, 20, 0.18),
    inset 0 0 32px rgba(0, 0, 0, 0.42),
    0 6px 20px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

/* Leaf veins (decorative) */
.radio-leaf-vein-main {
  position: absolute;
  top: 8%;
  bottom: 8%;
  left: 50%;
  width: 1px;
  background: rgba(80, 160, 50, 0.14);
  transform: rotate(2deg);
  pointer-events: none;
}
.radio-leaf-vein-l,
.radio-leaf-vein-r {
  position: absolute;
  top: 30%;
  height: 1px;
  width: 30%;
  background: rgba(80, 160, 50, 0.10);
  pointer-events: none;
}
.radio-leaf-vein-l { left: 18%; transform: rotate(18deg); transform-origin: right center; }
.radio-leaf-vein-r { right: 18%; transform: rotate(-18deg); transform-origin: left center; }

.radio-leaf-inner {
  padding: 0.9rem 1.1rem 1.0rem;
  position: relative;
  z-index: 1;
}

.radio-header {
  font-size: 0.52rem;
  letter-spacing: 0.2em;
  color: rgba(120, 210, 80, 0.62);
  text-align: center;
  margin-bottom: 0.4rem;
}

.radio-station-area {
  text-align: center;
  margin-bottom: 0.35rem;
}

#radio-name {
  font-size: 0.88rem;
  letter-spacing: 0.22em;
  color: rgba(170, 240, 110, 0.92);
  text-shadow: 0 0 10px rgba(120, 220, 60, 0.35);
}

#radio-freq {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: rgba(100, 180, 60, 0.60);
  margin-top: 0.15rem;
}

#radio-desc {
  font-size: 0.52rem;
  letter-spacing: 0.12em;
  color: rgba(100, 180, 60, 0.42);
  margin-top: 0.08rem;
}

/* Tuner row */
.radio-tuner-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.radio-nav {
  margin-top: 0;
  padding: 0.2rem 0.55rem;
  background: rgba(60, 130, 35, 0.12);
  border: 1px solid rgba(80, 170, 45, 0.28);
  color: rgba(140, 220, 80, 0.85);
  font-size: 0.7rem;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.radio-nav:hover {
  background: rgba(60, 130, 35, 0.28);
  border-color: rgba(100, 200, 55, 0.55);
}

/* Waveform bars */
.radio-waveform {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 20px;
}

.rb {
  width: 3px;
  background: rgba(100, 210, 55, 0.62);
  border-radius: 2px 2px 0 0;
  min-height: 3px;
  height: 4px;
  transition: height 0.1s;
}

/* Station 0 — silent: flat bars */
.radio-waveform.silent .rb {
  height: 3px !important;
  animation: none !important;
}

/* Station 1/2 — animated bars */
.radio-waveform.playing .rb:nth-child(1) { animation: rb 0.75s 0.00s ease-in-out infinite; }
.radio-waveform.playing .rb:nth-child(2) { animation: rb 0.65s 0.12s ease-in-out infinite; }
.radio-waveform.playing .rb:nth-child(3) { animation: rb 0.90s 0.06s ease-in-out infinite; }
.radio-waveform.playing .rb:nth-child(4) { animation: rb 0.58s 0.22s ease-in-out infinite; }
.radio-waveform.playing .rb:nth-child(5) { animation: rb 0.80s 0.10s ease-in-out infinite; }
.radio-waveform.playing .rb:nth-child(6) { animation: rb 0.70s 0.18s ease-in-out infinite; }
.radio-waveform.playing .rb:nth-child(7) { animation: rb 0.95s 0.04s ease-in-out infinite; }
.radio-waveform.playing .rb:nth-child(8) { animation: rb 0.62s 0.28s ease-in-out infinite; }

@keyframes rb {
  0%, 100% { height: 3px; }
  50%       { height: 17px; }
}

/* Station dots */
.radio-dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}

.rdot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(80, 140, 50, 0.28);
  border: 1px solid rgba(80, 160, 50, 0.3);
  cursor: pointer;
  transition: background 0.2s;
}
.rdot.active {
  background: rgba(120, 220, 70, 0.80);
  box-shadow: 0 0 5px rgba(100, 220, 50, 0.45);
}

/* Effects section */
.radio-fx-section {
  margin-top: 0.2rem;
}

.radio-fx-toggle {
  margin-top: 0;
  width: 100%;
  padding: 0.26rem 0.6rem;
  background: rgba(40, 100, 25, 0.10);
  border: 1px solid rgba(80, 160, 45, 0.20);
  color: rgba(110, 195, 65, 0.62);
  font-family: monospace;
  font-size: 0.56rem;
  letter-spacing: 0.18em;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.15s, color 0.15s;
}
.radio-fx-toggle:hover {
  background: rgba(40, 100, 25, 0.22);
  color: rgba(140, 220, 80, 0.85);
}

.radio-fx-panel {
  padding-top: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.radio-fx-panel.hidden { display: none; }

.radio-fx-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.radio-fx-label {
  font-size: 0.48rem;
  letter-spacing: 0.14em;
  color: rgba(100, 180, 60, 0.55);
  min-width: 82px;
  text-align: right;
}

.radio-fx-val {
  font-size: 0.48rem;
  color: rgba(100, 180, 60, 0.50);
  min-width: 26px;
  text-align: left;
}

.radio-fx-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  background: rgba(60, 130, 35, 0.30);
  border-radius: 2px;
  outline: none;
}
.radio-fx-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(110, 200, 60, 0.80);
  cursor: pointer;
  border: 1px solid rgba(140, 230, 80, 0.5);
}
.radio-fx-slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(110, 200, 60, 0.80);
  cursor: pointer;
  border: 1px solid rgba(140, 230, 80, 0.5);
}

/* Volume / mute row */
.radio-vol-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}

.radio-mute-btn {
  margin-top: 0;
  padding: 0.2rem 0.45rem;
  background: rgba(40, 100, 25, 0.10);
  border: 1px solid rgba(80, 160, 45, 0.22);
  color: rgba(120, 210, 70, 0.75);
  font-size: 0.75rem;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}
.radio-mute-btn:hover {
  background: rgba(40, 100, 25, 0.25);
}
.radio-mute-btn.muted {
  color: rgba(220, 90, 60, 0.85);
  border-color: rgba(200, 80, 50, 0.35);
}

.radio-vol-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  background: rgba(60, 130, 35, 0.30);
  border-radius: 2px;
  outline: none;
}
.radio-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(110, 200, 60, 0.80);
  cursor: pointer;
  border: 1px solid rgba(140, 230, 80, 0.5);
}
.radio-vol-slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(110, 200, 60, 0.80);
  cursor: pointer;
  border: 1px solid rgba(140, 230, 80, 0.5);
}

.radio-vol-val {
  font-size: 0.48rem;
  color: rgba(100, 180, 60, 0.50);
  min-width: 26px;
  text-align: left;
}

/* ── Cocoon cutscene screen ──────────────────────────────────────────────── */

#screen-cocoon {
  background: #000;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}
#screen-cocoon.hidden { display: none; }

#cocoon-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Mothlog screen ─────────────────────────────────────────────────────── */

.mothlog-inner {
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  width: min(680px, 92vw);
  text-align: center;
}

.mothlog-title {
  font-size: 1.8rem;
  letter-spacing: 0.22em;
  color: #a0d870;
  margin-bottom: 0.2rem;
}

.mothlog-sub {
  font-size: 0.65rem;
  color: rgba(140, 200, 90, 0.45);
  letter-spacing: 0.16em;
  margin-bottom: 0.9rem;
}

.mothlog-entries {
  flex: 1;
  overflow-y: auto;
  text-align: left;
  padding: 0.4rem 0.2rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(80, 160, 50, 0.30) transparent;
}

.mothlog-entry {
  border-left: 2px solid rgba(100, 180, 60, 0.28);
  padding: 0.5rem 0.85rem;
  margin-bottom: 0.7rem;
  transition: border-color 0.15s;
}
.mothlog-entry:hover {
  border-left-color: rgba(140, 220, 80, 0.55);
}

.mothlog-entry-meta {
  font-size: 0.58rem;
  color: rgba(120, 200, 70, 0.50);
  letter-spacing: 0.1em;
  margin-bottom: 0.2rem;
}

.mothlog-entry-msg {
  font-size: 0.72rem;
  color: rgba(200, 220, 175, 0.82);
  line-height: 1.55;
}

/* ── Pause screen leaf on/off switch ── */

.pause-inner > .radio-leaf-wrap {
  margin-top: 2rem;
}

.pause-leaf-switch {
  cursor: pointer;
  width: min(180px, 55vw) !important;
  transition: background 0.4s, border-color 0.4s, box-shadow 0.4s;
  user-select: none;
  outline: none;
}

.pause-leaf-switch:focus-visible {
  border-color: rgba(120, 210, 80, 0.55);
}

.pause-leaf-switch.radio-on {
  background: linear-gradient(155deg, #1e4a18 0%, #0e2b0b 52%, #183810 100%);
  border-color: rgba(90, 210, 60, 0.55);
  box-shadow:
    0 0 32px rgba(40, 160, 20, 0.28),
    inset 0 0 32px rgba(0, 0, 0, 0.38),
    0 6px 20px rgba(0, 0, 0, 0.55);
}

.pause-leaf-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.pause-station-name {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  color: transparent;
  height: 1em;
  line-height: 1;
  transition: color 0.35s;
  text-shadow: 0 0 10px rgba(120, 220, 60, 0.35);
}

.pause-leaf-switch.radio-on .pause-station-name {
  color: rgba(160, 240, 100, 0.9);
}

.leaf-onoff-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.leaf-onoff-track {
  width: 44px;
  height: 22px;
  background: rgba(20, 60, 15, 0.55);
  border: 1px solid rgba(60, 120, 40, 0.3);
  border-radius: 11px;
  position: relative;
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
  flex-shrink: 0;
}

.pause-leaf-switch.radio-on .leaf-onoff-track {
  background: rgba(50, 140, 25, 0.55);
  border-color: rgba(100, 210, 55, 0.65);
  box-shadow: 0 0 8px rgba(80, 210, 40, 0.35);
}

.leaf-onoff-thumb {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(55, 90, 40, 0.7);
  border: 1px solid rgba(80, 140, 50, 0.35);
  top: 3px;
  left: 3px;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.28s, box-shadow 0.28s;
}

.pause-leaf-switch.radio-on .leaf-onoff-thumb {
  transform: translateX(22px);
  background: rgba(130, 230, 75, 0.95);
  border-color: rgba(160, 255, 90, 0.5);
  box-shadow: 0 0 8px rgba(110, 230, 50, 0.6);
}

.leaf-onoff-label {
  font-size: 0.56rem;
  letter-spacing: 0.22em;
  color: rgba(70, 130, 45, 0.55);
  transition: color 0.3s;
  min-width: 1.8rem;
}

.pause-leaf-switch.radio-on .leaf-onoff-label {
  color: rgba(150, 235, 90, 0.9);
}

/* ── Groovebox tracks section in start radio ── */

.radio-gbox-section {
  margin-top: 0.3rem;
}

.radio-gbox-panel {
  padding-top: 0.4rem;
  max-height: 90px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(60, 130, 35, 0.3) transparent;
}

.radio-gbox-panel::-webkit-scrollbar { width: 3px; }
.radio-gbox-panel::-webkit-scrollbar-thumb { background: rgba(60, 140, 35, 0.3); border-radius: 2px; }

.radio-gbox-panel.hidden { display: none; }

.radio-gbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
  padding: 0.22rem 0.1rem;
  border-bottom: 1px solid rgba(60, 120, 35, 0.12);
}

.radio-gbox-row:last-child { border-bottom: none; }

.radio-gbox-name {
  font-size: 0.48rem;
  color: rgba(150, 220, 80, 0.85);
  letter-spacing: 0.07em;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.radio-gbox-creator {
  font-size: 0.42rem;
  color: rgba(90, 155, 50, 0.5);
  white-space: nowrap;
}

.radio-gbox-link {
  margin: 0;
  padding: 0.08rem 0.3rem;
  background: rgba(35, 90, 20, 0.18);
  border: 1px solid rgba(70, 155, 40, 0.28);
  color: rgba(130, 210, 65, 0.82);
  font-family: monospace;
  font-size: 0.44rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  border-radius: 3px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.radio-gbox-link:hover {
  background: rgba(45, 110, 25, 0.35);
  color: rgba(170, 240, 90, 0.98);
}

.radio-gbox-empty {
  font-size: 0.46rem;
  color: rgba(80, 150, 50, 0.45);
  text-align: center;
  padding: 0.35rem;
  letter-spacing: 0.1em;
}

.radio-gbox-select {
  background: none;
  border: 1px solid rgba(70, 155, 40, 0.28);
  cursor: pointer;
}

.gbox-selected .radio-gbox-select {
  background: rgba(45, 110, 25, 0.35);
  color: rgba(170, 240, 90, 0.98);
  border-color: rgba(120, 220, 60, 0.55);
}
