/* Jelly Ball's name: "Thrash Decision" by Chequered Ink Ltd. (drippy letters, like melting jelly), licensed for
   use inside Chideout only — see /fonts/LICENSE-NOTICE.txt. It's the game's wordmark, so it stays out of the
   app-font picker and only appears where .jb-wordmark is used. The font is all capitals. Browsers only
   download it when a .jb-wordmark element is on the page. */
@font-face { font-family: 'Jelly Ball Wordmark'; src: url('/fonts/thrash-decision.woff') format('woff'); font-weight: 400; font-style: normal; font-display: swap; }
.jb-wordmark {
  font-family: 'Jelly Ball Wordmark', var(--font-sys, system-ui), sans-serif;
  font-weight: 400; letter-spacing: 0.02em; line-height: 1.05; text-transform: uppercase;
  color: var(--brand, #7c4dff);
  /* the drips hang below the baseline: give them room so they aren't clipped */
  padding-bottom: 0.12em;
}
:root[data-font] .jb-wordmark { letter-spacing: 0.02em; } /* app fonts reset tracking on everything; keep ours */
[data-theme="dark"] .jb-wordmark { text-shadow: 0 0 0.35em color-mix(in srgb, var(--brand, #7c4dff) 55%, transparent); }

/* The Jelly Ball logo (the shiny ball) where the game used to show an emoji */
.jb-ball-logo { display: inline-block; vertical-align: middle; object-fit: contain; flex: none; }
.feed-jelly .feed-icon .jb-ball-logo { width: 30px; height: 30px; }
.empty-icon .jb-ball-logo { width: 44px; height: 44px; }
.btn .jb-ball-logo { width: 18px; height: 18px; margin-right: 2px; }
#modal-title .jb-title-ball { width: 26px; height: 26px; margin-right: 6px; vertical-align: -5px; }
#modal-title .jb-wordmark { font-size: 1.25em; vertical-align: -1px; }
.feed-jelly h1.jb-wordmark { font-size: 2rem; margin-bottom: 2px; }
/* the game page's title, spaced out a little (:root outranks the app-font rule above) */
:root .feed-jelly h1.jb-wordmark { letter-spacing: 0.09em; word-spacing: 0.18em; }

/* The left nav and the phone tab bar on playjellyball.com: "Jelly Ball" in the same lettering */
.nav-label .jb-nav-word { display: block; font-size: 1.12em; color: inherit; padding-bottom: 0.08em; }
.nav-item.is-active .jb-nav-word { color: var(--brand-text, var(--brand)); }
:root .tab-item .jb-tab-word { font-size: 0.6rem; letter-spacing: 0; padding-bottom: 0; color: inherit; text-shadow: none; overflow: visible; text-overflow: clip; max-width: none; }

/* chideout.com shows nothing about Jelly Ball (live.js takes these out too; this stops them flashing up first)
   and links across to playjellyball.com instead. logo-mark.js marks the Jelly Ball site with data-brand. */
html:not([data-brand="jellyball"]) .nav-item[data-nav="jellyball"],
html:not([data-brand="jellyball"]) .tab-item[data-nav="jellyball"],
html:not([data-brand="jellyball"]) #view-jellyball { display: none !important; }
a.nav-item.nav-out { text-decoration: none; color: inherit; }
a.nav-item.nav-out .nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ======================================================================
   REBRANDED PLAYJELLYBALL.COM FULL-WIDTH GAME-FIRST LAYOUT
   ====================================================================== */
html[data-brand="jellyball"] .leftnav,
html[data-brand="jellyball"] .rightbar,
html[data-brand="jellyball"] .tabbar,
html[data-brand="jellyball"] .nav-toggle,
html[data-brand="jellyball"] .topbar-search,
html[data-brand="jellyball"] #online-pill,
html[data-brand="jellyball"] #take-outside-btn,
html[data-brand="jellyball"] #create-post-btn,
html[data-brand="jellyball"] #friends-btn {
  display: none !important;
}

html[data-brand="jellyball"] .layout {
  display: block !important;
  max-width: 1160px !important;
  margin: 0 auto !important;
  width: 100% !important;
  padding: 0 16px 48px !important;
}

html[data-brand="jellyball"] .center {
  max-width: 100% !important;
  border: none !important;
  background: transparent !important;
}

html[data-brand="jellyball"] .topbar {
  justify-content: space-between !important;
  padding: 0 24px !important;
  border-bottom: 1px solid var(--border) !important;
}

/* ---------- Top Menu Navigation Bar (Collapsed Tabs) ---------- */
.jb-menu-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 12px auto 26px;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9999px;
  width: fit-content;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
}

.jb-menu-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 9999px;
  border: none;
  background: transparent;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.18s ease;
}

.jb-menu-tab:hover {
  color: var(--text);
  background: var(--hover);
}

.jb-menu-tab.is-active {
  color: #ffffff;
  background: var(--brand, #7c4dff);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--brand, #7c4dff) 45%, transparent);
}

.jb-menu-badge {
  font-size: 0.74rem;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.24);
  color: #ffd700;
  padding: 2px 7px;
  border-radius: 9999px;
}

/* ---------- Hero Showcase (Home) ---------- */
.jb-home-wrap {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-top: 10px;
}

.jb-hero-header {
  text-align: center;
  margin: 6px 0 2px;
}

.jb-hero-title {
  font-size: 3.2rem;
  margin: 0;
  color: var(--brand);
  letter-spacing: 0.05em;
  line-height: 1;
}

.jb-hero-tagline {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 8px 0 0;
  font-weight: 500;
}

.jb-showcase-container {
  position: relative;
  width: 100%;
  height: 380px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1);
}

.jb-showcase-bg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.jb-scene-pills {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  gap: 6px;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(10px);
  padding: 5px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.jb-scene-pill {
  padding: 6px 14px;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.jb-scene-pill:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.jb-scene-pill.is-active {
  color: #ffffff;
  background: var(--brand, #7c4dff);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--brand, #7c4dff) 50%, transparent);
}

.jb-stretchy-center-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.jb-stretchy-canvas {
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  width: 220px;
  height: 220px;
}

.jb-stretchy-canvas:active {
  cursor: grabbing;
}

.jb-stretchy-hint {
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  padding: 4px 12px;
  border-radius: 9999px;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.18);
  animation: jbHintFloat 2.4s ease-in-out infinite;
}

@keyframes jbHintFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ---------- The Three Big Bottom Tabs ---------- */
.jb-hero-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 8px;
}

.jb-big-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 26px 22px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.jb-big-tab:hover {
  transform: translateY(-5px);
  border-color: var(--brand, #7c4dff);
  box-shadow: 0 14px 34px color-mix(in srgb, var(--brand, #7c4dff) 24%, transparent);
}

.jb-big-tab-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.26);
  padding: 3px 9px;
  border-radius: 9999px;
}

.jb-big-tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--brand, #7c4dff);
  margin-bottom: 14px;
  transition: all 0.22s ease;
}

.jb-tab-explore .jb-big-tab-icon { color: #06b6d4; background: rgba(6, 182, 212, 0.1); }
.jb-tab-explore:hover .jb-big-tab-icon { background: rgba(6, 182, 212, 0.2); transform: scale(1.08); }
.jb-tab-play .jb-big-tab-icon { color: #8b5cf6; background: rgba(139, 92, 246, 0.1); }
.jb-tab-play:hover .jb-big-tab-icon { background: rgba(139, 92, 246, 0.2); transform: scale(1.08); }
.jb-tab-create .jb-big-tab-icon { color: #ec4899; background: rgba(236, 72, 153, 0.1); }
.jb-tab-create:hover .jb-big-tab-icon { background: rgba(236, 72, 153, 0.2); transform: scale(1.08); }

.jb-big-tab-title {
  font-family: 'Jelly Ball Wordmark', system-ui, sans-serif;
  font-size: 1.6rem;
  margin: 0 0 6px;
  color: var(--text);
}

.jb-big-tab-desc {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted);
  margin: 0 0 16px;
  flex: 1;
}

.jb-big-tab-arrow {
  align-self: flex-end;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--text-2);
  transition: all 0.2s ease;
}

.jb-big-tab:hover .jb-big-tab-arrow {
  background: var(--brand, #7c4dff);
  color: #ffffff;
  transform: translateX(4px);
}

/* ---------- Sub-pages (Play, Create, Explore) ---------- */
.jb-sub-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.jb-sub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.jb-sub-titles h2 {
  font-size: 1.85rem;
  margin: 0 0 4px;
}

.jb-sub-titles p {
  margin: 0;
  font-size: 0.94rem;
}

.jb-progress-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  min-width: 200px;
}

.jb-prog-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-2);
}

.jb-prog-label strong {
  color: #f59e0b;
}

.jb-prog-bar {
  height: 8px;
  border-radius: 9999px;
  background: var(--surface-3);
  overflow: hidden;
}

.jb-prog-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.45);
  transition: width 0.35s ease;
}

/* ---------- Campaign Levels Grid ---------- */
.jb-campaign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.jb-campaign-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.jb-campaign-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand, #7c4dff);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.jb-cc-thumb-wrap {
  position: relative;
  width: 100%;
  height: 160px;
  background: #0f121e;
  overflow: hidden;
}

.jb-cc-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.jb-cc-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 9999px;
}

.jb-badge-easy { background: rgba(16, 185, 129, 0.2); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.35); }
.jb-badge-medium { background: rgba(245, 158, 11, 0.2); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.35); }
.jb-badge-hard { background: rgba(239, 68, 68, 0.2); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.35); }

.jb-cc-stars {
  position: absolute;
  bottom: 8px;
  right: 10px;
  display: flex;
  gap: 3px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 1.15rem;
}

.jb-card-star.is-earned {
  color: #fbbf24;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.65);
}

.jb-card-star.is-empty {
  color: rgba(255, 255, 255, 0.25);
}

.jb-cc-body {
  padding: 18px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.jb-cc-title {
  font-size: 1.35rem;
  margin: 0 0 6px;
}

.jb-cc-desc {
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--muted);
  margin: 0 0 14px;
  flex: 1;
}

.jb-cc-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.8rem;
  color: var(--text-2);
  margin-bottom: 16px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-2);
}

.jb-cc-play-btn {
  width: 100%;
  justify-content: center;
  font-weight: 700;
  height: 38px;
  font-size: 0.92rem;
  border-radius: 10px;
}

/* ---------- Active Campaign Level Player Stage ---------- */
.jb-campaign-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}

.jb-campaign-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.jb-campaign-title-wrap {
  text-align: center;
}

.jb-campaign-title-wrap h2 {
  font-size: 1.35rem;
  margin: 0;
}

.jb-campaign-pars {
  font-size: 0.78rem;
  color: var(--muted);
}

.jb-campaign-stage-wrap {
  width: 100%;
  position: relative;
  min-height: 520px;
}

.jb-campaign-stage {
  width: 100%;
  height: 560px;
  position: relative;
}

/* ---------- Victory Overlay ---------- */
.jb-campaign-victory {
  padding: 28px 24px;
  text-align: center;
  border-radius: 22px;
  max-width: 440px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.jb-victory-banner {
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #f59e0b;
  margin-bottom: 8px;
}

.jb-victory-stars {
  display: flex;
  justify-content: center;
  gap: 14px;
  font-size: 2.8rem;
  margin: 10px 0 16px;
}

.jb-vstar.is-earned {
  color: #fbbf24;
  text-shadow: 0 0 14px rgba(251, 191, 36, 0.8);
}

.jb-vstar.is-empty {
  color: rgba(255, 255, 255, 0.22);
}

@keyframes jbStarBounce {
  0% { transform: scale(0) rotate(-45deg); opacity: 0; }
  65% { transform: scale(1.35) rotate(10deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.jb-star-pop-1 { animation: jbStarBounce 0.45s 0.1s cubic-bezier(0.17, 0.89, 0.32, 1.28) backwards; }
.jb-star-pop-2 { animation: jbStarBounce 0.45s 0.35s cubic-bezier(0.17, 0.89, 0.32, 1.28) backwards; }
.jb-star-pop-3 { animation: jbStarBounce 0.45s 0.6s cubic-bezier(0.17, 0.89, 0.32, 1.28) backwards; }

.jb-vtitle {
  font-size: 1.55rem;
  margin: 0 0 4px;
}

.jb-victory-time {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
}

.jb-victory-goals {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface-2);
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
  text-align: left;
  font-size: 0.84rem;
}

.jb-goal-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.jb-goal-item.is-met {
  color: var(--text);
  font-weight: 600;
}

.jb-goal-check {
  font-weight: 800;
  color: #10b981;
}

.jb-goal-item:not(.is-met) .jb-goal-check {
  color: var(--muted);
}

.jb-victory-meta {
  display: flex;
  justify-content: space-around;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 18px;
}

.jb-victory-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Create Grid ---------- */
.jb-create-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
}

.jb-create-card {
  padding: 32px 24px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
}

.jb-create-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border-radius: 22px;
  background: color-mix(in srgb, var(--brand, #7c4dff) 12%, transparent);
  color: var(--brand, #7c4dff);
  margin-bottom: 6px;
  transition: transform 0.22s ease;
}

.jb-create-card:hover .jb-create-card-icon {
  transform: scale(1.08);
}

.jb-create-card h3 {
  font-size: 1.45rem;
  margin: 0;
}

.jb-create-card p {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted);
  margin: 0 0 12px;
  flex: 1;
}

.jb-create-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.jb-create-actions button,
.jb-create-actions label {
  width: 100%;
  justify-content: center;
  cursor: pointer;
}

/* ---------- Responsive Adjustments ---------- */
@media (max-width: 840px) {
  .jb-hero-tabs {
    grid-template-columns: 1fr;
  }
  .jb-showcase-container {
    height: 320px;
  }
  .jb-hero-title {
    font-size: 2.5rem;
  }
  .jb-scene-pills {
    top: 10px;
    right: 10px;
  }
  .jb-scene-pill {
    padding: 4px 10px;
    font-size: 0.74rem;
  }
}

/* ======================================================================
   CUSTOM SVG ICONOGRAPHY & STARS
   ====================================================================== */
.jb-ic {
  display: inline-block;
  vertical-align: middle;
  width: 18px;
  height: 18px;
  stroke-width: 2;
  flex-shrink: 0;
}
.jb-ic.lg {
  width: 28px;
  height: 28px;
}
.jb-ic.xl {
  width: 38px;
  height: 38px;
}

.jb-star-row {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.jb-star-svg {
  display: inline-block;
  vertical-align: middle;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.jb-star-svg.is-filled {
  fill: #fbbf24;
  stroke: #d97706;
  stroke-width: 1.2;
  filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.7));
}

.jb-star-svg.is-empty {
  fill: rgba(255, 255, 255, 0.12);
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 1.2;
}

.jb-star-svg.xs {
  width: 13px;
  height: 13px;
  margin-right: 3px;
}

.jb-star-svg.sm {
  width: 16px;
  height: 16px;
}

.jb-star-svg.lg {
  width: 26px;
  height: 26px;
}

.jb-star-svg.xl {
  width: 44px;
  height: 44px;
}

.jb-victory-stars .jb-star-svg {
  width: 52px;
  height: 52px;
}

.jb-menu-tab .jb-ic {
  width: 17px;
  height: 17px;
}

.jb-scene-pill .jb-ic {
  width: 14px;
  height: 14px;
  margin-right: 5px;
}

.jb-stretchy-hint .jb-ic {
  width: 13px;
  height: 13px;
  margin-right: 5px;
  color: #fbbf24;
}

.jb-big-tab-arrow .jb-ic {
  width: 16px;
  height: 16px;
}

.jb-campaign-pars .jb-ic,
.jb-cc-stat .jb-ic,
.jb-victory-meta .jb-ic {
  width: 14px;
  height: 14px;
  margin-right: 4px;
  vertical-align: -2px;
}

.jb-goal-check .jb-ic {
  width: 15px;
  height: 15px;
  color: #10b981;
}

.jb-goal-item:not(.is-met) .jb-goal-check .jb-ic {
  color: var(--muted);
  opacity: 0.35;
}

/* The jelly logo is see-through by default (90%), like the jelly balls in the game (client-src/04e-jellyball.js,
   JB_JELLY_ALPHA, which also bends what's behind the in-game and home-page balls). */
.jb-ball-logo, .jb-logo-ball,
html[data-brand="jellyball"] img.brand-mark,
html[data-brand="jellyball"] img.pb-logo,
html[data-brand="jellyball"] img.chideout-logo { opacity: 0.9; }
