/* ==========================================================================
   AvalancheXpress — Summit Snow Tubing Unified Web & Kiosk Design System
   Matches https://avalanchexpress.com (`ax-modern` theme palette & AX Nunito)
   ========================================================================== */

@font-face {
  font-family: "AX Nunito";
  src: url("/static/ax/NunitoSans-latin-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  /* Official AvalancheXpress (`ax-modern`) Brand Tokens */
  --ax-navy: #183546;
  --ax-navy-deep: #102531;
  --ax-ink: #253d4a;
  --ax-teal: #356b68;
  --ax-teal-dark: #285451;
  --ax-warm: #bd8544;
  --ax-glow: #e5c29b;
  --ax-orange: #ff8b38;
  --ax-orange-deep: #d95b0c;
  --ax-paper: #f8f7f3;
  --ax-ice: #eaf0ee;
  --ax-ice-strong: #dce6e3;
  --ax-line: #d9e1dd;
  --ax-muted: #586b72;
  --ax-white: #ffffff;

  /* 10ft Lane Semantic Tokens (High-Contrast Snow Glare Safe) */
  --lane-clear-bg: #ffffff;
  --lane-clear-header: #1e6f50;
  --lane-clear-pill: #e6f5ee;
  --lane-clear-border: #8ec9b0;
  --lane-occ-bg: #fffaf5;
  --lane-occ-header: #d95b0c;
  --lane-occ-pill: #fff0e5;
  --lane-occ-border: #f39a60;
  --lane-hold-bg: #fdf5f5;
  --lane-hold-header: #a82431;
  --lane-hold-border: #e0929a;

  /* Legacy compatibility aliases */
  --bg-deep: var(--ax-paper);
  --bg-panel: #ffffff;
  --bg-card: #122836;
  --border-subtle: var(--ax-line);
  --border-bright: var(--ax-teal);
  --accent-cyan: var(--ax-teal);
  --accent-lime: #1f8a5b;
  --accent-gold: var(--ax-warm);
  --accent-red: #cf2e2e;
  --text-main: var(--ax-navy);
  --text-muted: var(--ax-muted);

  --ax-font: "AX Nunito", "Nunito Sans", "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --ax-shadow-sm: 0 4px 18px rgba(24, 53, 70, 0.06);
  --ax-shadow-md: 0 12px 36px rgba(24, 53, 70, 0.08);
  --ax-shadow-lg: 0 18px 46px rgba(24, 53, 70, 0.14);
  --transition-ms: 750ms;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  min-height: 100%;
  background: var(--ax-paper);
  color: var(--ax-ink);
  font-family: var(--ax-font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4 {
  font-family: var(--ax-font);
  color: var(--ax-navy);
  font-weight: 850;
  letter-spacing: -0.03em;
  line-height: 1.14;
}

button, input, select, textarea {
  font-family: inherit;
}

:focus-visible {
  outline: 3px solid var(--ax-warm);
  outline-offset: 3px;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   AVALANCHEXPRESS TOP UTILITY BAR & SITE HEADER (Hub, Claim, Moderate)
   ========================================================================== */

.ax-utility-bar {
  background: var(--ax-navy);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.4;
}

.ax-utility-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 9px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ax-utility-bar a {
  color: var(--ax-glow);
  text-decoration: none;
  font-weight: 800;
}

.ax-utility-bar a:hover {
  text-decoration: underline;
}

.ax-site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: #ffffff;
  border-bottom: 1px solid var(--ax-line);
  box-shadow: 0 4px 20px rgba(24, 53, 70, 0.05);
}

.ax-site-header-inner {
  max-width: 1440px;
  margin: 0 auto;
  min-height: 86px;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.ax-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: var(--ax-navy);
}

.ax-brand-logo {
  height: 56px;
  width: auto;
  max-width: 210px;
  object-fit: contain;
  display: block;
}

.ax-brand-divider {
  width: 1px;
  height: 36px;
  background: var(--ax-line);
}

.ax-brand-text {
  display: flex;
  flex-direction: column;
}

.ax-eyebrow {
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ax-teal);
}

.ax-brand-title {
  font-size: 1.18rem;
  font-weight: 900;
  letter-spacing: -0.025em;
  color: var(--ax-navy);
}

.ax-nav-pills {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ==========================================================================
   PASSIVE KIOSK VIEWPORT SHELL (16:9 Landscape, 9:16 Portrait, & Rotated TVs)
   ========================================================================== */

body.kiosk-body {
  height: 100vh;
  overflow: hidden;
  user-select: none;
  cursor: none;
  background: linear-gradient(180deg, var(--ax-paper) 0%, var(--ax-ice) 100%);
}

body.kiosk-body:hover {
  cursor: default;
}

body.kiosk-body.ax-theme-dark {
  background: radial-gradient(circle at 50% 0%, #1d4054 0%, #0e222e 78%);
  color: #f4f8f7;
}

.kiosk-rotator {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.kiosk-rotator.rotate-90 {
  width: 100vh;
  height: 100vw;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(90deg);
}

.kiosk-rotator.rotate-270 {
  width: 100vh;
  height: 100vw;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
}

body.preview-portrait-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ax-navy-deep);
}

body.preview-portrait-frame .kiosk-rotator {
  height: 98vh;
  width: calc(98vh * 9 / 16);
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--ax-paper) 0%, var(--ax-ice) 100%);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
}

/* ==========================================================================
   CONFIGURABLE KIOSK & LEADERBOARD HEADER / FOOTER BARS (AvalancheXpress Style)
   ========================================================================== */

.kiosk-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 26px;
  background: #ffffff;
  border-bottom: 1px solid var(--ax-line);
  box-shadow: 0 6px 24px rgba(24, 53, 70, 0.06);
  z-index: 10;
}

body.ax-theme-dark .kiosk-header {
  background: var(--ax-navy);
  border-bottom-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.kiosk-header.hidden,
.kiosk-footer.hidden {
  display: none !important;
}

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

.header-logo {
  height: 48px;
  width: auto;
  max-width: 185px;
  object-fit: contain;
}

.header-logo.hidden {
  display: none;
}

.header-titles {
  min-width: 0;
}

.header-title {
  font-size: clamp(1.15rem, 1.9vw, 1.72rem);
  font-weight: 900;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  color: var(--ax-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.ax-theme-dark .header-title {
  color: #ffffff;
}

.header-subtitle {
  font-size: clamp(0.72rem, 0.98vw, 0.88rem);
  font-weight: 850;
  letter-spacing: 0.1em;
  color: var(--ax-teal);
  text-transform: uppercase;
}

body.ax-theme-dark .header-subtitle {
  color: var(--ax-glow);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.screen-badge {
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--ax-navy);
  color: #ffffff;
  font-weight: 850;
  font-size: clamp(0.78rem, 1.05vw, 0.95rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.ax-theme-dark .screen-badge {
  background: var(--ax-teal);
}

.conn-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1f8a5b;
  box-shadow: 0 0 0 3px rgba(31, 138, 91, 0.2);
  transition: background 0.3s ease;
}

.conn-dot.offline {
  background: var(--ax-orange);
  box-shadow: 0 0 0 3px rgba(255, 139, 56, 0.25);
}

.kiosk-footer {
  flex: 0 0 auto;
  padding: 11px 24px;
  background: var(--ax-navy);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
  font-size: clamp(0.78rem, 1.02vw, 0.95rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #f4f7f6;
  text-transform: uppercase;
  z-index: 10;
}

/* ==========================================================================
   MAIN KIOSK STAGE & ZERO-CROP 1:1 SQUARE LAYOUTS
   ========================================================================== */

.kiosk-stage {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  container-type: size;
}

.stage-grid8-landscape {
  width: min(100cqw, calc(100cqh * 2.02));
  height: min(100cqh, calc(100cqw / 2.02));
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.stage-grid8-portrait {
  width: min(100cqw, calc(100cqh * 0.495));
  height: min(100cqh, calc(100cqw / 0.495));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stage-grid12-landscape {
  width: min(100cqw, calc(100cqh * 1.345));
  height: min(100cqh, calc(100cqw / 1.345));
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stage-grid12-portrait {
  width: min(100cqw, calc(100cqh * 0.745));
  height: min(100cqh, calc(100cqw / 0.745));
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.stage-single-landscape {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.stage-single-landscape .single-hero-wrap {
  height: 100%;
  aspect-ratio: 1 / 1;
  max-width: 54%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage-single-landscape .single-grid-wrap {
  height: 100%;
  aspect-ratio: 1 / 1;
  max-width: 44%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 14px;
}

.stage-single-portrait {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.stage-single-portrait .single-hero-wrap {
  width: 100%;
  max-height: 56%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage-single-portrait .single-grid-wrap {
  width: 100%;
  max-height: 42%;
  aspect-ratio: 2 / 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 10px;
}

.stage-single-portrait .single-grid-wrap.grid-2x2 {
  aspect-ratio: 1 / 1;
  width: auto;
  height: 41%;
  max-width: 100%;
}

.stage-bank-landscape {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: center;
}

.bank-lane-col {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--ax-line);
  border-radius: 16px;
  padding: 10px 12px 12px;
  gap: 8px;
  box-shadow: var(--ax-shadow-md);
}

body.ax-theme-dark .bank-lane-col {
  background: rgba(16, 37, 49, 0.78);
  border-color: rgba(255, 255, 255, 0.14);
}

.lane-col-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
}

.lane-col-title {
  font-size: clamp(0.98rem, 1.35vw, 1.28rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ax-navy);
  display: flex;
  align-items: center;
  gap: 8px;
}

body.ax-theme-dark .lane-col-title {
  color: #ffffff;
}

.lane-pill-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ax-teal);
}

body.ax-theme-dark .lane-pill-dot {
  background: var(--ax-glow);
}

.lane-col-meta {
  font-size: 0.78rem;
  font-weight: 850;
  color: var(--ax-teal);
  letter-spacing: 0.06em;
  background: var(--ax-ice);
  padding: 3px 9px;
  border-radius: 999px;
}

body.ax-theme-dark .lane-col-meta {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ax-glow);
}

.lane-col-body {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lane-stack-1plus2 {
  aspect-ratio: 2 / 3.06;
  max-height: 100%;
  max-width: 100%;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 2fr 1fr;
  gap: 10px;
}

.lane-stack-1plus2 .slot-hero {
  grid-column: 1 / span 2;
  grid-row: 1;
}

.stage-bank-portrait {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stage-bank-portrait .bank-lane-col {
  padding: 8px 10px;
}

.stage-bank-portrait .lane-stack-1plus2 {
  aspect-ratio: 3.06 / 2;
  max-height: 100%;
  max-width: 100%;
  height: 100%;
  width: auto;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
}

.stage-bank-portrait .lane-stack-1plus2 .slot-hero {
  grid-column: 1;
  grid-row: 1 / span 2;
}

/* ==========================================================================
   PHOTO SLOT CARD & DOUBLE-BUFFERED TRANSITIONS
   ========================================================================== */

.photo-slot {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  background: var(--ax-ice);
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid #ffffff;
  box-shadow: 0 10px 28px rgba(24, 53, 70, 0.14);
  transition: border-color 0.5s ease, box-shadow 0.5s ease;
}

body.ax-theme-dark .photo-slot {
  background: #0d1f2b;
  border-color: rgba(255, 255, 255, 0.16);
}

.photo-slot.slot-hero {
  border-width: 3px;
  border-color: var(--ax-teal);
}

.photo-slot.fresh-arrival {
  border-color: var(--ax-orange);
  box-shadow: 0 0 0 3px rgba(255, 139, 56, 0.4), 0 14px 36px rgba(24, 53, 70, 0.25);
}

.slot-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--ax-navy-deep);
  will-change: opacity, transform, filter;
}

.slot-img.hidden {
  opacity: 0;
  pointer-events: none;
}

.anim-dissolve .slot-front-enter {
  animation: dissolveIn var(--transition-ms) cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.anim-dissolve .slot-back-exit {
  animation: dissolveOut var(--transition-ms) cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes dissolveIn {
  0%   { opacity: 0; transform: scale(1.035); }
  100% { opacity: 1; transform: scale(1.0); }
}
@keyframes dissolveOut {
  0%   { opacity: 1; transform: scale(1.0); }
  100% { opacity: 0; transform: scale(0.985); }
}

.anim-cascade .slot-front-enter {
  animation: cascadeIn var(--transition-ms) cubic-bezier(0.19, 1, 0.22, 1) forwards;
}
.anim-cascade .slot-back-exit {
  animation: cascadeOut var(--transition-ms) cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes cascadeIn {
  0%   { opacity: 0; transform: translateY(-6%) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1.0); }
}
@keyframes cascadeOut {
  0%   { opacity: 1; transform: translateY(0) scale(1.0); }
  100% { opacity: 0; transform: translateY(6%) scale(0.97); }
}

.anim-zoom .slot-front-enter {
  animation: zoomIn var(--transition-ms) cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.anim-zoom .slot-back-exit {
  animation: zoomOut var(--transition-ms) cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes zoomIn {
  0%   { opacity: 0; transform: scale(1.08); filter: blur(6px) brightness(1.18); }
  100% { opacity: 1; transform: scale(1.0); filter: blur(0px) brightness(1.0); }
}
@keyframes zoomOut {
  0%   { opacity: 1; transform: scale(1.0); filter: blur(0px); }
  100% { opacity: 0; transform: scale(0.94); filter: blur(4px); }
}

.slot-chip {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(24, 53, 70, 0.88);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  color: #ffffff;
  z-index: 4;
  pointer-events: none;
}

.slot-hero .slot-chip {
  background: var(--ax-teal);
  border-color: rgba(255, 255, 255, 0.38);
  color: #ffffff;
}

.slot-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--ax-muted);
  font-size: 0.84rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  padding: 12px;
}

body.ax-theme-dark .slot-empty {
  color: rgba(234, 240, 238, 0.45);
}

.slot-empty.hidden {
  display: none;
}

/* ==========================================================================
   MODERATION & LAUNCHER HUB PAGES (`ax-modern` Card & Pill System)
   ========================================================================== */

.admin-wrap {
  max-width: 1380px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}

.admin-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 28px;
  background: #ffffff;
  border: 1px solid var(--ax-line);
  border-radius: 18px;
  box-shadow: var(--ax-shadow-md);
  margin-bottom: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  min-height: 44px;
  border-radius: 999px;
  border: 1.5px solid var(--ax-line);
  background: #ffffff;
  color: var(--ax-navy);
  font-size: 0.88rem;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.btn:hover {
  border-color: var(--ax-teal);
  background: var(--ax-ice);
  color: var(--ax-navy);
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--ax-navy);
  border-color: var(--ax-navy);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--ax-teal);
  border-color: var(--ax-teal);
  color: #ffffff;
}

.btn-gold {
  background: var(--ax-glow);
  border-color: #d7ae80;
  color: var(--ax-navy);
}

.btn-gold:hover {
  background: #ddb384;
  border-color: var(--ax-warm);
  color: var(--ax-navy);
}

.btn-teal {
  background: var(--ax-teal);
  border-color: var(--ax-teal);
  color: #ffffff;
}

.btn-teal:hover {
  background: var(--ax-navy);
  border-color: var(--ax-navy);
  color: #ffffff;
}

.btn-danger {
  background: #fdf2f2;
  border-color: #eab6ba;
  color: #a82431;
}

.btn-danger:hover {
  background: #cf2e2e;
  border-color: #cf2e2e;
  color: #ffffff;
}

.btn-restore {
  background: #e8f6ef;
  border-color: #8cc9af;
  color: #156d49;
}

.btn-restore:hover {
  background: #1e6f50;
  border-color: #1e6f50;
  color: #ffffff;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.chip-btn {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--ax-line);
  background: #ffffff;
  color: var(--ax-muted);
  font-size: 0.84rem;
  font-weight: 850;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip-btn:hover {
  border-color: var(--ax-teal);
  color: var(--ax-navy);
}

.chip-btn.active {
  background: var(--ax-teal);
  border-color: var(--ax-teal);
  color: #ffffff;
}

.input-field,
select.input-field {
  padding: 10px 14px;
  min-height: 44px;
  border-radius: 10px;
  border: 1.5px solid #8c9f97;
  background: #ffffff;
  color: var(--ax-navy);
  font-size: 0.92rem;
  font-weight: 750;
}

.input-field:focus,
select.input-field:focus {
  border-color: var(--ax-teal);
  outline: none;
  box-shadow: 0 0 0 3px rgba(53, 107, 104, 0.18);
}

.settings-drawer {
  background: #ffffff;
  border: 1px solid var(--ax-line);
  border-radius: 18px;
  padding: 24px 26px;
  margin-bottom: 24px;
  box-shadow: var(--ax-shadow-md);
}

.settings-drawer.hidden {
  display: none;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-group label {
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  color: var(--ax-teal);
  text-transform: uppercase;
}

.mod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.mod-card {
  background: #ffffff;
  border: 1px solid var(--ax-line);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--ax-shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.mod-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--ax-shadow-md);
}

.mod-card.is-starred {
  border: 2px solid var(--ax-warm);
  box-shadow: 0 8px 26px rgba(189, 133, 68, 0.22);
}

.mod-card.is-hidden {
  border-color: #e39aa1;
  background: #fdf5f6;
}

.mod-card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--ax-navy-deep);
  cursor: pointer;
}

.star-corner-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(24, 53, 70, 0.82);
  backdrop-filter: blur(6px);
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.15rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.16s ease, color 0.16s ease;
  z-index: 5;
}

.star-corner-btn:hover {
  transform: scale(1.1);
  color: var(--ax-glow);
}

.star-corner-btn.active {
  background: var(--ax-warm);
  border-color: #fff3db;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(189, 133, 68, 0.5);
}

.mod-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mod-card.is-hidden .mod-card-thumb img {
  opacity: 0.4;
  filter: grayscale(0.75);
}

.hidden-ribbon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg);
  padding: 6px 14px;
  background: #b8232f;
  color: #ffffff;
  font-weight: 900;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  border-radius: 8px;
  pointer-events: none;
}

.mod-card-body {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mod-meta-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 850;
  font-size: 0.96rem;
  color: var(--ax-navy);
}

.mod-meta-sub {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ax-muted);
}

/* Hub Feature Banner & Cards (Matches `.ax-lights-feature` & `.ax-attraction-card`) */
.ax-feature-banner {
  background: var(--ax-navy);
  color: #ffffff;
  border-radius: 18px;
  padding: 32px 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 30px;
  box-shadow: var(--ax-shadow-lg);
}

.ax-feature-banner .ax-eyebrow {
  color: var(--ax-glow);
  margin-bottom: 8px;
}

.ax-feature-banner h2 {
  color: #ffffff;
  font-size: clamp(1.55rem, 2.5vw, 2.15rem);
  margin-bottom: 8px;
}

.ax-feature-banner p {
  color: #dce6e4;
  font-size: 0.98rem;
  max-width: 640px;
  line-height: 1.55;
}

.ax-section-heading {
  margin-top: 30px;
  margin-bottom: 14px;
}

.ax-section-heading h2 {
  font-size: 1.45rem;
  margin-top: 4px;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

.hub-card {
  background: #ffffff;
  border: 1px solid var(--ax-line);
  border-radius: 15px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--ax-shadow-sm);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.hub-card:hover {
  border-color: var(--ax-teal);
  box-shadow: var(--ax-shadow-md);
  transform: translateY(-2px);
}

.hub-card h3 {
  font-size: 1.22rem;
  color: var(--ax-navy);
}

.hub-card p {
  font-size: 0.92rem;
  color: var(--ax-muted);
  line-height: 1.52;
}

.hub-card code {
  background: var(--ax-ice);
  color: var(--ax-navy);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.84em;
  font-weight: 700;
}

.hub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

/* ==========================================================================
   SPEED LEADERBOARD WEBAPP (`/leaderboard` -- Pure Big-Photo Top 5)
   ========================================================================== */

.lb-window-pills,
.lb-board-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.lb-window-pills.hidden,
.lb-board-tabs.hidden {
  display: none !important;
}

.lb-win-btn,
.lb-board-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--ax-line);
  background: var(--ax-paper);
  color: var(--ax-muted);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.15s ease;
}

body.ax-theme-dark .lb-win-btn,
body.ax-theme-dark .lb-board-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #d6e2df;
}

.lb-win-btn:hover,
.lb-board-btn:hover {
  border-color: var(--ax-teal);
  color: var(--ax-navy);
}

body.ax-theme-dark .lb-win-btn:hover,
body.ax-theme-dark .lb-board-btn:hover {
  color: #ffffff;
}

.lb-win-btn.active {
  background: var(--ax-teal);
  border-color: var(--ax-teal);
  color: #ffffff;
}

.lb-board-btn.active {
  background: var(--ax-navy);
  border-color: var(--ax-navy);
  color: var(--ax-glow);
}

body.ax-theme-dark .lb-board-btn.active {
  background: var(--ax-glow);
  border-color: var(--ax-glow);
  color: var(--ax-navy);
}

.lb-big5-landscape {
  width: min(100cqw, calc(100cqh * 2.025));
  height: min(100cqh, calc(100cqw / 2.025));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.lb-big5-subgrid {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 14px;
}

.lb-big5-portrait {
  width: min(100cqw, calc(100cqh * 0.494));
  height: min(100cqh, calc(100cqw / 0.494));
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 14px;
}

.lb-big5-portrait .lb-big5-subgrid {
  gap: 10px;
}

.lb-medal-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 15px;
  border-radius: 999px;
  font-weight: 900;
  font-size: clamp(0.84rem, 1.2vw, 1.12rem);
  letter-spacing: 0.04em;
  z-index: 6;
  pointer-events: none;
  box-shadow: 0 6px 20px rgba(16, 37, 49, 0.45);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.slot-hero .lb-medal-badge {
  top: 16px;
  left: 16px;
  padding: 8px 20px;
  font-size: clamp(1.05rem, 1.65vw, 1.45rem);
}

.medal-1 {
  background: linear-gradient(135deg, #f3d2a4, #bd8544);
  color: #183546;
  border: 2px solid #fff6e8;
}

.medal-2 {
  background: linear-gradient(135deg, #ffffff, #cedad6);
  color: #183546;
  border: 1.5px solid #ffffff;
}

.medal-3 {
  background: linear-gradient(135deg, #efb384, #a95d2c);
  color: #ffffff;
  border: 1.5px solid #ffe1c8;
}

.medal-4,
.medal-5 {
  background: rgba(24, 53, 70, 0.92);
  backdrop-filter: blur(6px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.photo-slot.rank-1-slot {
  border: 4px solid var(--ax-warm);
  box-shadow: 0 14px 40px rgba(24, 53, 70, 0.22);
}
