:root {
  color-scheme: light;
  --page-bg: #f5f9f3;
  --surface: #ffffff;
  --surface-soft: #f8fbf7;
  --surface-tint: #edf6ee;
  --text: #1d2b23;
  --text-soft: #405448;
  --muted: #6c7d72;
  --line: #dfeae1;
  --line-strong: #cadbc9;
  --primary: #2f7d50;
  --primary-dark: #245f3d;
  --primary-soft: #e6f3e9;
  --orange: #c96f24;
  --orange-soft: #fff0e1;
  --red: #b54843;
  --red-soft: #fcebea;
  --blue: #2d6b96;
  --blue-soft: #eaf3fa;
  --shadow-sm: 0 3px 12px rgba(42, 76, 52, 0.06);
  --shadow-md: 0 10px 28px rgba(42, 76, 52, 0.1);
  --shadow-lg: 0 24px 80px rgba(25, 47, 33, 0.2);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: var(--primary-dark);
}

img,
svg {
  display: block;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  transform: translateY(-150%);
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--primary-dark);
  color: #ffffff;
  font-size: 14px;
  text-decoration: none;
  transition: transform 0.16s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: #fbfdf9;
}

.header-inner {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 460px) auto;
  gap: 24px;
  align-items: center;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 24px;
}

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

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid #f2d9b9;
  border-radius: 20px;
  background: #fff4e6;
  font-size: 30px;
  box-shadow: inset 0 -4px 0 rgba(201, 111, 36, 0.08);
}

.brand-copy {
  min-width: 0;
}

.brand-eyebrow {
  margin: 0 0 1px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.brand-copy h1 {
  margin: 0;
  font-size: clamp(24px, 2.4vw, 30px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-form {
  min-width: 0;
}

.search-control {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 12px 0 15px;
  border: 1.5px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-control:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(47, 125, 80, 0.12);
}

.search-icon {
  flex: 0 0 auto;
  color: var(--muted);
}

.search-control input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.search-control input::placeholder {
  color: #94a49a;
}

.search-control input:disabled {
  cursor: wait;
}

.search-control input::-webkit-search-cancel-button,
.search-control input::-webkit-search-decoration {
  display: none;
  -webkit-appearance: none;
}

.search-clear {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface-tint);
  color: var(--text-soft);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}

.search-clear:hover {
  background: #dcecdf;
}

.search-key {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #8c9d91;
  font-size: 11px;
  line-height: 1;
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-stat {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.header-stat strong {
  color: var(--primary-dark);
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* Theme navigation */
.theme-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 253, 249, 0.96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.theme-nav-inner {
  display: flex;
  gap: 8px;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 12px 24px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #c9d9cb transparent;
  overscroll-behavior-x: contain;
}

.theme-nav-inner::-webkit-scrollbar {
  height: 5px;
}

.theme-nav-inner::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: #c9d9cb;
}

.nav-loading {
  padding: 7px 3px;
  color: var(--muted);
  font-size: 13px;
}

.theme-pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.theme-pill:hover {
  border-color: var(--line-strong);
  background: var(--surface-tint);
  transform: translateY(-1px);
}

.theme-pill:focus-visible {
  outline: 3px solid rgba(47, 125, 80, 0.22);
  outline-offset: 2px;
}

.theme-pill.is-active {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
  color: #ffffff;
}

.theme-pill-count {
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.theme-pill.is-active .theme-pill-count {
  background: rgba(255, 255, 255, 0.17);
  color: #ffffff;
}

/* Main layout */
.site-main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 36px 24px 64px;
}

.browse-heading {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
}

.heading-copy {
  min-width: 0;
}

.section-kicker {
  margin: 0 0 5px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.heading-copy h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.page-description {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.difficulty-filter {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.filter-label {
  padding-left: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.filter-buttons {
  display: flex;
  gap: 4px;
}

.filter-btn {
  min-height: 34px;
  padding: 6px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.filter-btn:hover {
  background: var(--surface-tint);
}

.filter-btn:focus-visible {
  outline: 3px solid rgba(47, 125, 80, 0.22);
  outline-offset: 1px;
}

.filter-btn.is-active {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.results-summary {
  min-height: 22px;
  margin: 18px 0 14px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* Cards */
.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 16px;
}

.level-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 13px;
  width: 100%;
  min-height: 218px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.level-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.level-card:focus-visible {
  outline: 3px solid rgba(47, 125, 80, 0.26);
  outline-offset: 2px;
}

.card-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.theme-badge {
  max-width: 70%;
  padding: 3px 8px;
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.level-id {
  color: #84968a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.01em;
}

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

.level-number {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
}

.level-number strong {
  color: var(--text);
  font-size: 29px;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.difficulty-tag {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.difficulty-tag::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.difficulty-easy {
  background: #e8f5e9;
  color: #347a42;
}

.difficulty-normal {
  background: var(--orange-soft);
  color: #a95c1e;
}

.difficulty-hard {
  background: var(--red-soft);
  color: var(--red);
}

.card-tip {
  display: -webkit-box;
  min-height: 40px;
  margin: 0;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #edf3ee;
}

.tower-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.tower-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border: 1px solid #dbe8dd;
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.no-tower {
  color: #8b9b90;
  font-size: 11px;
}

.video-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.video-status::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.video-status.is-missing {
  color: #8b9b90;
}

.video-status.is-available {
  color: #2d7d46;
}

/* Empty and load states */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 64px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 12px;
  border-radius: 18px;
  background: var(--surface-tint);
  font-size: 27px;
}

.empty-state h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.empty-state p {
  max-width: 480px;
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 14px;
}

.load-more-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 30px 0 8px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 18px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.primary-button {
  border: 1px solid var(--primary-dark);
  background: var(--primary-dark);
  color: #ffffff;
}

.primary-button:hover {
  background: #1c4f32;
  transform: translateY(-1px);
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

.secondary-button:hover {
  border-color: var(--primary);
  background: var(--surface-tint);
}

.primary-button:focus-visible,
.secondary-button:focus-visible {
  outline: 3px solid rgba(47, 125, 80, 0.24);
  outline-offset: 2px;
}

.scroll-hint,
.end-message {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.end-message {
  padding: 30px 0 4px;
  text-align: center;
}

/* Loading and error */
.state-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  padding: 48px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: center;
}

.state-panel h2 {
  margin: 14px 0 5px;
  font-size: 20px;
}

.state-panel p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.loading-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #dcebe0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.state-panel-error .state-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
  font-size: 24px;
  font-weight: 800;
}

.state-panel-error .primary-button {
  margin-top: 20px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #fbfdf9;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 22px 24px;
  color: #7d8e83;
  font-size: 12px;
}

.footer-inner p {
  margin: 0;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(19, 36, 25, 0.46);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  max-height: min(90vh, 860px);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  outline: none;
}

.modal-dialog:focus {
  outline: none;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 17px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text-soft);
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.modal-close:hover {
  border-color: var(--line-strong);
  background: var(--surface-tint);
}

.modal-close:focus-visible {
  outline: 3px solid rgba(47, 125, 80, 0.26);
  outline-offset: 2px;
}

.modal-header {
  padding: 25px 64px 18px 28px;
  border-bottom: 1px solid var(--line);
}

.modal-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.modal-title-row h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 800;
  letter-spacing: -0.025em;
}

.modal-theme {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.modal-content {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(270px, 0.85fr);
}

.modal-media {
  min-width: 0;
  padding: 24px 24px 26px 28px;
  background: var(--surface-soft);
}

.video-area {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #eaf2eb;
}

.video-area iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 20px;
  text-align: center;
}

.video-placeholder-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 10px;
  border: 1px solid #d3e2d6;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  color: var(--primary);
  font-size: 20px;
}

.video-placeholder h3 {
  margin: 0;
  font-size: 17px;
}

.video-placeholder p {
  margin: 5px 0 13px;
  color: var(--muted);
  font-size: 12px;
}

.bili-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid var(--primary-dark);
  border-radius: 10px;
  background: var(--primary-dark);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.16s ease, transform 0.16s ease;
}

.bili-button:hover {
  background: #1c4f32;
  transform: translateY(-1px);
}

.bili-button:focus-visible {
  outline: 3px solid rgba(47, 125, 80, 0.28);
  outline-offset: 2px;
}

.media-note {
  margin: 10px 2px 0;
  color: #84958a;
  font-size: 11px;
}

.modal-info {
  min-width: 0;
  padding: 26px 28px 28px;
  border-left: 1px solid var(--line);
}

.info-block + .info-block {
  margin-top: 24px;
}

.info-block h3 {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.modal-tip {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.modal-info .tower-list {
  gap: 6px;
}

.modal-info .tower-tag {
  padding: 5px 9px;
  font-size: 12px;
}

.info-meta {
  display: grid;
  gap: 10px;
  margin: 28px 0 0;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.info-meta > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.info-meta dt {
  color: var(--muted);
  font-size: 12px;
}

.info-meta dd {
  margin: 0;
  color: var(--text-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.noscript-warning {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 300;
  padding: 14px 18px;
  border: 1px solid #e4c6c1;
  border-radius: 12px;
  background: #fff4f2;
  color: #81332f;
  font-size: 14px;
  text-align: center;
}

/* Responsive */
@media (max-width: 980px) {
  .header-inner {
    grid-template-columns: minmax(250px, 1fr) minmax(270px, 1fr);
    gap: 16px 24px;
  }

  .header-stats {
    display: none;
  }

  .modal-content {
    grid-template-columns: minmax(0, 1.25fr) minmax(250px, 0.75fr);
  }
}

@media (max-width: 760px) {
  .site-main {
    padding-top: 26px;
  }

  .browse-heading {
    display: block;
  }

  .difficulty-filter {
    width: max-content;
    max-width: 100%;
    margin-top: 17px;
  }

  .filter-buttons {
    overflow-x: auto;
  }

  .modal {
    padding: 12px;
  }

  .modal-dialog {
    max-height: calc(100vh - 24px);
  }

  .modal-content {
    grid-template-columns: 1fr;
  }

  .modal-info {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .footer-inner {
    display: block;
  }

  .footer-inner p + p {
    margin-top: 4px;
  }
}

@media (max-width: 640px) {
  .header-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 18px 16px;
  }

  .brand-block {
    width: 100%;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    font-size: 25px;
  }

  .brand-copy h1 {
    font-size: 24px;
  }

  .brand-subtitle {
    font-size: 12px;
  }

  .search-form {
    width: 100%;
  }

  .search-control {
    min-height: 45px;
  }

  .search-key {
    display: none;
  }

  .theme-nav-inner {
    gap: 7px;
    padding: 9px 16px;
  }

  .theme-pill {
    min-height: 34px;
    padding: 6px 11px;
    font-size: 12px;
  }

  .site-main {
    padding: 23px 16px 48px;
  }

  .section-kicker {
    font-size: 11px;
  }

  .heading-copy h2 {
    font-size: 25px;
  }

  .page-description {
    font-size: 13px;
  }

  .difficulty-filter {
    width: 100%;
    justify-content: space-between;
    gap: 4px;
    padding: 4px;
  }

  .filter-label {
    padding-left: 7px;
  }

  .filter-buttons {
    flex: 1;
    justify-content: flex-end;
    gap: 2px;
  }

  .filter-btn {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    font-size: 12px;
  }

  .results-summary {
    margin: 15px 0 11px;
  }

  .level-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .level-card {
    min-height: 0;
    padding: 16px;
  }

  .level-number strong {
    font-size: 27px;
  }

  .empty-state {
    padding: 48px 20px;
  }

  .empty-state h2 {
    font-size: 22px;
  }

  .modal {
    display: block;
    padding: 0;
  }

  .modal-dialog {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    overflow-y: auto;
    border: 0;
    border-radius: 0;
  }

  .modal-close {
    position: fixed;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    box-shadow: 0 3px 14px rgba(30, 50, 36, 0.16);
  }

  .modal-header {
    padding: 19px 54px 15px 17px;
  }

  .modal-title-row h2 {
    font-size: 23px;
  }

  .modal-content {
    display: flex;
    flex-direction: column;
  }

  .modal-media {
    padding: 15px;
  }

  .video-area {
    border-radius: 12px;
  }

  .modal-info {
    padding: 20px 17px 30px;
  }

  .media-note {
    font-size: 10px;
  }

  .footer-inner {
    padding: 18px 16px;
  }
}

@media (max-width: 380px) {
  .brand-subtitle {
    display: none;
  }

  .filter-label {
    display: none;
  }

  .video-placeholder {
    padding: 12px;
  }

  .video-placeholder-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 6px;
    font-size: 16px;
  }

  .video-placeholder h3 {
    font-size: 15px;
  }

  .video-placeholder p {
    margin-bottom: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
