/* ═══════════════════════════════════════════
   LAYOUT — shared chrome, title, subject grid
═══════════════════════════════════════════ */

.screen-header {
  background: #2A2A2A;
  border-bottom: 4px solid var(--mc-border);
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.screen-body {
  padding: 1rem;
  overflow-y: auto;
  flex: 1;
}

.section-title {
  font-size: 0.65rem;
  color: var(--mc-gold);
  margin-bottom: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.player-badge {
  font-size: 0.55rem;
  color: var(--mc-emerald);
}

/* ═══════════════════════════════════════════
   TITLE SCREEN
═══════════════════════════════════════════ */
#screen-title {
  background: linear-gradient(180deg, #1E5A1E 0%, #0D2B0D 50%, #5B3A1A 100%);
  align-items: center;
  justify-content: center;
}

.title-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  width: 100%;
  max-width: 520px;
}

.title-logo {
  text-align: center;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6));
}

.logo-block {
  font-size: 3rem;
  display: inline-block;
  background: var(--mc-grass);
  border: 4px solid var(--mc-border);
  box-shadow: inset -4px -4px 0 rgba(0,0,0,0.4), inset 4px 4px 0 rgba(255,255,255,0.2);
  width: 80px; height: 80px;
  line-height: 80px;
  text-align: center;
  margin-bottom: 0.5rem;
}

.game-title {
  font-size: 1.6rem;
  text-shadow:
    3px 3px 0 var(--mc-border),
    -1px -1px 0 var(--mc-border);
  color: var(--mc-gold);
  letter-spacing: 0.05em;
  line-height: 1.4;
}

.game-title-sm {
  font-size: 1.0rem;
}
.game-subtitle {
  font-size: 0.55rem;
  color: var(--mc-text-dim);
  margin-top: 0.3rem;
  letter-spacing: 0.1em;
}

.title-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: stretch;
}

.player-greeting {
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
  color: #69f0ae;
  margin: 0 0 0.4rem;
  line-height: 1.4;
  text-align: center;
}
.player-greeting.hidden { display: none !important; }

.title-grass-row {
  display: flex;
  gap: 0.5rem;
  font-size: 1.5rem;
  animation: sway 3s ease-in-out infinite;
}
.grass-icon:nth-child(even) { animation: sway2 2.5s ease-in-out infinite; }

@keyframes sway { 0%,100%{transform:rotate(-5deg)} 50%{transform:rotate(5deg)} }
@keyframes sway2 { 0%,100%{transform:rotate(5deg)} 50%{transform:rotate(-5deg)} }

/* ═══════════════════════════════════════════
   SUBJECT SELECT SCREEN
═══════════════════════════════════════════ */
#screen-subject {
  background: linear-gradient(160deg, #0A130A 0%, #0F220F 45%, #091409 100%);
  align-items: center;
  justify-content: center;
}

.subject-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
  padding: 1.5rem 1rem;
  width: 100%;
  max-width: 580px;
}

.subject-tagline {
  font-size: 0.55rem;
  color: #6A9A6A;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.subject-grade-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin: 0.15rem 0 0.35rem;
  width: 100%;
  max-width: 20rem;
}

.subject-grade-label {
  font-family: var(--font-vt);
  font-size: 1.15rem;
  color: var(--mc-gold);
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.subject-grade-select {
  font-family: var(--font-vt);
  font-size: 1.2rem;
  line-height: 1.2;
  background: #1A1A1A;
  color: #c8e6c9;
  border: 3px solid #4a6a4a;
  padding: 0.55rem 1rem;
  min-width: 11rem;
  min-height: 2.5rem;
  border-radius: 4px;
  cursor: pointer;
  outline: none;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.35);
}

.subject-grade-select option {
  font-family: var(--font-vt);
  font-size: 1.15rem;
  padding: 0.4rem 0.6rem;
  background: #141a14;
  color: #e8f5e9;
}

.subject-grade-hint {
  margin: 0;
  padding: 0 0.5rem;
  font-family: var(--font-vt);
  font-size: 0.95rem;
  line-height: 1.25;
  color: #6a8f6a;
  text-align: center;
}

.subject-grade-select:focus {
  border-color: var(--mc-grass);
  box-shadow: 0 0 0 2px rgba(23, 221, 98, 0.25);
}

.subject-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  width: 100%;
}

.subject-card {
  background: linear-gradient(160deg, #182818 0%, #0F1F0F 100%);
  border: 3px solid #2A4A2A;
  box-shadow:
    inset -3px -3px 0 #060E06,
    inset 3px 3px 0 #3A6A3A,
    0 4px 16px rgba(0,0,0,0.5);
  padding: 1.4rem 0.8rem 1.2rem;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.14s;
  position: relative;
  border-radius: 2px;
}
.subject-card:hover:not(.disabled) {
  border-color: var(--mc-emerald);
  box-shadow:
    inset -3px -3px 0 #060E06,
    inset 3px 3px 0 var(--mc-emerald),
    0 0 18px rgba(23,221,98,0.25),
    0 6px 20px rgba(0,0,0,0.5);
  transform: translateY(-5px);
}
.subject-card.disabled { opacity: 0.35; cursor: not-allowed; }
.subject-card:focus-visible { outline: 3px solid var(--mc-gold); outline-offset: 2px; }

.subject-icon { font-size: 2.4rem; margin-bottom: 0.6rem; display: block; }
.subject-name { font-size: 0.6rem; color: var(--mc-gold); margin-bottom: 0.5rem; letter-spacing: 0.06em; }
.subject-desc {
  font-family: var(--font-vt);
  font-size: 1rem;
  color: #7AAA7A;
  line-height: 1.5;
}
.subject-soon-badge {
  position: absolute;
  top: 0.3rem; right: 0.3rem;
  font-size: 0.38rem;
  background: #8B0000;
  color: #FF9090;
  padding: 2px 5px;
  border: 1px solid #FF3030;
}

/* ═══════════════════════════════════════════
   STATS SCREEN
═══════════════════════════════════════════ */
#screen-stats { background: linear-gradient(180deg, #0D2B0D 0%, #152515 100%); }

.stats-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  text-align: center;
  margin-bottom: 0.5rem;
}
.stat-item { display: flex; flex-direction: column; gap: 0.2rem; }
.stat-value { font-family: var(--font-vt); font-size: 1.4rem; color: var(--mc-gold); }
.stat-label { font-family: var(--font-vt); font-size: 0.85rem; color: var(--mc-text-dim); }

.standards-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.std-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--mc-panel);
  border: 2px solid var(--mc-border);
  padding: 0.5rem;
}
.std-topic { display: flex; flex-direction: column; min-width: 110px; max-width: 130px; }
.std-name { font-family: var(--font-vt); font-size: 0.9rem; color: var(--mc-text); line-height: 1.2; }
.std-code { font-size: 0.42rem; color: var(--mc-text-dim); margin-top: 1px; }
.std-bar-wrap { flex: 1; height: 10px; background: #111; border: 2px solid #333; }
.std-bar-fill {
  height: 100%;
  transition: width 0.5s ease;
}
.std-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.06rem;
  min-width: 5.5rem;
  flex-shrink: 0;
}
.std-pct { font-family: var(--font-vt); font-size: 0.95rem; color: var(--mc-text-dim); text-align: right; line-height: 1.1; }
.std-count {
  font-family: var(--font-vt);
  font-size: 0.72rem;
  color: #8a9a8a;
  text-align: right;
  line-height: 1.1;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════
   SUMMARY SCREEN
═══════════════════════════════════════════ */
#screen-summary { background: linear-gradient(180deg, #0D2B0D 0%, #152515 100%); }

.summary-panel {
  margin: 0 auto 1rem;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-vt);
  font-size: 1.2rem;
}
.summary-label { color: var(--mc-text-dim); }
.summary-val-good { color: var(--mc-emerald); }
.summary-val-bad  { color: var(--mc-redstone); }
.summary-val      { color: var(--mc-gold); }
.summary-streak-row .summary-val { color: #ffd54f; }

/* ─── XP FLOAT ANIMATION ──────────────────── */
.xp-float {
  position: fixed;
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  color: var(--mc-emerald);
  pointer-events: none;
  z-index: 9999;
  animation: xp-rise 1.5s ease-out forwards;
}
.xp-float.negative { color: var(--mc-redstone); }
@keyframes xp-rise {
  0%   { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-80px); opacity: 0; }
}

/* ─── RESPONSIVE ──────────────────────────── */
@media (max-width: 480px) {
  .game-title  { font-size: 1.1rem; }
  .mode-grid   { grid-template-columns: 1fr; }
  .stats-summary { grid-template-columns: repeat(3,1fr); }
  .question-text { font-size: 1.25rem; }
  .choice-text { font-size: 1.15rem; }
  .hud-xp-wrap { min-width: 80px; }
  .mc-label    { font-size: 0.55rem; }
  .mc-btn      { font-size: 0.55rem; }
  .section-title { font-size: 0.6rem; }
  .diff-btn    { font-size: 0.52rem; min-height: 40px; padding: 0.5rem 0.7rem; }
  .mode-name   { font-size: 0.55rem; }
  .q-standard, .q-difficulty { font-size: 0.55rem; }
  .stat-label  { font-size: 0.8rem; }
  .std-code    { font-size: 0.5rem; }
  .subject-grid  { grid-template-columns: 1fr; }
  .pony-sprite   { width: 54px; height: 54px; }
  .passage-scroll-row,
  .passage-scroll { max-height: 120px; }
}

@media (max-width: 380px) {
  .subject-grid { grid-template-columns: 1fr; gap: 0.7rem; }
  .subject-icon { font-size: 2rem; }
  .subject-name { font-size: 0.55rem; }
  .game-title   { font-size: 0.9rem; }
}

@media (min-width: 640px) {
  .question-area { max-width: 680px; margin: 0 auto; }
  .screen-body   { max-width: 680px; margin: 0 auto; }
}

/* ─── GUEST MODE ──────────────────────────── */
.guest-locked {
  opacity: 0.5;
  filter: grayscale(0.6);
}
body.is-guest .hud-streak,
body.is-guest .hud-streak-label {
  opacity: 0.35;
  filter: grayscale(1);
}
