:root {
  --bg: #1a1a2e;
  --bg-card: #16213e;
  --text: #e0e0e0;
  --text-dim: #888;
  --accent-income: #4ecca3;
  --accent-efficiency: #7b68ee;
  --accent-investment: #ff6b6b;
  --gold: #ffd700;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 1rem;
}

/* --- 資源表示 --- */

#resource-display {
  text-align: center;
  padding: 2rem 0 1.5rem;
}

#resource-amount {
  font-size: 3rem;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

#resource-unit {
  font-size: 1.2rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

#rate-display {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
}

/* --- 選択肢カード --- */

#choices {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.choice-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.2rem;
  border-left: 4px solid transparent;
  transition: box-shadow 0.3s;
  opacity: 0.6;
}

.choice-card.affordable {
  opacity: 1;
}

.choice-card[data-type="income"] {
  border-left-color: var(--accent-income);
}
.choice-card[data-type="efficiency"] {
  border-left-color: var(--accent-efficiency);
}
.choice-card[data-type="investment"] {
  border-left-color: var(--accent-investment);
}

.choice-card.affordable[data-type="income"] {
  box-shadow: 0 0 12px rgba(78, 204, 163, 0.25);
}
.choice-card.affordable[data-type="efficiency"] {
  box-shadow: 0 0 12px rgba(123, 104, 238, 0.25);
}
.choice-card.affordable[data-type="investment"] {
  box-shadow: 0 0 12px rgba(255, 107, 107, 0.25);
}

.choice-name {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 0.3rem;
}

.choice-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
}

.choice-cost {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.8rem;
}

.buy-button {
  width: 100%;
  padding: 0.6rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  background: #333;
  color: #555;
  transition: background 0.2s, color 0.2s;
}

.buy-button:not(:disabled) {
  background: var(--accent-income);
  color: #000;
  font-weight: bold;
}

.choice-card[data-type="efficiency"] .buy-button:not(:disabled) {
  background: var(--accent-efficiency);
  color: #fff;
}

.choice-card[data-type="investment"] .buy-button:not(:disabled) {
  background: var(--accent-investment);
  color: #fff;
}

/* --- フッター --- */

#status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #333;
}

#stage-display {
  font-size: 0.9rem;
  color: var(--text-dim);
}

#reset-button {
  background: none;
  border: 1px solid #555;
  color: #555;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
}

#reset-button:hover {
  border-color: var(--accent-investment);
  color: var(--accent-investment);
}

/* --- オーバーレイ --- */

#overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  z-index: 100;
  transition: opacity 0.3s;
}

#overlay.hidden {
  display: none;
}

#overlay-text {
  font-size: 2rem;
  font-weight: bold;
  text-align: center;
  padding: 1rem;
  white-space: pre-line;
}

/* --- アニメーション --- */

@keyframes unit-up {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.15); color: var(--gold); }
  100% { transform: scale(1); }
}

.unit-up {
  animation: unit-up 0.6s ease;
}

@keyframes flash-gain {
  0%   { opacity: 1; }
  100% { opacity: 0; transform: translateY(-20px); }
}
