.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.progress-row {
  margin: 8px 0 18px;
}

.progress-row:last-child {
  margin-bottom: 0;
}

.progress-row__head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #cbd5e1;
  font-size: 14px;
}

.progress-row__head strong {
  color: #f8fafc;
}

.progress-bar {
  height: 14px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6, #6366f1);
}

.stat-card,
.game-card,
.result-card {
  background: rgba(15, 23, 42, 0.76);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(14px);
}

.stat-card {
  padding: 18px;
  border-radius: 20px;
}

.stat-card span {
  display: block;
  color: #94a3b8;
  font-size: 13px;
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
}

.game-card {
  padding: 36px;
  border-radius: 28px;
  text-align: center;
}

.label {
  margin: 0;
  color: #94a3b8;
  font-size: 14px;
}

#japanese {
  margin: 10px 0 16px;
  font-size: clamp(34px, 7vw, 76px);
}

.hidden-word {
  min-height: 34px;
  margin: 0 0 22px;
  color: #facc15;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.hidden-word span {
  display: inline-block;
  margin: 0 2px;
  text-shadow: 0 0 12px currentColor;
}

.input-wrapper {
  position: relative;
  width: min(620px, 100%);
  margin: 0 auto;
  background: #f8fafc;
  border-radius: 18px;
  border: 2px solid transparent;
}

.input-wrapper:focus-within {
  border-color: #60a5fa;
}

#input {
  width: 100%;
  padding: 18px 20px;
  font-size: 28px;
  text-align: center;
  border: none;
  outline: none;
  background: transparent;
  color: transparent;
  caret-color: #0f172a;
  position: relative;
  z-index: 2;
}

#input::placeholder {
  color: #94a3b8;
}

.typed-preview {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 20px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.08em;
  pointer-events: none;
  z-index: 1;
}

.typed-preview span {
  display: inline-block;
  margin: 0 2px;
  text-shadow: 0 0 10px currentColor;
}

.message {
  min-height: 30px;
  margin: 20px 0;
  font-size: 20px;
  font-weight: 700;
}

.message.correct {
  color: #22c55e;
}

.message.wrong {
  color: #f87171;
  animation: shake 0.18s ease-in-out;
}

.message.finished {
  color: #facc15;
}

button {
  padding: 13px 24px;
  border: none;
  border-radius: 999px;
  background: #3b82f6;
  color: white;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: #2563eb;
}

.result-card {
  margin-top: 20px;
  padding: 24px;
  border-radius: 24px;
}

.result-card h3 {
  margin-top: 0;
}

.word-list {
  display: grid;
  gap: 10px;
}

.word-item {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(30, 41, 59, 0.9);
  color: #cbd5e1;
}

.word-item strong {
  color: #f8fafc;
}

.muted {
  color: #94a3b8;
  margin: 8px 0 0;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 18px;
}

.profile-avatar {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  font-size: 28px;
  font-weight: 800;
}

.profile-email {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  word-break: break-all;
}

@keyframes shake {
  0% { transform: translateX(0); }
  30% { transform: translateX(-8px); }
  60% { transform: translateX(8px); }
  100% { transform: translateX(0); }
}

#wordSearch {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: 14px;
  border: none;
  outline: none;
  font-size: 16px;
}