:root {
  --page: #f2e7d3;
  --page-soft: #fff7e8;
  --surface: #fffaf0;
  --surface-2: #f7ead1;
  --paper: #fff6e4;
  --paper-deep: #ead7b8;
  --ink: #2d2118;
  --ink-soft: #75685b;
  --line: #dfca9e;
  --line-strong: #bd9b5d;
  --red: #8f2323;
  --red-deep: #641616;
  --gold: #bd8c2b;
  --green: #174f3d;
  --green-2: #1f6b55;
  --blue: #2564a5;
  --danger: #9a3429;
  --shadow: 0 18px 36px rgba(82, 48, 18, 0.13), 0 2px 0 rgba(255, 255, 255, 0.68) inset;
  --shadow-soft: 0 10px 24px rgba(82, 48, 18, 0.09), 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  --radius: 8px;
  --content: min(1200px, calc(100% - 32px));
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  overflow-x: hidden;
  background: var(--page);
  color: var(--ink);
  font-family: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
  letter-spacing: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(255, 248, 232, 0.96), rgba(242, 231, 211, 0.98) 48%, rgba(236, 221, 194, 1)),
    repeating-linear-gradient(0deg, rgba(111, 73, 27, 0.035) 0 1px, transparent 1px 6px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0 1px, transparent 1px 9px);
}

body::before {
  content: "";
  position: fixed;
  inset: 82px 0 auto;
  height: 250px;
  pointer-events: none;
  opacity: 0.52;
  background:
    linear-gradient(180deg, rgba(255, 250, 241, 0.68), transparent),
    repeating-linear-gradient(90deg, transparent 0 35px, rgba(189, 140, 43, 0.07) 36px, transparent 37px),
    repeating-linear-gradient(0deg, rgba(23, 79, 61, 0.035) 0 1px, transparent 1px 18px);
}

body.reading-mode-active::before,
body.reading-mode-active .topbar,
body.reading-mode-active .site-footer {
  display: none;
}

body.reading-mode-active .page {
  width: min(980px, calc(100% - 28px));
  padding-top: clamp(16px, 3vw, 30px);
  padding-bottom: clamp(28px, 4vw, 54px);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  pointer-events: none;
  padding: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--red-deep);
  font-weight: 800;
  box-shadow: var(--shadow-soft);
  white-space: nowrap;
}

.skip-link:focus {
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
  pointer-events: auto;
  padding: 10px 14px;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  min-height: 82px;
  padding: 0 clamp(16px, 4vw, 52px);
  background:
    linear-gradient(180deg, rgba(255, 250, 241, 0.97), rgba(247, 236, 214, 0.97)),
    repeating-linear-gradient(90deg, rgba(122, 77, 25, 0.05) 0 1px, transparent 1px 12px),
    var(--surface);
  border-bottom: 1px solid rgba(189, 140, 43, 0.24);
  color: var(--ink);
  box-shadow: 0 10px 22px rgba(82, 48, 18, 0.11);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.brand-mark,
.footer-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 246, 219, 0.92);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, #9d2d28, #6f1717),
    var(--red);
  color: #fff6dd;
  font-family: "Songti TC", "PMingLiU", serif;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 8px 16px rgba(100, 22, 22, 0.18);
}

.brand-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.brand strong {
  display: block;
  font-size: clamp(18px, 2vw, 25px);
  line-height: 1.15;
  white-space: nowrap;
}

.brand small {
  color: var(--green);
  font-size: 14px;
  font-weight: 700;
}

.main-nav {
  display: flex;
  align-items: stretch;
  gap: 2px;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 82px;
  padding: 0 24px;
  border-left: 1px solid rgba(189, 140, 43, 0.14);
  color: var(--ink-soft);
  font-size: 18px;
  font-weight: 850;
}

.main-nav a:last-child {
  border-right: 1px solid rgba(189, 140, 43, 0.14);
}

.main-nav a.active,
.main-nav a:hover {
  background: rgba(143, 35, 35, 0.08);
  color: var(--red-deep);
  box-shadow: inset 0 -4px 0 rgba(143, 35, 35, 0.82);
}

.mobile-menu-button {
  display: none;
  align-self: center;
  width: 46px;
  height: 46px;
  padding: 10px;
  border-radius: var(--radius);
  background: rgba(23, 79, 61, 0.08);
  border: 1px solid rgba(23, 79, 61, 0.22);
  color: var(--green);
}

.mobile-menu-button span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: currentColor;
}

.page {
  position: relative;
  flex: 1 0 auto;
  width: var(--content);
  margin: 0 auto;
  padding: clamp(28px, 4vw, 48px) 0 clamp(58px, 7vw, 86px);
}

.page.duel-page {
  padding-top: 16px;
}

.page:focus {
  outline: none;
}

.view {
  display: grid;
  gap: clamp(18px, 2.4vw, 30px);
}

.icon {
  width: 1.1em;
  height: 1.1em;
  flex: 0 0 auto;
}

.icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-top,
.page-heading,
.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.home-top {
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 3.6vw, 38px);
  border: 1px solid rgba(189, 140, 43, 0.32);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 250, 240, 0.96), rgba(247, 232, 201, 0.9)),
    repeating-linear-gradient(90deg, rgba(122, 77, 25, 0.04) 0 1px, transparent 1px 14px);
  box-shadow: var(--shadow-soft);
}

.home-top::after {
  content: "";
  position: absolute;
  inset: auto 24px 14px 24px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(189, 140, 43, 0.42), transparent);
}

.home-top h1,
.page-heading h1 {
  margin: 0;
  color: var(--red-deep);
  font-family: "Songti TC", "PMingLiU", "MingLiU", serif;
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 900;
  line-height: 1.08;
}

.home-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.home-counts span,
.question-meta span,
.section-pill,
.role-label {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(189, 140, 43, 0.38);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 251, 242, 0.95), rgba(246, 236, 216, 0.9)),
    var(--surface);
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 850;
  white-space: nowrap;
}

.entry-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.role-entry {
  display: grid;
  grid-template-columns: minmax(180px, 38%) minmax(0, 1fr);
  min-height: 260px;
  overflow: hidden;
  border: 2px solid rgba(143, 35, 35, 0.18);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.role-entry:hover,
.role-entry:focus-visible,
.module-card:hover,
.module-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(143, 35, 35, 0.44);
  box-shadow: 0 22px 48px rgba(70, 43, 18, 0.16);
  outline: none;
}

.student-entry {
  border-color: rgba(23, 79, 61, 0.24);
}

.student-entry:hover,
.student-entry:focus-visible {
  border-color: rgba(23, 79, 61, 0.52);
}

.entry-image {
  position: relative;
  min-height: 100%;
  background: var(--surface-2);
}

.entry-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 58%, rgba(255, 255, 255, 0.82));
}

.entry-image img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
}

.entry-content {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 16px;
  padding: clamp(24px, 3vw, 40px);
}

.role-label {
  border-color: rgba(23, 79, 61, 0.25);
  background: #edf5ef;
  color: var(--green);
}

.teacher-entry .role-label {
  border-color: rgba(143, 35, 35, 0.22);
  background: #f7e8e3;
  color: var(--red-deep);
}

.role-entry strong {
  color: var(--red-deep);
  font-family: "Songti TC", "PMingLiU", serif;
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 900;
  line-height: 1.08;
}

.student-entry strong {
  color: var(--green);
}

.entry-tags {
  color: var(--ink-soft);
  font-size: 17px;
  font-weight: 750;
  line-height: 1.45;
}

.entry-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius);
  background: var(--red);
  color: #fffaf0;
  font-weight: 900;
}

.student-entry .entry-action {
  background: var(--green);
}

.home-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.home-choice {
  position: relative;
  display: grid;
  grid-template-rows: minmax(210px, 1fr) auto;
  min-height: 430px;
  overflow: hidden;
  border: 1px solid rgba(189, 140, 43, 0.32);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.96), rgba(250, 240, 219, 0.96)),
    var(--paper);
  box-shadow: var(--shadow);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.home-choice::before {
  content: "";
  position: absolute;
  inset: 8px;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: calc(var(--radius) - 2px);
}

.home-choice:hover,
.home-choice:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(143, 35, 35, 0.4);
  box-shadow: 0 24px 44px rgba(82, 48, 18, 0.17), 0 2px 0 rgba(255, 255, 255, 0.72) inset;
  outline: none;
}

.choice-media {
  position: relative;
  min-height: 210px;
  overflow: hidden;
  margin: 12px 12px 0;
  border-radius: calc(var(--radius) - 2px);
  background: #f5e5c8;
}

.choice-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 70%, rgba(255, 250, 240, 0.94)),
    linear-gradient(90deg, rgba(255, 250, 240, 0.32), transparent 34%, transparent 66%, rgba(255, 250, 240, 0.32));
}

.choice-media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 230px;
  object-fit: cover;
}

.choice-body {
  position: relative;
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 12px;
  padding: clamp(20px, 3vw, 30px);
  z-index: 1;
}

.choice-body strong {
  color: var(--red-deep);
  font-family: "Songti TC", "PMingLiU", serif;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.08;
}

.student-choice .choice-body strong {
  color: var(--green);
}

.match-choice .choice-body strong {
  color: #8a5f12;
}

.choice-body span:not(.role-label) {
  color: var(--ink-soft);
  font-size: 18px;
  font-weight: 850;
}

.choice-body small {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid rgba(189, 140, 43, 0.34);
  border-radius: var(--radius);
  background: rgba(255, 247, 232, 0.9);
  color: var(--red-deep);
  font-size: 15px;
  font-weight: 900;
}

.account-panel,
.login-card,
.account-strip {
  border: 1px solid rgba(189, 140, 43, 0.3);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.96), rgba(248, 238, 217, 0.94)),
    var(--surface);
  box-shadow: var(--shadow-soft);
}

.account-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(18px, 3vw, 26px);
}

.account-panel h2,
.login-card h2 {
  margin: 8px 0 6px;
  color: var(--ink);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.2;
}

.account-panel p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.5;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.account-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  color: var(--ink-soft);
  font-weight: 850;
}

.account-strip strong {
  color: var(--ink);
}

.account-strip a {
  margin-left: auto;
  color: var(--red-deep);
  font-weight: 950;
}

.about-panel {
  display: grid;
  gap: 22px;
  width: min(680px, 100%);
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid rgba(226, 209, 182, 0.95);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-soft);
}

.about-panel h2 {
  margin: 12px 0 8px;
  color: var(--ink);
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.2;
}

.about-panel p {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.55;
}

.about-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.about-list div {
  display: grid;
  gap: 4px;
}

.about-list dt {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 850;
}

.about-list dd {
  margin: 0;
  color: var(--red-deep);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.login-card {
  display: grid;
  gap: 18px;
  padding: clamp(18px, 3vw, 28px);
}

.login-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.match-choice {
  align-content: stretch;
  border-color: rgba(189, 140, 43, 0.46);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(248, 235, 205, 0.96)),
    var(--paper);
  color: var(--ink);
}

.match-choice .role-label {
  border-color: rgba(189, 140, 43, 0.34);
  background: #fff4d5;
  color: #8a5f12;
}

.match-choice .choice-body span:not(.role-label),
.match-choice .choice-body small,
.match-choice .choice-body strong {
  color: #8a5f12;
}

.match-symbol {
  display: grid;
  min-height: 230px;
  place-items: center;
  color: #f7d98b;
  font-family: "Songti TC", "PMingLiU", serif;
  font-size: clamp(92px, 12vw, 150px);
  font-weight: 900;
}

.section-title h2,
.score-panel h2,
.report-card h2 {
  margin: 0;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.2;
}

.landing-view,
.dashboard-view {
  gap: clamp(20px, 3vw, 34px);
}

.landing-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
  align-items: center;
  gap: clamp(24px, 5vw, 62px);
  min-height: min(650px, calc(100vh - 156px));
  overflow: hidden;
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid rgba(189, 140, 43, 0.32);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 250, 239, 0.98), rgba(247, 232, 202, 0.94)),
    repeating-linear-gradient(90deg, rgba(122, 77, 25, 0.045) 0 1px, transparent 1px 15px),
    var(--paper);
  box-shadow: var(--shadow);
}

.landing-hero::before {
  content: "";
  position: absolute;
  inset: 16px;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: calc(var(--radius) - 2px);
}

.landing-copy {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: start;
  gap: 22px;
}

.landing-copy h1 {
  margin: 0;
  max-width: 9em;
  color: var(--red-deep);
  font-family: "Songti TC", "PMingLiU", "MingLiU", serif;
  font-size: clamp(46px, 7vw, 82px);
  font-weight: 900;
  line-height: 1.06;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.landing-visual {
  position: relative;
  z-index: 1;
  min-height: clamp(330px, 40vw, 500px);
}

.landing-visual::before {
  content: "";
  position: absolute;
  inset: 8% 9% 4% 7%;
  border: 1px solid rgba(189, 140, 43, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 252, 245, 0.82), rgba(239, 220, 186, 0.72)),
    repeating-linear-gradient(0deg, rgba(117, 104, 91, 0.05) 0 1px, transparent 1px 16px);
  box-shadow: 0 22px 42px rgba(82, 48, 18, 0.11);
  transform: rotate(-1.4deg);
}

.landing-visual-main,
.landing-visual-side {
  position: absolute;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(189, 140, 43, 0.26);
  border-radius: var(--radius);
  background: var(--surface);
  box-sizing: border-box;
  object-fit: contain;
  padding: 32px;
  box-shadow: 0 12px 26px rgba(82, 48, 18, 0.09);
}

.landing-visual-main {
  inset: 12% 18% 10% 0;
  width: 72%;
  height: 78%;
  animation: landingLift 6s ease-in-out infinite;
}

.landing-visual-side {
  right: 0;
  bottom: 18%;
  width: 42%;
  height: 42%;
  padding: 22px;
  animation: landingLift 6s ease-in-out 900ms infinite;
}

.floating-paper {
  position: absolute;
  z-index: 2;
  display: grid;
  width: clamp(54px, 7vw, 78px);
  height: clamp(70px, 9vw, 98px);
  place-items: center;
  border: 1px solid rgba(189, 140, 43, 0.34);
  border-radius: var(--radius);
  background: rgba(255, 250, 239, 0.94);
  color: var(--red-deep);
  font-family: "Songti TC", "PMingLiU", serif;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
  box-shadow: var(--shadow-soft);
  animation: floatingPaper 5.8s ease-in-out infinite;
}

.paper-one {
  top: 6%;
  left: 9%;
  color: var(--green);
}

.paper-two {
  top: 1%;
  right: 16%;
  animation-delay: 700ms;
}

.paper-three {
  right: 8%;
  bottom: 8%;
  color: var(--gold);
  animation-delay: 1200ms;
}

.landing-feature-grid,
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.landing-feature-grid article {
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 132px;
  padding: 20px;
  border: 1px solid rgba(189, 140, 43, 0.28);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.97), rgba(248, 238, 217, 0.94)),
    var(--surface);
  box-shadow: var(--shadow-soft);
}

.landing-feature-grid strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.2;
}

.dashboard-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid rgba(189, 140, 43, 0.32);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 250, 239, 0.98), rgba(246, 232, 205, 0.94)),
    repeating-linear-gradient(90deg, rgba(122, 77, 25, 0.045) 0 1px, transparent 1px 15px),
    var(--paper);
  box-shadow: var(--shadow-soft);
}

.dashboard-hero h1 {
  margin: 12px 0 8px;
  color: var(--red-deep);
  font-family: "Songti TC", "PMingLiU", "MingLiU", serif;
  font-size: clamp(38px, 5vw, 62px);
  font-weight: 900;
  line-height: 1.08;
}

.dashboard-hero p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.55;
}

.dashboard-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.dashboard-summary span,
.dashboard-summary a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid rgba(189, 140, 43, 0.34);
  border-radius: var(--radius);
  background: rgba(255, 250, 240, 0.88);
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 850;
}

.dashboard-summary strong {
  color: var(--red-deep);
  font-size: 20px;
}

.dashboard-summary a {
  color: var(--red-deep);
}

.dashboard-section {
  display: grid;
  gap: 14px;
}

.dashboard-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-section-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.2;
}

.dashboard-card {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 216px;
  overflow: hidden;
  border: 1px solid rgba(189, 140, 43, 0.3);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.97), rgba(248, 238, 217, 0.94)),
    var(--surface);
  box-shadow: var(--shadow-soft);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.dashboard-card:hover,
.dashboard-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(143, 35, 35, 0.42);
  box-shadow: 0 22px 44px rgba(70, 43, 18, 0.15);
  outline: none;
}

.dashboard-card-media {
  display: grid;
  width: 62px;
  height: 62px;
  min-height: 0;
  place-items: center;
  margin: 22px 22px 0;
  overflow: hidden;
  border: 1px solid rgba(189, 140, 43, 0.35);
  border-radius: 50%;
  background: #fff8ea;
}

.dashboard-card-media img {
  display: block;
  width: 38px;
  height: 38px;
  min-height: 0;
  object-fit: contain;
}

.dashboard-card.green .dashboard-card-media {
  border-color: rgba(31, 122, 88, 0.26);
  background: #edf7f1;
}

.dashboard-card.red .dashboard-card-media {
  border-color: rgba(143, 35, 35, 0.24);
  background: #f8e9e4;
}

.dashboard-card-icon {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  margin: 22px 22px 0;
  border: 1px solid rgba(189, 140, 43, 0.36);
  border-radius: var(--radius);
  background: #fff7e3;
  color: var(--gold);
  font-size: 30px;
  box-shadow: 0 8px 16px rgba(82, 48, 18, 0.08);
}

.dashboard-card.green .dashboard-card-icon {
  border-color: rgba(31, 122, 88, 0.24);
  background: #edf7f1;
  color: var(--green);
}

.dashboard-card.red .dashboard-card-icon {
  border-color: rgba(143, 35, 35, 0.22);
  background: #f8e9e4;
  color: var(--red-deep);
}

.dashboard-card-body {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px 22px 22px;
}

.dashboard-card-body strong {
  color: var(--ink);
  font-size: clamp(23px, 2.6vw, 30px);
  line-height: 1.18;
}

.dashboard-card.green .dashboard-card-body strong {
  color: var(--green);
}

.dashboard-card.gold .dashboard-card-body strong {
  color: #8a5f12;
}

.dashboard-card-body span {
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.45;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.05fr);
  gap: clamp(18px, 3vw, 28px);
  align-items: center;
}

.login-intro {
  position: relative;
  display: grid;
  align-content: start;
  gap: 16px;
  overflow: hidden;
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid rgba(189, 140, 43, 0.3);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(247, 233, 205, 0.92)),
    var(--paper);
  box-shadow: var(--shadow-soft);
}

.login-intro h2 {
  margin: 0;
  color: var(--red-deep);
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.15;
}

.login-intro p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 17px;
  font-weight: 780;
  line-height: 1.65;
}

.login-intro img {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-height: 190px;
  margin-top: auto;
  border: 1px solid rgba(189, 140, 43, 0.24);
  border-radius: var(--radius);
  background: #fff8ea;
  object-fit: contain;
  padding: 30px;
}

.login-layout .login-card {
  width: min(100%, 480px);
  justify-self: center;
  align-self: center;
  align-content: start;
  gap: 16px;
  padding: clamp(22px, 3vw, 32px);
}

.login-layout .login-grid {
  grid-template-columns: 1fr;
}

.login-layout .wide-actions {
  justify-content: flex-start;
}

.login-layout .primary-button {
  min-width: 132px;
  width: auto;
}

.login-layout .status-note {
  min-height: auto;
  padding: 2px 0 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 750;
}

.login-layout .status-note.good {
  background: transparent;
  color: var(--green);
}

.login-layout .status-note.calm {
  background: transparent;
  color: var(--ink-soft);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 14px;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.module-card {
  display: grid;
  min-height: 164px;
  align-content: space-between;
  justify-items: start;
  padding: 18px;
  border: 1px solid rgba(189, 140, 43, 0.3);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.96), rgba(248, 238, 217, 0.94)),
    var(--surface);
  box-shadow: var(--shadow-soft);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.module-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(189, 140, 43, 0.38);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #fff7e3, #ecd5ac),
    #fff8ea;
  color: var(--gold);
  font-size: 22px;
  box-shadow: 0 6px 14px rgba(82, 48, 18, 0.08);
}

.module-card strong {
  margin-top: 18px;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.2;
}

.module-card span:last-child {
  margin-top: 8px;
  color: var(--red-deep);
  font-size: 14px;
  font-weight: 850;
}

.hub-card {
  min-height: 230px;
  padding: 24px;
}

.hub-card strong {
  font-size: clamp(24px, 3vw, 34px);
}

.practice-entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.practice-entry-card {
  display: grid;
  gap: 18px;
  min-height: 270px;
  align-content: space-between;
  padding: clamp(24px, 3.5vw, 36px);
  border: 1px solid rgba(226, 209, 182, 0.96);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.practice-entry-card:hover {
  transform: translateY(-2px);
  border-color: rgba(143, 35, 35, 0.38);
  box-shadow: 0 18px 34px rgba(70, 43, 18, 0.13);
}

.practice-entry-card.custom-passages {
  border-color: rgba(31, 122, 88, 0.25);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(237, 247, 241, 0.96));
}

.practice-entry-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(189, 140, 43, 0.35);
  border-radius: 50%;
  background: #fff8ea;
  color: var(--gold);
}

.custom-passages .practice-entry-icon {
  border-color: rgba(31, 122, 88, 0.26);
  background: #edf7f1;
  color: var(--green);
}

.practice-entry-card strong {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.1;
}

.practice-entry-card span:last-child {
  color: var(--ink-soft);
  font-size: 18px;
  font-weight: 850;
  line-height: 1.45;
}

.practice-step-bar .secondary-button .icon,
.practice-start-actions .secondary-button .icon {
  transform: rotate(180deg);
}

.practice-scope-panel {
  margin-top: 14px;
}

.passage-multi-picker {
  border: 1px solid rgba(226, 209, 182, 0.92);
  border-radius: var(--radius);
  background: #fffaf2;
  overflow: hidden;
}

.passage-multi-picker summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  color: var(--red-deep);
  cursor: pointer;
  font-size: 18px;
  font-weight: 950;
  list-style: none;
}

.passage-multi-picker summary::-webkit-details-marker {
  display: none;
}

.passage-multi-picker summary strong {
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 850;
}

.scope-quick-actions,
.scope-batch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.scope-quick-actions {
  padding: 0 16px 12px;
}

.scope-batch-actions {
  justify-content: flex-end;
  padding-top: 4px;
}

.scope-batch-actions > span {
  margin-right: auto;
  color: var(--ink-soft);
  font-weight: 850;
}

.passage-check-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 380px;
  overflow: auto;
  padding: 0 16px 16px;
  -webkit-overflow-scrolling: touch;
}

.passage-check-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 9px;
  align-items: start;
  min-height: 76px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  cursor: pointer;
}

.passage-check-card.is-checked {
  border-color: rgba(31, 122, 88, 0.45);
  background: #edf7f1;
}

.passage-check-card input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--green);
}

.passage-check-card span,
.passage-check-card strong {
  grid-column: 2;
}

.passage-check-card span {
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
}

.passage-check-card strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.practice-start-actions {
  margin-top: 14px;
  justify-content: flex-end;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  color: var(--red-deep);
  font-size: 15px;
  font-weight: 850;
}

.back-link .icon {
  transform: rotate(180deg);
}

.control-panel,
.match-bar,
.table-panel,
.advisor-panel,
.reading-panel,
.question-card,
.score-panel,
.setup-card,
.report-card {
  border: 1px solid rgba(189, 140, 43, 0.3);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.96), rgba(250, 241, 222, 0.94)),
    var(--surface);
  box-shadow: var(--shadow-soft);
}

.control-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 18px;
  align-items: end;
  padding: 18px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 170px 150px;
  gap: 12px;
  align-items: end;
}

.learn-page .filters {
  grid-template-columns: minmax(260px, 1fr) minmax(220px, auto) 118px;
}

.filter-label {
  display: grid;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 850;
}

.category-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(58px, 1fr));
  gap: 8px;
}

.category-button {
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #dfc9a5;
  border-radius: var(--radius);
  background: #f8f0e0;
  color: var(--red-deep);
  cursor: pointer;
  font-size: 17px;
  font-weight: 950;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.category-button.is-active {
  border-color: rgba(143, 35, 35, 0.55);
  background: var(--red-deep);
  color: #fffaf0;
}

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

.field,
.select-field,
.textarea-field {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
}

.textarea-field {
  min-height: 94px;
  resize: vertical;
}

.field:focus,
.select-field:focus,
.textarea-field:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(189, 140, 43, 0.26);
  outline-offset: 2px;
}

.compact-progress {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-height: 78px;
  padding: 10px;
  border-radius: var(--radius);
  background: #f7ecd8;
  color: var(--red-deep);
}

.compact-progress strong {
  font-size: 31px;
  line-height: 1;
}

.compact-progress span {
  color: var(--ink-soft);
  font-weight: 850;
}

.learn-layout {
  display: grid;
  grid-template-columns: minmax(190px, 236px) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  height: min(780px, calc(100vh - 238px));
  min-height: 520px;
}

.passage-list {
  display: grid;
  gap: 10px;
  align-content: start;
  max-width: 100%;
  height: 100%;
  overflow: auto;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.passage-card {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(70, 43, 18, 0.05);
}

.passage-card.is-active {
  border-color: rgba(143, 35, 35, 0.48);
  background: #fff5e6;
}

.passage-card span {
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
}

.passage-card strong {
  font-size: 16px;
  line-height: 1.35;
}

.passage-card small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.passage-card .done-note {
  display: inline-flex;
  width: fit-content;
  min-height: 25px;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f2e4cf;
  color: var(--red-deep);
  font-size: 13px;
  font-weight: 900;
  -webkit-line-clamp: initial;
}

.reading-panel {
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding: clamp(26px, 3.2vw, 40px);
  scroll-margin-top: 96px;
  -webkit-overflow-scrolling: touch;
}

.reading-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.reading-title h1,
.reading-title h2 {
  margin: 10px 0 0;
  font-family: "Songti TC", "PMingLiU", serif;
  font-size: clamp(27px, 3.2vw, 40px);
  line-height: 1.22;
}

.reading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.reading-text {
  margin-top: 24px;
  color: #312319;
  font-family: "Songti TC", "PMingLiU", "MingLiU", serif;
  font-size: clamp(21px, 2.2vw, 27px);
  line-height: 2.05;
  white-space: pre-wrap;
}

.reading-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(143, 35, 35, 0.16);
  border-radius: var(--radius);
  background: #fff7ec;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 850;
}

.read-complete-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border: 1px solid rgba(101, 22, 22, 0.9);
  border-radius: var(--radius);
  background: #6f1717;
  color: #fffaf0;
  cursor: pointer;
  font-weight: 950;
  line-height: 1.2;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.read-complete-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(111, 23, 23, 0.16);
}

.reading-text-focus {
  font-size: clamp(23px, 2.5vw, 31px);
  line-height: 2.15;
}

.reading-mode-view {
  min-height: calc(100vh - 60px);
}

.reading-focus-panel {
  min-height: calc(100vh - 92px);
}

.reading-source-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.study-area {
  display: grid;
  gap: 18px;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.study-summary,
.study-section,
.study-details {
  display: grid;
  gap: 10px;
}

.study-summary {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

.study-section,
.study-details {
  padding-top: 16px;
  border-top: 1px solid rgba(226, 209, 182, 0.78);
}

.study-summary h3,
.study-section h3 {
  margin: 0;
  color: var(--red-deep);
  font-size: 18px;
  line-height: 1.35;
}

.study-summary p,
.study-section p,
.key-point-list,
.study-text {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.85;
}

.source-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid #dfc9a5;
  border-radius: var(--radius);
  background: #f6ecd8;
  color: var(--red-deep);
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
}

.key-point-list {
  display: grid;
  gap: 8px;
  padding-left: 1.2em;
}

.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-list span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(23, 79, 61, 0.22);
  border-radius: 999px;
  background: #edf5ef;
  color: var(--green);
  font-size: 14px;
  font-weight: 850;
}

.study-details summary {
  cursor: pointer;
  color: var(--red-deep);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.35;
}

.study-text {
  padding-top: 12px;
  white-space: pre-wrap;
}

.passage-quiz {
  display: grid;
  gap: 16px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.passage-quiz-head,
.passage-quiz-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.passage-quiz-head h3 {
  margin: 6px 0 0;
  color: var(--red-deep);
  font-size: 22px;
  line-height: 1.25;
}

.passage-quiz-head strong,
.passage-quiz-actions > span {
  color: var(--green);
  font-size: 15px;
  font-weight: 900;
}

.passage-quiz-list {
  display: grid;
  gap: 14px;
}

.passage-quiz-question {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(226, 209, 182, 0.9);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 251, 241, 0.96), rgba(248, 237, 219, 0.92)),
    var(--surface);
  box-shadow: 0 10px 18px rgba(82, 48, 18, 0.06);
}

.passage-quiz-question.is-correct {
  border-color: rgba(23, 79, 61, 0.28);
}

.passage-quiz-question.is-wrong {
  border-color: rgba(143, 35, 35, 0.28);
}

.passage-quiz-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.passage-quiz-meta span {
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #edf5ef;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.passage-quiz-meta strong {
  color: var(--red-deep);
  font-size: 16px;
}

.passage-quiz-question p {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 850;
  line-height: 1.7;
}

.passage-quiz-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.passage-quiz-feedback {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #fff7ec;
  color: var(--ink);
}

.passage-quiz-feedback.good {
  background: #edf5ef;
}

.passage-quiz-feedback strong {
  color: var(--red-deep);
}

.passage-quiz-feedback small {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.6;
}

.primary-button,
.secondary-button,
.danger-button,
.small-button,
.score-button,
.tab-button,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 900;
  line-height: 1.2;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.48) inset, 0 10px 18px rgba(82, 48, 18, 0.08);
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
}

.primary-button {
  border: 1px solid rgba(100, 22, 22, 0.38);
  background:
    linear-gradient(180deg, #a6332d, #7d1e1e),
    var(--red);
  color: #fffaf0;
  box-shadow: 0 12px 28px rgba(143, 35, 35, 0.2);
}

.primary-button.full {
  width: 100%;
}

.secondary-button,
.small-button,
.tab-button,
.chip {
  border: 1px solid rgba(189, 140, 43, 0.42);
  background:
    linear-gradient(180deg, #fff8e9, #f2e3c8),
    #f6ecd8;
  color: var(--red-deep);
}

.danger-button {
  border: 1px solid #e8c0b4;
  background: #f8e1da;
  color: #822018;
}

.small-button {
  min-height: 40px;
  padding: 9px 12px;
  font-size: 15px;
  white-space: nowrap;
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.small-button:hover,
.score-button:hover,
.tab-button:hover,
.chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.58) inset, 0 14px 22px rgba(82, 48, 18, 0.12);
}

.setup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.setup-step-bar,
.lobby-head,
.waiting-room-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.setup-step-bar > div,
.lobby-head > div,
.waiting-room-hero > div:first-child {
  display: grid;
  gap: 5px;
}

.setup-step-bar strong,
.lobby-head h1,
.waiting-room-hero h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.12;
}

.setup-step-bar span,
.lobby-head p,
.waiting-room-hero p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 17px;
  font-weight: 850;
  line-height: 1.45;
}

.mode-choice-grid,
.round-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

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

.mode-choice-card,
.round-choice-card,
.rules-card,
.lobby-result-panel {
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.mode-choice-card {
  position: relative;
  min-height: 330px;
  align-content: space-between;
}

.mode-choice-card h2,
.round-choice-card h2,
.rules-card h2,
.lobby-result-panel h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.18;
}

.mode-choice-card p,
.round-choice-card p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.55;
}

.round-choice-card > strong {
  color: var(--red-deep);
  font-size: 18px;
  font-weight: 950;
}

.round-timer-panel {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #e3cf9e;
  border-radius: var(--radius);
  background: #fff8ea;
}

.round-timer-panel span {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 900;
}

.round-timer-panel strong {
  color: var(--red-deep);
  font-size: clamp(28px, 4vw, 42px);
  font-variant-numeric: tabular-nums;
  font-weight: 950;
  line-height: 1;
  text-align: right;
}

.round-timer-panel small {
  grid-column: 1 / -1;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 850;
}

.round-timer-panel.is-running {
  border-color: #9fc9af;
  background: #edf7f1;
}

.round-timer-panel.is-running strong {
  color: var(--green);
}

.round-timer-panel.compact {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px 12px;
}

.round-timer-panel.compact strong {
  font-size: 24px;
}

.round-timer-panel.subtle {
  display: inline-grid;
  grid-template-columns: auto auto;
  width: max-content;
  min-width: 118px;
  gap: 2px 8px;
  padding: 6px 10px;
  border-color: #eadcc2;
  background: rgba(255, 250, 240, 0.82);
  box-shadow: none;
}

.round-timer-panel.subtle span {
  color: #766b59;
  font-size: 12px;
  line-height: 1;
}

.round-timer-panel.subtle strong {
  color: #5d5447;
  font-size: 16px;
  line-height: 1;
  text-align: right;
}

.round-timer-panel.subtle small {
  display: none;
}

.round-timer-panel.subtle.is-running {
  border-color: #c9ddcf;
  background: rgba(239, 248, 242, 0.86);
}

.round-timer-panel.subtle.is-running strong {
  color: #35664f;
}

.round-choice-card.is-complete {
  border-color: #bad7c6;
  background: #f4fbf6;
}

.round-choice-card.is-locked {
  opacity: 0.72;
}

.help-dot {
  position: absolute;
  right: 18px;
  bottom: 76px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #dfc9a5;
  border-radius: 50%;
  background: #fff7e8;
  color: var(--red-deep);
  cursor: pointer;
  font-size: 20px;
  font-weight: 950;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(45, 33, 24, 0.32);
}

.info-modal {
  position: relative;
  display: grid;
  gap: 12px;
  width: min(520px, 100%);
  padding: 28px;
  border-radius: var(--radius);
  background: #fffaf1;
  box-shadow: 0 28px 80px rgba(45, 33, 24, 0.28);
}

.info-modal h2 {
  margin: 0;
  color: var(--red-deep);
  font-size: 30px;
}

.info-modal p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.65;
}

.modal-close {
  justify-self: end;
}

.setup-card {
  display: grid;
  gap: 14px;
  align-content: start;
  min-height: 260px;
  padding: 28px;
}

.setup-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: var(--radius);
  background: #f7ecd8;
  color: var(--red-deep);
  font-size: 26px;
}

.setup-card h2 {
  margin: 0;
  font-size: clamp(27px, 3vw, 34px);
}

.setup-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 17px;
  font-weight: 750;
}

.match-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
}

.match-bar.simple {
  justify-content: space-between;
}

.match-bar > div:first-child {
  display: grid;
  gap: 4px;
}

.match-bar strong {
  font-size: 20px;
}

.match-bar span {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 850;
}

.stage-tabs,
.chip-row,
.wide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab-button,
.chip {
  min-height: 40px;
  padding: 8px 13px;
}

.tab-button.is-active,
.chip.is-active {
  border-color: var(--red);
  background: var(--red);
  color: #fffaf0;
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.team-card {
  position: relative;
  overflow: hidden;
  min-height: 128px;
}

.team-card > div {
  display: grid;
  gap: 6px;
  padding: 17px;
}

.team-strip {
  display: block;
  height: 8px;
}

.team-card h3 {
  margin: 0;
  font-size: 21px;
}

.team-card strong {
  font-size: 42px;
  line-height: 1;
}

.team-card span:last-child {
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 800;
}

.status-note {
  min-height: 52px;
  padding: 14px 16px;
  border: 1px solid #ead2a0;
  border-radius: var(--radius);
  background: #fff5dd;
  color: #65430f;
  font-weight: 900;
  line-height: 1.45;
}

.status-note.good {
  border-color: #bad7c6;
  background: #edf7f1;
  color: #1f624d;
}

.status-note.calm {
  border-color: var(--line);
  background: #fffaf1;
  color: var(--ink-soft);
}

.teacher-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.duel-live-view {
  gap: 14px;
}

.duel-live-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.duel-live-title {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.duel-live-title .back-link {
  margin: 0;
  white-space: nowrap;
}

.duel-live-title strong {
  overflow: hidden;
  color: var(--ink);
  font-size: clamp(20px, 2.4vw, 27px);
  font-weight: 950;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.duel-live-meta,
.student-live-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.duel-focus-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 16px;
  align-items: start;
}

.duel-side-panel {
  display: grid;
  gap: 12px;
}

.duel-workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.duel-team-panel,
.active-question-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.duel-team-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.duel-side-panel .duel-team-panel {
  gap: 10px;
  padding: 14px;
}

.duel-team-panel h2 {
  margin: 0;
  font-size: 24px;
}

.duel-side-panel .duel-team-panel h2 {
  font-size: 20px;
}

.duel-team-grid {
  display: grid;
  gap: 10px;
}

.duel-team-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 12px 14px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-left: 8px solid var(--team);
  border-radius: var(--radius);
  background: #fffaf2;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.duel-team-button.is-active {
  background: #fff5e6;
  border-color: var(--team);
  border-left-color: var(--team);
}

.duel-team-button.is-signal {
  background: #f9f1df;
  border-color: rgba(189, 140, 43, 0.72);
  border-left-color: var(--team);
}

.duel-team-button span {
  font-size: 19px;
  font-weight: 900;
}

.duel-team-button strong {
  color: var(--team);
  font-size: 28px;
}

.duel-team-button small {
  grid-column: 1 / -1;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 850;
}

.duel-side-panel .duel-team-button {
  min-height: 58px;
  padding: 10px 12px;
}

.duel-side-panel .duel-team-button span {
  font-size: 17px;
}

.duel-side-panel .duel-team-button strong {
  font-size: 25px;
}

.active-question-panel {
  display: grid;
  gap: 16px;
  min-height: 260px;
  padding: clamp(18px, 3vw, 28px);
  border-top: 8px solid var(--team);
}

.duel-focus-layout .active-question-panel {
  min-height: calc(100vh - 190px);
  align-content: start;
  padding: clamp(20px, 3vw, 34px);
  gap: 10px;
}

.active-question-panel:not(.has-question) {
  align-content: center;
  justify-items: start;
}

.duel-focus-layout .active-question-panel:not(.has-question) {
  justify-items: center;
}

.active-team-name {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-height: 42px;
  padding: 8px 14px;
  border-radius: var(--radius);
  background: var(--team);
  color: #fff;
  font-size: 19px;
  font-weight: 900;
}

.duel-focus-layout .active-team-name {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 17px;
}

.duel-empty-copy {
  margin: 0;
  color: var(--ink-soft);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.55;
}

.duel-question-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.duel-question-head > span {
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 900;
}

.duel-progress-note,
.answer-timer-panel,
.student-timer-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid #e7d3a9;
  border-radius: var(--radius);
  background: #fff7e8;
  color: var(--ink-soft);
}

.duel-progress-note strong,
.answer-timer-panel strong,
.student-timer-note strong {
  color: var(--red-deep);
  font-size: 20px;
  font-weight: 950;
  line-height: 1.2;
}

.duel-progress-note span,
.answer-timer-panel span,
.student-timer-note span {
  font-size: 15px;
  font-weight: 850;
  line-height: 1.35;
}

.answer-timer-panel.is-running,
.student-timer-note.is-running {
  border-color: #9fc9af;
  background: #e9f7ef;
  color: #184f3d;
}

.answer-timer-panel.is-running strong,
.student-timer-note.is-running strong {
  color: #184f3d;
}

.answer-timer-panel.is-answered,
.student-timer-note.is-answered {
  border-color: #9fc9af;
  background: #e8f6ed;
  color: #174d39;
}

.answer-timer-panel.is-answered strong,
.student-timer-note.is-answered strong {
  color: #174d39;
}

.answer-timer-panel.is-expired,
.student-timer-note.is-expired {
  border-color: #e4c0b7;
  background: #fae7e1;
  color: #7e241b;
}

.answer-timer-panel.is-expired strong,
.student-timer-note.is-expired strong {
  color: #7e241b;
}

.challenge-mode-switch {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid #e6cf9a;
  border-radius: var(--radius);
  background: #fff7e8;
}

.mode-toggle {
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--red-deep);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.mode-toggle.is-active {
  background: var(--red);
  color: #fff;
}

.shared-question-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #e7d3a9;
  border-radius: var(--radius);
  background: #fff7e8;
  color: var(--ink-soft);
  font-weight: 850;
}

.shared-question-note strong {
  color: var(--red-deep);
}

.question-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

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

.shared-score-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e3c98f;
  border-radius: var(--radius);
  background: #fff8ea;
}

.shared-score-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.shared-score-title h3 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
}

.shared-score-title span {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.4;
}

.shared-score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.shared-score-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #eadbc1;
  border-left: 6px solid var(--team);
  border-radius: var(--radius);
  background: #fffdf8;
}

.shared-score-card.is-marked {
  border-color: rgba(189, 140, 43, 0.78);
  border-left-color: var(--team);
  background: #fff4d7;
}

.shared-score-card.is-attempted {
  opacity: 0.72;
}

.shared-score-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.shared-score-card-head strong {
  font-size: 18px;
}

.shared-score-card-head span {
  color: var(--team);
  font-size: 26px;
  font-weight: 950;
}

.shared-score-card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.shared-score-card .score-button {
  min-height: 44px;
}

.shared-score-card small {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 850;
}

.question-card,
.score-panel {
  padding: clamp(20px, 3vw, 30px);
}

.duel-focus-layout .question-card {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.duel-focus-layout .question-meta {
  gap: 6px;
  margin-bottom: 10px;
}

.duel-focus-layout .question-meta span {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 13px;
}

.question-text {
  margin: 0;
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 900;
  line-height: 1.48;
}

.duel-focus-layout .question-text {
  font-size: clamp(34px, 4.4vw, 58px);
  line-height: 1.34;
}

.duel-focus-layout .answer-box {
  margin-top: 22px;
}

.duel-focus-layout .question-actions {
  margin-top: 2px;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.option-item {
  display: flex;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffaf1;
  font-size: 18px;
  line-height: 1.45;
}

.option-item strong {
  color: var(--red-deep);
}

.practice-card {
  display: grid;
  gap: 18px;
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.option-choice {
  display: flex;
  align-items: start;
  gap: 12px;
  min-height: 76px;
  padding: 15px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #fffaf1;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.option-choice:hover {
  transform: translateY(-1px);
  border-color: rgba(143, 35, 35, 0.42);
}

.option-choice strong {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #f1dfbd;
  color: var(--red-deep);
  font-weight: 950;
}

.option-choice span {
  font-size: 18px;
  line-height: 1.45;
}

.option-choice.is-selected {
  border-color: var(--gold);
  background: #fff3d7;
}

.option-choice.is-correct {
  border-color: #80b99c;
  background: #edf7f1;
}

.option-choice.is-wrong {
  border-color: #d79a8d;
  background: #fae7e1;
}

.practice-footer {
  display: grid;
  gap: 12px;
}

.practice-result {
  display: grid;
  gap: 5px;
  min-height: 74px;
  padding: 14px;
  border: 1px solid #ead2a0;
  border-radius: var(--radius);
  background: #fff5dd;
  color: #65430f;
}

.practice-result.good {
  border-color: #bad7c6;
  background: #edf7f1;
  color: #1f624d;
}

.practice-result.calm {
  border-color: #e4c0b7;
  background: #fae7e1;
  color: #7e241b;
}

.practice-result.is-feedback {
  animation: score-pop 520ms ease;
}

.practice-result strong,
.practice-result span,
.practice-result small {
  line-height: 1.45;
}

.practice-result strong {
  font-size: 18px;
}

.practice-result small {
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 750;
}

.answer-box {
  display: grid;
  gap: 12px;
  margin-top: 24px;
  padding: 16px;
  border-left: 5px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: #fff7e8;
}

.answer-box div {
  display: grid;
  gap: 5px;
}

.answer-box strong {
  color: var(--red-deep);
  font-size: 15px;
}

.answer-box span {
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.55;
}

.score-panel {
  display: grid;
  gap: 12px;
}

.score-team {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #eadbc1;
  border-radius: var(--radius);
  background: #fffaf2;
}

.score-team h3 {
  margin: 0;
  font-size: 18px;
}

.score-button {
  width: 100%;
  min-height: 50px;
  color: #fff;
}

.score-button.correct {
  background: var(--green-2);
}

.score-button.correct.soft {
  background: #2b8269;
}

.score-button.wrong {
  background: var(--danger);
}

.score-button.wrong.soft {
  background: #b44a3c;
}

.score-button.neutral {
  background: var(--gold);
}

.score-feedback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  animation: score-pop 520ms ease;
}

.score-feedback.good {
  border: 1px solid #a9cfb8;
  background: #e9f7ef;
  color: #184f3d;
}

.score-feedback.calm {
  border: 1px solid #ead2a0;
  background: #fff5dd;
  color: #65430f;
}

.score-feedback div {
  display: grid;
  gap: 4px;
}

.score-feedback strong {
  font-size: 20px;
}

.score-feedback span {
  font-size: 16px;
  font-weight: 850;
}

@keyframes score-pop {
  0% {
    transform: scale(0.985);
    opacity: 0.72;
  }
  55% {
    transform: scale(1.012);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

.buzzer-stage {
  display: grid;
  gap: 18px;
}

.buzzer-select-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.buzzer-select-card {
  display: grid;
  min-height: 240px;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(0, 0, 0, 0.18)),
    var(--team);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.buzzer-select-card span {
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 900;
}

.single-buzzer {
  display: grid;
  gap: 18px;
  min-height: min(680px, calc(100vh - 220px));
}

.single-buzzer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.single-buzzer-top strong {
  color: var(--team);
  font-size: clamp(28px, 4vw, 46px);
}

.single-buzzer-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.8fr);
  gap: 16px;
}

.single-buzzer-button,
.advisor-buzzer-button {
  display: grid;
  place-items: center;
  gap: 18px;
  min-height: 520px;
  padding: 32px;
  border: 4px solid rgba(255, 255, 255, 0.64);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.20), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.22)),
    var(--team);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 24px 60px rgba(35, 28, 18, 0.22);
}

.advisor-buzzer-button {
  border-color: rgba(247, 217, 139, 0.84);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.12), rgba(0, 0, 0, 0.20)),
    #6d4b12;
}

.single-buzzer-button.is-hit {
  filter: brightness(1.13);
  transform: scale(0.99);
  animation: answer-ring 540ms ease;
}

.advisor-buzzer-button.is-requested {
  filter: brightness(1.12);
  animation: advisor-pulse 720ms ease;
}

.single-buzzer-button span,
.advisor-buzzer-button span {
  font-size: clamp(38px, 7vw, 82px);
  font-weight: 900;
}

.single-buzzer-button strong,
.advisor-buzzer-button strong {
  font-size: clamp(48px, 10vw, 118px);
  line-height: 1;
}

.advisor-buzzer-button span {
  font-size: clamp(24px, 4vw, 42px);
}

.advisor-buzzer-button strong {
  font-size: clamp(36px, 6vw, 72px);
}

.buzzer-device-note {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink-soft);
  font-size: 18px;
  font-weight: 850;
  line-height: 1.45;
}

.student-observer-note,
.student-score-feedback {
  display: grid;
  gap: 8px;
  min-height: 150px;
  align-content: center;
  padding: 20px;
  border: 1px solid #dfc9a5;
  border-radius: var(--radius);
  background: #fff7e8;
  color: var(--ink-soft);
  box-shadow: var(--shadow-soft);
}

.student-observer-note strong,
.student-score-feedback strong {
  color: var(--red-deep);
  font-size: 26px;
  line-height: 1.2;
}

.student-observer-note span,
.student-score-feedback span {
  font-size: 18px;
  font-weight: 850;
  line-height: 1.45;
}

.student-score-feedback {
  min-height: 86px;
  animation: score-pop 520ms ease;
}

.student-score-feedback.good {
  border-color: #9fc9af;
  background: #e9f7ef;
  color: #184f3d;
}

.student-score-feedback.good strong {
  color: #184f3d;
}

.student-score-feedback.calm {
  border-color: #e4c0b7;
  background: #fae7e1;
  color: #7e241b;
}

.student-score-feedback.calm strong {
  color: #7e241b;
}

@keyframes answer-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 247, 223, 0.9), 0 24px 60px rgba(35, 28, 18, 0.22);
  }
  100% {
    box-shadow: 0 0 0 24px rgba(255, 247, 223, 0), 0 24px 60px rgba(35, 28, 18, 0.22);
  }
}

@keyframes advisor-pulse {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(0.985);
  }
  100% {
    transform: scale(1);
  }
}

.buzzer-control {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.buzzer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.team-button {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 190px;
  padding: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.14)),
    var(--team);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.team-button span {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
}

.team-button strong {
  font-size: clamp(18px, 2.4vw, 26px);
}

.team-button[disabled],
.primary-button[disabled],
.secondary-button[disabled],
.small-button[disabled],
.score-button[disabled] {
  cursor: not-allowed;
  opacity: 0.56;
  transform: none;
}

.advisor-panel {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: clamp(24px, 4vw, 44px);
}

.countdown {
  display: grid;
  width: min(260px, 100%);
  aspect-ratio: 1;
  place-items: center;
  border: 12px solid #ecd5a7;
  border-radius: 50%;
  background: #fffaf0;
  color: var(--red);
  font-size: clamp(58px, 9vw, 92px);
  font-weight: 900;
  line-height: 1;
}

.advisor-card .secondary-button,
.advisor-card .score-button {
  margin-top: 6px;
}

.device-signal-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.device-signal-panel h2 {
  margin: 0;
  font-size: 20px;
}

.device-signal-list {
  display: grid;
  gap: 8px;
}

.device-signal {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #eadbc1;
  border-radius: var(--radius);
  background: #fffaf2;
}

.device-signal.is-buzz {
  border-color: var(--team);
  border-left: 8px solid var(--team);
  background: #fffdf8;
}

.device-signal div {
  display: grid;
  gap: 3px;
}

.device-signal strong {
  font-size: 17px;
}

.device-signal.is-buzz strong {
  color: var(--team);
  font-size: 20px;
}

.device-signal span,
.device-signal small {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 850;
}

.device-signal.is-handled {
  opacity: 0.62;
}

.shared-question-note.has-buzz {
  border-color: var(--team);
  border-left: 7px solid var(--team);
  background: #fffdf8;
}

.shared-question-note.has-buzz strong,
.shared-question-note.has-buzz span {
  color: var(--team);
}

.duel-live-view button:hover,
.student-live-layout button:hover,
.student-standby-layout button:hover,
.single-buzzer button:hover {
  transform: none;
}

.metrics-grid,
.report-grid {
  display: grid;
  gap: 16px;
}

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

.metrics-grid article {
  display: grid;
  gap: 8px;
  min-height: 132px;
  align-content: center;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
}

.metrics-grid span {
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 850;
}

.metrics-grid strong {
  color: var(--red-deep);
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1;
}

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

.report-card {
  padding: 22px;
}

.report-card p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.65;
}

.practice-layout {
  display: grid;
  gap: 14px;
}

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

.session-result-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.section-title p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
  font-weight: 800;
}

.result-team-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.result-team-card {
  display: grid;
  gap: 8px;
  min-height: 142px;
  padding: 14px;
  border: 1px solid #eadbc1;
  border-left: 8px solid var(--team);
  border-radius: var(--radius);
  background: #fffaf2;
}

.result-team-card span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--team);
  color: #fff;
  font-weight: 950;
}

.result-team-card strong {
  font-size: 20px;
}

.result-team-card b {
  color: var(--team);
  font-size: 42px;
  line-height: 1;
}

.result-team-card small {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.45;
}

.table-panel {
  padding: 18px;
  overflow: auto;
}

.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.table-toolbar span {
  color: var(--ink-soft);
  font-weight: 850;
}

.simple-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: var(--radius);
}

.simple-table th,
.simple-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.simple-table th {
  color: var(--red-deep);
  background: #f7ecd8;
  font-size: 15px;
  white-space: nowrap;
}

.simple-table td {
  background: rgba(255, 255, 255, 0.72);
  font-size: 16px;
  line-height: 1.45;
}

.empty-state {
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 28px;
  border: 1px dashed #d5c09e;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink-soft);
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.55;
}

.empty-state.compact {
  min-height: 180px;
}

.scope-panel,
.join-match-panel,
.live-match-notice,
.editor-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.scope-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.scope-panel.compact {
  padding: 14px;
}

.team-name-setup {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.live-team-name-setup {
  max-width: 520px;
  margin: 0 auto;
  border-top: 6px solid var(--team);
}

.live-team-name-field {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 900;
}

.team-name-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.team-name-card {
  display: grid;
  gap: 9px;
}

.team-name-card span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 900;
}

.team-name-card i {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--team);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55);
}

.scope-head,
.editor-head,
.student-live-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.scope-head h2,
.editor-head h2,
.join-match-panel h2,
.student-live-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.22;
}

.scope-head p,
.editor-head p,
.join-match-panel p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.45;
}

.scope-mode-buttons,
.management-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.scope-picker-row,
.join-match-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.scope-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.scope-tags > span {
  color: var(--ink-soft);
  font-weight: 850;
}

.scope-tag {
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid rgba(23, 79, 61, 0.22);
  border-radius: 999px;
  background: #edf5ef;
  color: var(--green);
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
}

.live-match-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #dfc9a5;
  border-radius: var(--radius);
  background: #fff7e8;
  color: var(--red-deep);
  font-size: 15px;
  font-weight: 950;
  white-space: nowrap;
}

.duel-side-panel .live-match-badge {
  width: 100%;
  min-height: 58px;
  font-size: 22px;
}

.live-match-badge.good,
.live-match-notice.good {
  border-color: #bad7c6;
  background: #edf7f1;
  color: #1f624d;
}

.live-match-notice {
  display: grid;
  gap: 5px;
  padding: 14px;
  color: var(--ink-soft);
  font-weight: 850;
  line-height: 1.45;
}

.live-match-notice strong {
  color: var(--red-deep);
  font-size: 18px;
}

.match-code-card,
.match-code-mini {
  display: grid;
  min-width: 190px;
  gap: 5px;
  justify-items: center;
  padding: 18px;
  border: 1px solid #dfc9a5;
  border-radius: var(--radius);
  background: #fff7e8;
}

.match-code-card span,
.match-code-mini span {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 900;
}

.match-code-card strong {
  color: var(--red-deep);
  font-size: clamp(38px, 5vw, 56px);
  letter-spacing: 0.08em;
  line-height: 1;
}

.match-code-mini strong {
  color: var(--red-deep);
  font-size: 26px;
  letter-spacing: 0.08em;
}

.waiting-team-grid,
.lobby-score-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.waiting-team-card,
.lobby-score-card {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 18px;
  border: 1px solid var(--line);
  border-top: 7px solid var(--team);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.waiting-team-card {
  align-content: center;
  text-align: center;
}

.waiting-team-card.is-ready {
  border-color: rgba(31, 107, 85, 0.32);
  border-top-color: var(--team);
  background: #f2faf5;
}

.waiting-team-card span,
.lobby-score-card span {
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 900;
}

.waiting-team-card strong,
.lobby-score-card strong {
  color: var(--team);
  font-size: 29px;
  line-height: 1.12;
}

.waiting-team-card small,
.lobby-score-card small {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.35;
}

.rules-card ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 22px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 850;
  line-height: 1.55;
}

.rules-team-picker {
  max-width: 760px;
}

.lobby-status-note {
  padding: 16px 18px;
  border: 1px solid #d7bd82;
  border-left: 7px solid var(--gold);
  border-radius: var(--radius);
  background: #fff7e8;
  color: var(--red-deep);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.45;
  box-shadow: var(--shadow-soft);
}

.lobby-finish-actions {
  justify-content: end;
}

.student-standby-layout {
  display: grid;
  max-width: 920px;
  margin: 0 auto;
}

.student-score-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.management-layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.85fr) minmax(520px, 1.35fr);
  gap: 18px;
  align-items: start;
}

.management-layout.passages {
  grid-template-columns: minmax(0, 1fr);
}

.editor-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

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

.form-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.textarea-field.large {
  min-height: 140px;
}

.textarea-field.extra-large {
  min-height: 260px;
}

.management-list {
  max-height: 980px;
  overflow-x: hidden;
  overflow-y: auto;
}

.management-list-counts {
  display: grid;
  gap: 4px;
  justify-items: end;
  text-align: right;
}

.management-list-counts strong {
  color: var(--red-deep);
  font-size: 16px;
  font-weight: 950;
}

.question-form-actions {
  justify-content: space-between;
}

.question-filter-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.question-filter-grid .filter-label {
  min-width: 0;
}

.question-filter-grid .secondary-button {
  min-height: 48px;
  white-space: nowrap;
}

.question-management-list {
  display: grid;
  gap: 8px;
}

.question-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 64px;
  padding: 12px;
  border: 1px solid rgba(188, 167, 131, 0.58);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
}

.question-list-main {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.question-list-main strong,
.question-list-main span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.question-list-main strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 950;
}

.question-list-main span {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 850;
}

.join-match-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 14px;
  align-items: center;
  padding: 18px;
}

.join-match-panel.compact {
  grid-template-columns: minmax(0, 1fr) auto;
}

.join-match-panel .status-note {
  grid-column: 1 / -1;
}

.student-live-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 18px;
  align-items: start;
}

.student-live-layout.is-observer-only {
  grid-template-columns: minmax(0, 920px);
  justify-content: center;
}

.student-live-question {
  display: grid;
  gap: 14px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.student-question-card {
  box-shadow: none;
}

.live-buzzer {
  min-height: 0;
}

.live-buzzer .single-buzzer-actions {
  grid-template-columns: 1fr;
}

.live-buzzer .single-buzzer-button,
.live-buzzer .advisor-buzzer-button {
  min-height: 230px;
}

.site-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 28px clamp(16px, 4vw, 52px);
  background:
    linear-gradient(180deg, rgba(250, 241, 222, 0.98), rgba(234, 217, 184, 0.98)),
    repeating-linear-gradient(90deg, rgba(122, 77, 25, 0.04) 0 1px, transparent 1px 12px),
    var(--paper-deep);
  border-top: 1px solid rgba(189, 140, 43, 0.28);
  color: var(--ink);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.footer-mark {
  width: 42px;
  height: 42px;
  font-size: 23px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  color: var(--ink-soft);
  font-weight: 800;
}

.site-footer .footer-about-link {
  color: rgba(117, 104, 91, 0.74);
  font-size: 14px;
  font-weight: 700;
}

@keyframes landingLift {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(0.8deg);
  }
}

@keyframes floatingPaper {
  0%,
  100% {
    transform: translateY(0) rotate(-3deg);
  }
  50% {
    transform: translateY(-12px) rotate(2deg);
  }
}

@media (max-width: 1180px) {
  .dashboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

  .question-filter-grid .secondary-button {
    justify-self: start;
  }

  .main-nav a {
    padding: 0 16px;
  }
}

@media (max-width: 980px) {
  .topbar {
    flex-wrap: wrap;
    align-items: center;
    min-height: 74px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .brand strong {
    white-space: normal;
    font-size: 18px;
  }

  .brand small {
    display: none;
  }

  .mobile-menu-button {
    display: block;
  }

  .main-nav {
    display: none;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .topbar.menu-open .main-nav {
    display: grid;
  }

  .main-nav a {
    justify-content: center;
    min-height: 48px;
    padding: 0 12px;
    border: 1px solid rgba(189, 140, 43, 0.26);
    border-radius: var(--radius);
  }

  .landing-hero,
  .login-layout {
    grid-template-columns: 1fr;
  }

  .landing-hero {
    min-height: auto;
  }

  .landing-visual {
    min-height: 360px;
  }

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

	  .entry-board,
	  .home-choice-grid,
	  .login-grid,
	  .hub-grid,
  .mode-choice-grid,
  .learn-layout,
  .teacher-layout,
  .duel-workspace,
  .duel-focus-layout,
  .management-layout,
  .student-live-layout,
  .join-match-panel,
  .setup-grid,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .duel-focus-layout .active-question-panel {
    min-height: 0;
  }

  .scoreboard,
  .buzzer-grid,
  .buzzer-select-grid,
  .team-name-grid,
  .waiting-team-grid,
  .lobby-score-grid,
  .round-choice-grid,
  .metrics-grid,
  .result-team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .learn-layout {
    height: auto;
    min-height: 0;
  }

  .passage-list {
    height: auto;
    max-height: 420px;
  }

  .reading-panel {
    height: auto;
    max-height: 72vh;
  }

  .control-panel {
    grid-template-columns: 1fr;
  }

  .filters {
    grid-template-columns: minmax(0, 1fr) 160px;
  }

  .filters .field {
    grid-column: 1 / -1;
  }

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

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

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

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

  .hub-card {
    min-height: 180px;
  }

  .single-buzzer-actions {
    grid-template-columns: 1fr;
  }

  .advisor-buzzer-button {
    min-height: 220px;
  }

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

@media (min-width: 721px) and (max-width: 980px) {
  :root {
    --content: min(920px, calc(100% - 32px));
  }

  body::before {
    height: 190px;
  }

  .page {
    padding-top: 24px;
    padding-bottom: 58px;
  }

  .topbar {
    min-height: 70px;
    padding: 10px 20px;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
    font-size: 24px;
  }

  .brand strong {
    max-width: 18em;
    font-size: 20px;
    white-space: nowrap;
  }

  .mobile-menu-button {
    width: 48px;
    height: 48px;
  }

  .landing-hero {
    gap: 20px;
    padding: 34px 40px 28px;
  }

  .landing-copy {
    gap: 16px;
  }

  .landing-copy h1 {
    font-size: 60px;
    line-height: 1.05;
  }

  .landing-visual {
    min-height: 330px;
  }

  .login-layout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.86fr);
    gap: 18px;
    align-items: stretch;
  }

  .login-intro {
    align-content: start;
    gap: 12px;
    padding: 22px;
  }

  .login-intro h2 {
    font-size: 31px;
  }

  .login-intro p {
    font-size: 16px;
    line-height: 1.58;
  }

  .login-intro img {
    height: 250px;
    min-height: 0;
    padding: 22px;
  }

  .login-layout .login-card {
    width: 100%;
    padding: 24px;
  }

  .dashboard-view {
    gap: 22px;
  }

  .dashboard-hero {
    align-items: start;
    padding: 24px;
  }

  .dashboard-hero h1 {
    font-size: 44px;
  }

  .dashboard-hero p {
    font-size: 17px;
  }

  .dashboard-card {
    min-height: 190px;
  }

  .dashboard-card-media,
  .dashboard-card-icon {
    margin: 18px 18px 0;
  }

  .dashboard-card-body {
    padding: 18px;
  }

  .hub-card {
    min-height: 170px;
  }

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

  .practice-entry-card {
    min-height: 178px;
  }

  .learn-page {
    width: min(920px, calc(100% - 28px));
    padding-top: 18px;
  }

  .learn-page .view,
  .learn-page .control-panel,
  .learn-page .filters,
  .learn-page .learn-layout,
  .learn-page .passage-list,
  .learn-page .reading-panel {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
  }

  .learn-page .page-heading {
    align-items: center;
  }

  .learn-page .page-heading h1 {
    font-size: 40px;
  }

  .learn-page .control-panel {
    grid-template-columns: minmax(0, 1fr) 92px;
    gap: 12px;
    padding: 14px;
    width: 100%;
  }

  .learn-page .filters {
    grid-template-columns: minmax(0, 1fr) minmax(210px, 0.9fr) 112px;
    gap: 10px;
    width: 100%;
  }

  .learn-page .filter-label {
    min-width: 0;
  }

  .learn-page .category-buttons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .learn-page .field {
    min-height: 46px;
  }

  .learn-page .category-button,
  .learn-page .control-panel .secondary-button {
    min-height: 46px;
  }

  .learn-page .compact-progress {
    min-height: 66px;
  }

  .learn-page .compact-progress strong {
    font-size: 28px;
  }

  .learn-page .learn-layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: auto;
    min-height: 0;
  }

  .learn-page .passage-list {
    display: flex;
    gap: 10px;
    height: auto;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 12px;
    scroll-snap-type: x proximity;
  }

  .learn-page .passage-card {
    flex: 0 0 210px;
    min-height: 84px;
    padding: 12px;
    scroll-snap-align: start;
  }

  .learn-page .passage-card small {
    -webkit-line-clamp: 1;
  }

  .learn-page .reading-panel {
    width: 100%;
    max-height: none;
    min-height: calc(100vh - 318px);
    padding: 24px;
    scroll-margin-top: 82px;
  }

  .learn-page .reading-title {
    align-items: start;
    gap: 14px;
  }

  .learn-page .reading-title h1,
  .learn-page .reading-title h2 {
    font-size: 34px;
  }

  .learn-page .reading-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 260px;
  }

  .learn-page .reading-actions .secondary-button,
  .learn-page .reading-actions .small-button,
  .learn-page .read-complete-button {
    min-height: 44px;
  }

  .learn-page .reading-text {
    font-size: 24px;
    line-height: 2.05;
  }

  .learn-page .study-summary p,
  .learn-page .study-section p,
  .learn-page .key-point-list,
  .learn-page .study-text {
    font-size: 18px;
    line-height: 1.85;
  }

  .learn-page .passage-quiz-question {
    padding: 18px;
  }

  .learn-page .passage-quiz-question p {
    font-size: 18px;
  }

  .learn-page .passage-quiz-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .question-text {
    font-size: 28px;
  }

  .option-choice,
  .passage-quiz-options .option-choice {
    min-height: 84px;
    padding: 16px;
  }

  .student-live-layout,
  .join-match-panel,
  .duel-focus-layout {
    gap: 16px;
  }

  .single-buzzer {
    min-height: 620px;
  }

  .single-buzzer-button {
    min-height: 430px;
  }

  .site-footer {
    gap: 18px;
    padding: 22px 24px;
  }
}

@media (min-width: 981px) and (max-width: 1180px) {
  .learn-layout {
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
    height: min(720px, calc(100vh - 218px));
  }

  .reading-panel {
    padding: 30px;
  }

  .landing-hero {
    min-height: min(560px, calc(100vh - 132px));
  }
}

@media (min-width: 981px) and (max-width: 1180px) and (max-height: 820px) {
  :root {
    --content: min(1120px, calc(100% - 32px));
  }

  body::before {
    height: 140px;
  }

  .topbar {
    min-height: 64px;
    padding: 0 18px;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
    font-size: 24px;
  }

  .brand strong {
    font-size: 20px;
  }

  .brand small {
    font-size: 13px;
  }

  .main-nav a {
    min-height: 64px;
    padding: 0 12px;
    font-size: 16px;
  }

  .page {
    padding-top: 14px;
    padding-bottom: 42px;
  }

  .view {
    gap: 14px;
  }

  .page-heading {
    align-items: center;
  }

  .page-heading > div {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: 16px;
  }

  .back-link {
    margin-bottom: 0;
    font-size: 14px;
  }

  .page-heading h1 {
    font-size: 36px;
  }

  .landing-hero {
    min-height: 380px;
    padding: 28px 34px;
  }

  .landing-copy h1 {
    font-size: 56px;
  }

  .landing-visual {
    min-height: 300px;
  }

  .dashboard-view {
    gap: 16px;
  }

  .dashboard-hero {
    align-items: center;
    padding: 20px 24px;
  }

  .dashboard-hero h1 {
    margin: 8px 0 6px;
    font-size: 42px;
  }

  .dashboard-card {
    min-height: 178px;
  }

  .dashboard-card-media,
  .dashboard-card-icon {
    margin: 16px 16px 0;
  }

  .dashboard-card-body {
    padding: 16px;
  }

  .learn-page {
    padding-top: 12px;
  }

  .learn-page .view,
  .learn-page .control-panel,
  .learn-page .filters,
  .learn-page .learn-layout,
  .learn-page .passage-list,
  .learn-page .reading-panel {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
  }

  .learn-page .page-heading {
    align-items: center;
  }

  .learn-page .control-panel {
    grid-template-columns: minmax(0, 1fr) 74px;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
  }

  .learn-page .filters {
    grid-template-columns: minmax(220px, 1fr) minmax(250px, 0.7fr) 108px;
    gap: 8px;
  }

  .learn-page .filter-label {
    gap: 4px;
    font-size: 14px;
  }

  .learn-page .field,
  .learn-page .select-field,
  .learn-page .category-button,
  .learn-page .control-panel .secondary-button {
    min-height: 40px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .learn-page .category-button {
    font-size: 16px;
  }

  .learn-page .compact-progress {
    min-height: 56px;
    padding: 7px 4px;
  }

  .learn-page .compact-progress strong {
    font-size: 25px;
  }

  .learn-page .compact-progress span {
    font-size: 12px;
  }

  .learn-layout {
    grid-template-columns: minmax(178px, 210px) minmax(0, 1fr);
    gap: 12px;
    height: max(500px, calc(100vh - 244px));
    min-height: 500px;
  }

  .passage-list {
    gap: 8px;
    padding-right: 3px;
  }

  .passage-card {
    min-height: 72px;
    padding: 10px;
  }

  .passage-card strong {
    font-size: 15px;
  }

  .reading-panel {
    padding: 22px;
    scroll-margin-top: 72px;
  }

  .reading-title {
    gap: 12px;
    padding-bottom: 14px;
  }

  .reading-title h1,
  .reading-title h2 {
    margin-top: 8px;
    font-size: 32px;
  }

  .reading-actions .secondary-button,
  .reading-actions .small-button {
    min-height: 40px;
    padding: 8px 12px;
  }

  .reading-status-row {
    margin-top: 10px;
    padding: 10px 12px;
  }

  .reading-text {
    margin-top: 18px;
    font-size: 23px;
    line-height: 1.95;
  }

  .passage-quiz {
    gap: 14px;
    margin-top: 24px;
    padding-top: 20px;
  }

  .passage-quiz-question {
    padding: 14px;
  }

  .passage-quiz-options {
    gap: 9px;
  }

  .passage-quiz-options .option-choice {
    min-height: 76px;
  }

  .match-bar {
    gap: 10px;
    padding: 10px 12px;
  }

  .match-bar strong {
    font-size: 18px;
  }

  .match-bar .primary-button,
  .match-bar .secondary-button {
    min-height: 42px;
    padding: 9px 13px;
  }

  .practice-layout {
    gap: 10px;
  }

  .practice-card {
    gap: 14px;
    padding: 20px;
  }

  .question-meta {
    gap: 6px;
    margin-bottom: 10px;
  }

  .question-meta span {
    min-height: 28px;
    padding: 5px 9px;
    font-size: 13px;
  }

  .question-text {
    font-size: 30px;
    line-height: 1.38;
  }

  .options-grid {
    gap: 8px;
    margin-top: 18px;
  }

  .option-choice {
    min-height: 72px;
    padding: 13px;
  }

  .practice-result {
    min-height: 62px;
    padding: 12px;
  }

  .practice-footer {
    gap: 10px;
  }

  .single-buzzer {
    min-height: 500px;
  }

  .single-buzzer-button {
    min-height: 320px;
  }
}

@media (hover: none) {
  .role-entry:hover,
  .module-card:hover,
  .dashboard-card:hover,
  .practice-entry-card:hover,
  .option-choice:hover,
  .category-button:hover,
  .read-complete-button:hover {
    transform: none;
  }
}

@media (max-width: 720px) {
  :root {
    --content: min(100% - 24px, 1200px);
  }

  body::before {
    height: 160px;
  }

  .page {
    padding-top: 24px;
  }

  .page.duel-page {
    padding-top: 12px;
  }

	  .home-top,
	  .page-heading,
	  .account-panel,
  .dashboard-hero,
	  .match-bar,
  .scope-head,
  .editor-head,
  .student-live-head,
  .duel-live-top,
  .setup-step-bar,
  .lobby-head,
  .waiting-room-hero,
  .site-footer {
    align-items: start;
    flex-direction: column;
  }

  .duel-live-title {
    align-items: center;
    flex: 1 1 100%;
    flex-direction: row;
    gap: 10px;
  }

  .duel-live-top {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 7px;
  }

  .duel-live-meta,
  .student-live-tools {
    justify-content: space-between;
    width: 100%;
  }

  .duel-live-title strong {
    font-size: 20px;
  }

  .question-filter-grid {
    grid-template-columns: 1fr;
  }

  .management-list-counts {
    justify-items: start;
    text-align: left;
  }

  .duel-live-top .stage-tabs {
    flex: 1 1 auto;
    gap: 6px;
  }

  .challenge-mode-switch {
    flex: 1 1 100%;
  }

  .mode-toggle {
    flex: 1 1 0;
  }

  .duel-live-top .tab-button,
  .duel-live-top .danger-button {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 14px;
  }

	  .home-counts {
	    justify-content: flex-start;
	  }

	  .account-actions,
	  .account-strip a {
	    justify-content: flex-start;
	    margin-left: 0;
	  }

  .entry-board {
    gap: 16px;
  }

  .role-entry {
    grid-template-columns: 1fr;
  }

  .entry-image img {
    min-height: 170px;
  }

  .entry-image::after {
    background: linear-gradient(180deg, transparent 52%, rgba(255, 255, 255, 0.9));
  }

  .module-grid,
  .landing-feature-grid,
  .dashboard-grid,
  .hub-grid,
  .practice-entry-grid,
  .filters,
  .form-grid.two,
  .form-grid.four,
  .scope-picker-row,
  .join-match-form,
  .scoreboard,
  .buzzer-grid,
  .buzzer-select-grid,
  .team-name-grid,
  .mode-choice-grid,
  .waiting-team-grid,
  .lobby-score-grid,
  .round-choice-grid,
  .student-score-strip,
	  .metrics-grid,
	  .result-team-grid,
	  .options-grid,
  .passage-quiz-options,
	  .shared-score-card-actions,
  .wide-actions,
  .question-actions,
	  .practice-actions {
	    grid-template-columns: 1fr;
	  }

  .passage-quiz-head,
  .passage-quiz-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .shared-score-title {
    align-items: start;
    flex-direction: column;
  }

  .module-card {
    min-height: 124px;
  }

  .landing-hero {
    padding: 22px;
  }

  .landing-copy h1 {
    font-size: 42px;
  }

  .landing-visual {
    min-height: 280px;
  }

  .landing-visual-side {
    width: 46%;
  }

  .dashboard-summary {
    justify-content: flex-start;
  }

  .dashboard-card {
    min-height: 206px;
  }

  .practice-entry-card {
    min-height: 180px;
  }

  .practice-entry-card strong {
    font-size: 30px;
  }

  .passage-check-list {
    grid-template-columns: 1fr;
    max-height: 430px;
  }

  .scope-batch-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .scope-batch-actions > span {
    margin-right: 0;
  }

  .passage-list {
    height: auto;
    max-height: 260px;
  }

  .reading-panel {
    height: auto;
    max-height: none;
    min-height: auto;
  }

	  .reading-title {
	    flex-direction: column;
	  }

  .reading-actions {
    justify-content: flex-start;
  }

	  .study-summary {
	    grid-template-columns: 1fr;
	  }

  .source-link {
    justify-self: start;
  }

  .question-text {
    font-size: 25px;
  }

  .duel-focus-layout .question-text {
    font-size: 31px;
  }

  .team-button {
    min-height: 142px;
  }

  .buzzer-select-card {
    min-height: 150px;
  }

  .single-buzzer {
    min-height: 520px;
  }

  .single-buzzer-button {
    min-height: 360px;
  }

  .advisor-buzzer-button {
    min-height: 170px;
  }

  .score-feedback {
    align-items: stretch;
    flex-direction: column;
  }

  .simple-table {
    min-width: 640px;
  }

  .site-footer nav {
    gap: 12px;
  }

  .learn-page {
    width: min(100% - 16px, 1200px);
    padding-top: 14px;
    padding-bottom: 36px;
  }

  .learn-page .page-heading {
    gap: 8px;
  }

  .learn-page .page-heading h1 {
    font-size: 30px;
  }

  .learn-page .back-link {
    margin-bottom: 4px;
    font-size: 14px;
  }

  .learn-page .control-panel {
    grid-template-columns: minmax(0, 1fr) 66px;
    gap: 10px;
    padding: 12px;
  }

  .learn-page .filters {
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
  }

  .learn-page .filters .filter-label:first-child {
    grid-column: auto;
  }

  .learn-page .category-buttons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .learn-page .category-button {
    min-height: 38px;
    padding: 7px 8px;
    font-size: 15px;
  }

  .learn-page .filter-label {
    gap: 5px;
  }

  .learn-page .filter-label > span {
    font-size: 13px;
  }

  .learn-page .field,
  .learn-page .select-field {
    min-height: 42px;
    padding: 9px 11px;
    font-size: 15px;
  }

  .learn-page .control-panel .secondary-button {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 14px;
  }

  .learn-page .compact-progress {
    align-self: stretch;
    min-height: 42px;
    padding: 6px 4px;
  }

  .learn-page .compact-progress strong {
    font-size: 22px;
  }

  .learn-page .compact-progress span {
    font-size: 12px;
  }

  .learn-page .learn-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    min-width: 0;
  }

  .learn-page .passage-list {
    display: flex;
    gap: 8px;
    width: 100%;
    min-width: 0;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 10px;
    scroll-snap-type: x proximity;
  }

  .learn-page .passage-card {
    flex: 0 0 min(58vw, 220px);
    min-height: 78px;
    padding: 10px;
    scroll-snap-align: center;
  }

  .learn-page .passage-card strong {
    font-size: 16px;
  }

  .learn-page .passage-card small {
    -webkit-line-clamp: 1;
  }

  .learn-page .reading-panel {
    width: 100%;
    min-width: 0;
    padding: 16px;
    scroll-margin-top: 82px;
  }

  .learn-page .reading-title {
    gap: 10px;
    padding-bottom: 12px;
  }

  .learn-page .reading-title h1,
  .learn-page .reading-title h2 {
    margin-top: 7px;
    font-size: 25px;
  }

  .learn-page .reading-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    gap: 8px;
  }

  .learn-page .reading-actions .secondary-button,
  .learn-page .reading-actions .small-button {
    min-height: 38px;
    padding: 8px 9px;
    font-size: 14px;
  }

  .learn-page .reading-text {
    margin-top: 16px;
    font-size: 22px;
    line-height: 1.9;
  }

  .learn-page .reading-status-row {
    align-items: stretch;
    margin-top: 10px;
    padding: 10px;
    font-size: 14px;
  }

  .learn-page .read-complete-button {
    width: 100%;
    min-height: 38px;
    font-size: 14px;
  }

  .learn-page .study-area {
    gap: 14px;
    margin-top: 22px;
    padding-top: 16px;
  }

  body.reading-mode-active .learn-page {
    width: min(100% - 16px, 920px);
    padding-top: 8px;
  }

  body.reading-mode-active .reading-focus-panel {
    min-height: calc(100vh - 16px);
  }

  body.reading-mode-active .reading-title {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: -16px -16px 0;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.96);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
