/* 星空花园：场景底图、题板和触控组件。 */
#app[data-scene] {
  --scene-ink: #20314f;
  --scene-edge: #d8f4ff;
  --scene-panel: rgba(24, 31, 84, .9);
  --scene-card: linear-gradient(165deg, #fbfdff 10%, #c9ecff 74%, #a8dcef);
  --scene-drop: 0 5px 0 #455a99, 0 9px 24px rgba(14, 22, 77, .35);
  padding: clamp(10px, 2vw, 26px);
  background: var(--scene-overlay), var(--scene-art) center bottom / cover no-repeat, #302e80;
}

#app[data-scene="sky-garden"] {
  --scene-art: url("../assets/scenes/sky-garden.webp");
  --scene-overlay: linear-gradient(180deg, rgba(19, 20, 65, .3), transparent 74%);
}

[data-scene] :is(button, select, input):focus-visible {
  outline: 3px solid #fff3a8;
  outline-offset: 4px;
}

[data-scene] .btn {
  min-height: 44px;
  font-weight: 700;
  background: var(--scene-panel);
  border-color: #b2d9ff;
  box-shadow: 0 3px 0 #373c7c;
}

[data-scene] .btn-primary,
[data-scene] .scene-exit {
  color: #53280b;
  background: linear-gradient(#fff0ab, #ffb85d);
  border-color: #fff4ce;
  box-shadow: 0 3px 0 #a7532c;
}

[data-scene] .logo {
  color: #fff4cb;
  font-size: clamp(30px, 5vw, 57px);
  letter-spacing: .08em;
  margin: clamp(4px, 3vh, 25px) 0 6px;
  text-shadow: 0 3px 0 #443359, 0 0 28px #8177ee;
}

[data-scene] .profile-chip-row {
  display: flex; align-items: center; justify-content: center; gap: 10px;
}

[data-scene] .profile-chip {
  padding: 8px 12px; border-radius: 999px; background: var(--scene-panel);
  color: #fff3cb;
}

[data-scene] .subject-card {
  width: clamp(112px, 20vw, 204px);
  padding: clamp(8px, 2vh, 18px) 7px;
  background: var(--scene-card);
  border: 2px solid var(--scene-edge);
  box-shadow: var(--scene-drop);
}
[data-scene] .subject-card[data-subject="literacy"] {
  background: linear-gradient(#fff9d9, #ffc977);
}
[data-scene] .subject-card[data-subject="english"] {
  background: linear-gradient(#f9ebff, #dbc2ff);
}
[data-scene] .subject-name { color: var(--scene-ink); font-weight: 800; }
[data-screen="home"] .home-row { margin-top: 8px; }

[data-scene] :is(.practice-form, .practice-result) {
  background: var(--scene-panel);
  border: 2px solid var(--scene-edge);
  border-radius: 24px;
  padding: clamp(14px, 3vw, 26px);
  box-shadow: var(--scene-drop);
}
[data-scene] .screen-title { color: #f2f9ff; }

.scene-hud { justify-content: space-between; align-items: flex-start; gap: 10px; }
.scene-round {
  display: flex; align-items: center; flex-wrap: wrap; gap: 5px 10px;
  min-height: 44px; max-width: 100%;
  padding: 7px 12px; border-radius: 14px;
  background: var(--scene-panel); border: 2px solid #b2d9ff;
}
.scene-round .play-title {
  flex: 0 1 auto; margin: 0; font-size: clamp(15px, 2.1vw, 21px); color: #fff6d8;
  overflow-wrap: anywhere;
}
.scene-round .practice-progress {
  font-size: 15px; white-space: nowrap; color: #fff4c6; font-weight: 800;
  border-radius: 9px; background: #4653a0; padding: 3px 8px;
}
.scene-controls { display: flex; flex-shrink: 0; gap: 8px; }
[data-scene] .scene-replay {
  min-width: 46px; padding: 5px 9px; font-size: 21px;
  background: linear-gradient(#ebffd7, #84d5a3); border-color: #efffdd; box-shadow: 0 3px 0 #2e765d;
}
.scene-replay:disabled { opacity: .55; cursor: default; }

[data-scene] .play-view {
  justify-content: flex-start;
  min-height: min-content;
  padding: clamp(8px, 3.8vh, 35px) 0;
}
.scene-prompt,
[data-scene] :is(.maze-tip, .finisher-tip) {
  max-width: min(100%, 46rem);
  padding: clamp(8px, 2vh, 15px) clamp(14px, 3vw, 30px);
  border-radius: 22px; border: 3px solid #f4fbff;
  background: var(--scene-card); color: var(--scene-ink);
  font-size: clamp(22px, 3.2vw, 38px); font-weight: 800; text-align: center;
  text-shadow: none; box-shadow: var(--scene-drop);
}
.scene-stage { position: relative; min-height: clamp(124px, 25vh, 248px); }

[data-scene] :is(.choice-grid, .jump-path) {
  display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(8px, 1.8vw, 18px);
}
[data-scene] :is(.choice-option, .meteor, .link-item, .jump-stone, .memory-card) {
  color: var(--scene-ink); background: var(--scene-card); border: 2px solid var(--scene-edge);
  border-radius: 18px; box-shadow: var(--scene-drop);
  min-height: 48px; padding: 8px 13px; font: inherit; font-weight: 800; cursor: pointer;
  overflow-wrap: anywhere;
}
[data-scene] :is(.choice-option, .meteor) {
  min-width: clamp(56px, 10vw, 118px);
  max-width: 100%;
  min-height: clamp(58px, 14vh, 100px);
  font-size: clamp(20px, 3.6vw, 43px);
}
[data-scene] :is(.choice-option, .meteor):nth-child(3n + 1) {
  background: linear-gradient(#fffadd, #ffcd85);
  border-color: #fff1bb;
}
[data-scene] :is(.choice-option, .meteor):nth-child(3n + 2) {
  background: linear-gradient(#f4e8ff, #cbb7ff);
  border-color: #f4e8ff;
}
[data-scene] .choice-prompt-items {
  background: var(--scene-panel); border: 2px solid #b2d9ff;
  border-radius: 16px; padding: 8px 14px;
}

.shooter-stage { position: relative; width: min(760px, 76vw); min-height: 150px; }
[data-scene] .meteor { position: absolute; translate: -50% 0; top: 0; max-width: 26%; }
[data-scene] .shooter-stage[data-dense="true"] {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  min-height: 0; gap: 10px;
}
[data-scene] .shooter-stage[data-dense="true"] .meteor {
  position: static; translate: none; min-width: 0; max-width: none;
  min-height: 44px; padding: 5px; font-size: clamp(17px, 2.6vw, 27px);
}

[data-scene] .link-board {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(560px, 96%); gap: clamp(20px, 10vw, 112px);
}
[data-scene] .link-col { display: grid; gap: 10px; }
[data-scene] :is(.link-item, .memory-card) { font-size: clamp(17px, 2.4vw, 27px); }
[data-scene] :is(.link-item.selected, .memory-card[aria-pressed="true"]) {
  background: #fff1b0; border-color: #ffe064;
}
[data-scene] :is(.link-item.matched, .memory-card.matched) {
  background: #c5f7ce; border-color: #73d39d; cursor: default;
}
[data-scene] .memory-card[aria-pressed="false"] {
  color: #f4ecff; background: linear-gradient(165deg, #7772d1, #433f95);
  border-color: #c6b9ff;
}

[data-scene] :is(.drag-stage, .jump-stage, .trace-stage, .gesture-zone, .maze-grid) {
  background: var(--scene-panel); border: 2px solid #b2d9ff;
  border-radius: 20px; padding: 12px; text-align: center;
}
[data-scene] .scene-stage > :is(.drag-stage, .jump-stage, .trace-stage) {
  width: min(520px, 100%);
}
[data-scene] :is(.drag-head, .drag-pool) {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 7px 12px;
}
[data-scene] .drag-pool { min-height: 48px; margin: 8px 0; }
[data-scene] .drag-item {
  display: inline-grid; place-items: center; min-width: 42px; min-height: 42px;
  border-radius: 12px; background: #655dcc; font-size: 22px; cursor: grab; touch-action: none;
}
[data-scene] .drag-slot { min-height: 52px; padding: 12px; border: 2px dashed #85f1f9; border-radius: 13px; }
[data-scene] :is(.drag-launch, .trace-done) {
  color: #492906; background: #ffd486; border: 2px solid #fff4ce;
  border-radius: 12px; min-height: 44px; padding: 7px 18px; margin-top: 8px;
  cursor: pointer; font: inherit; font-weight: 700;
}
[data-scene] .jump-hero { display: block; font-size: 29px; margin-bottom: 5px; }
[data-scene] .trace-writer { background: #f8fbff; border-radius: 16px; }
[data-scene] .trace-canvas {
  display: block; width: min(100%, 210px); height: auto; margin: 6px auto;
  border: 2px dashed #a6e7f8; border-radius: 12px; touch-action: none;
}
[data-scene] .gesture-zone { min-height: 120px; display: grid; place-items: center; cursor: pointer; }

[data-scene] .toast {
  top: auto; bottom: max(10px, env(safe-area-inset-bottom)); width: max-content;
  pointer-events: none; animation: none;
}
