:root {
  --bg: #f5f6ff;
  --bg-secondary: #ffffff;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --text: #182036;
  --muted: #5d6582;
  --line: rgba(24, 32, 54, 0.12);
  --accent: #14b86e;
  --accent-strong: #0e8e56;
  --accent-soft: rgba(20, 184, 110, 0.16);
  --accent-warm: #f4b83c;
  --shadow-lg: 0 24px 60px rgba(22, 28, 56, 0.14);
  --shadow-md: 0 16px 36px rgba(22, 28, 56, 0.12);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --title-font: "Trebuchet MS", "Verdana", sans-serif;
  --body-font: "Segoe UI", "Tahoma", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  font-family: var(--body-font);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.85), transparent 34%),
    radial-gradient(circle at 80% 10%, rgba(255, 241, 190, 0.85), transparent 26%),
    linear-gradient(180deg, var(--bg) 0%, #eef4ff 42%, #f9fbff 100%);
  transition: background 300ms ease, color 300ms ease;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04)),
    var(--world-background-image) center / cover no-repeat;
  opacity: 0.16;
  filter: blur(3px) saturate(1.04);
  transform: scale(1.03);
  pointer-events: none;
}

body[data-world="space"] {
  --bg: #081224;
  --bg-secondary: #101f38;
  --surface: rgba(13, 27, 52, 0.72);
  --surface-strong: rgba(16, 31, 56, 0.9);
  --text: #eef5ff;
  --muted: #a9b7d2;
  --line: rgba(200, 222, 255, 0.16);
  --accent: #59d4ff;
  --accent-strong: #24b7e7;
  --accent-soft: rgba(89, 212, 255, 0.18);
  --accent-warm: #ffd166;
}

body[data-world="superhero"] {
  --bg: #fff4dc;
  --bg-secondary: #fff8e9;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: rgba(255, 255, 255, 0.95);
  --text: #2d1d20;
  --muted: #775c63;
  --line: rgba(45, 29, 32, 0.12);
  --accent: #ff5c45;
  --accent-strong: #dd3822;
  --accent-soft: rgba(255, 92, 69, 0.17);
  --accent-warm: #ffcb47;
}

body[data-world="jungle"] {
  --bg: #edf8e3;
  --bg-secondary: #f7fff0;
  --surface: rgba(255, 255, 255, 0.76);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --text: #173120;
  --muted: #5d7a66;
  --line: rgba(23, 49, 32, 0.12);
  --accent: #4ca449;
  --accent-strong: #348233;
  --accent-soft: rgba(76, 164, 73, 0.16);
  --accent-warm: #f5bd59;
}

body[data-world="dino"] {
  --bg: #fff6eb;
  --bg-secondary: #fff9f1;
  --surface: rgba(255, 255, 255, 0.8);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --text: #372417;
  --muted: #7a604d;
  --line: rgba(55, 36, 23, 0.12);
  --accent: #ff8b2d;
  --accent-strong: #dd6f14;
  --accent-soft: rgba(255, 139, 45, 0.16);
  --accent-warm: #ffd865;
}

body[data-world="insect"] {
  --bg: #effce9;
  --bg-secondary: #f7fff2;
  --surface: rgba(255, 255, 255, 0.76);
  --surface-strong: rgba(255, 255, 255, 0.95);
  --text: #173526;
  --muted: #5f7a6b;
  --line: rgba(23, 53, 38, 0.12);
  --accent: #17ba73;
  --accent-strong: #11985d;
  --accent-soft: rgba(23, 186, 115, 0.16);
  --accent-warm: #ffd966;
}

.page-glow,
.page-grid {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
}

.page-glow {
  filter: blur(40px);
  opacity: 0.75;
}

.page-glow-a {
  background: radial-gradient(circle at 15% 18%, var(--accent-soft), transparent 40%);
}

.page-glow-b {
  background: radial-gradient(circle at 85% 10%, rgba(255, 226, 131, 0.28), transparent 24%);
}

.page-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.25), transparent 72%);
  opacity: 0.25;
}

.app-shell {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.hero-panel,
.section-block,
.ending-section {
  position: relative;
  z-index: 1;
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: stretch;
  padding: 36px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 40px;
  background: linear-gradient(145deg, var(--surface-strong), var(--surface));
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.eyebrow,
.game-tag,
.mission-label,
.music-label,
.status-label {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--accent-strong);
}

.game-tag::before {
  content: "";
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.68);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--title-font);
  line-height: 1.02;
}

h1 {
  font-size: clamp(2.8rem, 5vw, 5.1rem);
  max-width: 12ch;
}

h2 {
  font-size: clamp(2rem, 3.4vw, 3rem);
}

h3 {
  font-size: clamp(1.35rem, 2vw, 1.9rem);
}

p {
  margin: 0;
  line-height: 1.65;
}

.hero-lead,
.section-heading p,
.game-copy,
.music-copy p,
.status-caption,
#spotlightDescription {
  color: var(--muted);
}

.hero-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-traits span,
.fact-pill,
.score-chip,
.world-mini-tag,
.gallery-count {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.hero-traits span {
  padding: 10px 14px;
  font-weight: 700;
}

.hero-actions,
.game-actions,
.music-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

button,
input[type="range"] {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, opacity 160ms ease;
}

button:hover {
  transform: translateY(-2px);
}

button:active {
  transform: translateY(1px) scale(0.99);
}

button:focus-visible,
input[type="range"]:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.95);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--accent-soft);
}

.primary-button,
.secondary-button,
.ghost-button,
.world-select-button {
  min-height: 54px;
  padding: 14px 20px;
  border-radius: 18px;
  font-weight: 800;
}

.primary-button {
  color: #fff;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.14);
}

.secondary-button {
  color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.82));
  border: 1px solid var(--line);
}

.ghost-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--line);
}

.hero-visual {
  display: grid;
  gap: 18px;
  align-content: start;
}

.hero-portrait-card,
.mission-card,
.world-spotlight,
.game-card,
.music-card,
.gallery-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
}

.hero-portrait-card {
  padding: 20px;
}

.portrait-stage {
  position: relative;
  min-height: 320px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.86), transparent 40%),
    linear-gradient(180deg, var(--accent-soft), rgba(255, 255, 255, 0.2));
}

#heroPortraitImage {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.portrait-placeholder {
  position: relative;
  width: min(300px, 85%);
  aspect-ratio: 1;
  animation: floaty 4.5s ease-in-out infinite;
}

.planet-core,
.planet-ring,
.spark {
  position: absolute;
  display: block;
}

.planet-core {
  inset: 16%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff7d6 0 12%, transparent 13%),
    linear-gradient(135deg, var(--accent), var(--accent-warm));
  box-shadow: 0 20px 34px rgba(0, 0, 0, 0.14);
}

.planet-ring {
  inset: 24% 10%;
  border: 18px solid rgba(255, 255, 255, 0.62);
  border-radius: 50%;
  transform: rotate(-18deg);
}

.spark {
  width: 20px;
  height: 20px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.7);
  animation: twinkle 2.8s ease-in-out infinite;
}

.spark-a {
  top: 12%;
  left: 16%;
}

.spark-b {
  top: 20%;
  right: 14%;
  animation-delay: 0.9s;
}

.spark-c {
  right: 20%;
  bottom: 14%;
  animation-delay: 1.4s;
}

.hero-status {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 16px;
}

.status-value {
  font-size: 1.5rem;
  font-weight: 900;
  font-family: var(--title-font);
}

.mission-card {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.mission-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.mission-stats div {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid var(--line);
}

.stat-name,
.fact-label,
.score-chip span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.84rem;
  color: var(--muted);
}

.stat-name + strong,
.fact-pill strong,
.score-chip strong {
  font-size: 1rem;
}

.section-block {
  margin-top: 22px;
  padding: 30px;
  border-radius: 36px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px);
}

.section-heading {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.world-card-grid,
.game-grid,
.gallery-grid {
  display: grid;
  gap: 18px;
}

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

.world-card {
  position: relative;
  display: grid;
  gap: 14px;
  min-height: 246px;
  padding: 18px;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  cursor: pointer;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.5), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.62));
}

.world-card:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.95);
  outline-offset: 4px;
  box-shadow: 0 0 0 6px var(--accent-soft);
}

.world-card::before,
.world-card::after {
  content: "";
  position: absolute;
  inset: auto;
  border-radius: 999px;
  opacity: 0.8;
}

.world-card::before {
  width: 150px;
  height: 150px;
  right: -44px;
  top: -38px;
  background: var(--accent-soft);
}

.world-card::after {
  width: 88px;
  height: 88px;
  left: -24px;
  bottom: -26px;
  background: rgba(255, 255, 255, 0.5);
}

.world-card > * {
  position: relative;
  z-index: 1;
}

.world-card-art {
  min-height: 94px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.world-card-icon {
  position: absolute;
  top: 28px;
  right: 28px;
  width: 42px;
  height: 42px;
  object-fit: contain;
  padding: 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1);
}

.world-mini-tag {
  width: fit-content;
  padding: 8px 12px;
  font-weight: 800;
}

.world-title {
  font-size: 1.48rem;
}

.world-description {
  color: var(--muted);
}

.world-select-button {
  margin-top: auto;
  color: var(--text);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
}

.world-card.is-active {
  box-shadow: 0 20px 36px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.world-card.is-active .world-select-button {
  color: #fff;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
}

.world-spotlight {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-top: 20px;
  padding: 22px;
}

.spotlight-copy {
  display: grid;
  gap: 10px;
}

.spotlight-facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.fact-pill {
  min-width: 150px;
  padding: 14px 16px;
}

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

.game-card {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.game-card[data-game="bug"] .game-tag::before {
  background-image: url("assets/generated/ui/icon-bug.png");
}

.game-card[data-game="star"] .game-tag::before {
  background-image: url("assets/generated/ui/icon-star.png");
}

.game-card[data-game="power"] .game-tag::before {
  background-image: url("assets/generated/ui/icon-power.png");
}

.game-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.score-chip {
  min-width: 92px;
  padding: 10px 14px;
  text-align: right;
}

.game-status {
  min-height: 26px;
  font-weight: 700;
  color: var(--accent-strong);
}

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

.bug-tile,
.star-target,
.power-button {
  position: relative;
  overflow: hidden;
}

.bug-tile {
  min-height: 78px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.7), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.7));
}

.bug-tile:disabled {
  cursor: default;
}

.bug-tile::before,
.bug-tile::after {
  content: "";
  position: absolute;
  inset: auto;
}

.bug-tile::before {
  left: 50%;
  top: 20px;
  width: 36px;
  height: 36px;
  border-radius: 60% 0 60% 0;
  background: linear-gradient(135deg, #8cdb74, #2fb55f);
  transform: translateX(-50%) rotate(-45deg);
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.08);
}

.bug-tile::after {
  left: 50%;
  bottom: 14px;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: rgba(22, 42, 29, 0.22);
}

.bug-tile[data-state="miss"] {
  animation: nudge 240ms ease;
}

.bug-tile[data-state="clue"],
.bug-tile[data-state="nearby"] {
  box-shadow: 0 0 0 3px var(--accent-soft), 0 14px 22px rgba(0, 0, 0, 0.08);
}

.bug-tile[data-state="clue"]::before {
  transform: translateX(-50%) rotate(-45deg) scale(1.08);
  box-shadow:
    inset 0 -5px 0 rgba(0, 0, 0, 0.08),
    0 0 0 10px rgba(255, 255, 255, 0.22);
}

.bug-tile[data-state="nearby"]::after {
  width: 14px;
  height: 14px;
  margin-left: -7px;
  background: var(--accent-warm);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.22);
}

.bug-tile[data-state="found"] {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 245, 184, 0.9));
}

.bug-tile[data-state="found"]::before,
.bug-tile[data-state="revealed"]::before {
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 40% 40%;
  background:
    radial-gradient(circle at 30% 30%, #ffdbe1 0 14%, transparent 15%),
    linear-gradient(180deg, #20262f, #39414f);
  transform: translateX(-50%);
  top: 24px;
  box-shadow:
    -12px 2px 0 -8px #20262f,
    12px 2px 0 -8px #20262f,
    -12px 14px 0 -8px #20262f,
    12px 14px 0 -8px #20262f;
}

.bug-tile[data-state="revealed"] {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 225, 225, 0.92));
}

.star-field {
  position: relative;
  min-height: 260px;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 12% 14%, rgba(255, 255, 255, 0.9), transparent 3%),
    radial-gradient(circle at 28% 64%, rgba(255, 255, 255, 0.82), transparent 2.5%),
    radial-gradient(circle at 78% 20%, rgba(255, 255, 255, 0.88), transparent 2.5%),
    radial-gradient(circle at 84% 76%, rgba(255, 255, 255, 0.7), transparent 3%),
    linear-gradient(180deg, rgba(15, 28, 64, 0.94), rgba(31, 54, 112, 0.94));
}

.star-field::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 46%);
  pointer-events: none;
}

.star-target {
  position: absolute;
  width: var(--star-target-size, 78px);
  height: var(--star-target-size, 78px);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 50%, #fff8d9 0 38%, transparent 39%),
    linear-gradient(135deg, #ffe16c, #ffb92c);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
  transition: left 150ms ease, top 150ms ease, transform 150ms ease;
}

.star-target::before {
  content: "";
  position: absolute;
  inset: 14px;
  clip-path: polygon(50% 0%, 61% 35%, 100% 35%, 69% 57%, 80% 100%, 50% 74%, 20% 100%, 31% 57%, 0 35%, 39% 35%);
  background: #fff;
}

.star-target.is-hit {
  animation: heroPulse 220ms ease;
}

.star-field.is-miss {
  animation: nudge 260ms ease;
}

.power-meter {
  position: relative;
  width: 100%;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.62);
}

.power-meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-warm));
  transition: width 120ms linear;
}

.power-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  font-weight: 700;
}

.power-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.64);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 800;
}

.legend-chip::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 999px;
}

.legend-chip-marker::before {
  background: #fff;
  border: 2px solid rgba(24, 32, 54, 0.12);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.15);
}

.legend-chip-zone::before {
  border: 2px dashed rgba(255, 255, 255, 0.96);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.18));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, white);
}

.power-sweet-spot,
.power-marker {
  position: absolute;
  top: 50%;
}

.power-sweet-spot {
  transform: translateY(-50%);
  left: var(--power-zone-start, 36%);
  width: var(--power-zone-width, 22%);
  height: calc(100% + 18px);
  border-radius: 999px;
  border: 3px dashed rgba(255, 255, 255, 0.96);
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.14)),
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 24%, white), rgba(255, 255, 255, 0.22));
  box-shadow:
    0 0 0 5px color-mix(in srgb, var(--accent) 18%, white),
    0 0 26px color-mix(in srgb, var(--accent) 30%, white);
}

.power-marker {
  transform: translate(-50%, -50%);
  left: var(--power-marker-left, 0%);
  width: 20px;
  height: 40px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff, #eff4ff);
  border: 2px solid rgba(24, 32, 54, 0.08);
  box-shadow:
    0 12px 18px rgba(0, 0, 0, 0.16),
    0 0 0 4px rgba(255, 255, 255, 0.28);
}

.power-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 10px solid #fff;
  transform: translateX(-50%);
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.14));
}

.power-button {
  min-height: 180px;
  border-radius: 32px;
  font-family: var(--title-font);
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-weight: 900;
  color: #fff;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.28), transparent 20%),
    linear-gradient(180deg, var(--accent), var(--accent-strong));
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.16);
}

.power-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.power-button.is-super {
  animation: heroPulse 440ms ease 2;
}

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

.gallery-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.gallery-image-wrap {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.86), transparent 30%),
    linear-gradient(180deg, var(--accent-soft), rgba(255, 255, 255, 0.42));
}

.gallery-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

.gallery-meta {
  display: grid;
  gap: 8px;
}

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

.gallery-count {
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 800;
}

.gallery-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gallery-actions button {
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
}

.gallery-note {
  color: var(--muted);
  font-size: 0.95rem;
}

.music-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
  align-items: center;
  padding: 24px;
}

.progress-wrap {
  flex: 1;
  min-width: 200px;
}

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

.music-times {
  display: flex;
  gap: 12px;
  font-weight: 800;
}

.ending-section {
  margin-top: 24px;
  padding: 48px 24px;
  text-align: center;
}

.ending-section p {
  font-family: var(--title-font);
  font-size: clamp(3rem, 10vw, 8rem);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-12px);
  }
}

@keyframes twinkle {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.18);
    opacity: 1;
  }
}

@keyframes nudge {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

@keyframes heroPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

@media (max-width: 1120px) {
  .hero-panel,
  .music-card,
  .game-grid {
    grid-template-columns: 1fr;
  }

  .world-card-grid,
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 18px, 100%);
    padding-top: 12px;
  }

  .hero-panel,
  .section-block {
    padding: 22px;
    border-radius: 28px;
  }

  .world-card-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .bug-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .world-spotlight,
  .game-topline,
  .gallery-title-row {
    flex-direction: column;
    align-items: start;
  }

  .spotlight-facts {
    justify-content: start;
  }

  .portrait-stage {
    min-height: 260px;
  }

  .power-button {
    min-height: 150px;
  }

  .power-legend {
    flex-direction: column;
    align-items: start;
  }

  .world-card-icon {
    top: 24px;
    right: 24px;
  }

  .star-field {
    min-height: 220px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
