* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: radial-gradient(circle at 18% 12%, #fff1f7 0%, #e9f1ff 42%, #e7fbf3 100%);
  color: #232838;
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.app__title {
  margin: 0;
  font-size: clamp(20px, 5.5vw, 26px);
  letter-spacing: -0.02em;
  color: #24306a;
}

.app__hint {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #5a6178;
}

.word {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: linear-gradient(140deg, #ffffff 0%, #f2f8ff 100%);
  border: 1px solid #cfe0ff;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(64, 110, 220, 0.14);
}

.word__label {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd76e 0%, #ffa8c9 100%);
  color: #6b2d4a;
  font-size: 12px;
  font-weight: 700;
}

.word__text {
  font-size: clamp(22px, 7vw, 30px);
  letter-spacing: -0.01em;
  color: #1f2a52;
}

.card {
  position: relative;
  min-height: 150px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(160deg, #fffdf6 0%, #ffeed8 100%);
  border: 1px solid #ffdca8;
  box-shadow: 0 12px 26px rgba(64, 110, 220, 0.16);
}

.card__answer {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px 22px;
  text-align: center;
  font-size: clamp(16px, 4.6vw, 21px);
  font-weight: 700;
  line-height: 1.45;
  color: #4a3410;
  word-break: keep-all;
}

.card__scratch {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  display: block;
  cursor: crosshair;
  touch-action: none;
  transition: opacity 0.45s ease;
  -webkit-user-select: none;
  user-select: none;
}

.card__scratch.is-revealed {
  opacity: 0;
  pointer-events: none;
}

.card__done {
  position: absolute;
  left: 12px;
  bottom: 10px;
  z-index: 3;
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #22c55e 0%, #14b8a6 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}

.status {
  margin: 0;
  min-height: 20px;
  font-size: 13px;
  color: #5a6178;
}

.status.is-error {
  color: #b3261e;
  font-weight: 700;
}

.controls {
  display: flex;
  gap: 10px;
}

.btn {
  flex: 1 1 0;
  padding: 13px 16px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f7bff 0%, #8a5bff 100%);
  box-shadow: 0 6px 16px rgba(79, 123, 255, 0.28);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn--ghost {
  background: #ffffff;
  color: #4f5bd0;
  border: 1px solid #b9c4ea;
  box-shadow: 0 6px 16px rgba(79, 123, 255, 0.12);
}

.btn:not(:disabled):active {
  transform: scale(0.98);
}

.btn:not(:disabled):hover {
  filter: brightness(1.06);
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
}

@media (max-height: 560px) {
  .app__hint {
    display: none;
  }

  .card,
  .card__answer {
    min-height: 120px;
  }
}
