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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Meiryo', sans-serif;
  background: #f5f6fa;
  color: #333;
  min-height: 100vh;
  padding: 16px;
}

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

h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 4px;
  text-align: center;
  padding-top: 16px;
}

.subtitle {
  text-align: center;
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 24px;
}

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

.label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

textarea {
  width: 100%;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  line-height: 1.6;
  color: #333;
  transition: border-color 0.2s;
  min-height: 160px;
}

textarea:focus {
  outline: none;
  border-color: #4a90d9;
}

.char-count {
  text-align: right;
  font-size: 0.82rem;
  color: #aaa;
  margin-top: 6px;
}

.speed-control {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

#speed-slider {
  flex: 1;
  height: 6px;
  appearance: none;
  -webkit-appearance: none;
  background: #e0e0e0;
  border-radius: 3px;
  cursor: pointer;
  accent-color: #4a90d9;
}

#speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #4a90d9;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(74,144,217,0.4);
}

#speed-number {
  width: 80px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 1rem;
  text-align: center;
  color: #333;
  transition: border-color 0.2s;
}

#speed-number:focus {
  outline: none;
  border-color: #4a90d9;
}

.speed-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-btn {
  flex: 1;
  min-width: 80px;
  padding: 7px 8px;
  border: 1.5px solid #d0d0d0;
  border-radius: 20px;
  background: #fff;
  color: #666;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.preset-btn:hover {
  border-color: #4a90d9;
  color: #4a90d9;
}

.preset-btn.active {
  background: #4a90d9;
  border-color: #4a90d9;
  color: #fff;
  font-weight: 600;
}

.result-card {
  background: linear-gradient(135deg, #4a90d9, #357abd);
  border-radius: 16px;
  padding: 28px 20px;
  text-align: center;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(74,144,217,0.3);
}

.result-label {
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.result-time {
  color: #fff;
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 8px;
}

.result-detail {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
}

.actions {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
}

.btn-primary, .btn-secondary {
  flex: 1;
  padding: 14px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}

.btn-primary {
  background: #4a90d9;
  color: #fff;
}

.btn-primary:hover {
  background: #357abd;
}

.btn-primary.copied {
  background: #27ae60;
}

.btn-secondary {
  background: #fff;
  color: #888;
  border: 1.5px solid #e0e0e0;
}

.btn-secondary:hover {
  border-color: #ccc;
  color: #555;
}

@media (max-width: 480px) {
  h1 { font-size: 1.35rem; }
  .result-time { font-size: 2rem; }
  .preset-btn { font-size: 0.75rem; padding: 6px 6px; }
  .speed-control { flex-direction: column; align-items: stretch; }
  #speed-slider { width: 100%; }
  #speed-number { width: 100%; }
}
