:root {
  color-scheme: dark;
  --bg: #070706;
  --stone: #171713;
  --stone-2: #23231d;
  --stone-3: #323126;
  --gold: #cfa85d;
  --gold-hi: #f1d58a;
  --bronze: #7b512b;
  --blood: #8f2e24;
  --moss: #53623b;
  --mana: #347082;
  --ink: #f3e8c5;
  --muted: #aaa08b;
  --line: #4e4434;
  --black-glass: rgba(8, 8, 7, 0.86);
  --shadow: 0 18px 38px rgba(0, 0, 0, 0.62);
  --font-sans:
    Pretendard, Inter, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic",
    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--font-sans);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: #050504;
  color: var(--ink);
}

button,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.game-world {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
}

#sceneCanvas {
  display: none;
}

.scene-photo-bg {
  position: absolute;
  inset: 0;
  z-index: -4;
  overflow: hidden;
  background-color: #11110d;
}

.scene-photo-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.92) contrast(0.95) brightness(0.72);
  transform: scale(1.01);
}

.scene-photo-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.38), rgba(0, 0, 0, 0.08) 42%, rgba(0, 0, 0, 0.66)),
    radial-gradient(circle at 50% 45%, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.38) 72%);
}

body[data-scene="departure"] .scene-photo-image {
  object-position: center 50%;
}

body[data-scene="darwin"] .scene-photo-image {
  object-position: center;
}

body[data-scene="garage"] .scene-photo-image {
  object-position: center 44%;
}

body[data-scene="race"] .scene-photo-image {
  object-position: center;
}

.world-vignette {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.16), transparent 34%, rgba(0, 0, 0, 0.62)),
    radial-gradient(circle at 50% 42%, transparent 0 24rem, rgba(0, 0, 0, 0.3) 54rem);
}

.game-hud {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  right: 0.75rem;
  z-index: 7;
  display: grid;
  grid-template-columns: 17rem minmax(0, 1fr) 13.5rem;
  gap: 0.65rem;
  align-items: start;
}

.brand,
.scene-stats,
.quest-banner,
.team-picker,
.coach-panel,
.dialogue-panel,
.scenario-button,
.team-button,
.choice-button,
.icon-button,
.control-button,
.speed-button,
textarea {
  border: 1px solid #6e5b3c;
  box-shadow:
    inset 0 1px 0 rgba(255, 231, 150, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.58),
    0 0 0 1px rgba(0, 0, 0, 0.76),
    var(--shadow);
}

.brand {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr);
  gap: 0.62rem;
  min-height: 4.8rem;
  padding: 0.55rem;
  background: linear-gradient(180deg, rgba(46, 45, 34, 0.96), rgba(12, 12, 10, 0.96));
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  border: 1px solid #97713d;
  background:
    linear-gradient(135deg, rgba(255, 230, 136, 0.18), transparent 45%),
    linear-gradient(180deg, #4a3724, #18120d);
  color: var(--gold-hi);
  font-size: 1rem;
  font-weight: 850;
  text-shadow: 0 2px 0 #000;
}

.brand h1 {
  margin: 0;
  overflow: hidden;
  color: var(--gold-hi);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.02rem;
  letter-spacing: 0;
  text-shadow: 0 2px 0 #000;
}

.brand p {
  margin: 0.18rem 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.scenario-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
}

.scenario-button,
.team-button,
.choice-button,
.icon-button,
.control-button,
.speed-button {
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    color 120ms ease,
    background 120ms ease;
}

.scenario-button {
  min-height: 4.75rem;
  padding: 0.52rem 0.58rem;
  background:
    linear-gradient(180deg, rgba(49, 50, 39, 0.94), rgba(13, 14, 12, 0.94)),
    repeating-linear-gradient(90deg, transparent 0 5px, rgba(255, 255, 255, 0.025) 5px 6px);
  color: var(--ink);
  text-align: left;
}

.scenario-button:hover,
.scenario-button.active {
  transform: translateY(-1px);
  border-color: var(--gold-hi);
  background: linear-gradient(180deg, rgba(76, 62, 33, 0.98), rgba(20, 17, 12, 0.98));
}

.scenario-number {
  display: inline-block;
  min-width: 1.35rem;
  padding: 0.06rem 0.22rem;
  border: 1px solid #6e5b3c;
  background: rgba(0, 0, 0, 0.5);
  color: var(--gold-hi);
  font-size: 0.66rem;
  font-weight: 850;
  text-align: center;
}

.scenario-label {
  display: block;
  margin-top: 0.25rem;
  overflow: hidden;
  color: #f2e0ab;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 850;
}

.scenario-meta {
  display: block;
  margin-top: 0.18rem;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.68rem;
}

.scene-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
}

.scene-stats div {
  min-height: 4.75rem;
  padding: 0.55rem 0.38rem;
  border: 1px solid #6e5b3c;
  background: linear-gradient(180deg, rgba(38, 36, 29, 0.96), rgba(7, 7, 6, 0.96));
  text-align: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 231, 150, 0.14),
    0 0 0 1px rgba(0, 0, 0, 0.72);
}

.scene-stats span {
  display: block;
  color: #fff2ba;
  font-size: 1.05rem;
  font-weight: 850;
}

.scene-stats small {
  display: block;
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
}

.team-picker {
  position: absolute;
  top: 6rem;
  right: 0.75rem;
  z-index: 8;
  width: min(39rem, calc(100vw - 1.5rem));
  padding: 0.55rem;
  background: var(--black-glass);
}

.team-picker.is-hidden {
  display: none;
}

.section-kicker {
  color: var(--gold-hi);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 2px 0 #000;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(6.8rem, 1fr));
  gap: 0.35rem;
  margin-top: 0.42rem;
}

.team-button {
  display: grid;
  gap: 0.15rem;
  min-height: 4.65rem;
  padding: 0.4rem;
  background: linear-gradient(180deg, rgba(43, 41, 32, 0.96), rgba(13, 13, 11, 0.96));
  color: var(--ink);
  text-align: center;
}

.team-button:hover,
.team-button.active {
  border-color: var(--gold-hi);
  background: linear-gradient(180deg, rgba(77, 60, 32, 0.98), rgba(21, 17, 12, 0.98));
}

.team-rank {
  display: grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  margin: 0 auto;
  border: 1px solid #8c6b39;
  background: #14110d;
  color: var(--gold-hi);
  font-size: 0.72rem;
  font-weight: 850;
}

.team-detail {
  min-width: 0;
}

.team-name,
.team-car,
.team-country {
  display: block;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.team-name {
  color: #f1e1b3;
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1.24;
}

.team-car {
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.22;
}

.team-country {
  display: none;
}

.scene-overlay {
  position: absolute;
  top: 6rem;
  left: 0.75rem;
  z-index: 6;
  max-width: min(31rem, calc(100vw - 1.5rem));
}

.quest-banner {
  padding: 0.7rem 0.85rem;
  background:
    linear-gradient(180deg, rgba(41, 38, 30, 0.94), rgba(8, 8, 7, 0.92)),
    radial-gradient(circle at 90% 15%, rgba(207, 168, 93, 0.14), transparent 14rem);
}

.quest-banner h2 {
  margin: 0.28rem 0 0;
  color: #f4e2a9;
  font-size: clamp(1.05rem, 2vw, 1.55rem);
  line-height: 1.16;
  letter-spacing: 0;
  text-shadow: 0 2px 0 #000;
}

.quest-banner p {
  display: -webkit-box;
  max-height: 3.1rem;
  margin: 0.38rem 0 0;
  overflow: hidden;
  color: #c8bda3;
  line-height: 1.45;
  font-size: 0.82rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.stage-actors {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.player-character,
.npc-character {
  position: absolute;
  bottom: clamp(14rem, 24vh, 17rem);
  width: clamp(8rem, 13vw, 12rem);
  height: clamp(12rem, 21vw, 18rem);
  image-rendering: pixelated;
}

.player-character {
  left: clamp(8rem, 28vw, 28rem);
  transform: skewY(-7deg) scale(0.95);
}

.npc-character {
  right: clamp(8rem, 26vw, 27rem);
  transform: skewY(7deg);
  animation: npc-idle 2.4s steps(2, end) infinite;
}

.player-head,
.npc-head {
  position: absolute;
  left: 50%;
  width: 2.6rem;
  height: 2.6rem;
  transform: translateX(-50%);
  border: 1px solid #100d0a;
  background: #c79a72;
  box-shadow: inset -0.32rem -0.32rem 0 rgba(70, 43, 32, 0.28);
}

.player-head {
  top: 2.3rem;
}

.npc-head {
  top: 2.2rem;
  background: #b98663;
  z-index: 5;
}

.player-hair,
.npc-hair,
.npc-hat {
  position: absolute;
  left: 50%;
  z-index: 6;
  transform: translateX(-50%);
}

.player-hair {
  top: 1.75rem;
  width: 3.1rem;
  height: 1.15rem;
  background: #2e2b24;
  clip-path: polygon(0 40%, 18% 0, 86% 0, 100% 45%, 82% 100%, 10% 100%);
}

.npc-hair {
  top: 4.2rem;
  width: 4.6rem;
  height: 4.1rem;
  background: #353025;
  clip-path: polygon(16% 0, 84% 0, 100% 46%, 84% 100%, 18% 100%, 0 45%);
  z-index: 2;
}

.npc-hat {
  top: 1.4rem;
  width: 4.7rem;
  height: 1rem;
  border: 1px solid #1b130c;
  background: linear-gradient(180deg, #6b4b25, #26190d);
  clip-path: polygon(0 42%, 18% 10%, 82% 10%, 100% 42%, 74% 100%, 26% 100%);
}

.player-body,
.npc-body {
  position: absolute;
  left: 50%;
  top: 4.65rem;
  width: 3.8rem;
  height: 5.4rem;
  transform: translateX(-50%);
  border: 1px solid #0d0d0c;
  box-shadow:
    inset -0.45rem -0.45rem 0 rgba(0, 0, 0, 0.28),
    0 0.45rem 0 rgba(0, 0, 0, 0.32);
}

.player-body {
  background: linear-gradient(180deg, #3d5365, #1d2730);
}

.npc-body {
  background: linear-gradient(180deg, #5b4c32, #261c11);
  z-index: 3;
}

.player-body::before,
.npc-body::before {
  content: "";
  position: absolute;
  left: -1rem;
  top: 1.2rem;
  width: 1rem;
  height: 3.7rem;
  border: 1px solid #0d0d0c;
  background: inherit;
}

.player-body::after,
.npc-body::after {
  content: "";
  position: absolute;
  right: -1rem;
  top: 1.2rem;
  width: 1rem;
  height: 3.7rem;
  border: 1px solid #0d0d0c;
  background: inherit;
}

.backpack {
  position: absolute;
  left: 0.95rem;
  top: 0.9rem;
  width: 1.9rem;
  height: 2.7rem;
  border: 1px solid #120e0b;
  background: linear-gradient(180deg, #8f2e24, #421712);
}

.backpack span {
  display: none;
}

.speaker-badge {
  position: absolute;
  left: 50%;
  bottom: -2.05rem;
  transform: translateX(-50%);
  min-width: 4.8rem;
  padding: 0.22rem 0.42rem;
  border: 1px solid #6e5b3c;
  background: rgba(7, 7, 6, 0.88);
  color: var(--gold-hi);
  font-size: 0.68rem;
  font-weight: 850;
  text-align: center;
  text-shadow: 0 1px 0 #000;
}

.speech-icon {
  position: absolute;
  top: -0.1rem;
  left: 50%;
  z-index: 9;
  display: grid;
  place-items: center;
  min-width: 4.2rem;
  height: 1.55rem;
  padding: 0 0.45rem;
  transform: translateX(-50%);
  border: 1px solid #8c6b39;
  background: rgba(11, 10, 8, 0.92);
  color: var(--gold-hi);
  font-size: 0.9rem;
  font-weight: 850;
  text-shadow: 0 1px 0 #000;
}

.speech-icon::after {
  content: "NPC";
  position: absolute;
  top: -1.1rem;
  left: 50%;
  transform: translateX(-50%);
  color: #d6c7a2;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.npc-face::before,
.npc-face::after {
  content: "";
  position: absolute;
  top: 0.95rem;
  width: 0.38rem;
  height: 0.38rem;
  background: #1a100c;
}

.npc-face::before {
  left: 0.65rem;
}

.npc-face::after {
  right: 0.65rem;
}

.npc-head::after {
  content: "";
  position: absolute;
  left: 1.05rem;
  top: 1.62rem;
  width: 0.55rem;
  height: 0.18rem;
  background: #1a100c;
}

.npc-arm {
  display: none;
}

@keyframes npc-idle {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -0.18rem;
  }
}

.trainer-layout {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 9;
  display: grid;
  grid-template-columns: minmax(13rem, 20rem) minmax(0, 49rem);
  gap: 0.7rem;
  align-items: end;
  justify-content: center;
}

.coach-panel {
  display: grid;
  gap: 0.42rem;
  max-height: 17rem;
  overflow: auto;
  padding: 0.55rem;
  background: var(--black-glass);
}

.coach-block {
  padding: 0.46rem 0.5rem;
  border: 1px solid #4b3c2a;
  background: linear-gradient(180deg, rgba(39, 36, 29, 0.82), rgba(11, 10, 8, 0.88));
}

.coach-block p {
  margin: 0.24rem 0 0;
  color: #dfd1ac;
  line-height: 1.42;
  font-size: 0.78rem;
}

.quest-card {
  background: linear-gradient(180deg, rgba(55, 39, 26, 0.92), rgba(14, 10, 8, 0.92));
}

.word-stack,
.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.34rem;
}

.word-chip {
  padding: 0.18rem 0.38rem;
  border: 1px solid #5e6446;
  background: rgba(18, 26, 18, 0.86);
  color: #b5d08d;
  font-size: 0.68rem;
  font-weight: 850;
}

.source-links a {
  color: #9ec6d0;
  font-size: 0.68rem;
  font-weight: 800;
  text-decoration: none;
}

.source-links a:hover {
  color: var(--gold-hi);
}

.dialogue-panel {
  display: grid;
  gap: 0.4rem;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.partner-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  justify-self: start;
  min-width: min(32rem, 100%);
  padding: 0.48rem 0.72rem;
  border: 1px solid #6e5b3c;
  background: linear-gradient(180deg, rgba(37, 34, 27, 0.96), rgba(7, 7, 6, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 231, 150, 0.16),
    0 0 0 1px rgba(0, 0, 0, 0.78);
}

.partner-name {
  color: #f4e2a9;
  font-size: 1rem;
  font-weight: 850;
  text-shadow: 0 2px 0 #000;
}

.partner-role {
  margin-top: 0.08rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.voice-status {
  display: inline-block;
  margin-top: 0.32rem;
  padding: 0.12rem 0.32rem;
  border: 1px solid rgba(158, 198, 208, 0.42);
  background: rgba(21, 48, 56, 0.68);
  color: #bfe9ef;
  font-size: 0.64rem;
  font-weight: 850;
  text-transform: uppercase;
}

.voice-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.32rem;
  min-width: 9rem;
}

.speed-control {
  display: flex;
  gap: 0.24rem;
}

.control-button,
.speed-button {
  min-height: 1.75rem;
  padding: 0.18rem 0.42rem;
  background: linear-gradient(180deg, rgba(42, 41, 34, 0.96), rgba(10, 10, 9, 0.96));
  color: #d9cfb3;
  font-size: 0.64rem;
  font-weight: 850;
  line-height: 1;
}

.control-button.active,
.speed-button.active {
  border-color: var(--gold-hi);
  background: linear-gradient(180deg, rgba(84, 65, 34, 0.98), rgba(23, 17, 11, 0.98));
  color: #fff0bd;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 7.4rem;
  overflow: auto;
  padding: 0.72rem 0.82rem;
  border: 1px solid #6e5b3c;
  background:
    linear-gradient(180deg, rgba(13, 12, 10, 0.94), rgba(4, 4, 3, 0.94)),
    repeating-linear-gradient(0deg, transparent 0 19px, rgba(255, 255, 255, 0.025) 19px 20px);
  box-shadow:
    inset 0 1px 0 rgba(255, 231, 150, 0.14),
    0 0 0 1px rgba(0, 0, 0, 0.78),
    var(--shadow);
  scroll-behavior: smooth;
}

.message {
  display: grid;
  gap: 0.16rem;
}

.message-meta {
  color: #b38a4a;
  font-size: 0.68rem;
  font-weight: 850;
}

.message-bubble {
  color: #efe4c2;
  line-height: 1.38;
  font-size: 0.92rem;
  font-weight: 800;
}

.message.partner .message-bubble::before {
  content: '"';
  color: var(--gold-hi);
}

.message.partner .message-bubble::after {
  content: '"';
  color: var(--gold-hi);
}

.message.partner.caption-hidden .message-bubble {
  color: #d8cfb7;
  font-size: 0.86rem;
  font-weight: 700;
}

.message.partner.caption-hidden .message-bubble::before,
.message.partner.caption-hidden .message-bubble::after {
  content: "";
}

.message.user .message-meta {
  color: #82b7c4;
}

.message.user .message-bubble {
  color: #bfe9ef;
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.choice-grid.hidden {
  display: none;
}

.choice-button {
  min-height: 3.05rem;
  padding: 0.56rem 0.74rem;
  background: linear-gradient(180deg, rgba(43, 39, 30, 0.98), rgba(11, 10, 8, 0.98));
  color: #f2e0ab;
  line-height: 1.26;
  text-align: left;
  font-size: 0.84rem;
  font-weight: 850;
}

.choice-button::before {
  content: ">";
  display: inline-block;
  margin-right: 0.45rem;
  color: var(--gold-hi);
}

.choice-button:hover {
  transform: translateY(-1px);
  border-color: var(--gold-hi);
  background: linear-gradient(180deg, rgba(82, 58, 29, 0.98), rgba(21, 15, 9, 0.98));
}

.answer-dock {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.48rem;
  align-items: end;
}

.transcript-box {
  display: grid;
  gap: 0.18rem;
}

.transcript-box label {
  padding-left: 0.15rem;
  color: var(--gold-hi);
  font-size: 0.72rem;
  font-weight: 850;
  text-shadow: 0 1px 0 #000;
  text-transform: uppercase;
}

textarea {
  width: 100%;
  min-height: 3.35rem;
  max-height: 7rem;
  resize: vertical;
  padding: 0.62rem 0.72rem;
  outline: none;
  background: rgba(6, 6, 5, 0.9);
  color: #f5eccd;
  line-height: 1.34;
}

textarea:focus {
  border-color: var(--gold-hi);
}

.dock-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(3.8rem, 1fr));
  gap: 0.35rem;
}

.icon-button {
  min-height: 3.4rem;
  padding: 0 0.48rem;
  background: linear-gradient(180deg, rgba(49, 47, 37, 0.98), rgba(9, 9, 8, 0.98));
  color: #f2e0ab;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.icon-button:hover {
  transform: translateY(-1px);
  border-color: var(--gold-hi);
}

.icon-button.primary {
  background: linear-gradient(180deg, #7b512b, #28190e);
  color: #fff0bd;
}

.icon-button.is-listening {
  background: linear-gradient(180deg, #8f2e24, #2c0c09);
  color: #fff;
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.button-symbol {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
  .game-hud {
    grid-template-columns: 15rem minmax(0, 1fr);
  }

  .scene-stats {
    grid-column: 1 / -1;
    max-width: 23rem;
  }

  .scenario-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-picker {
    top: 10.7rem;
  }
}

@media (max-width: 820px) {
  body {
    overflow: auto;
  }

  .game-world {
    min-height: 100svh;
    padding-bottom: 0.75rem;
  }

  .game-hud,
  .scene-overlay,
  .team-picker,
  .trainer-layout {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    width: auto;
    margin: 0.65rem;
  }

  .game-hud {
    grid-template-columns: 1fr;
  }

  .scenario-list {
    grid-template-columns: 1fr 1fr;
  }

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

  .stage-actors {
    position: relative;
    height: 17rem;
  }

  .player-character,
  .npc-character {
    bottom: 1.5rem;
    width: 9rem;
    height: 13rem;
  }

  .player-character {
    left: 18%;
  }

  .npc-character {
    right: 18%;
  }

  .trainer-layout {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .coach-panel {
    max-height: none;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }

  .answer-dock {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 520px) {
  .scenario-list,
  .team-grid {
    grid-template-columns: 1fr;
  }

  .brand {
    min-height: 4rem;
  }

  .quest-banner p {
    max-height: 4.6rem;
    -webkit-line-clamp: 3;
  }

  .stage-actors {
    height: 14rem;
  }

  .player-character {
    left: 10%;
    transform: scale(0.82) skewY(-7deg);
  }

  .npc-character {
    right: 10%;
    transform: scale(0.82) skewY(7deg);
  }
}
