:root {
  --pink: #ff1f8e;
  --lime: #d9ff00;
  --green: #1fd65f;
  --blue: #00b7ff;
  --yellow: #ffe600;
  --orange: #ff7a00;
  --red: #ff2a2a;
  --ink: #111;
  --paper: #fffdf2;
  --muted: #555;
  --shadow: 6px 6px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --border: 3px solid var(--ink);
  --font-display: "Bungee", "Archivo Black", Impact, sans-serif;
  --font-heavy: "Archivo Black", Impact, sans-serif;
  --font-body: "Archivo", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--yellow);
  background-image: radial-gradient(rgba(0,0,0,.12) 1.2px, transparent 1.4px);
  background-size: 14px 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: inherit; }

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 6px 16px;
  background: var(--ink);
  color: var(--lime);
  font-family: var(--font-heavy);
  font-size: 12px;
  letter-spacing: .06em;
}
.topbar-msg { color: var(--pink); }

/* ---------- masthead ---------- */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 16px;
  max-width: 1280px;
  margin: 0 auto;
}
.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  min-width: 0;
}
.logo-mark {
  font-family: "Bungee Shade", var(--font-display);
  font-size: clamp(44px, 9vw, 84px);
  line-height: 1;
  color: var(--pink);
  background: var(--lime);
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 4px 14px 0;
  transform: rotate(-3deg);
}
.logo-text { display: flex; flex-direction: column; min-width: 0; }
.logo-name {
  font-family: var(--font-display);
  font-size: clamp(18px, 3.4vw, 36px);
  line-height: 1.05;
  text-shadow: 3px 3px 0 var(--pink);
}
.logo-tag {
  font-family: var(--font-heavy);
  font-size: clamp(10px, 1.4vw, 14px);
  background: var(--ink);
  color: var(--yellow);
  padding: 2px 8px;
  margin-top: 6px;
  align-self: flex-start;
}
.masthead-badge {
  flex: none;
  width: 120px;
  height: 120px;
  display: grid;
  place-content: center;
  text-align: center;
  font-family: var(--font-heavy);
  font-size: 12px;
  line-height: 1.1;
  background: var(--red);
  color: #fff;
  clip-path: polygon(50% 0%, 61% 15%, 79% 7%, 80% 26%, 98% 30%, 88% 47%, 100% 62%, 82% 70%, 85% 90%, 66% 86%, 55% 100%, 43% 87%, 24% 95%, 21% 76%, 2% 70%, 12% 52%, 0% 36%, 18% 28%, 18% 8%, 37% 14%);
  animation: wobble 2.4s ease-in-out infinite;
}
.masthead-badge strong { font-family: var(--font-display); font-size: 32px; color: var(--yellow); }

@keyframes wobble {
  0%, 100% { transform: rotate(-8deg) scale(1); }
  50% { transform: rotate(8deg) scale(1.06); }
}

/* ---------- category nav ---------- */
.catnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
  max-width: 1280px;
  margin: 0 auto;
}
/* Phones: one swipeable row without a visible scrollbar. */
@media (max-width: 700px) {
  .catnav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 14px; }
  .catnav::-webkit-scrollbar { display: none; }
}
.catnav a {
  flex: none;
  text-decoration: none;
  font-family: var(--font-heavy);
  font-size: 13px;
  padding: 6px 12px;
  border: var(--border);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .1s;
}
.catnav a:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.catnav a.active { background: var(--pink); color: #fff; }

/* ---------- ticker ---------- */
.ticker {
  display: flex;
  align-items: stretch;
  border-top: var(--border);
  border-bottom: var(--border);
  background: var(--ink);
  color: #fff;
  font-family: var(--font-heavy);
  font-size: 14px;
  overflow: hidden;
}
.ticker-label {
  flex: none;
  background: var(--red);
  padding: 8px 14px;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { background: var(--pink); } }
.ticker-track { overflow: hidden; flex: 1; display: flex; align-items: center; }
.ticker-items {
  display: inline-flex;
  white-space: nowrap;
  animation: scroll 60s linear infinite;
}
.ticker-items span { padding: 0 28px; }
.ticker-items span::after { content: "★"; color: var(--lime); padding-left: 56px; }
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  max-width: 1280px;
  margin: 24px auto;
  padding: 0 16px;
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
}

.loading {
  font-family: var(--font-heavy);
  padding: 40px;
  background: #fff;
  border: var(--border);
  box-shadow: var(--shadow);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 28px);
  margin: 32px 0 14px;
  display: inline-block;
  background: var(--ink);
  color: var(--lime);
  padding: 4px 14px;
  transform: rotate(-1deg);
}
.section-title:first-child { margin-top: 0; }

/* ---------- category badge ---------- */
.cat {
  display: inline-block;
  font-family: var(--font-heavy);
  font-size: 11px;
  letter-spacing: .05em;
  padding: 3px 8px;
  border: 2px solid var(--ink);
  background: var(--c, var(--lime));
  color: var(--ct, var(--ink));
  text-decoration: none;
}

/* ---------- art block (thumbnail) ---------- */
.art {
  position: relative;
  aspect-ratio: 16 / 9;
  border-bottom: var(--border);
  background: var(--c, var(--lime));
  overflow: hidden;
  display: grid;
  place-items: center;
}
.art::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.35) 0 10deg, transparent 10deg 20deg);
  animation: spin 40s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.art-emoji {
  position: relative;
  font-size: clamp(48px, 9vw, 96px);
  filter: drop-shadow(4px 4px 0 rgba(0,0,0,.6));
}
.art-level {
  position: absolute;
  right: 10px;
  bottom: 10px;
  font-family: var(--font-heavy);
  font-size: 12px;
  background: var(--ink);
  color: var(--lime);
  padding: 3px 8px;
}

/* ---------- lead story ---------- */
.lead {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: #fff;
  border: var(--border);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .12s, box-shadow .12s;
}
.lead:hover, .card:hover { transform: translate(-3px, -3px) rotate(var(--tilt, 0deg)); box-shadow: 9px 9px 0 var(--ink); }
.lead .art { aspect-ratio: auto; min-height: 280px; border-bottom: 0; border-right: var(--border); }
.lead .art-emoji { font-size: clamp(80px, 12vw, 150px); }
.lead-body { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.lead h2 {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.4vw, 40px);
  line-height: 1.05;
  margin: 0;
}
.lead p { margin: 0; font-size: 17px; }
@media (max-width: 700px) {
  .lead { grid-template-columns: 1fr; }
  .lead .art { min-height: 200px; border-right: 0; border-bottom: var(--border); }
}

/* ---------- card grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}
.card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: var(--border);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .12s, box-shadow .12s;
  transform: rotate(var(--tilt, 0deg));
}
/* Slight tilt for a hand-pasted look; kept in a variable so :hover can lift every card. */
.card:nth-child(3n+2) { --tilt: .6deg; }
.card:nth-child(3n) { --tilt: -.5deg; }
.card-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { font-family: var(--font-heavy); font-size: 19px; line-height: 1.15; margin: 0; }
.card p { margin: 0; font-size: 14px; color: #333; }
.meta { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: auto; }

/* ---------- article page ---------- */
.article {
  background: #fff;
  border: var(--border);
  box-shadow: var(--shadow);
}
.article .art { aspect-ratio: 21 / 9; }
.article .art-emoji { font-size: clamp(90px, 14vw, 170px); }
.article-body { padding: clamp(18px, 4vw, 36px); }
.article h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 52px);
  line-height: 1.02;
  margin: 12px 0 8px;
}
.article .real {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  border-left: 6px solid var(--pink);
  padding-left: 10px;
  margin: 0 0 18px;
}
.article .lede { font-size: 19px; font-weight: 600; }
.article .body-text { font-size: 18px; }
.article .film {
  margin: 24px 0;
  padding: 14px 16px;
  background: var(--lime);
  border: var(--border);
  font-family: var(--font-heavy);
}
.levelbar {
  display: flex;
  gap: 4px;
  margin: 8px 0 20px;
}
.levelbar span {
  flex: 1;
  height: 18px;
  border: 2px solid var(--ink);
  background: #eee;
}
.levelbar span.on:nth-child(-n+3) { background: var(--green); }
.levelbar span.on:nth-child(n+4) { background: var(--yellow); }
.levelbar span.on:nth-child(n+7) { background: var(--orange); }
.levelbar span.on:nth-child(n+9) { background: var(--red); }
.level-label { font-family: var(--font-heavy); font-size: 14px; }

.source-btn, .back-btn, .more-btn {
  display: inline-block;
  font-family: var(--font-heavy);
  text-decoration: none;
  padding: 10px 16px;
  border: var(--border);
  box-shadow: var(--shadow-sm);
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  font-size: 15px;
}
.back-btn { display: block; width: max-content; background: #fff; color: var(--ink); margin-bottom: 20px; }
.more-btn { background: var(--pink); display: block; margin: 28px auto 0; }
.source-btn:hover, .back-btn:hover, .more-btn:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }

/* ---------- sidebar ---------- */
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.box {
  background: #fff;
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 14px;
}
.box-title {
  font-family: var(--font-display);
  font-size: 16px;
  margin: -14px -14px 12px;
  padding: 8px 14px;
  background: var(--blue);
  color: #fff;
  border-bottom: var(--border);
}
.box-note { font-size: 12px; color: var(--muted); margin: 6px 0 0; }

.schedule ul { list-style: none; margin: 0; padding: 0; }
.schedule li { padding: 6px 0; border-bottom: 1px dashed #aaa; font-weight: 600; }
.schedule li:last-child { border-bottom: 0; }
.schedule li span { display: inline-block; width: 52px; font-family: var(--font-heavy); color: var(--pink); }

.mostread ol { margin: 0; padding-left: 0; list-style: none; counter-reset: mr; }
.mostread li { counter-increment: mr; display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed #aaa; }
.mostread li:last-child { border-bottom: 0; }
.mostread li::before {
  content: counter(mr);
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1;
  color: var(--pink);
  -webkit-text-stroke: 1px var(--ink);
}
.mostread a { text-decoration: none; font-weight: 800; font-size: 14px; }
.mostread a:hover { text-decoration: underline; }

/* IQ meter */
.iq-meter {
  position: relative;
  width: 180px;
  height: 90px;
  margin: 6px auto 0;
}
/* Half disc with its own base line, so nothing gets clipped. */
.iq-meter::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 3px solid var(--ink);
  border-radius: 90px 90px 0 0;
  background: conic-gradient(from -90deg at 50% 100%, var(--red) 0 45deg, var(--orange) 45deg 90deg, var(--yellow) 90deg 135deg, var(--green) 135deg 180deg, transparent 180deg);
}
/* Pivot hub on the base line. */
.iq-meter::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: var(--ink);
}
.iq-needle {
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 4px;
  height: 74px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--ink);
  transform-origin: bottom center;
  transform: rotate(-90deg);
  transition: transform 1.6s cubic-bezier(.3, 1.6, .5, 1);
}
.iq-readout { text-align: center; margin: 8px 0 0; font-family: var(--font-heavy); }
.iq-readout strong { font-family: var(--font-display); font-size: 30px; color: var(--pink); }
.iq-readout span { display: block; font-size: 12px; }

/* ads */
.ad {
  position: relative;
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 22px 16px 16px;
  text-align: center;
}
.ad-label {
  position: absolute;
  top: 0;
  left: 0;
  font-size: 9px;
  letter-spacing: .1em;
  background: var(--ink);
  color: #fff;
  padding: 2px 6px;
}
.ad h3 { margin: 6px 0 4px; }
.ad p { margin: 4px 0; }
.ad-brawndo {
  background: #ffd400;
  color: var(--ink);
  overflow: hidden;
  isolation: isolate;
}
/* Yellow sunburst, like the Brawndo poster, slowly turning behind the logo. */
.ad-brawndo::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 34%;
  width: 260%;
  aspect-ratio: 1;
  translate: -50% -50%;
  background:
    radial-gradient(circle, rgba(255,255,255,.55), transparent 30%),
    repeating-conic-gradient(#ffd400 0 9deg, #ffe94d 9deg 18deg);
  animation: sunburst-spin 60s linear infinite;
}
@keyframes sunburst-spin { to { rotate: 360deg; } }
.brawndo-logo {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 0 auto 4px;
  overflow: visible;
  animation: shake 1.8s ease-in-out infinite;
}
/* Colors sampled from the poster. */
.brawndo-logo .bolt-outer { fill: #046504; }
.brawndo-logo .bolt-pale { fill: #a6d17a; }
.brawndo-logo .bolt-inner { fill: #6cb146; }
.brawndo-logo .banner { fill: #fff; stroke: #0a5906; stroke-width: 7; }
.brawndo-logo .banner-text {
  font-family: var(--font-heavy);
  font-size: 80px;
  fill: #b8641a;
  stroke: #7a3a08;
  stroke-width: 1.5;
}
.brawndo-logo .tagline {
  font-family: var(--font-heavy);
  font-size: 56px;
  fill: #111;
}
.brawndo-claim {
  font-family: var(--font-display);
  font-size: 18px;
  background: var(--ink);
  color: var(--lime);
  padding: 6px;
  transform: rotate(-2deg);
}
.brawndo-small { font-size: 12px; font-style: italic; font-weight: 600; }
@keyframes shake {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg) translateY(-3px); }
}
.ad-hospital { background: #fff; border-style: dashed; }
.ad-hospital h3 { font-family: var(--font-display); font-size: 18px; color: var(--blue); }
.ad-cta {
  font-family: var(--font-heavy);
  background: var(--pink);
  color: #fff;
  padding: 6px;
  margin-top: 10px !important;
}

/* ---------- footer ---------- */
.footer {
  background: var(--ink);
  color: #ddd;
  padding: 28px 16px;
  margin-top: 40px;
  font-size: 14px;
}
.footer p { max-width: 900px; margin: 0 auto 10px; }
.footer strong { color: var(--lime); }
.footer-small { font-size: 12px; color: #999; }

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

@media (max-width: 560px) {
  .masthead-badge { display: none; }
  .topbar-temp { display: none; }
}
