:root {
  --grid-line: #c9d8ea;
  --desk: #eef2f6;
  --ink: #2b2b2b;
  --right: #1f8f4e;
  --wrong: #c62828;
  --accent: #3a5a8c;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Patrick Hand', system-ui, sans-serif;
  color: var(--ink);
}

.desk {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-color: var(--desk);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 28px 28px;
}

.paper {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 560px;
  background: #fffdf8;
  border-radius: 2px;
  box-shadow:
    0 1px 2px rgba(0,0,0,0.08),
    0 8px 24px rgba(0,0,0,0.15),
    0 24px 48px rgba(0,0,0,0.12);
  transform: rotate(-0.6deg);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.paper::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 35px,
    rgba(58, 90, 140, 0.12) 36px
  );
  background-position: 0 100px;
}

.loading {
  margin: auto;
  font-size: 1.4rem;
  color: #888;
}

/* ---- Header ---- */

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: 'Caveat', cursive;
  margin-bottom: 18px;
  z-index: 1;
}

.category-label {
  font-size: 1.3rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.progress-label {
  font-size: 1.2rem;
  color: #888;
}

/* ---- Prompt ---- */

.prompt-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 8px;
  z-index: 1;
}

.verb-hint {
  font-family: 'Caveat', cursive;
  font-size: 1.4rem;
  color: var(--accent);
}

.prompt-text {
  font-size: 2.1rem;
  line-height: 1.3;
}

/* ---- Options ---- */

.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
  z-index: 1;
}

.option-btn {
  font-family: inherit;
  font-size: 1.3rem;
  padding: 14px 10px;
  background: #fff;
  border: 2px solid var(--accent);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease;
}

.option-btn:hover {
  background: #eef4ff;
}

.option-btn:active {
  transform: scale(0.97);
}

.option-btn:disabled {
  cursor: default;
}

.option-key {
  font-family: 'Caveat', cursive;
  font-size: 1rem;
  color: #999;
  margin-right: 6px;
}

/* ---- Score bar ---- */

.score-bar {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 18px;
  font-family: 'Caveat', cursive;
  font-size: 1.3rem;
  z-index: 1;
}

.score-right { color: var(--right); }
.score-wrong { color: var(--wrong); }

/* ---- Feedback stamp ---- */

.stamp {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  z-index: 2;
}

.stamp.show {
  animation: stamp-pop 0.4s ease forwards;
}

.stamp-mark {
  font-family: 'Caveat', cursive;
  font-weight: 700;
  font-size: 6rem;
  transform: rotate(-12deg);
}

.stamp.right .stamp-mark {
  color: var(--right);
}

.stamp.wrong .stamp-mark {
  color: var(--wrong);
}

@keyframes stamp-pop {
  0%   { opacity: 0; transform: scale(1.4); }
  25%  { opacity: 1; transform: scale(1); }
  75%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1); }
}

/* ---- Summary screen ---- */

.summary {
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.summary h1 {
  font-family: 'Caveat', cursive;
  font-size: 2.6rem;
  color: var(--accent);
  margin: 0 0 4px;
  text-align: center;
}

.summary .accuracy {
  text-align: center;
  font-size: 1.4rem;
  margin-bottom: 20px;
}

.summary .stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  font-family: 'Caveat', cursive;
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.summary .breakdown {
  margin-bottom: 16px;
}

.summary .breakdown h2,
.summary .missed h2 {
  font-family: 'Caveat', cursive;
  font-size: 1.5rem;
  color: var(--accent);
  margin: 0 0 6px;
}

.summary ul {
  margin: 0;
  padding-left: 20px;
  font-size: 1.05rem;
  line-height: 1.5;
}

.missed {
  flex: 1;
  overflow-y: auto;
}

.play-again {
  margin-top: 18px;
  align-self: center;
  font-family: 'Caveat', cursive;
  font-size: 1.5rem;
  font-weight: 700;
  padding: 10px 28px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.play-again:hover {
  filter: brightness(1.1);
}

@media (max-width: 520px) {
  .paper {
    min-height: 90vh;
    padding: 24px 18px;
  }
  .prompt-text {
    font-size: 1.7rem;
  }
}
