/* ===== Daily challenges: shared components for Word + Maths ===== */
:root {
  --g-correct: #3e8e58;
  --g-present: #c9a227;
  --g-absent: #787c86;
}

@media (prefers-color-scheme: dark) {
  :root {
    --g-correct: #4c9a63;
    --g-present: #b8952e;
    --g-absent: #4a4f58;
  }
}

.daily-wrap {
  max-width: 520px;
  margin: 0 auto;
}

.daily-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.daily-head h1 {
  font-size: 1.5rem;
}

.daily-num {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.daily-date {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.35rem;
}

/* ===== Word board ===== */
.board {
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  gap: 6px;
  width: min(330px, 100%);
  margin: 0 auto 1.5rem;
}

.board-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.tile {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  text-transform: uppercase;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.tile.filled {
  border-color: var(--text-muted);
}

.tile.correct { background: var(--g-correct); border-color: var(--g-correct); color: #fff; }
.tile.present { background: var(--g-present); border-color: var(--g-present); color: #fff; }
.tile.absent  { background: var(--g-absent);  border-color: var(--g-absent);  color: #fff; }

/* ===== On-screen keyboard ===== */
.kb {
  display: flex;
  flex-direction: column;
  gap: 6px;
  user-select: none;
  -webkit-user-select: none;
}

.kb-row {
  display: flex;
  justify-content: center;
  gap: 5px;
}

.kb button {
  flex: 1;
  max-width: 44px;
  padding: 0.85rem 0;
  border: none;
  border-radius: 6px;
  background: var(--border);
  color: var(--text);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  cursor: pointer;
}

.kb button.wide {
  max-width: 68px;
  flex: 1.6;
  font-size: 0.7rem;
}

.kb button.correct { background: var(--g-correct); color: #fff; }
.kb button.present { background: var(--g-present); color: #fff; }
.kb button.absent  { background: var(--g-absent);  color: #fff; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 4.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 0.5rem 1.1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 10;
}

.toast.show {
  opacity: 1;
}

/* ===== Maths quiz ===== */
.quiz-progress {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
  font-variant-numeric: tabular-nums;
}

.quiz-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.quiz-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.3s;
}

.quiz-q {
  text-align: center;
  font-size: 2.6rem;
  font-weight: 700;
  margin: 2.25rem 0;
  font-variant-numeric: tabular-nums;
}

.quiz-input {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
}

.quiz-input input {
  width: 160px;
  text-align: center;
  font-size: 1.4rem;
  padding: 0.55rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.quiz-input input:focus {
  outline: none;
  border-color: var(--accent);
}

.quiz-feedback {
  text-align: center;
  min-height: 1.7rem;
  margin-top: 1rem;
  font-weight: 600;
}

.quiz-feedback.good { color: var(--ok); }
.quiz-feedback.bad  { color: var(--err); }

/* ===== Result panel & stats ===== */
.result-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 1.5rem;
  text-align: center;
}

.result-panel h2 {
  font-size: 1.4rem;
  margin-bottom: 0.25rem;
}

.result-sub {
  color: var(--text-muted);
}

.stats-row {
  display: flex;
  justify-content: center;
  gap: 2.25rem;
  margin: 1.5rem 0;
}

.stat b {
  display: block;
  font-size: 1.8rem;
  font-variant-numeric: tabular-nums;
}

.stat span {
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.countdown {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  margin-top: 1rem;
}

/* ===== Hub cards ===== */
.challenge-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.challenge-card .icon {
  font-size: 1.6rem;
}

.challenge-status {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.challenge-status.done {
  color: var(--ok);
  font-weight: 600;
}

.streak-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  align-self: flex-start;
}

.challenge-card .btn {
  align-self: flex-start;
  margin-top: 0.5rem;
}
