:root {
  --bg: #121212;
  --fg: #fff;
  --gold-1: #c49a6c;
  --gold-2: #a67c52;
  --header-grad: linear-gradient(90deg, #3e2f1c, #c49a6c);
  --card-radius: 12px;
  --tab-height: 64px;
}

/* Light theme overrides (toggled by .light-theme on <html>) */
.light-theme {
  --bg: #fdf6ec;
  --fg: #3e2f1c;
  --header-grad: linear-gradient(90deg, #c49a6c, #a67c52);
}

/* Global reset-ish */
html, body {
  height: 100%;
  margin: 0;
  overflow-x: hidden; /* stop any horizontal jiggle */
}


/* Ensure padding/borders don't push things past 100% width */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: background 0.4s ease, color 0.4s ease;
  overflow-x: hidden; /* Never scroll sideways */
}

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

/* Screenreader-only helper */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ============================
   HEADER
============================ */
/* Only the top app header should be sticky */
.app-header {
  text-align: center;
  padding: 16px;
  background: var(--header-grad);
  border-bottom: 3px solid var(--gold-1);
  position: sticky;
  top: 0;
  z-index: 5;
}


.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.header-logo {
  max-height: 56px;
  width: auto;
  border-radius: 8px;
  padding: 4px;
  /* If you ever want a white box behind logos: background:#fff; */
}

h1 {
  margin: 0;
  font-weight: 400;
  font-size: 1.4rem;
  color: #fff;
}

@media (max-width: 768px) {
  h1 {
    font-size: 1.1rem;
  }
}

.app-main {
  flex: 1;
  /* space for header above and bottom nav below */
  padding: 10px 12px calc(var(--tab-height) + 16px);
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: pan-y;
}

/* Each page is just a block; we show/hide with display */
.page {
  display: none;
  background: var(--bg);
}

/* Only the active one is visible */
.page.active {
  display: block;
}

/* Sections inside pages */
.nav-section {
  margin-bottom: 18px;
}

/* Keep main sections at a nice readable width on wider screens */
@media (min-width: 960px) {
  .nav-section {
    max-width: 960px;
    margin-inline: auto;
  }
}


/* Title used in most sections */
.section-title {
  color: var(--gold-1);
  margin: 10px 0 12px;
  font-size: 1.2rem;
}
/* =========================
   App Update Banner
   ========================= */
.app-update-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--tab-height, 64px) + 12px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  padding: 0 12px;
  pointer-events: none;
}

.app-update-banner[hidden] {
  display: none !important;
}

.app-update-banner__inner {
  pointer-events: auto;
  width: min(560px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(8, 8, 8, 0.94);
  border: 1px solid rgba(196, 154, 108, 0.35);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
}

.app-update-banner__text {
  color: #f2f2f2;
  font-size: 0.9rem;
  font-weight: 600;
}

.app-update-banner__btn {
  appearance: none;
  border: 1px solid rgba(196, 154, 108, 0.45);
  background: linear-gradient(180deg, rgba(196,154,108,0.2), rgba(196,154,108,0.08));
  color: #f5e7d6;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  line-height: 1;
}

.app-update-banner__btn:hover {
  background: linear-gradient(180deg, rgba(196,154,108,0.28), rgba(196,154,108,0.12));
}

.app-update-banner__btn:active {
  transform: translateY(1px);
}

/* Light theme */
.light-theme .app-update-banner__inner {
  background: rgba(255, 248, 238, 0.98);
  border-color: rgba(166, 124, 82, 0.35);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
}

.light-theme .app-update-banner__text {
  color: #2f2418;
}

.light-theme .app-update-banner__btn {
  color: #2f2418;
  border-color: rgba(166, 124, 82, 0.35);
  background: linear-gradient(180deg, rgba(196,154,108,0.18), rgba(196,154,108,0.06));
}
/* ============================
   CARD GRID + BUTTONS
============================ */
.card-links {
  display: grid;
  gap: 12px;
}

/* Single-column cards by default */
.card-links {
  grid-template-columns: 1fr;
}

/* Optional multi-column for really wide screens, if desired
@media (min-width: 1024px) {
  .card-links {
    grid-template-columns: 1fr 1fr;
  }
}
*/

/* Global card-style button/anchor */
.card-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--card-radius);
  background: linear-gradient(90deg, var(--gold-1), var(--gold-2));
  color: #fff;
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.2;
  cursor: pointer;
  border: none;
  text-align: left;
  box-sizing: border-box;
  text-decoration: none;
}

/* Make button.card-link behave like a normal card-link */
button.card-link {
  font: inherit;
  color: inherit;
  background: linear-gradient(90deg, var(--gold-1), var(--gold-2));
  font-weight: 300 !important;
}

/* Desktop-only cards (e.g., Break & Dish wheels) */
.card-link.desktop-only {
  display: none;
}

@media (min-width: 1024px) {
  .card-link.desktop-only {
    display: flex;
  }
}

/* =========================
   Tournament Info (cs-data)
   ========================= */

.cs-shell {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  background: linear-gradient(145deg, #080808, #050509);
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
  padding: 1.1rem 0.9rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.cs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid #262626;
  padding-bottom: 0.4rem;
  font-size: 0.8rem;
  color: #b3b3b3;
}

/* Left side: Updated */
.cs-header-left {
  font-weight: 400;   /* match Source */
}

/* Right side: Source */
.cs-header-meta {
  text-align: right;
  font-weight: 400;
  opacity: 0.9;
}



.cs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
}

/* FLAT CARDS – no thick borders, more room for text */
.cs-card {
  background: transparent;
  border-radius: 0;
  border: none;
  padding: 0 0 0.9rem;
}

/* Thin line directly under each card heading */
.cs-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.45rem;
  margin-bottom: 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.cs-card-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.cs-card-pill {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 0, #fff, #c49a6c);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 0 10px rgba(196, 154, 108, 0.6);
  flex-shrink: 0;
}

.cs-card-title {
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
}

.cs-card-title span {
  color: #c49a6c;
}

/* Body is now just a container – no border, no big background */
.cs-card-body {
  border: none;
  background: transparent;
  padding: 0;
}

.cs-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cs-date-group {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cs-date-group:first-child {
  border-top: none;
  padding-top: 0;
}

.cs-date-heading {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #b3b3b3;
  opacity: 0.9;
  padding: 0 0.1rem 0.1rem;
}

/* Rows: full-width text, very light background, no heavy box */
.cs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.15rem;
  border-radius: 6px;
  background: transparent;
}

.cs-row:hover {
  background: rgba(196, 154, 108, 0.08);
}

.cs-row-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1;
}

.cs-row-name {
  color: #c49a6c;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  word-break: break-word;
  white-space: normal;
}

.cs-row-name:hover {
  text-decoration: underline;
}

.cs-row-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.cs-status-dot,
.cs-status-tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.55);
  min-width: 26px;
}

.cs-status-dot::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #ff4d4f;
  box-shadow: 0 0 8px rgba(255, 77, 79, 0.9);
  margin-right: 0.35rem;
}

.cs-status-dot {
  color: #ff4d4f;
}

.cs-status-tick::before {
  content: "✔";
  font-size: 0.72rem;
  color: #c49a6c;
}

.cs-status-dot {
  color: #3cd47a;
}

.cs-status-tick {
  color: #b3b3b3;
}

.cs-empty {
  padding: 1rem 0.2rem;
  text-align: center;
  font-size: 0.8rem;
  color: #b3b3b3;
}

.cs-empty.cs-error {
  color: #ff5252;
}
/* Live pill = RED (dot + text + border) */
.cs-status-pill-live,
.cs-status-pill-upcoming {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  min-width: 26px;
  background: rgba(0, 0, 0, 0.55);
  white-space: nowrap;
  border: 1px solid;
}

.cs-status-pill-live {
  color: #ff4d4f;
  border-color: rgba(255, 77, 79, 0.45);
  box-shadow: inset 0 0 0 1px rgba(255, 77, 79, 0.08);
}

.cs-status-pill-live::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #ff4d4f;
  box-shadow: 0 0 8px rgba(255, 77, 79, 0.9);
  margin-right: 0.35rem;
}

/* Upcoming pill = GREEN (dot + text + border) */
.cs-status-pill-upcoming {
  color: #3cd47a;
  border-color: rgba(60, 212, 122, 0.35);
  box-shadow: inset 0 0 0 1px rgba(60, 212, 122, 0.06);
}

.cs-status-pill-upcoming::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #3cd47a;
  box-shadow: 0 0 8px rgba(60, 212, 122, 0.9);
  margin-right: 0.35rem;
}

/* Full-bleed feel on mobile */
@media (max-width: 600px) {
  .cs-shell {
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* Tournaments page: align shell full-width, no sideways overflow */
#page-tournaments {
  padding-top: 8px; /* sit nicely under sticky app header */
  padding-left: 0;
  padding-right: 0;
}

/* Keep the shell centred and constrained on bigger screens */
#page-tournaments .cs-shell {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

/* On small screens, make it feel full-bleed */
@media (max-width: 600px) {
  #page-tournaments .cs-shell {
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* Keep main sections at a nice readable width on wider screens */
@media (min-width: 960px) {
  .nav-section {
    max-width: 960px;
    margin-inline: auto;
  }
}

/* Light theme tweaks for flatter cards */
.light-theme .cs-shell {
  background: #f7efe2;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.light-theme .cs-card-header {
  border-bottom-color: rgba(0, 0, 0, 0.12);
}

.light-theme .cs-date-heading {
  color: #555;
}

.light-theme .cs-row:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* Two-column layout on wider screens */
@media (min-width: 880px) {
  .cs-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
  }
}


/* Tournaments page: follow normal page padding, no sideways weirdness */
#page-tournaments {
  padding: 14px 8px calc(var(--tab-height) + 24px);
}

/* Keep the shell centred and constrained on bigger screens */
#page-tournaments .cs-shell {
  width: 100%;
  max-width: 1100px;
  margin: 8px auto 0;
}

/* On small screens, full-bleed feel without overshooting */
@media (max-width: 600px) {
  #page-tournaments {
    padding-left: 0;
    padding-right: 0;
  }

  #page-tournaments .cs-shell {
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* Tighten section titles inside tournaments page so content doesn't scroll behind gaps */
#page-tournaments .section-title {
  margin-top: 4px;
  margin-bottom: 8px;
}

/* Two-column layout on wider screens */
@media (min-width: 880px) {
  .cs-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
  }
}

/* Light theme tweaks for tournament cards */
.light-theme .cs-shell {
  background: #f7efe2;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.light-theme .cs-card {
  background: #fff5e6;
  border-color: rgba(0, 0, 0, 0.06);
}

.light-theme .cs-date-heading {
  color: #555;
}

.light-theme .cs-row {
  background: rgba(0, 0, 0, 0.02);
}
/* =========================
   Tournament Info – add-ons
   (for Upcoming/Live + Finished split)
   ========================= */

/* Your updated HTML uses .cs-card-grid */
.cs-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
}

/* Two-column layout on wider screens */
@media (min-width: 880px) {
  .cs-card-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
  }
}

/* Header pills in the card headers */
.cs-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}

.cs-status-pill--upcoming {
  color: #d8d8d8;
}

.cs-status-pill--active {
  color: #3cd47a;
}

.cs-status-pill--finished {
  color: #bfbfbf;
}

/* Optional: make the "Upcoming" badge in rows look different from "Live" */
.cs-status-pill-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.55);
  color: #d7d7d7;
  min-width: 26px;
  line-height: 1.1;
  white-space: nowrap;
}

.cs-status-pill-mini--upcoming::before {
  content: "○";
  font-size: 0.7rem;
  margin-right: 0.3rem;
  opacity: 0.9;
}

/* If you want LIVE to stay green but "Upcoming" to look neutral,
   update the JS to use cs-status-pill-mini for upcoming.
   (Current JS reuses .cs-status-dot for both, which still works.) */

/* Light theme versions */
.light-theme .cs-status-pill {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.7);
}

.light-theme .cs-status-pill--active {
  color: #1f9d57;
}

.light-theme .cs-status-pill--finished {
  color: #666;
}

.light-theme .cs-status-pill-mini {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.9);
  color: #555;
}

/* ============================
   VIDEO / LIVE
============================ */
.video-section {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 12px;
}

.video-shell {
  width: 100%;
  max-width: 960px;
  aspect-ratio: 16 / 9;
  background: #1f1f1f;
  border-radius: var(--card-radius);
  overflow: hidden;
  position: relative;
  border: 2px solid rgba(196, 154, 108, 0.4); /* gold border */
}

iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  opacity: 0;
  transition: opacity 0.6s ease-in;
}

.skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #1f1f1f, #2b2b2b, #1f1f1f);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.live-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: bold;
  font-size: 1.1rem;
  min-height: 1.6rem;
}

.live-dot {
  width: 12px;
  height: 12px;
  background-color: #ff2a2a;
  border-radius: 50%;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

.not-live {
  color: #aaa;
  font-size: 1rem;
}

.youtube-link {
  text-align: center;
  padding: 16px;
}

.youtube-link a {
  color: var(--gold-1);
  font-weight: bold;
  font-size: 1rem;
}

.youtube-link a:hover {
  color: var(--gold-2);
}

/* ============================
   LATEST VIDEOS GRID
============================ */
.latest-videos-section {
  margin-top: 4px;
}

.latest-videos-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.video-card {
  display: flex;
  flex-direction: column;
  background: #1f1f1f;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(196, 154, 108, 0.5);
  padding: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.video-card:focus-visible {
  outline: 2px solid var(--gold-1);
  outline-offset: 2px;
}

.video-card.active {
  box-shadow: 0 0 0 2px var(--gold-1);
}

.video-thumb-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.video-thumb-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-badge-live {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #ff2a2a;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.video-info {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.video-title {
  font-size: 0.9rem;
  font-weight: 500;
}

.video-meta {
  font-size: 0.75rem;
  color: #aaa;
}

@media (min-width: 768px) {
  .latest-videos-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

/* ============================
   BOTTOM NAV BAR
============================ */
.app-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--tab-height);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  background: rgba(18, 18, 18, 0.95);
  border-top: 1px solid rgba(196, 154, 108, 0.35);
  backdrop-filter: saturate(140%) blur(8px);
}

.app-nav .tab {
  display: grid;
  place-items: center;
  gap: 4px;
  height: 100%;
  color: #ddd;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.app-nav .tab[aria-current="page"] {
  color: var(--gold-1);
}

.app-nav .icon {
  font-size: 1.4rem;
}

.app-nav .label {
  font-size: 0.75rem;
}

/* Live tab pulse effect (when used) */
.app-nav .tab.live-active {
  color: #ff2a2a;
  animation: navPulse 1s infinite;
}

@keyframes navPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

/* ============================
   FULLSCREEN LIVE VIDEO (LANDSCAPE MOBILE)
============================ */
#videoShell {
  transition: all 0.4s ease-in-out;
}

.landscape-fullscreen {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 70vh;
  max-width: 100vw;
  max-height: 70vh;
  z-index: 9999;
  background: black;
  display: grid;
  place-items: center;
  opacity: 0;
  border-radius: 12px;
  transition: opacity 0.4s ease-in-out, width 0.4s ease, height 0.4s ease;
}

.landscape-fullscreen.show {
  opacity: 1;
}

.landscape-fullscreen iframe {
  width: 100% !important;
  height: 100% !important;
  border-radius: 0 !important;
}

/* Hide header & bottom nav when fullscreen is active */
.fullscreen-active header,
.fullscreen-active .app-nav {
  display: none !important;
}

/* ============================
   RANKINGS
============================ */
#page-rankings .card-links {
  display: grid;
  gap: 12px;
}

.rank-item {
  margin: 0;
}

/* (You’re currently using direct links for rankings;
   accordion styles kept in case you reintroduce them) */
#page-rankings .rank-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  width: 100%;
  border: none;
  background: linear-gradient(90deg, var(--gold-1), var(--gold-2));
  color: #fff;
  font-weight: 300;
  font-size: 1rem;
  border-radius: var(--card-radius);
  cursor: pointer;
  text-align: left;
}

.rank-arrow {
  margin-left: auto;
  font-size: 1rem;
  opacity: 0.85;
  transition: transform 0.25s ease;
}

.rank-toggle[aria-expanded="true"] .rank-arrow {
  transform: rotate(180deg);
}

.rank-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.rank-panel .panel-inner {
  padding: 0;
}

.rank-panel.open .panel-inner {
  padding-top: 10px;
  padding-bottom: 70px;
}

.rank-panel img {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  display: block;
  border-radius: 12px;
}

/* ============================
   SETTINGS
============================ */
#page-settings .nav-section > * {
  margin-bottom: 12px;
}

#page-settings .nav-section > *:last-child {
  margin-bottom: 0;
}

/* Notification row styled like a button */
.settings-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--card-radius);
  background: linear-gradient(90deg, var(--gold-1), var(--gold-2));
  color: #fff;
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.2;
  cursor: pointer;
  border: none;
  text-align: left;
  box-sizing: border-box;
}

.settings-btn .card-icon {
  font-size: 1rem;
}

.settings-btn .label-text {
  flex: 1;
  text-align: left;
}

/* Toggle inside notification row */
.settings-btn .toggle {
  display: flex;
  align-items: center;
  margin-left: auto;
  padding: 0;
}

.settings-btn .toggle input {
  display: none;
}

.settings-btn .toggle .slider {
  width: 46px;
  height: 24px;
  background: #666;
  border-radius: 24px;
  position: relative;
  transition: 0.2s;
}

.settings-btn .toggle .slider::before {
  content: '';
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: 0.2s;
}

.settings-btn .toggle input:checked + .slider {
  background: #28c928;
}

.settings-btn .toggle input:checked + .slider::before {
  transform: translateX(22px);
}

/* ============================
   ABOUT OVERLAY
============================ */
body.no-scroll {
  overflow: hidden;
}

.about-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  justify-content: center;
  align-items: flex-start;
  padding: 1.5rem;
  z-index: 9999;
}

.about-overlay.open {
  display: flex;
}

.about-panel {
  max-width: 900px;
  width: 100%;
  max-height: 100%;
  background: #050509;
  border-radius: 16px;
  border: 1px solid rgba(196, 154, 108, 0.6);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.about-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: radial-gradient(circle at top left, #2b1b0e 0, #050509 55%);
}

.about-header h2 {
  margin: 0;
  font-size: 1.25rem;
  color: #f9f9f9;
}

.about-back-btn {
  background: transparent;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0.35rem 0.9rem;
  color: #f9f9f9;
  font-size: 0.9rem;
  cursor: pointer;
}

.about-back-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.about-content {
  padding: 1.25rem 1.25rem 1.5rem;
  overflow-y: auto;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #e0e0e0;
}

.about-content h3 {
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  color: #c49a6c;
  font-size: 1.05rem;
}

.about-content p {
  margin: 0 0 0.8rem;
}

.about-content ul {
  margin: 0 0 1rem 1.2rem;
  padding: 0;
}

.about-content li {
  margin-bottom: 0.4rem;
}

/* ============================
   ACCESSIBILITY / REDUCED MOTION
============================ */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ============================
   SUBMIT A GREAT SHOT – Button
============================ */
.submit-shot-bar {
  display: flex;
  justify-content: center;
  padding: 10px 16px 4px;
}

.submit-shot-btn {
  background: linear-gradient(135deg, var(--gold-2), var(--gold-1));
  color: #fff;
  border: none;
  border-radius: var(--card-radius);
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  max-width: 480px;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.submit-shot-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.45);
}

.submit-shot-btn:active {
  transform: translateY(0);
  filter: brightness(0.95);
}

/* ============================
   SUBMIT A GREAT SHOT – Modal
============================ */
.submit-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 200;
  display: flex;
  align-items: flex-end;       /* slides up from bottom on mobile */
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.submit-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.submit-panel {
  background: var(--bg);
  width: 100%;
  max-width: 560px;
  border-radius: 20px 20px 0 0;
  padding: 0 0 env(safe-area-inset-bottom, 16px);
  transform: translateY(40px);
  transition: transform 0.3s cubic-bezier(0.34, 1.3, 0.64, 1);
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 -4px 32px rgba(0,0,0,0.5);
}

.submit-overlay.open .submit-panel {
  transform: translateY(0);
}

@media (min-width: 600px) {
  .submit-overlay {
    align-items: center;
  }
  .submit-panel {
    border-radius: 20px;
    max-height: 80vh;
    margin: 16px;
  }
}

.submit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
  border-bottom: 1px solid rgba(196,154,108,0.25);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
}

.submit-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold-1);
}

.submit-close-btn {
  background: none;
  border: none;
  color: var(--fg);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.submit-close-btn:hover { opacity: 1; }

.submit-body {
  padding: 16px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.submit-desc {
  margin: 0 0 6px;
  font-size: 0.88rem;
  opacity: 0.75;
  line-height: 1.5;
}

.submit-label {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-1);
  margin-bottom: -4px;
}

.submit-label-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.65;
  font-size: 0.78rem;
}

.submit-input,
.submit-textarea {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(196,154,108,0.3);
  border-radius: 10px;
  color: var(--fg);
  font-family: inherit;
  font-size: 0.92rem;
  padding: 10px 12px;
  transition: border-color 0.2s;
  outline: none;
}

.submit-input:focus,
.submit-textarea:focus {
  border-color: var(--gold-1);
  background: rgba(255,255,255,0.09);
}

.submit-input[readonly] {
  opacity: 0.6;
  cursor: default;
}

.submit-textarea {
  resize: vertical;
  min-height: 90px;
}

.light-theme .submit-input,
.light-theme .submit-textarea {
  background: rgba(0,0,0,0.04);
}

.light-theme .submit-input:focus,
.light-theme .submit-textarea:focus {
  background: rgba(0,0,0,0.07);
}

.submit-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.submit-btn {
  flex: 1;
  padding: 13px 16px;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
}

.submit-btn:active {
  transform: scale(0.97);
}

.submit-btn--cancel {
  background: rgba(255,255,255,0.08);
  color: var(--fg);
}

.submit-btn--cancel:hover { filter: brightness(1.2); }

.submit-btn--send {
  background: linear-gradient(135deg, var(--gold-2), var(--gold-1));
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.submit-btn--send:hover { filter: brightness(1.1); }

.light-theme .submit-btn--cancel {
  background: rgba(0,0,0,0.08);
}


/* =========================
   LDM TV Shop Promo Banner
   ========================= */
.ldm-shop-banner {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  z-index: 10050;
  width: min(calc(100vw - 20px), 620px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 42px 10px 12px;
  border: 1px solid rgba(196, 154, 108, 0.9);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(18, 18, 18, 0.98), rgba(62, 42, 24, 0.98));
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
  transform: translate(-50%, -145%);
  opacity: 0;
  transition: transform 420ms ease, opacity 420ms ease;
  -webkit-tap-highlight-color: transparent;
}

.ldm-shop-banner.open {
  transform: translate(-50%, 0);
  opacity: 1;
}

.ldm-shop-banner.closing {
  transform: translate(-50%, -145%);
  opacity: 0;
}

.ldm-shop-banner:focus-visible {
  outline: 3px solid var(--gold-1);
  outline-offset: 3px;
}

.ldm-shop-thumb {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 14px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.ldm-shop-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1.15;
}

.ldm-shop-title {
  color: #f4d7ad;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.ldm-shop-subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.86rem;
  font-weight: 600;
}

.ldm-shop-cta {
  display: inline-flex;
  width: fit-content;
  margin-top: 3px;
  color: #121212;
  background: var(--gold-1);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 800;
}

.ldm-shop-banner-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}

.ldm-shop-banner-close:focus-visible {
  outline: 2px solid var(--gold-1);
  outline-offset: 2px;
}

.ldm-shop-overlay {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: none;
  flex-direction: column;
  background: #101010;
}

.ldm-shop-overlay.open {
  display: flex;
}

.ldm-shop-overlay-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) 10px 10px;
  border-bottom: 1px solid rgba(196, 154, 108, 0.35);
  background: #16120f;
  color: #fff;
}

.ldm-shop-back,
.ldm-shop-external {
  border: 1px solid rgba(196, 154, 108, 0.65);
  border-radius: 999px;
  background: rgba(196, 154, 108, 0.12);
  color: #f4d7ad;
  padding: 8px 12px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.ldm-shop-overlay-title {
  flex: 1;
  min-width: 0;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ldm-shop-frame-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #fff;
}

.ldm-shop-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.ldm-shop-fallback-note {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(18, 18, 18, 0.78);
  color: #fff;
  font-size: 0.78rem;
  text-align: center;
  pointer-events: none;
}

.light-theme .ldm-shop-banner {
  background: linear-gradient(135deg, rgba(255, 248, 238, 0.99), rgba(229, 203, 171, 0.99));
  color: #2f2418;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.light-theme .ldm-shop-title {
  color: #3e2f1c;
}

.light-theme .ldm-shop-subtitle {
  color: rgba(47, 36, 24, 0.86);
}

.light-theme .ldm-shop-banner-close {
  color: #3e2f1c;
  background: rgba(0, 0, 0, 0.08);
}

@media (max-width: 430px) {
  .ldm-shop-banner {
    gap: 10px;
    padding: 9px 38px 9px 10px;
  }

  .ldm-shop-thumb {
    width: 54px;
    height: 54px;
    flex-basis: 54px;
  }

  .ldm-shop-title {
    font-size: 0.92rem;
  }

  .ldm-shop-subtitle {
    font-size: 0.78rem;
  }

  .ldm-shop-cta {
    font-size: 0.7rem;
    padding: 3px 9px;
  }
}

