:root {
  --bg-1: #f8f9fa;
  --bg-2: #eef3f8;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-border: rgba(60, 64, 67, 0.16);
  --panel-soft: rgba(248, 249, 250, 0.9);
  --text: #202124;
  --muted: #5f6368;
  --yes: #34a853;
  --maybe: #fbbc05;
  --button: #4285f4;
  --button-hover: #1a73e8;
  --focus: #1a73e8;
}

* {
  box-sizing: border-box;
}

.site-nav {
  width: min(1080px, 92vw);
  margin: 1rem auto 0.55rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(66, 133, 244, 0.28);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 20px rgba(26, 115, 232, 0.08);
}

.nav-toggle {
  display: none;
  border: 1px solid rgba(66, 133, 244, 0.36);
  border-radius: 10px;
  background: #ffffff;
  color: #1a73e8;
  font-family: "Sora", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.45rem 0.78rem;
  cursor: pointer;
}

.nav-toggle:focus-visible {
  outline: 2px solid #1a73e8;
  outline-offset: 2px;
}

.nav-links {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.nav-link {
  text-decoration: none;
  padding: 0.45rem 0.78rem;
  border-radius: 999px;
  border: 1px solid rgba(66, 133, 244, 0.26);
  background: #ffffff;
  color: #1a73e8;
  font-family: "Sora", sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.nav-link:hover {
  background: rgba(66, 133, 244, 0.12);
  border-color: rgba(26, 115, 232, 0.48);
  transform: translateY(-1px);
}

.nav-link[aria-current="page"] {
  color: #ffffff;
  background: linear-gradient(100deg, #4285f4, #1a73e8);
  border-color: rgba(26, 115, 232, 0.72);
}

@media (max-width: 760px) {
  .site-nav {
    padding: 0.58rem;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 0.48rem;
  }

  .nav-links {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.35rem;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 240ms ease, opacity 200ms ease;
    pointer-events: none;
  }

  .site-nav.is-open .nav-links {
    max-height: 320px;
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link {
    width: 100%;
    text-align: center;
  }
}

.site-footer {
  width: min(1080px, 92vw);
  margin: 0.85rem auto 1.15rem;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(66, 133, 244, 0.24);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 16px rgba(26, 115, 232, 0.07);
}

.site-footer p {
  margin: 0;
  color: #5f6368;
  text-align: center;
  font-size: 0.92rem;
}

.site-footer a {
  color: #1a73e8;
  font-weight: 700;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Outfit", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 8% 5%, rgba(66, 133, 244, 0.16) 0%, transparent 30%),
    radial-gradient(circle at 90% 10%, rgba(52, 168, 83, 0.14) 0%, transparent 26%),
    radial-gradient(circle at 76% 74%, rgba(251, 188, 5, 0.14) 0%, transparent 30%),
    linear-gradient(125deg, var(--bg-1), var(--bg-2));
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Google Search-inspired theme override */
.poll-card,
.results-card,
.quiz-card,
.home-card {
  background: var(--panel);
  border-color: var(--panel-border);
  box-shadow: 0 10px 28px rgba(60, 64, 67, 0.16);
}

.tag,
.quiz-topbar .status-text,
.room-chip,
.badge-pill {
  color: #1a73e8;
  border-color: rgba(26, 115, 232, 0.24);
  background: rgba(66, 133, 244, 0.08);
}

.home-copy,
.status-text,
.review-topic,
.submission-time,
#totalCount,
.clue-item,
.clue-btn span {
  color: var(--muted);
}

.topic-card,
.quick-stats article,
.gamification-grid article,
.result-grid article,
.question-card,
.review-item,
.submission-item,
.bar-track,
.progress-track,
.clue-btn,
.cw-cell,
.student-input,
.option,
.quiz-option {
  border-color: rgba(60, 64, 67, 0.2);
  background: rgba(255, 255, 255, 0.9);
}

.review-title,
.review-line,
.submission-title,
.submission-answer,
.bar-label,
.bar-value,
.student-field,
.option span,
.clue-btn,
.cw-input {
  color: var(--text);
}

.submit-btn {
  background: var(--button);
  color: #ffffff;
}

.submit-btn:hover {
  background: var(--button-hover);
}

.reset-btn,
.home-btn {
  background: rgba(60, 64, 67, 0.1);
  color: var(--text);
}

.progress-fill {
  background: linear-gradient(90deg, #4285f4 0%, #ea4335 35%, #fbbc05 68%, #34a853 100%);
}

.yes-bar {
  background: linear-gradient(90deg, #1e8e3e, #34a853);
}

.maybe-bar {
  background: linear-gradient(90deg, #f29900, #fbbc05);
}

.result-message {
  color: #1a73e8;
}

.crossword-card,
.crossword-sidecard {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(248, 249, 250, 0.97));
  border-color: rgba(60, 64, 67, 0.2);
}

.crossword-grid {
  background: rgba(66, 133, 244, 0.09);
  border-color: rgba(66, 133, 244, 0.25);
  box-shadow: inset 0 0 0 1px rgba(66, 133, 244, 0.2);
}

.crossword-grid:empty::before {
  color: #5f6368;
}

.cw-cell.blocked {
  background: #dfe3e8;
}

.cw-input {
  background: rgba(255, 255, 255, 0.96);
}

.cw-number {
  color: #1a73e8;
}

.cw-input:focus {
  outline-color: #1a73e8;
  background: rgba(66, 133, 244, 0.14);
}

.cw-input.is-active {
  background: rgba(66, 133, 244, 0.12);
}

.cw-input.hinted,
.cw-cell.entry-fixed {
  background: rgba(251, 188, 5, 0.18);
}

.cw-input.is-wrong,
.quiz-option.is-wrong {
  border-color: rgba(234, 67, 53, 0.55);
  background: rgba(234, 67, 53, 0.12);
}

.quiz-option.is-correct,
.review-correct {
  border-color: rgba(52, 168, 83, 0.55);
  background: rgba(52, 168, 83, 0.12);
}

.review-incorrect {
  border-color: rgba(234, 67, 53, 0.5);
}

.review-skipped {
  border-color: rgba(251, 188, 5, 0.58);
}

.crossword-clues,
.final-result {
  border-top-color: rgba(60, 64, 67, 0.2);
}

.clue-btn:hover {
  border-color: rgba(26, 115, 232, 0.45);
  background: rgba(66, 133, 244, 0.1);
}

.clue-btn.is-active {
  border-color: rgba(52, 168, 83, 0.65);
  background: rgba(52, 168, 83, 0.14);
}

h1,
h2,
p {
  margin: 0;
}

.home-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.home-card {
  width: min(640px, 94vw);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 1.35rem;
  backdrop-filter: blur(6px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  animation: fadeIn 260ms ease both;
}

.home-copy {
  margin-top: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

.module-topics {
  margin-top: 1rem;
  display: grid;
  gap: 0.7rem;
}

.topic-card {
  border: 1px solid rgba(214, 239, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 0.75rem;
}

.topic-card h2 {
  font-size: 1rem;
}

.topic-card ul {
  margin: 0.55rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.topic-card li {
  margin: 0.28rem 0;
}

.home-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.home-actions .tag {
  width: 100%;
  margin: 0 0 0.2rem;
  text-align: left;
}

.home-link {
  display: inline-block;
  text-decoration: none;
  color: #ffffff;
  background: var(--button);
  font-family: "Sora", sans-serif;
  font-weight: 700;
  border-radius: 10px;
  padding: 0.6rem 1rem;
}

.home-link:hover {
  background: var(--button-hover);
}

.poll-shell {
  width: min(980px, 92vw);
  margin: 2rem auto;
  display: grid;
  gap: 1rem;
}

.quiz-shell {
  width: min(1080px, 92vw);
  margin: 1.6rem auto 2.2rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.4fr 1fr;
  align-items: start;
}

.poll-card,
.results-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 1.25rem;
  backdrop-filter: blur(6px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.menti-card {
  border: 1px solid rgba(167, 223, 255, 0.3);
}

.menti-head {
  display: flex;
  justify-content: space-between;
  gap: 0.9rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.room-chip {
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: 0.05em;
  border-radius: 999px;
  padding: 0.45rem 0.72rem;
  color: #e9f7ff;
  background: rgba(17, 182, 255, 0.2);
  border: 1px solid rgba(167, 223, 255, 0.4);
}

.quick-stats {
  margin-top: 0.95rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.quick-stats article {
  border: 1px solid rgba(214, 239, 255, 0.22);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 0.7rem;
}

.quiz-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 1.35rem;
  backdrop-filter: blur(6px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.quiz-topbar {
  margin-top: 0.9rem;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.quiz-topbar .status-text {
  margin-top: 0;
  padding: 0.32rem 0.62rem;
  border: 1px solid rgba(214, 239, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #d9efff;
}

.progress-track {
  margin-top: 0.4rem;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(201, 230, 251, 0.25);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #11b6ff, #2ee59d);
  transition: width 260ms ease;
}

.question-card {
  margin-top: 1rem;
  border: 1px solid rgba(214, 239, 255, 0.24);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  padding: 0.9rem;
}

.quiz-options {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.6rem;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid rgba(214, 239, 255, 0.24);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 0.68rem 0.8rem;
  cursor: pointer;
}

.quiz-option input {
  accent-color: var(--button);
}

.quiz-option.is-wrong {
  border-color: rgba(255, 99, 99, 0.72);
  background: rgba(255, 80, 80, 0.18);
}

.quiz-option.is-correct {
  border-color: rgba(46, 229, 157, 0.72);
  background: rgba(46, 229, 157, 0.2);
}

.quiz-option.locked {
  cursor: default;
}

.gamification-card {
  align-self: start;
}

.gamification-grid {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.gamification-grid article {
  border: 1px solid rgba(214, 239, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 0.7rem;
}

.badge-title {
  margin-top: 1rem;
}

.badge-wrap {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.badge-pill {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: rgba(24, 161, 255, 0.2);
  border: 1px solid rgba(167, 223, 255, 0.35);
  color: #dff4ff;
}

.final-result {
  margin-top: 1rem;
  border-top: 1px solid rgba(214, 239, 255, 0.2);
  padding-top: 0.9rem;
}

.submission-review {
  margin-top: 0.75rem;
  max-height: 360px;
  overflow: auto;
  display: grid;
  gap: 0.6rem;
  padding-right: 0.25rem;
}

.review-item {
  border: 1px solid rgba(214, 239, 255, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.7rem;
}

.review-title {
  font-weight: 700;
  color: #f3f9ff;
}

.review-topic {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.review-line {
  margin-top: 0.35rem;
  color: #e6f4ff;
  font-size: 0.9rem;
}

.review-correct {
  border-color: rgba(46, 229, 157, 0.45);
}

.review-incorrect {
  border-color: rgba(255, 129, 129, 0.5);
}

.review-skipped {
  border-color: rgba(255, 200, 87, 0.52);
}

.tag {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #d6efff;
  border: 1px solid rgba(214, 239, 255, 0.26);
  background: rgba(255, 255, 255, 0.07);
}

h1 {
  margin-top: 0.8rem;
  line-height: 1.3;
  font-family: "Sora", sans-serif;
  font-size: clamp(1.2rem, 3.2vw, 1.85rem);
}

.poll-form {
  margin-top: 1.1rem;
  display: grid;
  gap: 0.7rem;
}

.student-field {
  font-size: 0.92rem;
  color: #e6f4ff;
}

.student-input {
  border: 1px solid rgba(214, 239, 255, 0.24);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 10px;
  padding: 0.62rem 0.7rem;
  font-family: "Outfit", sans-serif;
}

.student-input::placeholder {
  color: #98b6ca;
}

.option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid rgba(214, 239, 255, 0.24);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 0.68rem 0.8rem;
  cursor: pointer;
}

.option input {
  accent-color: var(--button);
  width: 18px;
  height: 18px;
}

.option span {
  font-size: 1rem;
}

.form-actions {
  margin-top: 0.25rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 0.64rem 1.02rem;
  font-weight: 700;
  font-family: "Sora", sans-serif;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.submit-btn {
  background: var(--button);
  color: #ffffff;
}

.submit-btn:hover {
  background: var(--button-hover);
}

.reset-btn {
  background: rgba(255, 255, 255, 0.13);
  color: var(--text);
}

.home-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.13);
  color: var(--text);
}

.status-text {
  margin-top: 0.85rem;
  color: var(--muted);
}

.results-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: baseline;
  flex-wrap: wrap;
}

h2 {
  font-family: "Sora", sans-serif;
  font-size: 1.15rem;
}

#totalCount {
  color: var(--muted);
  font-size: 0.93rem;
}

.chart-wrap {
  margin-top: 1rem;
  display: grid;
  gap: 0.95rem;
}

.submission-list {
  margin-top: 0.8rem;
  max-height: 260px;
  overflow: auto;
  display: grid;
  gap: 0.55rem;
}

.submission-item {
  border: 1px solid rgba(214, 239, 255, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.65rem;
}

.submission-title {
  font-weight: 700;
}

.submission-answer {
  margin-top: 0.2rem;
  color: #dff4ff;
}

.submission-time {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.84rem;
}

body.presenter-mode .poll-card {
  opacity: 0.62;
}

body.presenter-mode .results-card {
  transform: scale(1.01);
  border-color: rgba(46, 229, 157, 0.45);
}

.bar-row {
  display: grid;
  grid-template-columns: 74px 1fr 86px;
  align-items: center;
  gap: 0.7rem;
}

.bar-label,
.bar-value {
  font-size: 0.92rem;
  color: #e6f4ff;
}

.bar-track {
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(201, 230, 251, 0.25);
  background: rgba(255, 255, 255, 0.06);
}

.bar {
  height: 100%;
  width: 0%;
  transition: width 360ms ease;
}

.yes-bar {
  background: linear-gradient(90deg, #1fc88f, var(--yes));
}

.maybe-bar {
  background: linear-gradient(90deg, #f4b73a, var(--maybe));
}

@media (max-width: 680px) {
  .quick-stats {
    grid-template-columns: 1fr;
  }

  .bar-row {
    grid-template-columns: 56px 1fr;
  }

  .bar-value {
    grid-column: 1 / span 2;
    color: var(--muted);
    font-size: 0.86rem;
  }
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn.primary {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  color: #07220d;
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}

.result-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.result-grid article {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem;
}

.result-message {
  font-weight: 700;
  color: #f4e6c0;
}

.crossword-shell {
  grid-template-columns: 1.55fr 1fr;
  gap: 1.1rem;
}

.crossword-card {
  position: relative;
  background: linear-gradient(180deg, rgba(8, 28, 45, 0.93), rgba(6, 20, 33, 0.9));
  border-color: rgba(167, 223, 255, 0.28);
}

.crossword-sidecard {
  background: linear-gradient(180deg, rgba(7, 22, 36, 0.93), rgba(6, 20, 32, 0.9));
  border-color: rgba(167, 223, 255, 0.25);
}

.crossword-progress {
  margin-top: 0.8rem;
}

.crossword-zoom {
  margin-top: 0.62rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
}

.active-clue-strip {
  margin-top: 0.56rem;
  border: 1px solid rgba(66, 133, 244, 0.28);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  padding: 0.56rem 0.68rem;
}

.active-clue-strip p {
  margin: 0;
  color: #202124;
  font-size: 0.9rem;
  line-height: 1.4;
}

.zoom-btn {
  min-width: 56px;
  padding: 0.45rem 0.68rem;
}

.zoom-label {
  margin: 0;
  color: #5f6368;
  font-size: 0.88rem;
  font-weight: 600;
}

.crossword-grid-wrap {
  margin-top: 0.95rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.35rem;
  -webkit-overflow-scrolling: touch;
  touch-action: auto;
  overscroll-behavior-x: contain;
}

.crossword-grid {
  display: grid;
  gap: 3px;
  background: rgba(157, 215, 253, 0.12);
  border: 1px solid rgba(167, 223, 255, 0.28);
  border-radius: 14px;
  padding: 0.55rem;
  box-shadow: inset 0 0 0 1px rgba(22, 65, 97, 0.45);
}

.crossword-grid:empty {
  min-height: 210px;
  place-items: center;
}

.crossword-grid:empty::before {
  content: "Preparing puzzle...";
  color: #97bfd8;
  letter-spacing: 0.03em;
}

.cw-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  min-width: 0;
  border-radius: 7px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.cw-cell.entry-correct::after {
  content: "✓";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: rgba(46, 229, 157, 0.95);
  color: #06321f;
  font-size: 0.6rem;
  line-height: 13px;
  text-align: center;
  font-weight: 800;
  z-index: 3;
}

.cw-cell.entry-fixed {
  box-shadow: inset 0 0 0 2px rgba(255, 200, 87, 0.72);
}

.cw-cell.blocked {
  background: rgba(3, 9, 16, 0.92);
}

.cw-number {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 0.58rem;
  font-weight: 700;
  color: #a5d7f9;
  z-index: 2;
}

.cw-input {
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(255, 255, 255, 0.02);
  color: #f5fcff;
  font-family: "Sora", sans-serif;
  font-size: clamp(0.86rem, 1.65vw, 1.02rem);
  text-transform: uppercase;
  text-align: center;
  padding-top: 0.35rem;
  transition: background-color 160ms ease;
}

.cw-input:focus {
  outline: 2px solid rgba(127, 209, 255, 0.95);
  outline-offset: -1px;
  background: rgba(24, 161, 255, 0.15);
}

.cw-input.is-active {
  background: rgba(24, 161, 255, 0.18);
}

.cw-input.hinted {
  background: rgba(255, 200, 87, 0.25);
}

.cw-input.is-wrong {
  background: rgba(255, 99, 99, 0.22);
}

.crossword-actions {
  margin-top: 0.75rem;
}

.crossword-clues {
  margin-top: 0.95rem;
  border-top: 1px solid rgba(214, 239, 255, 0.18);
  padding-top: 0.8rem;
  max-height: 54vh;
  overflow: auto;
  padding-right: 0.25rem;
}

.crossword-clues h2 {
  margin-top: 0.65rem;
  font-size: 1rem;
}

.clue-list {
  margin: 0.45rem 0 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.45rem;
}

.clue-item {
  color: var(--muted);
}

.clue-btn {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(214, 239, 255, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: #e6f4ff;
  font-family: "Outfit", sans-serif;
  line-height: 1.38;
  padding: 0.5rem 0.6rem;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.clue-btn:hover {
  border-color: rgba(167, 223, 255, 0.5);
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-1px);
}

.clue-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.clue-btn.is-active {
  border-color: rgba(46, 229, 157, 0.75);
  background: rgba(46, 229, 157, 0.15);
}

.clue-btn span {
  color: #acd0e8;
  font-size: 0.84rem;
}

.report-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.65rem;
  justify-content: center;
  flex-wrap: wrap;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 820px) {
  .quiz-shell {
    width: min(1080px, 95vw);
    margin-top: 0.95rem;
  }

  .quiz-card,
  .results-card,
  .home-card {
    padding: 1rem;
    border-radius: 14px;
  }

  .form-actions {
    gap: 0.5rem;
  }

  .form-actions .btn,
  .form-actions .home-btn,
  .form-actions .home-link {
    flex: 1 1 100%;
    justify-content: center;
    min-height: 44px;
  }

  .quiz-topbar {
    gap: 0.5rem;
  }

  .quiz-topbar .status-text {
    font-size: 0.84rem;
  }

  .question-card h2 {
    font-size: 1.02rem;
    line-height: 1.35;
  }

  .gamification-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quiz-shell {
    grid-template-columns: 1fr;
  }

  .crossword-shell {
    grid-template-columns: 1fr;
  }

  .crossword-sidecard {
    order: 1;
  }

  .crossword-card {
    order: 2;
  }

  .setup-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  body {
    background-attachment: scroll;
  }

  .site-nav {
    margin-top: 0.72rem;
    padding: 0.5rem;
  }

  .nav-links {
    gap: 0.35rem;
  }

  .nav-link {
    font-size: 0.78rem;
    padding: 0.4rem 0.62rem;
  }

  .site-footer {
    margin-bottom: 0.85rem;
    padding: 0.72rem 0.78rem;
  }

  .site-footer p {
    font-size: 0.85rem;
  }

  .home-shell,
  .quiz-shell,
  .poll-shell {
    width: min(1080px, 96vw);
  }

  .quiz-card,
  .results-card,
  .home-card {
    padding: 0.86rem;
    border-radius: 12px;
  }

  h1 {
    font-size: 1.22rem;
  }

  h2 {
    font-size: 1rem;
  }

  .home-copy,
  .status-text,
  .review-line,
  .submission-answer,
  .clue-btn {
    font-size: 0.9rem;
  }

  .quiz-option,
  .option {
    padding: 0.8rem 0.72rem;
    min-height: 46px;
  }

  .student-input,
  .cw-input {
    font-size: 16px;
  }

  .crossword-actions {
    gap: 0.5rem;
  }

  .crossword-actions .btn,
  .crossword-actions .home-btn {
    min-height: 46px;
  }

  .app-shell {
    padding: 0.7rem;
  }

  .top-bar {
    align-items: flex-start;
    gap: 0.7rem;
    flex-direction: column;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .crossword-grid-wrap {
    margin-inline: -0.2rem;
    padding-inline: 0.2rem;
  }

  .crossword-grid {
    width: max-content;
    padding: 0.4rem;
    gap: 2px;
  }

  .crossword-zoom {
    margin-top: 0.56rem;
  }

  .zoom-label {
    font-size: 0.84rem;
  }

  .active-clue-strip {
    margin-top: 0.5rem;
    padding: 0.5rem 0.58rem;
  }

  .active-clue-strip p {
    font-size: 0.86rem;
  }

  .crossword-clues {
    max-height: none;
  }
}

/* Final accessibility and Google-theme overrides */
body {
  color: #202124;
  background: radial-gradient(circle at 8% 5%, rgba(66, 133, 244, 0.2) 0%, transparent 30%),
    radial-gradient(circle at 90% 10%, rgba(52, 168, 83, 0.18) 0%, transparent 26%),
    radial-gradient(circle at 76% 74%, rgba(251, 188, 5, 0.2) 0%, transparent 30%),
    linear-gradient(125deg, #f8f9fa, #e9f2ff);
}

h1,
h2,
.results-head p,
.bar-label,
.bar-value,
.review-title,
.review-line,
.submission-title,
.submission-answer,
.option span,
.student-field {
  color: #202124;
}

.home-copy,
.status-text,
.review-topic,
.submission-time,
#totalCount,
.clue-item,
.clue-btn span {
  color: #5f6368;
}

.poll-card,
.results-card,
.quiz-card,
.home-card,
.crossword-card,
.crossword-sidecard {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 249, 250, 0.98));
  border-color: rgba(66, 133, 244, 0.26);
  box-shadow: 0 12px 30px rgba(26, 115, 232, 0.14);
}

.tag,
.quiz-topbar .status-text,
.room-chip,
.badge-pill {
  color: #174ea6;
  border-color: rgba(66, 133, 244, 0.35);
  background: linear-gradient(90deg, rgba(66, 133, 244, 0.18), rgba(66, 133, 244, 0.08));
}

.topic-card,
.quick-stats article,
.gamification-grid article,
.result-grid article,
.question-card,
.review-item,
.submission-item,
.bar-track,
.progress-track,
.student-input,
.option,
.quiz-option,
.clue-btn {
  border-color: rgba(60, 64, 67, 0.2);
  background: rgba(255, 255, 255, 0.95);
}

.submit-btn {
  background: linear-gradient(100deg, #4285f4, #1a73e8);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(26, 115, 232, 0.25);
}

.submit-btn:hover {
  background: linear-gradient(100deg, #1a73e8, #1967d2);
}

.reset-btn,
.home-btn {
  background: rgba(66, 133, 244, 0.12);
  color: #202124;
}

.crossword-grid {
  background: linear-gradient(180deg, rgba(66, 133, 244, 0.22), rgba(66, 133, 244, 0.12));
  border-color: rgba(66, 133, 244, 0.42);
  box-shadow: inset 0 0 0 1px rgba(66, 133, 244, 0.3), 0 8px 18px rgba(26, 115, 232, 0.16);
}

.crossword-grid:empty::before {
  color: #5f6368;
}

.cw-cell {
  background: #ffffff;
  border: 1px solid rgba(66, 133, 244, 0.16);
}

.cw-cell.blocked {
  background: #d2ddeb;
  border-color: rgba(95, 99, 104, 0.22);
}

.cw-number {
  color: #1967d2;
}

.cw-input {
  background: rgba(255, 255, 255, 0.98);
  color: #202124;
  font-weight: 700;
}

.cw-input:focus {
  outline-color: #1a73e8;
  background: rgba(66, 133, 244, 0.28);
}

.cw-input.is-active {
  background: rgba(66, 133, 244, 0.24);
}

.cw-input.hinted {
  background: rgba(251, 188, 5, 0.28);
}

.cw-cell.entry-fixed {
  box-shadow: inset 0 0 0 2px rgba(251, 188, 5, 0.82);
}

.cw-input.is-wrong,
.quiz-option.is-wrong {
  border-color: rgba(234, 67, 53, 0.55);
  background: rgba(234, 67, 53, 0.12);
}

.quiz-option.is-correct,
.review-correct {
  border-color: rgba(52, 168, 83, 0.55);
  background: rgba(52, 168, 83, 0.12);
}

.review-incorrect {
  border-color: rgba(234, 67, 53, 0.5);
}

.review-skipped {
  border-color: rgba(251, 188, 5, 0.58);
}

.result-message {
  color: #1a73e8;
}

.crossword-clues,
.final-result {
  border-top-color: rgba(60, 64, 67, 0.22);
}

.clue-btn {
  border-color: rgba(66, 133, 244, 0.32);
  background: #ffffff;
  color: #202124;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.16);
}

.clue-btn:hover {
  border-color: rgba(26, 115, 232, 0.62);
  background: rgba(66, 133, 244, 0.18);
}

.clue-btn.is-active {
  border-color: rgba(52, 168, 83, 0.84);
  background: rgba(52, 168, 83, 0.26);
  box-shadow: 0 0 0 1px rgba(52, 168, 83, 0.36);
}

.reset-btn,
.home-btn {
  border: 1px solid rgba(60, 64, 67, 0.24);
}

.results-card h2,
.crossword-clues h2,
.badge-title {
  color: #1967d2;
}

.progress-fill {
  background: linear-gradient(90deg, #4285f4 0%, #ea4335 35%, #fbbc05 68%, #34a853 100%);
}

.yes-bar {
  background: linear-gradient(90deg, #1e8e3e, #34a853);
}

.maybe-bar {
  background: linear-gradient(90deg, #f29900, #fbbc05);
}
