﻿/*
世界 UI 样式系统
- 风格：童话 / 玩具感 / 呼吸感（非扁平、非 Material）
- 核心舞台：fusion-triangle（唯一主舞台）
- 状态驱动：通过 body / stage 的 class 切换世界阶段
- 目标平台：移动端优先，现代浏览器
*/
:root {
  --text: #2b1e33;
  --toy-shadow: 0 24px 30px rgba(36, 18, 80, 0.25);
  --card-bright: #fff8f1;
  --card-soft: #fffbdf;
}

/* Generic hidden utility (used by JS) */
.hidden {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Baloo 2", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background:
    url("assets/bg-world.webp") center center / cover no-repeat,
    linear-gradient(180deg, #eef6ff, #fcefe8);
  display: flex;
  justify-content: center;
  padding: 0;
  overflow-x: hidden;
}

.el,
.fusion-input,
button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}


.app {
  width: min(540px, 100%);
  min-height: 100svh;
  height: auto;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
  padding: 16px;
  max-width: 480px;
  margin: 0 auto;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

.start-overlay {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 24px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.95),
    rgba(255, 217, 193, 0.98)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: all;
}

.start-overlay.hidden {
  display: none !important;
}

.start-card {
  width: min(360px, 100%);
  text-align: center;
  padding: 22px 20px;
}

.start-title {
  font-size: 20px;
  font-weight: 900;
  color: #2c2a2c;
  letter-spacing: 0.08em;
}

.start-sub {
  margin-top: 6px;
  font-size: 13px;
  color: rgba(43, 30, 51, 0.7);
}

.start-story {
  margin-top: 10px;
  font-size: 13px;
  color: #3b1f2f;
  line-height: 1.5;
  min-height: 38px;
}

.start-actions {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.start-btn {
  font-size: 15px;
  padding: 12px 20px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 120ms ease;
}

.start-btn.primary {
  background: linear-gradient(135deg, #ff6fb9, #ffb347);
  color: #2f1b0e;
}

.start-btn.ghost {
  background: rgba(255, 255, 255, 0.9);
  color: #4b2e1f;
}

.start-btn:not(:disabled):active {
}

.start-btn:disabled,
.start-btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.confirm-overlay {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 24px;
  border-radius: 28px;
  background: rgba(255, 248, 241, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  backdrop-filter: blur(6px);
}

.confirm-card {
  width: min(320px, 100%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 245, 220, 0.92));
  border-radius: 24px;
  padding: 20px 18px;
  text-align: center;
  box-shadow: 0 20px 32px rgba(36, 18, 80, 0.2);
  border: 1px solid rgba(43, 30, 51, 0.08);
}

.confirm-title {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #3b2320;
}

.confirm-desc {
  margin-top: 6px;
  font-size: 13px;
  color: rgba(43, 30, 51, 0.7);
}

.confirm-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.confirm-btn {
  min-width: 110px;
  padding: 10px 16px;
  border-radius: 999px;
  border: none;
  font-weight: 900;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.confirm-btn.ghost {
  background: rgba(255, 255, 255, 0.95);
  color: #4b2e1f;
  border: 1px solid rgba(43, 30, 51, 0.12);
  box-shadow: 0 10px 18px rgba(66, 36, 87, 0.12);
}

.confirm-btn.danger {
  background: linear-gradient(135deg, #ff8b8b, #ffb36a);
  color: #3d1f16;
  box-shadow: 0 12px 0 rgba(255, 255, 255, 0.6);
}

.confirm-btn:active {
  transform: translateY(2px);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  pointer-events: none;
}

.overlay.hidden {
  display: none !important;
}

.chapter-complete-card {
  width: min(360px, 100%);
  padding: 24px 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 245, 220, 0.95));
  border-radius: 28px;
  box-shadow: 0 30px 35px rgba(18, 12, 30, 0.35);
  border: 1px solid rgba(43, 30, 51, 0.1);
  text-align: center;
  pointer-events: all;
}

.chapter-intro-card {
  width: 100%;
  min-height: 100%;
  padding: 48px 32px;
  background: transparent;
  text-align: center;
  border-radius: 0;
  box-shadow: none;
  border: none;
  pointer-events: all;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
}

#chapterCompleteOverlay {
  background: rgba(11, 7, 20, 0.65);
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 48px rgba(2, 0, 32, 0.35);
  padding: 20px;
  pointer-events: all;
}

#chapterIntroOverlay {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 245, 220, 0.9));
  padding: 0;
  align-items: stretch;
  justify-content: flex-start;
  pointer-events: all;
}

.chapter-complete-card h2,
.chapter-intro-card h2 {
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
  color: #2f1b2d;
}

.chapter-complete-card p,
.chapter-intro-card p {
  font-size: 14px;
  color: rgba(40, 27, 41, 0.8);
  line-height: 1.4;
  margin-bottom: 20px;
}

.chapter-complete-quote {
  font-size: 13px;
  font-style: italic;
  color: rgba(26, 18, 40, 0.75);
  margin-top: -10px;
  margin-bottom: 20px;
}

.primary-btn {
  width: 100%;
  border-radius: 20px;
  border: none;
  padding: 14px 18px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.primary-btn {
  background: linear-gradient(135deg, #ff6fb9, #ffb347);
  color: #2f1b0e;
  box-shadow: 0 12px 0 rgba(255, 255, 255, 0.5);
}

.primary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: inset 0 0 0 rgba(0, 0, 0, 0);
}

.primary-btn:active,
 .primary-btn:active {
  transform: translateY(2px);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
}

/* 
世界阶段：Start Overlay
- 冻结世界，仅展示启动引导
- 不销毁布局，仅隐藏视觉
*/
body.start-freeze .dock,
body.start-freeze .stage,
body.start-freeze .hud,
body.start-freeze .task {
  visibility: hidden;
}

.hud {
  position: relative;
  background:
    radial-gradient(
      circle at 20% 0%,
      rgba(255,255,255,0.92),
      rgba(255,240,220,0.75) 45%,
      rgba(255,220,200,0.45) 70%,
      transparent 100%
    );
  box-shadow: none;
  border-radius: 0 0 32px 32px;
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  backdrop-filter: blur(6px);
}


.hud-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hud-status {
  gap: 12px;
}

.hud-world-link {
  font-weight: 700;
  font-size: 0.9rem;
  color: #44221c;
  letter-spacing: 0.08em;
  text-decoration: none;
}


.hud-version {
  font-size: 0.7rem;
  color: rgba(0,0,0,0.4);
}

.stage {
  /* Fusion-triangle is the only active stage. Avoid reintroducing the legacy slot skin; keep these styles lightweight. */
  position: relative;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  overflow: hidden;
  isolation: isolate;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 16px 16px 18px;
  flex: 0 0 auto;
  margin-bottom: 8px;
  z-index: 1;
  max-height: 42vh;
}

.play-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.fusion-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: none;
  border: none;
  box-shadow: none;
  pointer-events: none;
  opacity: 0;
}

.fusion-input {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 1px 4px rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: rgba(43, 30, 51, 0.8);
  gap: 2px;
  text-align: center;
}

.fusion-input.filled {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.7);
}

.fusion-input-emoji {
  font-size: 20px;
  line-height: 1;
}

.fusion-input-name {
  font-size: 10px;
  line-height: 1.1;
  opacity: 0.75;
  max-width: 48px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


.fusion-input-left,
.fusion-input-right {
  top: auto;
  bottom: 40%;
  transform: translate(-50%, 0);
}

.fusion-input-left {
  left: 20%;
}

.fusion-input-right {
  left: 80%;
}

.fusion-triangle {
  /* WHY: anchor absolute rings to the triangle itself, not the stage */
  position: relative;
  width: clamp(260px, 72vw, 360px);
  aspect-ratio: 4 / 3;
  height: auto;
}

.spiral-token {
  pointer-events: none;
  position: fixed;
  z-index: 9998;
  transition: none;
  opacity: 1;
}




/*
核心舞台系统（Fusion Stage）
- 这是视觉与交互的锚点
- 尺寸、比例、动画节奏需保持稳定
- 允许调整“亮度 / 强度”，不允许重排结构
*/

/* 让融合轨道在线条颜色和亮度上更突出 */
/* 使轨道线变成黑色并增强可见度 */
.fusion-rings {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* WHY: keep the only continuous animation isolated for smoother frames */
  will-change: transform, opacity;
  opacity: 0.5;
  transform: scale(1);
  transition: transform 0.45s ease, opacity 0.45s ease;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.stage-hint,
.toast {
  text-align: center;
  font-weight: 600;
}

.stage-hint {
  color: #5a3c7c;
  font-size: 15px;
  padding: 0 20px;
  width: 100%;
  min-height: 44px;
  line-height: 1.4;
  user-select: none;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.stage-has-one .fusion-rings,
.stage-has-pair .fusion-rings {
  opacity: 0.95;
}

.fusion-rings svg {
  width: 100%;
  height: 100%;
}


.toast {
    position: absolute;
    left: 50%;
    top: 20px;
    transform: translateX(-50%) translateY(-6px);
    padding: 10px 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.15);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    color: #3b1b0c;
    opacity: 0;
    pointer-events: none;
    max-height: 30vh;
    overflow: hidden;
    transition: opacity 200ms ease, transform 200ms ease;
  }

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


.dock {
  flex: 0 0 auto;
  max-height: 38vh;
  -webkit-overflow-scrolling: touch;
  position: relative;
  background: var(--card-soft);
  border-radius: 24px 24px 28px 28px;
  padding: 16px 16px 28px;
  /* WHY: separate visual padding from safe-area padding without double-counting */
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
  box-shadow: 0 10px 0 rgba(255, 255, 255, 0.65), 0 14px 26px rgba(80, 110, 170, 0.2);
  border: 3px solid rgba(255, 255, 255, 0.65);
  overflow-y: auto;
  /* WHY: keep scroll behavior but hide scrollbar */
  scrollbar-width: none;
  overscroll-behavior: contain;
  opacity: 0.95;
  transform: scale(1);
  /* WHY: allow dock to shrink inside flex and keep internal scrolling reliable */
  min-height: 0;
  z-index: 10;
}

.dock::-webkit-scrollbar {
  display: none;
}

.dock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 8px;
  opacity: 0.6;
}

.dock-title {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  opacity: 0.4;
}

.progress {
  font-size: 0.6rem;
  opacity: 0.35;
  letter-spacing: 0.06em;
}

.grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.el-slot {
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.15), transparent 60%),
    radial-gradient(circle at 70% 20%, rgba(255, 255, 255, 0.08), transparent 60%);
  box-shadow: inset 0 4px 10px rgba(255, 255, 255, 0.35), inset 0 -4px 6px rgba(242, 226, 204, 0.25);
  opacity: 0.65;
  cursor: default;
}

.elements-grid {
  grid-template-rows: repeat(auto-fill, minmax(56px, auto));
}

@media (max-width: 340px) {
  .elements-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 340px) {
  .stage {
    max-height: none;
  }
}

/* ========== Compact element tile ========== */
.el {
  position: relative;
  min-width: 72px;
  height: 60px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px;
  user-select: none;
  cursor: pointer;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.68), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.5));
  box-shadow:
    /* 顶部高光 */
    inset 0 2px 0 rgba(255, 255, 255, 0.9),
    /* 玩具底边（硬） */
    0 5px 0 rgba(210, 210, 210, 1),
    /* 桌面投影（远） */
    0 10px 14px rgba(0, 0, 0, 0.22);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.el-emoji {
  font-size: 20px;
  line-height: 1;
  margin-bottom: 2px;
}

.badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffd54f;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
  pointer-events: none;
}

.el-text {
  font-size: 12px;
  opacity: 0.9;
}

.el:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.7),
    0 10px 14px rgba(0, 0, 0, 0.2);
}

.el:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.16);
}


.grid .el {
  min-height: 70px;
  padding: 8px;
  font-size: 15px;
}


.el:not(.locked) {
  border: 2px solid rgba(255, 215, 120, 0.6);
}

.task {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 6px 16px 2px;
  opacity: 0.85;
}

.task-label {
  font-size: 0.6rem;
  opacity: 0.4;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.task-text {
  font-size: 0.85rem;
  font-weight: 500;
  color: #5a3a28;
  text-shadow:
    0 1px 0 rgba(255,255,255,0.6);
  margin-top: 2px;
  letter-spacing: 0.02em;
  opacity: 0.85;
}

.fusion-overlay {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.92), rgba(255, 225, 200, 0.85) 40%, rgba(150, 110, 220, 0.18) 70%, rgba(0, 0, 0, 0.05) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 12;
  backdrop-filter: blur(6px);
  box-shadow: 0 24px 48px rgba(44, 20, 60, 0.2);
  pointer-events: none;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 220ms ease, transform 220ms ease;
}

.fusion-overlay.show {
  opacity: 1;
  transform: scale(1);
  pointer-events: all;
}

.fusion-overlay.hidden {
  display: none !important;
}

.fusion-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 245, 220, 0.95));
  border-radius: 28px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 24px 40px rgba(36, 18, 80, 0.2);
  position: relative;
  overflow: hidden;
}

.fusion-card::after {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 22px;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.8), transparent 70%);
  opacity: 0;
  pointer-events: none;
  filter: blur(4px);
}

.fusion-overlay[data-rarity="common"] .fusion-card::after {
  animation: fusionSparkleCommon 1.4s ease-in-out;
}

.fusion-overlay[data-rarity="rare"] .fusion-card::after {
  animation: fusionSparkleRare 1.6s ease-in-out;
  background: radial-gradient(circle at 50% 60%, rgba(255, 223, 120, 0.9), transparent 70%);
}

.fusion-overlay[data-rarity="legendary"] .fusion-card::after {
  animation: fusionSparkleLegendary 2s ease-in-out;
  background: radial-gradient(circle at 50% 40%, rgba(255, 238, 120, 0.95), transparent 60%);
  filter: blur(6px);
}

@keyframes fusionSparkleCommon {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  45% {
    opacity: 0.9;
    transform: scale(1.03);
  }
  100% {
    opacity: 0;
    transform: scale(0.95);
  }
}

@keyframes fusionSparkleRare {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.1);
  }
  100% {
    opacity: 0;
    transform: scale(0.9);
  }
}

@keyframes fusionSparkleLegendary {
  0% {
    opacity: 0;
    transform: scale(0.88);
  }
  40% {
    opacity: 1;
    transform: scale(1.15);
  }
  100% {
    opacity: 0;
    transform: scale(0.88);
  }
}

.fusion-title {
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.14em;
  opacity: 0.75;
  margin-bottom: 10px;
}

.fusion-result {
  font-size: 56px;
  margin-top: 2px;
  line-height: 1;
  filter: drop-shadow(0 10px 18px rgba(255, 190, 120, 0.35));
}

.fusion-overlay[data-rarity="rare"] .fusion-result {
  filter: drop-shadow(0 16px 30px rgba(255, 205, 138, 0.65));
}

.fusion-overlay[data-rarity="legendary"] .fusion-result {
  filter: drop-shadow(0 24px 40px rgba(255, 220, 160, 0.8));
}

.fusion-name {
  font-weight: 900;
  font-size: 18px;
  margin-top: 8px;
  letter-spacing: 0.06em;
}

.fusion-reason {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(43, 30, 51, 0.78);
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(43, 30, 51, 0.08);
}

.fusion-btn {
  margin-top: 14px;
  padding: 10px 16px;
  border-radius: 999px;
  border: none;
  font-weight: 900;
  background: linear-gradient(135deg, #ff6fb9, #ffb347);
  color: #2f1b0e;
  cursor: pointer;
  box-shadow: 0 12px 0 rgba(255, 255, 255, 0.6);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.fusion-btn:active {
  transform: translateY(2px);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
}

.flying-token {
  pointer-events: none;
  position: fixed;
  z-index: 9999;
  font-size: inherit;
  font-weight: inherit;
  text-align: center;
  line-height: inherit;
}

/* ========== World Encyclopedia Overlay ========== */
.world-overlay {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.92), rgba(230, 245, 255, 0.86) 44%, rgba(150, 110, 220, 0.12) 72%, rgba(0, 0, 0, 0.05) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 14;
  backdrop-filter: blur(6px);
  box-shadow: 0 24px 48px rgba(44, 20, 60, 0.2);
}

.world-card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 245, 220, 0.92));
  border-radius: 26px;
  padding: 18px 16px 14px;
  box-shadow: 0 24px 40px rgba(36, 18, 80, 0.18);
  border: 1px solid rgba(43, 30, 51, 0.08);
}

.world-title {
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.12em;
  opacity: 0.78;
  margin-bottom: 8px;
}

.world-meta {
  font-size: 12px;
  opacity: 0.75;
  margin-bottom: 8px;
}

.world-hint {
  font-size: 13px;
  line-height: 1.4;
  color: rgba(43, 30, 51, 0.82);
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(43, 30, 51, 0.08);
  margin-bottom: 12px;
  min-height: 42px;
}

.world-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.world-col-title {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  opacity: 0.55;
  margin-bottom: 6px;
}

.world-list {
  background: rgba(255, 255, 255, 0.55);
  border-radius: 18px;
  padding: 10px 10px;
  border: 1px solid rgba(43, 30, 51, 0.08);
  max-height: 34vh;
  overflow: auto;
  scrollbar-width: none;
}

.world-list::-webkit-scrollbar {
  display: none;
}

.world-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px;
  border-radius: 12px;
}

.world-item .emoji {
  font-size: 16px;
  width: 22px;
  text-align: center;
}

.world-item .name {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.9;
}

.world-item.unknown {
  opacity: 0.55;
}

.world-btn {
  margin-top: 12px;
  width: 100%;
  padding: 10px 16px;
  border-radius: 999px;
  border: none;
  font-weight: 900;
  background: linear-gradient(135deg, #ff6fb9, #ffb347);
  color: #2f1b0e;
  cursor: pointer;
  box-shadow: 0 12px 0 rgba(255, 255, 255, 0.6);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.world-btn:active {
  transform: translateY(2px);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
}

@media (max-height: 700px) {
  /* WHY: let stage yield space on short screens without vh caps */
  .stage {
    max-height: none;
    min-height: 180px;
    flex: 0 1 auto;
  }

  /* WHY: drop the unused grid track so play-area owns remaining height */
  .app {
    grid-template-rows: auto auto 1fr;
  }

  .dock {
    max-height: none;
    /* WHY: let dock consume leftover height and keep last row visible */
    flex: 1;
    /* WHY: keep safe-area padding while reducing visual padding on small screens */
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

  .elements-grid {
    padding-bottom: 6px;
  }
}
