@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

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

:root {
  --green:  #33ff33;
  --yellow: #ffff33;
  --cyan:   #33ffff;
  --pink:   #ff33ff;
  --red:    #ff3333;
  --white:  #ffffff;
  --dim:    #888888;
  --bg:     #0a0a0a;
  --panel:  #111111;
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--green);
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  line-height: 1.8;
}

/* scanline overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,0.08) 3px,
    rgba(0,0,0,0.08) 4px
  );
  pointer-events: none;
  z-index: 999;
}

/* ── Layout ─────────────────────────────── */

.game-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.back-link {
  display: inline-block;
  color: var(--dim);
  text-decoration: none;
  font-size: 8px;
  margin-bottom: 32px;
  letter-spacing: 0.05em;
}
.back-link:hover { color: var(--green); }

/* ── Title ──────────────────────────────── */

.game-title {
  font-size: 20px;
  color: var(--yellow);
  text-align: center;
  margin-bottom: 8px;
  text-shadow: 0 0 16px var(--yellow), 3px 3px 0 #664400;
  letter-spacing: 0.08em;
}

.game-subtitle {
  font-size: 8px;
  color: var(--cyan);
  text-align: center;
  margin-bottom: 40px;
  letter-spacing: 0.1em;
}

/* ── Panel / box ────────────────────────── */

.panel {
  background: var(--panel);
  border: 3px solid var(--green);
  box-shadow: 0 0 0 1px #000, 4px 4px 0 var(--green);
  padding: 28px 32px;
  margin-bottom: 24px;
}

/* ── Score bar ──────────────────────────── */

.score-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
  font-size: 9px;
}

.score-item { color: var(--cyan); }
.score-item span { color: var(--yellow); }

.streak-item { color: var(--pink); }
.streak-item span { color: var(--white); }

/* ── Question ───────────────────────────── */

.question-number {
  font-size: 8px;
  color: var(--dim);
  margin-bottom: 16px;
  letter-spacing: 0.1em;
}

.question-text {
  font-size: 22px;
  color: var(--white);
  text-align: center;
  margin: 24px 0 32px;
  letter-spacing: 0.05em;
  text-shadow: 2px 2px 0 #333;
}

.question-text .blank {
  color: var(--cyan);
  border-bottom: 3px solid var(--cyan);
  padding: 0 4px;
}

/* ── Input ──────────────────────────────── */

.answer-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.answer-input {
  background: #000;
  border: 2px solid var(--green);
  color: var(--green);
  font-family: 'Press Start 2P', monospace;
  font-size: 18px;
  padding: 10px 16px;
  width: 160px;
  text-align: center;
  outline: none;
  box-shadow: 0 0 8px var(--green);
}

.answer-input:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 12px var(--yellow);
  color: var(--yellow);
}

/* ── Buttons ────────────────────────────── */

.btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  padding: 12px 20px;
  border: none;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: transform 0.05s, box-shadow 0.05s;
}

.btn:active { transform: translate(2px, 2px); box-shadow: none !important; }

.btn-green {
  background: var(--green);
  color: #000;
  box-shadow: 3px 3px 0 #006600;
}
.btn-green:hover { background: #55ff55; }

.btn-red {
  background: var(--red);
  color: #000;
  box-shadow: 3px 3px 0 #660000;
}
.btn-red:hover { background: #ff5555; }

.btn-yellow {
  background: var(--yellow);
  color: #000;
  box-shadow: 3px 3px 0 #666600;
}
.btn-yellow:hover { background: #ffff55; }

.btn-cyan {
  background: var(--cyan);
  color: #000;
  box-shadow: 3px 3px 0 #006666;
}
.btn-cyan:hover { background: #55ffff; }

/* ── Feedback ───────────────────────────── */

.feedback {
  text-align: center;
  font-size: 14px;
  min-height: 28px;
  margin: 20px 0;
  letter-spacing: 0.05em;
}

.feedback.correct { color: var(--green); text-shadow: 0 0 10px var(--green); }
.feedback.wrong   { color: var(--red);   text-shadow: 0 0 10px var(--red); }
.feedback.bonus   { color: var(--pink);  text-shadow: 0 0 10px var(--pink); }

/* ── Progress dots ──────────────────────── */

.progress-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.dot {
  width: 14px;
  height: 14px;
  background: #333;
  border: 2px solid #555;
}
.dot.correct { background: var(--green); border-color: var(--green); box-shadow: 0 0 6px var(--green); }
.dot.wrong   { background: var(--red);   border-color: var(--red); }
.dot.current { border-color: var(--yellow); animation: blink 0.8s step-end infinite; }

/* ── End screen ─────────────────────────── */

.end-screen { display: none; text-align: center; }
.end-screen.show { display: block; }

.end-title {
  font-size: 24px;
  color: var(--yellow);
  text-shadow: 0 0 20px var(--yellow), 3px 3px 0 #664400;
  margin-bottom: 24px;
  letter-spacing: 0.1em;
}

.money-display {
  font-size: 36px;
  color: var(--green);
  text-shadow: 0 0 24px var(--green), 4px 4px 0 #006600;
  margin: 24px 0;
}

.breakdown {
  font-size: 8px;
  color: var(--dim);
  line-height: 2.4;
  margin-bottom: 32px;
}

.breakdown .earned { color: var(--cyan); }

/* ── Reading word display ───────────────── */

.word-display {
  font-size: 48px;
  color: var(--white);
  text-align: center;
  margin: 32px 0;
  text-shadow: 0 0 20px var(--cyan), 4px 4px 0 #333;
  letter-spacing: 0.12em;
}

.read-buttons {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-top: 24px;
}

.read-btn {
  width: 80px;
  height: 80px;
  font-size: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid;
  cursor: pointer;
  background: #000;
  transition: transform 0.05s;
}

.read-btn:active { transform: scale(0.93); }

.read-btn.check {
  border-color: var(--green);
  color: var(--green);
  box-shadow: 0 0 12px var(--green);
}
.read-btn.check:hover { background: #002200; }

.read-btn.cross {
  border-color: var(--red);
  color: var(--red);
  box-shadow: 0 0 12px var(--red);
}
.read-btn.cross:hover { background: #220000; }

/* ── Spelling sentence ──────────────────── */

.sentence-display {
  font-size: 14px;
  color: var(--white);
  text-align: center;
  line-height: 2.2;
  margin: 20px 0 28px;
  min-height: 60px;
}

.loading-text {
  color: var(--dim);
  font-size: 9px;
  text-align: center;
  animation: blink 1s step-end infinite;
}

/* ── Animations ─────────────────────────── */

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

@keyframes flash-green {
  0%   { background: var(--green); }
  100% { background: var(--panel); }
}

.insert-coin {
  font-size: 9px;
  color: var(--yellow);
  text-align: center;
  animation: blink 1.2s step-end infinite;
  margin-top: 16px;
  letter-spacing: 0.1em;
}
