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

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

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

h1 {
  text-align: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
  color: #1a365d;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.card h2 {
  font-size: 0.85rem;
  font-weight: 600;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

#entryTime {
  flex: 1;
  font-size: 1.5rem;
  font-weight: 700;
  padding: 8px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  color: #2d3748;
  text-align: center;
}

#entryTime:focus {
  outline: none;
  border-color: #3182ce;
}

#setNowBtn {
  padding: 10px 14px;
  background: #ebf8ff;
  color: #2b6cb0;
  border: 1px solid #bee3f8;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}

#setNowBtn:hover {
  background: #bee3f8;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.settings-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-grid span {
  font-size: 0.78rem;
  color: #718096;
}

.settings-grid input {
  padding: 8px 10px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: #2d3748;
  text-align: center;
}

.settings-grid input:focus {
  outline: none;
  border-color: #3182ce;
}

.result-card {
  background: #1a365d;
  color: #fff;
}

.result-card .result-main {
  display: flex;
  justify-content: space-around;
  margin-bottom: 14px;
}

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

.result-label {
  font-size: 0.78rem;
  color: #90cdf4;
  margin-bottom: 4px;
}

.result-value {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
}

.free-time-box {
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}

.free-time-box.over {
  background: rgba(245, 101, 101, 0.3);
}

.free-label {
  font-size: 0.78rem;
  color: #90cdf4;
  margin-bottom: 2px;
}

.free-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #68d391;
}

.free-value.over {
  color: #fc8181;
}

.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.btn-primary {
  flex: 1;
  padding: 14px;
  background: #3182ce;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary:hover {
  background: #2b6cb0;
}

.btn-primary.running {
  background: #e53e3e;
}

.btn-primary.running:hover {
  background: #c53030;
}

.btn-secondary {
  padding: 14px 20px;
  background: #e2e8f0;
  color: #4a5568;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary:hover {
  background: #cbd5e0;
}

@media (max-width: 400px) {
  h1 {
    font-size: 1.2rem;
  }

  .result-value {
    font-size: 1.6rem;
  }

  .free-value {
    font-size: 1.3rem;
  }
}
