@import url('https://fonts.googleapis.com/css2?family=Jersey+10&display=swap');

:root {
  --bg: #111827;
  --bg-soft: #172033;
  --panel: #f7f4ed;
  --panel-2: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #84cc16;
  --accent-dark: #3f6212;
  --border: rgba(17, 24, 39, 0.12);
  --shadow: 0 12px 36px rgba(0, 0, 0, 0.14);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius: 24px;
  --radius-small: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  margin: 0;
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  min-width: 320px;
  color: var(--text);
  font-family: 'Jersey 10', system-ui, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(132, 204, 22, 0.18), transparent 25%),
    radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.12), transparent 18%),
    linear-gradient(180deg, var(--bg), var(--bg-soft));
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
}

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

.app-shell {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* TOPBAR */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(17, 24, 39, 0.92);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: white;
  margin-bottom: 10px;
}

.brand__kicker {
  color: #bef264;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  opacity: 0.95;
}

.brand h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3.5vw, 2.5rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
}

.chapterbar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0 4px;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}

.chapterbar::-webkit-scrollbar {
  height: 6px;
}

.chapterbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
}

.chapterbar button {
  flex: 0 0 auto;
  scroll-snap-align: start;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: white;
  border-radius: 999px;
  padding: 9px 14px;
  line-height: 1;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.chapterbar button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.12);
}

.chapterbar button.is-active {
  background: var(--accent);
  color: #172554;
  border-color: transparent;
}

/* MAIN STAGE */

.stage {
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 18px 14px;
}

.slide-card {
  width: min(980px, 100%);
  min-height: calc(100svh - 188px);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.slide-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1;
}

.slide {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 22px;
  text-align: center;
  overflow: hidden;
}

.slide__inner {
  width: min(820px, 100%);
  animation: fadeIn 220ms ease;
}

.slide__text {
  margin: 0;
  line-height: 1.06;
  letter-spacing: 0.01em;
  text-wrap: balance;
  word-break: break-word;
  font-size: clamp(2rem, 5vw, 4.2rem);
}

.slide__text.is-small {
  font-size: clamp(1.35rem, 2.7vw, 2.2rem);
}

.slide__text.is-medium {
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.slide__text.is-large {
  font-size: clamp(2.35rem, 5vw, 4.8rem);
}

.slide__text.is-red {
  color: #dc2626;
}

.slide__text.is-green {
  color: #15803d;
}

.slide__text.is-muted {
  color: #374151;
}

.slide__image {
  width: auto;
  max-width: 100%;
  max-height: min(64svh, 720px);
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
  background: #e5e7eb;
}

.ticker {
  position: relative;
  display: flex;
  align-items: center;
  height: 42px;
  overflow: hidden;
  background: #65a30d;
  color: white;
  font-size: 1rem;
}

.ticker>div {
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;
  animation: marquee 18s linear infinite;
}

/* FOOTER */

.footerbar {
  position: sticky;
  bottom: 0;
  z-index: 25;
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 14px;
  background: rgba(17, 24, 39, 0.92);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
}

.navbtn {
  border: none;
  border-radius: 999px;
  background: white;
  color: #111827;
  min-width: 56px;
  min-height: 56px;
  padding: 0 18px;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

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

.navbtn--wide {
  min-width: 148px;
  font-size: 1.02rem;
}

.navbtn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* ANIMATION */

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes marquee {
  from {
    transform: translateX(0%);
  }

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

/* TABLET */

@media (max-width: 900px) {
  .stage {
    padding: 12px;
  }

  .slide-card {
    min-height: calc(100svh - 176px);
  }

  .slide {
    padding: 22px 16px;
  }

  .slide__image {
    max-height: min(58svh, 620px);
  }
}

/* MOBILE */

@media (max-width: 700px) {
  .topbar {
    padding: 10px 10px 8px;
  }

  .brand {
    margin-bottom: 8px;
  }

  .brand__kicker {
    font-size: 0.85rem;
  }

  .brand h1 {
    font-size: clamp(1.45rem, 8vw, 2rem);
  }

  .chapterbar {
    gap: 6px;
    padding-bottom: 2px;
  }

  .chapterbar button {
    padding: 8px 12px;
    font-size: 0.92rem;
  }

  .stage {
    padding: 8px;
  }

  .slide-card {
    width: 100%;
    min-height: calc(100svh - 162px);
    border-radius: 18px;
  }

  .slide-meta {
    padding: 10px 12px;
    font-size: 0.95rem;
  }

  .slide {
    padding: 14px 10px;
  }

  .slide__inner {
    width: 100%;
  }

  .slide__text {
    font-size: clamp(1.5rem, 7vw, 2.4rem);
    line-height: 1.03;
  }

  .slide__text.is-small {
    font-size: clamp(1.05rem, 5vw, 1.45rem);
  }

  .slide__text.is-medium {
    font-size: clamp(1.35rem, 6vw, 1.95rem);
  }

  .slide__text.is-large {
    font-size: clamp(1.85rem, 8vw, 2.85rem);
  }

  .slide__image {
    max-height: min(50svh, 420px);
    border-radius: 14px;
  }

  .ticker {
    height: 34px;
    font-size: 0.86rem;
  }

  .footerbar {
    gap: 8px;
    padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
  }

  .navbtn {
    min-width: 46px;
    min-height: 46px;
    padding: 0 12px;
    font-size: 1rem;
  }

  .navbtn--wide {
    min-width: 112px;
    font-size: 0.86rem;
  }
}

/* VERY SMALL PHONES */

@media (max-width: 420px) {
  .topbar {
    padding: 8px 8px 6px;
  }

  .brand h1 {
    font-size: 1.35rem;
  }

  .slide-card {
    min-height: calc(100svh - 154px);
    border-radius: 14px;
  }

  .slide-meta {
    padding: 8px 10px;
    font-size: 0.85rem;
  }

  .slide {
    padding: 12px 8px;
  }

  .slide__text {
    font-size: clamp(1.35rem, 7vw, 2rem);
  }

  .slide__text.is-small {
    font-size: clamp(0.98rem, 4.8vw, 1.2rem);
  }

  .slide__text.is-medium {
    font-size: clamp(1.2rem, 5.8vw, 1.65rem);
  }

  .slide__text.is-large {
    font-size: clamp(1.65rem, 8vw, 2.3rem);
  }

  .slide__image {
    max-height: min(44svh, 340px);
  }

  .ticker {
    height: 30px;
    font-size: 0.78rem;
  }

  .footerbar {
    gap: 6px;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  }

  .navbtn {
    min-width: 42px;
    min-height: 42px;
    padding: 0 10px;
    font-size: 0.95rem;
  }

  .navbtn--wide {
    min-width: 96px;
    font-size: 0.78rem;
  }
}

/* REDUCED MOTION */

@media (prefers-reduced-motion: reduce) {

  .slide__inner,
  .ticker>div,
  .chapterbar button,
  .navbtn {
    animation: none !important;
    transition: none !important;
  }
}