:root {
  --paper: #f5f5f5;
  --ink: #121212;
  --news-yellow: #f3ce09;
  --news-blue: #0a4e96;
  --news-red: #c1111c;
  --news-orange: #de8a15;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body.quizzes-page {
  min-height: 100dvh;
  background: #d5d5d5;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-inline: 0.15rem;
}

.portal-shell {
  width: min(1540px, 100%);
  margin: 0;
  border-left: 1px solid #868686;
  border-right: 1px solid #868686;
  background: #efefef;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 200;
  background: #000;
  color: #fff;
  padding: 0.45rem 0.65rem;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

.billboard-ad {
  position: relative;
  min-height: 138px;
  border-bottom: 3px solid #1a1a1a;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.94), rgba(210, 220, 230, 0.98)),
    repeating-linear-gradient(
      -55deg,
      rgba(26, 86, 151, 0.08) 0,
      rgba(26, 86, 151, 0.08) 14px,
      rgba(26, 86, 151, 0) 14px,
      rgba(26, 86, 151, 0) 30px
    );
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  padding: 0.8rem;
}

.billboard-ad::after {
  content: '';
  position: absolute;
  right: 14%;
  bottom: 14px;
  width: min(300px, 35vw);
  height: 66px;
  border-radius: 44px;
  border: 2px solid rgba(70, 70, 70, 0.45);
  background: linear-gradient(180deg, #8b9098, #5f6772);
  opacity: 0.7;
}

.billboard-tag {
  margin: 0;
  align-self: start;
  border: 1px solid #0b2f63;
  background: #0a4e96;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0.25rem 0.45rem;
}

.billboard-copy {
  position: relative;
  z-index: 1;
}

.billboard-kicker {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #0b4f96;
}

.billboard-copy h1 {
  margin: 0.3rem 0 0;
  font-family: 'Arial Black', Impact, sans-serif;
  font-size: clamp(1.1rem, 2.4vw, 1.85rem);
  line-height: 1.1;
  color: #1f3d61;
  max-width: 28ch;
}

.billboard-cta {
  position: relative;
  z-index: 1;
  min-height: 2.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #0e0e0e;
  background: #111;
  color: #fff;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.8rem;
}

.quizzes-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: stretch;
  border-bottom: 4px solid #101010;
}

.header-link {
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-right: 2px solid #111;
  border-left: 2px solid #111;
  color: #fff;
  background: var(--news-blue);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.75rem;
}

.header-link-accent {
  background: var(--news-red);
}

.is-disabled-link {
  cursor: default;
  pointer-events: none;
}

.news-brand {
  background: var(--news-yellow);
  color: #0c0c0c;
  border-right: 2px solid #111;
  border-left: 2px solid #111;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 0.35rem 0.6rem;
}

.brand-kicker {
  margin: 0;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}

.news-brand h2 {
  margin: 0.18rem 0 0;
  font-family: 'Arial Black', Impact, sans-serif;
  font-size: clamp(1.45rem, 4vw, 2.4rem);
  line-height: 0.88;
  letter-spacing: 0.02em;
}

.utility-bar {
  border-bottom: 2px solid #1a1a1a;
  background: #ffffff;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.utility-bar a {
  text-decoration: none;
  color: #053f7d;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.35rem 0.55rem;
  border-right: 1px solid #b7b7b7;
}

.headline-ticker {
  border-top: 1px solid #fff;
  border-bottom: 3px solid #951117;
  background: linear-gradient(90deg, #c1111c, #e2352b, #c1111c);
  overflow: hidden;
}

.ticker-track {
  margin: 0;
  padding: 0.33rem 0;
  display: inline-flex;
  min-width: 100%;
  gap: 1.6rem;
  white-space: nowrap;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  animation: ticker-slide 17s linear infinite;
}

.ticker-track span::before {
  content: '||';
  margin-right: 0.5rem;
  color: #ffe486;
}

.quizzes-main {
  display: grid;
  grid-template-areas: 'left center right';
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr) minmax(220px, 340px);
  gap: 0.5rem;
  padding: 0.5rem;
}

.rail-left {
  grid-area: left;
}

.quiz-stage {
  grid-area: center;
}

.rail-right {
  grid-area: right;
}

.ad-rail {
  display: grid;
  gap: 0.45rem;
  align-content: start;
  pointer-events: none;
}

.left-menu {
  display: grid;
  gap: 0;
  border: 1px solid #8c1018;
  pointer-events: auto;
}

.left-menu a {
  text-decoration: none;
  color: #fff;
  background: linear-gradient(180deg, #d61f2d, #a90f1a);
  border-bottom: 1px solid #ef6d73;
  border-top: 1px solid #7e0b13;
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.45rem 0.5rem;
}

.left-menu a:last-child {
  border-bottom: 0;
}

.feature-ad {
  border: 2px solid #c7831d;
  background: linear-gradient(180deg, #f6b544, #e59626);
  color: #fff;
  padding: 0.56rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

.feature-ad-kicker {
  margin: 0;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.feature-ad-title {
  margin: 0.32rem 0 0;
  font-family: 'Arial Black', Impact, sans-serif;
  font-size: 1rem;
  line-height: 1.1;
}

.feature-ad-copy {
  margin: 0.36rem 0 0;
  font-size: 0.72rem;
  line-height: 1.25;
}

.ad-stack {
  display: grid;
  gap: 0.5rem;
}

.fake-ad {
  border: 2px solid #8a8a8a;
  background: linear-gradient(180deg, #ffffff, #f3f3f3);
  padding: 0.48rem;
  display: grid;
  gap: 0.2rem;
  min-height: 78px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px #fff;
}

.fake-ad:nth-child(3n + 1) {
  border-color: #af0f1b;
  background: linear-gradient(180deg, #fff4d7, #ffe2b3);
}

.fake-ad:nth-child(3n + 2) {
  border-color: #0b4f96;
  background: linear-gradient(180deg, #eaf3ff, #d6e8ff);
}

.fake-ad:nth-child(3n) {
  border-color: #5d3b9f;
  background: linear-gradient(180deg, #f6ecff, #e9dbff);
}

.fake-ad-kicker {
  margin: 0;
  color: #222;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.fake-ad-title {
  margin: 0;
  color: #101010;
  font-size: 0.76rem;
  line-height: 1.2;
  font-weight: 800;
}

.fake-ad-copy {
  margin: 0;
  color: #2d2d2d;
  font-size: 0.62rem;
  line-height: 1.24;
}

.fake-ad-cta {
  margin: 0.2rem 0 0;
  color: #a40f19;
  font-size: 0.57rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: underline;
}

.quiz-stage {
  border: 1px solid #979797;
  background: #fff;
  min-height: 520px;
  display: grid;
  grid-template-rows: 1fr auto;
}

.stage-view {
  min-height: 0;
  padding: clamp(0.75rem, 1.8vw, 1.1rem);
  overflow: auto;
}

.stage-headline {
  margin: 0;
  font-family: 'Arial Black', Impact, sans-serif;
  font-size: clamp(1.05rem, 2.2vw, 1.65rem);
  line-height: 1.05;
  text-transform: uppercase;
  color: #101010;
  letter-spacing: 0.01em;
}

.stage-subheadline {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  line-height: 1.35;
  color: #343434;
  max-width: 56ch;
}

.quiz-picker-grid {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.quiz-card {
  border: 1px solid #949494;
  background: linear-gradient(180deg, #fff, #f4f7ff);
  padding: 0.45rem;
  display: grid;
  grid-template-columns: minmax(4.15rem, 5.15rem) minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.quiz-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.18);
}

.quiz-card:focus-visible {
  outline: 2px solid #0066c4;
  outline-offset: 2px;
}

.quiz-card-media {
  border: 1px solid #7f7f7f;
  background: #e7ecff;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.quiz-card-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.quiz-card-copy {
  min-width: 0;
  display: grid;
  gap: 0.36rem;
}

.quiz-card h3 {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.15;
  color: #0e0e0e;
}

.quiz-card p {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.3;
  color: #373737;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.quiz-start-btn,
.quiz-action-btn,
.choice-btn {
  border: 1px solid #333;
  border-radius: 0;
  background: linear-gradient(180deg, #f8f8f8, #e6e6e6);
  color: #111;
  cursor: pointer;
}

.quiz-start-btn,
.quiz-action-btn {
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.56rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.quiz-action-btn.secondary {
  background: linear-gradient(180deg, #fff5d8, #f5dd98);
}

.quiz-action-btn.tertiary {
  background: linear-gradient(180deg, #edf4ff, #d4e4fb);
}

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

.quiz-meta-row {
  margin-top: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.quiz-progress {
  margin: 0;
  color: #0a4e96;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.quiz-question {
  margin: 0.62rem 0 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1rem, 2.2vw, 1.4rem);
  line-height: 1.2;
}

.choice-grid {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.45rem;
}

.choice-btn {
  width: 100%;
  min-height: 2.45rem;
  text-align: left;
  padding: 0.52rem 0.62rem;
  font-size: 0.82rem;
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: none;
}

.choice-btn.is-selected {
  border-color: #ac101b;
  border-width: 2px;
  background: linear-gradient(180deg, #fff4e2, #ffe0b4);
}

.quiz-actions {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.result-card {
  border: 1px solid #888;
  background: #fffdf4;
  padding: 0.7rem;
}

.result-kicker {
  margin: 0;
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a2121b;
}

.result-title {
  margin: 0.33rem 0 0;
  font-family: 'Arial Black', Impact, sans-serif;
  font-size: clamp(1.2rem, 2.7vw, 1.75rem);
  line-height: 1.08;
}

.result-copy {
  margin: 0.42rem 0 0;
  font-size: 0.86rem;
  line-height: 1.35;
}

.result-tagline {
  margin: 0.6rem 0 0;
  color: #0a4e96;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.live-status {
  margin: 0;
  min-height: 2rem;
  display: flex;
  align-items: center;
  border-top: 2px solid #1a1a1a;
  background: #101010;
  color: #ffe486;
  padding: 0.3rem 0.65rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sticky-ad-bar {
  border-top: 2px solid #101010;
  background: #f3ce09;
}

.ad-strip-track {
  min-height: 2.1rem;
  display: flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0 0.5rem;
  overflow: hidden;
}

.strip-chip {
  border: 1px solid #101010;
  background: #fff;
  color: #111;
  padding: 0.18rem 0.45rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.strip-chip:nth-child(2n) {
  background: #f7e7b3;
}

.strip-chip:nth-child(3n) {
  background: #dbeaff;
}

.hidden {
  display: none !important;
}

@media (min-width: 1081px) {
  body.quizzes-page {
    height: 100dvh;
    overflow: hidden;
  }

  .portal-shell {
    min-height: 100dvh;
    height: 100dvh;
    display: grid;
    grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
    overflow: hidden;
  }

  .quizzes-main {
    min-height: 0;
    overflow: hidden;
  }

  .ad-rail {
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .ad-stack {
    min-height: 0;
    overflow: hidden;
    align-content: start;
  }

  .quiz-stage {
    min-height: 0;
    height: 100%;
  }
}

@keyframes ticker-slide {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

@media (max-width: 1080px) {
  .quizzes-main {
    grid-template-areas:
      'center'
      'left'
      'right';
    grid-template-columns: 1fr;
  }

  .ad-rail {
    pointer-events: none;
  }

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

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

  .quiz-stage {
    min-height: clamp(430px, 65dvh, 640px);
  }
}

@media (max-width: 780px) {
  .billboard-ad {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    min-height: 0;
  }

  .billboard-ad::after {
    display: none;
  }

  .quizzes-header {
    grid-template-columns: 1fr;
  }

  .header-link,
  .news-brand {
    border-left: 0;
    border-right: 0;
  }

  .utility-bar a {
    flex: 1 1 auto;
    text-align: center;
  }

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

  .quiz-card {
    grid-template-columns: minmax(3.5rem, 4.2rem) minmax(0, 1fr);
    align-items: start;
  }

  .quiz-start-btn {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 1.8rem;
  }

  .left-menu {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 520px) {
  body.quizzes-page {
    padding-inline: 0;
  }

  .portal-shell {
    width: 100%;
    border-left: 0;
    border-right: 0;
  }

  .quizzes-main {
    padding: 0.35rem;
  }

  .ad-stack {
    grid-template-columns: 1fr;
  }

  .quiz-action-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track {
    animation: none;
  }
}
