* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Comic Sans MS", "Microsoft JhengHei", sans-serif;
  background: linear-gradient(135deg, #a1c4fd, #c2e9fb);
}

.screen {
  background: white;
  border-radius: 24px;
  padding: 40px;
  width: 90%;
  max-width: 480px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

h1 {
  margin-top: 0;
  color: #2d5da1;
}

.subtitle {
  color: #666;
  margin-top: -8px;
}

.mode-list, .difficulty-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.difficulty-list {
  flex-direction: row;
  justify-content: center;
  margin-top: 24px;
}

button {
  font-family: inherit;
  font-size: 16px;
  padding: 14px 20px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  transition: transform 0.1s ease;
}

button:hover {
  transform: scale(1.04);
}

.mode-btn {
  background: #4f8ef7;
  color: white;
  font-weight: bold;
}

.mode-btn.disabled {
  background: #d9d9d9;
  color: #888;
  cursor: not-allowed;
}

.mode-btn.disabled:hover {
  transform: none;
}

.diff-btn {
  background: #eef2ff;
  color: #333;
  padding: 8px 16px;
}

.diff-btn.selected {
  background: #ffb84f;
  color: white;
  font-weight: bold;
}

#meta.low-time {
  color: #e74c3c;
}

.hud {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  color: #444;
  margin-bottom: 20px;
}

.word-card {
  background: #f2f6ff;
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 20px;
}

.hint {
  margin: 0 0 8px;
  color: #888;
}

#current-word {
  font-size: 42px;
  letter-spacing: 2px;
  color: #2d5da1;
  margin: 0;
}

.falling-zone {
  position: relative;
  height: 220px;
  background: linear-gradient(to bottom, #eaf4ff, #ffffff);
  border: 2px dashed #cfe0f5;
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 20px;
}

.falling-word {
  position: absolute;
  top: 0%;
  left: 50%;
  transform: translate(-50%, 0);
  text-align: center;
}

.fw-letters {
  font-size: 32px;
  font-weight: bold;
  letter-spacing: 2px;
  color: #2d5da1;
}

.fw-hint {
  margin-top: 4px;
  font-size: 14px;
  color: #888;
}

.falling-word.caught .fw-letters {
  color: #2ecc71;
}

.letter.correct {
  color: #2ecc71;
}

.letter.wrong {
  color: #e74c3c;
}

.ground-line {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 8px;
  border-bottom: 3px dashed #ffb84f;
}

#typing-input {
  width: 100%;
  font-size: 20px;
  padding: 12px;
  border-radius: 12px;
  border: 2px solid #ccc;
  text-align: center;
}

#typing-input:focus {
  outline: none;
  border-color: #4f8ef7;
}

#feedback {
  min-height: 24px;
  font-weight: bold;
  font-size: 18px;
}

#feedback.correct {
  color: #2ecc71;
}

#feedback.wrong {
  color: #e74c3c;
}

#quit-btn, #replay-btn, #back-btn {
  margin-top: 16px;
  background: #eef2ff;
  color: #333;
}

.word-card.shake {
  animation: shake 0.3s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}
