body {
  margin: 0;
  font-family: "Noto Sans TC", Arial, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
}

.app {
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px;
}

header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

header h1,
header #progress {
  margin: 0;
}

.bgm-controls {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 92px;
}

#bgm-toggle {
  width: auto;
  font-size: 0.95rem;
  padding: 6px 10px;
}

.vertical-volume {
  writing-mode: bt-lr;
  -webkit-appearance: slider-vertical;
  appearance: slider-vertical;
  width: 26px;
  height: 130px;
}

.bgm-volume-label {
  font-size: 0.85rem;
  opacity: 0.9;
}

.traits-audio-layout {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.traits-block {
  flex: 1 1 auto;
  min-width: 0;
}

.traits-block h3 {
  margin: 0;
  margin-bottom: 8px;
}

.game-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.game-layout .panel {
  flex: 1 1 620px;
  margin: 12px 0 20px;
}

.traits-section {
  flex: 0 0 260px;
  margin: 12px 0 20px;
}

.panel {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 16px;
  margin: 12px 0 20px;
}

.options {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.options button {
  font-size: 1.3rem;
  line-height: 1.75;
}

.scene-story-layout {
  display: grid;
  grid-template-columns: minmax(460px, 1.25fr) minmax(420px, 1.1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 12px;
}

.story-block p {
  margin-top: 0;
  font-size: 1.35rem;
  line-height: 1.9;
}

.story-block {
  max-height: 520px;
  overflow-y: auto;
  padding-right: 6px;
}

.panel h3 {
  font-size: 1.45rem;
  line-height: 1.5;
}

.intro-screen {
  display: grid;
  gap: 16px;
}

.intro-title {
  text-align: center;
  margin: 0;
  font-size: 2rem;
}

.intro-carousel img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #334155;
  display: block;
}

.intro-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

button {
  background: #334155;
  color: #f8fafc;
  border: 1px solid #475569;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  font-size: 1.05rem;
}

button:hover { background: #475569; }

.traits {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.trait {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 10px;
  width: 75%;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }

  .game-layout {
    flex-direction: column;
  }

  .scene-story-layout {
    grid-template-columns: 1fr;
  }

  .traits-audio-layout {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }

  .vertical-volume {
    height: 110px;
  }

  .story-block {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .story-block p {
    font-size: 1.55rem !important;
    line-height: 2 !important;
  }

  .panel h3 {
    font-size: 1.65rem !important;
    line-height: 1.6 !important;
  }

  .options button {
    font-size: 1.55rem !important;
    line-height: 1.9 !important;
    padding: 14px 16px !important;
  }

  .game-layout .panel,
  .traits-section {
    flex: 1 1 auto;
    width: 100%;
  }
}
