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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7fa;
  color: #333;
  min-height: 100vh;
  padding: 16px;
}

.container {
  max-width: 600px;
  margin: 0 auto;
}

h1 {
  font-size: 1.4rem;
  text-align: center;
  margin-top: 12px;
  color: #1a1a2e;
}

.subtitle {
  text-align: center;
  font-size: 0.85rem;
  color: #888;
  margin: 4px 0 20px;
}

/* カード */
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 480px) {
  .cards {
    grid-template-columns: 1fr;
  }
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  border-top: 4px solid #ccc;
}

.car-card {
  border-top-color: #2196F3;
}

.train-card {
  border-top-color: #4caf50;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.card-header h2 {
  font-size: 1rem;
  font-weight: 700;
}

.icon {
  font-size: 1.3rem;
}

/* フィールド */
.field {
  margin-bottom: 10px;
}

.field label {
  display: block;
  font-size: 0.78rem;
  color: #666;
  margin-bottom: 3px;
}

.field input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.field input:focus {
  outline: none;
  border-color: #2196F3;
}

.subtotal {
  margin-top: 10px;
  padding: 8px 10px;
  background: #f0f4ff;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
  text-align: right;
}

.train-card .subtotal {
  background: #f0fff4;
}

/* 比較ボタン */
.compare-btn {
  width: 100%;
  padding: 14px;
  background: #2196F3;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 16px;
}

.compare-btn:hover {
  background: #1976D2;
}

.compare-btn:active {
  background: #1565C0;
}

/* 結果エリア */
.result-area {
  margin-bottom: 12px;
}

.result-box {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.09);
  text-align: center;
  border-left: 6px solid #ccc;
}

.result-box.car-wins {
  border-left-color: #2196F3;
  background: #f0f7ff;
}

.result-box.train-wins {
  border-left-color: #4caf50;
  background: #f0fff4;
}

.result-box.tie {
  border-left-color: #ff9800;
  background: #fff8f0;
}

.winner {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.diff {
  font-size: 1rem;
  color: #555;
  margin-bottom: 10px;
}

.detail {
  font-size: 0.85rem;
  color: #888;
  line-height: 1.6;
}

/* リセットボタン */
.reset-btn {
  width: 100%;
  padding: 10px;
  background: #fff;
  color: #999;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}

.reset-btn:hover {
  background: #f5f5f5;
}
