:root {
  color-scheme: dark;
  --bg: #101729;
  --panel: #1b2440;
  --panel-border: #3e4f80;
  --text: #eef4ff;
  --muted: #a7b4d6;
  --accent: #60b5ff;
  --ok: #64d892;
  --warn: #f0bf58;
  --danger: #ff6c83;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  background: radial-gradient(circle at top, #1c2b57, var(--bg) 70%);
  color: var(--text);
}

.app {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 12px 12px 28px;
  display: grid;
  gap: 12px;
}

.panel {
  background: rgba(27, 36, 64, 0.92);
  border: 2px solid var(--panel-border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.32);
}

.title-panel h1 {
  margin: 0.2rem 0 0;
  font-size: clamp(1.2rem, 4vw, 1.8rem);
  line-height: 1.3;
}

.subtitle {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.hidden {
  display: none;
}

.status-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.92rem;
  color: #d5e3ff;
}

.status-grid {
  display: grid;
  gap: 10px;
}

.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 0.92rem;
}

.gauge {
  height: 10px;
  border-radius: 999px;
  background: #0f1320;
  overflow: hidden;
}

.gauge span {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width 0.25s ease;
}

#qualityGauge {
  background: linear-gradient(90deg, #4cd8a8, #67f8bd);
}

#costGauge {
  background: linear-gradient(90deg, #56a5ff, #84cbff);
}

#deliveryGauge {
  background: linear-gradient(90deg, #ff9e5a, #ffd36f);
}

.screen-panel {
  min-height: 54vh;
}

.start-screen,
.game-screen,
.result-screen {
  display: grid;
  gap: 12px;
}

.story {
  margin: 0;
  line-height: 1.7;
}

.bullet-list {
  margin: 0;
  padding-left: 1.2rem;
  color: #d7e4ff;
  line-height: 1.6;
}

.battle-card {
  border: 2px dashed #5b73b5;
  border-radius: 12px;
  padding: 12px;
  background: rgba(17, 23, 43, 0.55);
}

.enemy {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.enemy-desc {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.rule-box {
  background: rgba(11, 16, 33, 0.84);
  border: 1px solid #344466;
  border-radius: 12px;
  padding: 10px;
  color: #d6e2ff;
  line-height: 1.55;
}

.actions-grid {
  display: grid;
  gap: 10px;
}

.btn {
  appearance: none;
  border: 2px solid #7ea4ef;
  background: #2f4f93;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 12px;
  padding: 12px;
  text-align: left;
  min-height: 54px;
}

.btn.primary {
  background: #1b73d6;
  border-color: #8ec4ff;
  text-align: center;
}

.btn:active {
  transform: translateY(1px);
}

.btn small {
  display: block;
  margin-top: 4px;
  font-weight: 400;
  color: #d8e5ff;
}

.notice {
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.92rem;
  line-height: 1.45;
  background: rgba(16, 44, 85, 0.75);
}

.notice.warn {
  background: rgba(82, 58, 7, 0.72);
}

.notice.bad {
  background: rgba(85, 20, 38, 0.72);
}

.log-list {
  margin: 0;
  padding-left: 1.1rem;
  line-height: 1.55;
  color: #d6e1ff;
}

.summary-box {
  background: rgba(13, 20, 38, 0.82);
  border: 1px solid #415586;
  border-radius: 10px;
  padding: 10px;
}

.summary-box p {
  margin: 0;
  line-height: 1.6;
}

@media (min-width: 720px) {
  .actions-grid {
    grid-template-columns: 1fr 1fr;
  }
}
