@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap');

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

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: #fafafa;
  color: #222;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

#app {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.header {
  padding: 16px 20px;
  background: white;
  border-bottom: 1px solid #e0e0e0;
  flex-shrink: 0;
}

.header h1 {
  font-size: 18px;
  font-weight: 700;
}

.header .subtitle {
  font-size: 13px;
  color: #666;
  margin-top: 4px;
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card h2 {
  font-size: 16px;
  margin-bottom: 12px;
  font-weight: 700;
}

.stat-bar {
  margin-bottom: 12px;
}

.stat-bar .label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
  color: #555;
}

.stat-bar .bar {
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.stat-bar .fill {
  height: 100%;
  background: #4CAF50;
  transition: width 0.3s ease;
  border-radius: 4px;
}

.stat-bar.warning .fill {
  background: #FF9800;
}

.stat-bar.danger .fill {
  background: #F44336;
}

.button {
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Noto Sans JP', sans-serif;
  touch-action: manipulation;
}

.button.primary {
  background: #222;
  color: white;
}

.button.primary:active {
  transform: scale(0.98);
  background: #111;
}

.button.secondary {
  background: white;
  color: #222;
  border: 1px solid #ddd;
}

.button.secondary:active {
  background: #f5f5f5;
}

.button-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.choice-card {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.choice-card:active {
  transform: scale(0.98);
  border-color: #222;
}

.choice-card.selected {
  border-color: #222;
  background: #fafafa;
}

.choice-card h3 {
  font-size: 15px;
  margin-bottom: 6px;
  font-weight: 600;
}

.choice-card p {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
}

.choice-card .effects {
  margin-top: 8px;
  font-size: 12px;
  color: #888;
}

.option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.option-item {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 12px;
}

.option-item label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
}

.option-item select,
.option-item input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-family: 'Noto Sans JP', sans-serif;
}

.result-screen {
  text-align: center;
}

.rank-display {
  font-size: 72px;
  font-weight: 700;
  margin: 20px 0;
  line-height: 1;
}

.rank-display.S { color: #FFD700; }
.rank-display.A { color: #4CAF50; }
.rank-display.B { color: #2196F3; }
.rank-display.C { color: #FF9800; }
.rank-display.D { color: #F44336; }

.score-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 20px 0;
}

.score-item {
  background: #f5f5f5;
  padding: 16px;
  border-radius: 6px;
}

.score-item .label {
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
}

.score-item .value {
  font-size: 24px;
  font-weight: 700;
}

.feedback {
  background: #f5f5f5;
  padding: 16px;
  border-radius: 6px;
  margin: 16px 0;
  text-align: left;
}

.feedback h3 {
  font-size: 14px;
  margin-bottom: 8px;
  font-weight: 600;
}

.feedback p {
  font-size: 13px;
  color: #555;
  line-height: 1.6;
}

.event-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.event-popup-content {
  background: white;
  border-radius: 12px;
  padding: 24px;
  max-width: 400px;
  width: 100%;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.event-popup h3 {
  font-size: 16px;
  margin-bottom: 12px;
  font-weight: 700;
}

.event-popup p {
  font-size: 14px;
  color: #555;
  line-height: 1.6;
  margin-bottom: 20px;
}

.phase-indicator {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.phase-dot {
  flex: 1;
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  transition: background 0.3s ease;
}

.phase-dot.active {
  background: #222;
}

.phase-dot.completed {
  background: #4CAF50;
}