/* Scene2-7 | 계절 옷입히기 자음 종합게임 전용 스타일 */
.scene27-panel[hidden] {
  display: none !important;
}

.scene27-panel.is-active {
  display: block;
  position: absolute;
  inset: 0;
  padding: 0;
  overflow: hidden;
  border-radius: inherit;
}

body[data-current-scene="scene2-7"] .scene2-activity-stage {
  overflow: hidden;
}

.scene27-game {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  color: #17255f;
  background:
    radial-gradient(circle at 8% 16%, rgba(255, 255, 255, 0.92) 0 2px, transparent 3px),
    radial-gradient(circle at 91% 12%, rgba(255, 248, 163, 0.9) 0 2px, transparent 3px),
    radial-gradient(circle at 75% 82%, rgba(255, 255, 255, 0.75) 0 1.5px, transparent 2.5px),
    linear-gradient(145deg, #172963 0%, #3b4f9f 43%, #7566c7 100%);
  isolation: isolate;
  touch-action: manipulation;
}

.scene27-game::before,
.scene27-game::after {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.scene27-game::before {
  top: -18%;
  right: -9%;
  width: 42%;
  aspect-ratio: 1;
  background: radial-gradient(circle at 35% 35%, #fff7a5, #ff9d67 48%, #a94baf 72%);
  box-shadow: 0 0 55px rgba(255, 193, 117, 0.45);
  opacity: 0.7;
}

.scene27-game::after {
  bottom: -24%;
  left: -8%;
  width: 38%;
  aspect-ratio: 1;
  border: 18px solid rgba(117, 225, 255, 0.28);
  box-shadow: 0 0 45px rgba(85, 215, 255, 0.25);
}

.scene27-game[data-scene27-season="summer"] {
  background-color: #68d9ef;
  background-image: url("assets/backgrounds/scene27_summer_beach_background_v1.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.scene27-game[data-scene27-season="winter"] {
  background-color: #dff3ff;
  background-image: url("assets/backgrounds/scene27_winter_ski_resort_background_v1.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.scene27-game[data-scene27-season]::before,
.scene27-game[data-scene27-season]::after {
  opacity: 0;
}

.scene27-status {
  position: absolute;
  z-index: 30;
  top: 2.2%;
  left: 2.2%;
  width: max-content;
  max-width: calc(100% - 4.4%);
  margin: 0;
  padding: 0.45em 1em;
  border: 2px solid rgba(206, 239, 255, 0.72);
  border-radius: 999px;
  color: #fff;
  background: rgba(17, 35, 104, 0.78);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  font-size: clamp(0.78rem, 1.25vw, 1.02rem);
  font-weight: 900;
  line-height: 1.3;
}

.scene27-character-select,
.scene27-play-screen {
  position: absolute;
  inset: 0;
}

.scene27-character-select[hidden],
.scene27-play-screen[hidden],
.scene27-season-picker[hidden],
.scene27-complete[hidden],
.scene27-drag-ghost[hidden] {
  display: none !important;
}

.scene27-screen-title {
  position: absolute;
  top: 8.5%;
  left: 50%;
  z-index: 2;
  margin: 0;
  transform: translateX(-50%);
  color: #fff8b3;
  font-size: clamp(1.1rem, 2.3vw, 2rem);
  text-align: center;
  text-shadow: 0 3px 0 #3e2d8c, 0 5px 16px rgba(0, 0, 0, 0.38);
  white-space: nowrap;
}

.scene27-character-grid {
  position: absolute;
  inset: 15% 8% 5%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 7vw, 104px);
}

.scene27-character-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  padding: 1.2% 4% 2%;
  place-items: center;
  grid-template-rows: minmax(0, 1fr) auto;
  border: 3px solid rgba(201, 239, 255, 0.76);
  border-radius: 28px;
  color: #19306e;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.93), rgba(207, 239, 255, 0.86));
  box-shadow: 0 12px 0 rgba(24, 43, 121, 0.45), 0 18px 34px rgba(0, 0, 0, 0.24);
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease, opacity 350ms ease, visibility 350ms step-end;
}

.scene27-character-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  min-height: 0;
  user-select: none;
  pointer-events: none;
}

.scene27-character-card span {
  min-width: 7.5em;
  padding: 0.42em 1em;
  border-radius: 999px;
  background: #fff7ab;
  box-shadow: inset 0 -3px 0 rgba(245, 168, 45, 0.35);
  font-size: clamp(0.9rem, 1.65vw, 1.25rem);
  font-weight: 1000;
}

.scene27-character-card:hover,
.scene27-character-card:focus-visible {
  z-index: 3;
  transform: scale(1.04);
  filter: brightness(1.05) drop-shadow(0 0 13px rgba(117, 237, 255, 0.95));
  outline: 4px solid #fff59b;
  outline-offset: 3px;
}

.scene27-character-card.is-selected {
  border-color: #fff59b;
  box-shadow: 0 0 0 5px rgba(85, 223, 255, 0.62), 0 12px 0 rgba(24, 43, 121, 0.45), 0 18px 34px rgba(0, 0, 0, 0.24);
}

.scene27-character-grid.is-boy-selected .scene27-character-card[data-character="girl"],
.scene27-character-grid.is-girl-selected .scene27-character-card[data-character="boy"] {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.scene27-season-picker {
  position: absolute;
  top: 8%;
  bottom: 8%;
  display: grid;
  align-content: center;
  gap: clamp(12px, 2vh, 22px);
  width: calc(50% - clamp(12px, 3.5vw, 52px));
  padding: 4%;
  border: 3px solid rgba(211, 239, 255, 0.8);
  border-radius: 28px;
  background: rgba(236, 247, 255, 0.94);
  box-shadow: 0 12px 0 rgba(24, 43, 121, 0.42), 0 18px 34px rgba(0, 0, 0, 0.24);
  animation: scene27-season-arrive 360ms ease both;
}

.scene27-character-grid.is-boy-selected .scene27-season-picker {
  right: 0;
}

.scene27-character-grid.is-girl-selected .scene27-season-picker {
  left: 0;
}

.scene27-season-picker h3 {
  margin: 0 0 0.3em;
  color: #253878;
  font-size: clamp(1rem, 1.8vw, 1.45rem);
  text-align: center;
}

.scene27-season-picker button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7em;
  min-height: clamp(64px, 11vh, 98px);
  padding: 0.5em 1em;
  border: 3px solid #fff;
  border-radius: 22px;
  color: #1a367d;
  box-shadow: 0 6px 0 rgba(38, 71, 156, 0.4);
  font: inherit;
  cursor: pointer;
}

.scene27-season-picker button[data-season="summer"] {
  background: linear-gradient(135deg, #fff2a5, #79e2ff);
}

.scene27-season-picker button[data-season="winter"] {
  background: linear-gradient(135deg, #f9fdff, #b9d8ff);
}

.scene27-season-picker button span {
  font-size: clamp(1.7rem, 3vw, 2.8rem);
}

.scene27-season-picker button strong {
  font-size: clamp(1.05rem, 2vw, 1.55rem);
}

.scene27-season-picker button:hover,
.scene27-season-picker button:focus-visible {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.05);
  outline: 4px solid #ffce54;
  outline-offset: 3px;
}

.scene27-play-screen {
  display: grid;
  grid-template-columns: minmax(220px, 33%) minmax(0, 67%);
  padding: 8.5% 2.3% 2.2%;
  gap: 2%;
}

.scene27-dresser,
.scene27-learning-area {
  min-width: 0;
  min-height: 0;
  border: 2px solid rgba(213, 240, 255, 0.7);
  border-radius: 26px;
  background: rgba(235, 247, 255, 0.9);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}

.scene27-dresser {
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.96), rgba(210, 238, 255, 0.9) 62%, rgba(146, 198, 247, 0.92)),
    repeating-linear-gradient(90deg, transparent 0 48px, rgba(62, 111, 187, 0.08) 49px 50px);
}

.scene27-character-stage {
  position: relative;
  height: 94%;
  max-width: 96%;
  aspect-ratio: 2 / 3;
}

.scene27-character-base {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

.scene27-character-base {
  z-index: 20;
}

.scene27-applied-layer {
  display: none;
}

.scene27-character-stage.is-changing .scene27-character-base {
  animation: scene27-state-change 440ms cubic-bezier(.2, .8, .25, 1.1) both;
}

.scene27-learning-area {
  display: grid;
  grid-template-rows: auto minmax(92px, 1fr) auto auto;
  gap: clamp(7px, 1.2vh, 13px);
  padding: clamp(10px, 1.5vw, 18px);
  overflow: hidden;
}

.scene27-top-row {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) minmax(140px, 1.25fr) minmax(88px, 0.75fr);
  align-items: stretch;
  gap: clamp(7px, 1vw, 13px);
}

.scene27-current-item,
.scene27-drop-target,
.scene27-progress {
  min-width: 0;
  min-height: 78px;
  border-radius: 18px;
}

.scene27-current-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(50px, 0.9fr) minmax(0, 1.1fr);
  place-items: center;
  gap: 0.25em;
  padding: 0.45em 0.65em;
  border: 3px solid #ffcf51;
  background: #fffbe0;
  box-shadow: 0 0 0 3px rgba(255, 221, 108, 0.25);
}

.scene27-current-badge {
  position: absolute;
  top: -0.65em;
  left: 50%;
  z-index: 2;
  padding: 0.25em 0.7em;
  border-radius: 999px;
  color: #fff;
  background: #e9656c;
  font-size: clamp(0.62rem, 1vw, 0.78rem);
  font-weight: 900;
  white-space: nowrap;
  transform: translateX(-50%);
}

.scene27-current-item img {
  display: block;
  width: min(76px, 100%);
  height: min(76px, 88%);
  object-fit: contain;
  animation: scene27-current-pulse 1.8s ease-in-out infinite;
}

.scene27-current-name {
  min-width: 0;
  color: #24345f;
  font-size: clamp(0.88rem, 1.65vw, 1.28rem);
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  word-break: keep-all;
}

.scene27-current-name mark {
  color: #e32626;
  background: transparent;
}

.scene27-drop-target {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.2em;
  padding: 0.4em;
  border: 4px dashed #5d72ce;
  color: #223b86;
  background: linear-gradient(180deg, #eef7ff, #ccedff);
  font: inherit;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.scene27-drop-target span {
  display: grid;
  width: 2em;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  color: #314eaa;
  background: #fff;
  font-size: clamp(1.15rem, 2.5vw, 2rem);
  font-weight: 1000;
}

.scene27-drop-target strong {
  font-size: clamp(0.7rem, 1vw, 0.86rem);
}

.scene27-drop-target.is-ready,
.scene27-drop-target:hover,
.scene27-drop-target:focus-visible {
  border-color: #ffad33;
  background: #fff4ae;
  transform: scale(1.02);
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.scene27-drop-target.is-correct {
  border-style: solid;
  border-color: #36b978;
  background: #c9f7d9;
  animation: scene27-correct-pop 420ms ease both;
}

.scene27-drop-target.is-wrong {
  border-color: #e67c7c;
  background: #ffe3e3;
  animation: scene27-gentle-retry 420ms ease-in-out both;
}

.scene27-progress {
  display: grid;
  place-items: center;
  align-content: center;
  padding: 0.45em;
  color: #eaf8ff;
  background: #263e91;
  text-align: center;
}

.scene27-progress span {
  font-size: clamp(0.62rem, 1vw, 0.78rem);
  font-weight: 800;
}

.scene27-progress strong {
  color: #fff49e;
  font-size: clamp(0.92rem, 1.7vw, 1.25rem);
}

.scene27-inventory-wrap,
.scene27-consonant-wrap {
  min-height: 0;
  padding: 0.45em 0.65em;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.scene27-inventory-wrap h3,
.scene27-consonant-wrap h3 {
  margin: 0 0 0.25em;
  color: #35478c;
  font-size: clamp(0.68rem, 1.05vw, 0.88rem);
}

.scene27-inventory {
  display: grid;
  grid-template-columns: repeat(10, minmax(34px, 1fr));
  gap: clamp(3px, 0.5vw, 7px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.scene27-inventory li {
  display: grid;
  min-width: 0;
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid #b8c9ea;
  border-radius: 12px;
  background: #f7fbff;
  transition: opacity 220ms ease, transform 220ms ease;
}

.scene27-inventory li.is-current {
  border: 3px solid #ffb93c;
  box-shadow: 0 0 0 3px rgba(255, 210, 86, 0.32);
  transform: translateY(-2px) scale(1.04);
}

.scene27-inventory li.is-applied {
  opacity: 0;
  transform: scale(0.55);
}

.scene27-inventory img {
  display: block;
  width: 90%;
  height: 90%;
  object-fit: contain;
}

.scene27-consonants {
  display: grid;
  grid-template-columns: repeat(7, minmax(40px, 1fr));
  gap: clamp(5px, 0.7vw, 9px);
}

.scene27-consonant {
  min-width: 0;
  min-height: clamp(38px, 6vh, 54px);
  padding: 0.2em;
  border: 3px solid #91b4e9;
  border-radius: 14px;
  color: #223d89;
  background: linear-gradient(180deg, #fff, #dff1ff);
  box-shadow: 0 4px 0 #7587c8;
  font: inherit;
  font-size: clamp(1.05rem, 2.1vw, 1.65rem);
  font-weight: 1000;
  line-height: 1;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.scene27-consonant:hover,
.scene27-consonant:focus-visible,
.scene27-consonant.is-selected {
  border-color: #ffb93c;
  background: #fff5a8;
  box-shadow: 0 0 0 3px rgba(255, 212, 83, 0.35), 0 4px 0 #e8a837;
  outline: 3px solid #fff;
  outline-offset: 2px;
  transform: translateY(-2px);
}

.scene27-consonant:disabled {
  cursor: default;
  opacity: 0.64;
  transform: none;
}

.scene27-action-row {
  display: flex;
  align-items: center;
  gap: 0.8em;
  min-width: 0;
}

.scene27-listen,
.scene27-complete button {
  min-height: 42px;
  padding: 0.5em 1em;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #1f377f;
  background: linear-gradient(180deg, #fff8b7, #84e4ff);
  box-shadow: 0 4px 0 #5264b5;
  font: inherit;
  font-size: clamp(0.72rem, 1vw, 0.88rem);
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.scene27-listen:hover,
.scene27-listen:focus-visible,
.scene27-complete button:hover,
.scene27-complete button:focus-visible {
  filter: brightness(1.07);
  outline: 3px solid #fff49b;
  outline-offset: 2px;
  transform: translateY(-1px);
}

.scene27-listen:disabled {
  cursor: default;
  opacity: 0.62;
}

.scene27-selection-help {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #42518d;
  font-size: clamp(0.62rem, 0.95vw, 0.78rem);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene27-complete {
  position: absolute;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding-left: 34%;
  background: rgba(19, 30, 91, 0.28);
  backdrop-filter: blur(2px);
}

.scene27-complete-card {
  width: min(88%, 520px);
  padding: clamp(20px, 4vw, 44px);
  border: 4px solid #fff6a4;
  border-radius: 30px;
  color: #243a82;
  background: linear-gradient(145deg, #fffef2, #dff5ff);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  text-align: center;
  animation: scene27-complete-arrive 520ms cubic-bezier(.2, .85, .25, 1.2) both;
}

.scene27-complete-stars {
  color: #ffaf30;
  font-size: clamp(1.5rem, 4vw, 3rem);
}

.scene27-complete h2 {
  margin: 0.25em 0;
  font-size: clamp(1.25rem, 2.6vw, 2.1rem);
}

.scene27-complete p {
  margin: 0 0 1.2em;
  font-weight: 800;
}

.scene27-drag-ghost {
  position: fixed;
  z-index: 9999;
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border: 4px solid #fff49c;
  border-radius: 18px;
  color: #203b8b;
  background: rgba(239, 249, 255, 0.96);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
  font-size: 2rem;
  font-weight: 1000;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

@keyframes scene27-season-arrive {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes scene27-current-pulse {
  0%, 100% { transform: scale(0.94); }
  50% { transform: scale(1.04); }
}

@keyframes scene27-state-change {
  from { opacity: 0.35; transform: scale(0.94); filter: brightness(1.4) drop-shadow(0 0 18px #fff59f); }
  to { opacity: 1; transform: scale(1); filter: none; }
}

@keyframes scene27-correct-pop {
  0% { transform: scale(1); }
  55% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes scene27-gentle-retry {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-5px); }
  70% { transform: translateX(5px); }
}

@keyframes scene27-complete-arrive {
  from { opacity: 0; transform: translateY(18px) scale(0.86); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 760px), (max-height: 560px) {
  .scene27-play-screen {
    grid-template-columns: minmax(150px, 30%) minmax(0, 70%);
    padding-top: 9.5%;
  }

  .scene27-learning-area {
    grid-template-rows: auto minmax(64px, 1fr) auto auto;
    padding: 8px;
  }

  .scene27-inventory {
    grid-template-columns: repeat(10, minmax(26px, 1fr));
  }

  .scene27-consonant {
    min-height: 34px;
  }

  .scene27-selection-help {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scene27-character-card,
  .scene27-season-picker,
  .scene27-current-item img,
  .scene27-character-base,
  .scene27-drop-target,
  .scene27-complete-card {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}


/* Candidate 2: Scene2-7 compact guidance and item prominence. */
.scene27-status {
  width: max-content;
  max-width: calc(100% - 4.4%);
  white-space: nowrap;
}
.scene27-inventory-wrap,
.scene27-consonant-wrap {
  padding-top: 0.55em;
}
.scene27-current-item {
  z-index: 55;
  overflow: visible;
}
.scene27-current-item img {
  position: relative;
  top: -2mm;
  z-index: 90;
}
.scene27-current-badge {
  z-index: 80;
}
