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

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: #fff;
  color: #222;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#app {
  width: 100%;
  max-width: 500px;
  text-align: center;
}

h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

h2 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

p {
  font-size: 1rem;
  color: #666;
  margin-bottom: 2rem;
}

.disclaimer {
  font-size: 0.875rem;
  color: #999;
  background: #f5f5f5;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 2rem;
  line-height: 1.5;
}

button {
  background: #222;
  color: #fff;
  border: none;
  padding: 1rem 2.5rem;
  font-size: 1.125rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, opacity 0.15s;
}

button:active {
  transform: scale(0.98);
}

button:hover {
  opacity: 0.9;
}

.hidden {
  display: none !important;
}

/* Test Screen */
#progress {
  font-size: 0.875rem;
  color: #999;
  margin-bottom: 2rem;
}

#phrase-display {
  background: #f5f5f5;
  padding: 2rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#phrase-text {
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 2;
  color: #222;
  margin: 0;
}

#phrase-text ruby {
  ruby-align: center;
}

#phrase-text rt {
  font-size: 0.6em;
  color: #666;
}

.record-btn {
  background: #222;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  padding: 0;
  transition: transform 0.15s, background 0.15s;
}

.record-btn.recording {
  background: #dc3545;
}

.mic-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.btn-text {
  font-size: 0.875rem;
}

#recording-status {
  color: #dc3545;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.pulse {
  width: 12px;
  height: 12px;
  background: #dc3545;
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Result Screen */
.score-circle {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: #222;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2rem;
  position: relative;
}

#score-number {
  font-size: 3.5rem;
  font-weight: 700;
}

.score-label {
  font-size: 1.25rem;
  margin-top: -0.5rem;
}

#result-message {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 2rem;
  color: #222;
}

#detail-results {
  text-align: left;
  margin-bottom: 2rem;
}

.result-item {
  background: #f5f5f5;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

.result-phrase {
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #222;
  line-height: 2;
}

.result-phrase ruby {
  ruby-align: center;
}

.result-phrase rt {
  font-size: 0.6em;
  color: #666;
}

.result-score {
  font-size: 0.875rem;
  color: #666;
}

.result-score.correct {
  color: #28a745;
}

.result-score.incorrect {
  color: #dc3545;
}

#retry-btn {
  margin-top: 1rem;
}

#recognized-text {
  background: #e8f4f8;
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1.5rem;
  min-height: 50px;
  font-size: 1.125rem;
  color: #222;
  line-height: 1.5;
}

.result-spoken {
  font-size: 0.875rem;
  color: #666;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

#recognized-text {
  background: #e8f4f8;
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1.5rem;
  min-height: 50px;
  font-size: 1.125rem;
  color: #222;
  line-height: 1.5;
}

#recognition-status {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  margin-top: 1rem;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s;
}

#recognition-status.recognition-waiting {
  background: #f5f5f5;
  color: #999;
}

#recognition-status.recognition-ok {
  background: #d4edda;
  color: #28a745;
}