/* Forums (teal), the Create page (orange, like Upload) and Downloads. */
:root { --z-forums: #0E8C8C; --z-forums-ink: #0B6E6E; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --z-forums: #2DD4BF; --z-forums-ink: #5EEAD4; }
}
:root[data-theme="dark"] { --z-forums: #2DD4BF; --z-forums-ink: #5EEAD4; }
body[data-zone="forums"] { --zone: var(--z-forums); --zone-ink: var(--z-forums-ink); --zone-rail: var(--z-forums); }
body[data-zone="forums"] .nav a.is-active::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--zone); margin-right: 8px;
}

/* ---------------------------------------------------------------- Forums tab */
.forums-page { width: 100%; max-width: 46rem; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.forums-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#view .forums-head h1, #view .forum-title h1 { color: var(--zone-ink); }
.forums-head .btn svg { width: 16px; height: 16px; }

.forum-search { position: relative; }
.forum-search input { width: 100%; height: 48px; padding-left: 44px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid transparent; }
.forum-search input:focus { background: var(--surface); border-color: var(--z-forums); box-shadow: 0 0 0 4px color-mix(in srgb, var(--z-forums) 25%, transparent); }
.forum-search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; display: grid; }

.forum-shelf { display: flex; flex-direction: column; gap: 10px; }
.forum-shelf + .forum-shelf { margin-top: 12px; }
.forum-shelf h2 { font-size: var(--fs-h3); color: var(--ink-2); letter-spacing: 0; }
.forum-list { display: flex; flex-direction: column; gap: 8px; }
.forum-card {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-1);
}
.forum-card-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-decoration: none; color: var(--ink); min-height: 48px; }
.forum-card-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.forum-card-text strong { font-size: 1.0625rem; overflow-wrap: anywhere; }
.forum-card-text small { color: var(--ink-2); font-size: var(--fs-sm); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.forum-meta { color: var(--ink-3); font-size: 13px; margin: 0; }
.forum-meta a { color: inherit; }
.forum-badge {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: color-mix(in srgb, var(--z-forums) 16%, var(--surface)); color: var(--z-forums-ink);
  font: 800 1.2rem/1 var(--font-display);
}
.forum-badge-lg { width: 56px; height: 56px; border-radius: 16px; font-size: 1.5rem; }
.forum-badge-pic { overflow: hidden; background: var(--surface-2); }
.forum-badge-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* votes */
.vote { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); }
.vote-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); cursor: pointer; }
.vote-btn svg { width: 20px; height: 20px; }
.vote-btn svg path { fill: none; }
.vote-btn.is-on svg path { fill: currentColor; }
.vote-up.is-on { color: var(--signal-ink); }
.vote-down.is-on { color: var(--z-sounds-ink); }
.vote-btn:active { transform: scale(0.9); }
.vote-btn:focus-visible { outline: 2px solid var(--z-forums); outline-offset: -2px; }
.vote-score { min-width: 1.6em; text-align: center; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
@media (hover: hover) { .vote-btn:hover { background: var(--surface-2); color: var(--ink); } }

/* Hot / New / Top */
.forum-sort { display: inline-flex; align-self: flex-start; gap: 2px; padding: 4px; background: var(--surface-2); border-radius: var(--r-pill); }
.forum-sort a { display: grid; place-items: center; min-height: 44px; padding: 0 18px; border-radius: var(--r-pill); text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: var(--fs-sm); }
.forum-sort a.is-on { background: var(--surface); color: var(--z-forums-ink); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); font-weight: 600; }

/* rules */
.forum-rules { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 0 16px; }
.forum-rules summary { min-height: 48px; display: flex; align-items: center; font-weight: 600; cursor: pointer; }
.forum-rules .forum-text { padding-bottom: 14px; color: var(--ink-2); }
.forum-text a { color: var(--z-forums-ink); overflow-wrap: anywhere; }
.mod-pic { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mod-pic .btn { min-height: 44px; }
.forum-card .btn { flex: none; min-height: 44px; padding-inline: 18px; }
.forum-joined { flex: none; display: inline-flex; align-items: center; gap: 4px; color: var(--z-forums-ink); font-size: 13px; font-weight: 600; }
.forum-joined svg { width: 16px; height: 16px; }
@media (hover: hover) { .forum-card:hover { border-color: var(--z-forums); } }

/* ---------------------------------------------------------------- one forum, one post */
.forum-back { display: inline-flex; align-items: center; gap: 2px; align-self: flex-start; min-height: 44px; padding-right: 12px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: var(--fs-sm); }
.forum-head { display: flex; flex-direction: column; gap: 10px; }
.forum-title { display: flex; align-items: center; gap: 14px; }
.forum-title h1 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem); overflow-wrap: anywhere; }
.forum-about { color: var(--ink-2); max-width: 60ch; overflow-wrap: anywhere; margin: 0; }
.forum-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.forum-actions .btn svg { width: 16px; height: 16px; }
.forum-actions [data-close-forum], .forum-actions .forum-report-btn { margin-left: auto; }
.forum-actions [data-close-forum] + .forum-report-btn { margin-left: 0; }
.forum-actions .btn { min-height: 44px; }
.forums-head .btn { min-height: 44px; }
.forums-head h1 { margin-right: auto; }
#forum-box select { width: 100%; height: 44px; }
.report-forum-name { display: flex; align-items: center; gap: 10px; }
.report-row > strong { font: 700 1.0625rem/1.25 var(--font-display); overflow-wrap: anywhere; }
.report-row .row-btns .btn { min-height: 44px; }
.report-row .row-btns { flex-wrap: wrap; }
.forum-mods a { color: inherit; font-weight: 600; }
.forum-actions .count, .forum-shelf h2 .count { margin-left: 6px; }
.mod-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mod-list li { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 4px 0; border-top: 1px solid var(--line); }
.mod-list li:first-child { border-top: 0; }
.mod-list li span { font-weight: 600; margin-right: auto; overflow-wrap: anywhere; }
.mod-list li small { color: var(--ink-3); font-size: 13px; }
.mod-list .btn { min-height: 44px; }
.mod-add { display: flex; gap: 8px; flex-wrap: wrap; }
.mod-add input { flex: 1 1 12rem; height: 44px; }
.mod-add .btn { min-height: 44px; }

.forum-form { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.forum-form label { font-weight: 500; font-size: var(--fs-sm); }
.forum-form textarea, .forum-form input { width: 100%; }
.forum-form .row-btns { margin-top: 4px; }
#forum-box textarea, #forum-box input { width: 100%; }
#forum-box .login-head { margin-bottom: 14px; }
#forum-box .login-form label { font-weight: 500; font-size: var(--fs-sm); margin-top: 4px; }
#forum-box .login-actions { margin-top: 8px; }

.forum-posts, .forum-replies { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.forum-post-row { padding: 14px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.forum-post-row:first-child { border-top: 0; }
.forum-post-link { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 4px; }
.forum-post-link strong { font: 700 1.125rem/1.25 var(--font-display); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.forum-post-link p { margin: 0; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.forum-post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--ink-3); font-size: 13px; }
.forum-post-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.forum-post-meta svg { width: 15px; height: 15px; }
.forum-by { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--ink); font-weight: 600; text-decoration: none; }
.forum-by .avatar { width: 24px; height: 24px; font-size: 10px; }
.forum-tools { margin-left: auto; gap: 14px !important; }
.forum-tools .link-btn { font-size: 13px; color: var(--ink-3); min-height: 44px; min-width: 44px; padding: 0 4px; }

.forum-thread { display: flex; flex-direction: column; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.forum-thread h1 { font-size: clamp(1.4rem, 1.15rem + 1.2vw, 1.9rem); overflow-wrap: anywhere; }
.forum-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 68ch; line-height: 1.55; }
.forum-replies-title { font-size: var(--fs-h3); color: var(--ink-2); letter-spacing: 0; }
.forum-reply { padding: 12px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.forum-reply:first-child { border-top: 0; }
.forum-join-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--ink-2); }
.forum-pager { display: flex; justify-content: space-between; gap: 8px; }
.forum-pager:empty { display: none; }

/* ---------------------------------------------------------------- Create */
.create-page { width: 100%; max-width: 46rem; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
#view .create-page > h1 { color: var(--zone-ink); }
.create-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: stretch; }
.create-drops { display: grid; grid-template-columns: 1fr; grid-auto-rows: 1fr; gap: 12px; }
.create-drop {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 12px; width: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-1);
  color: var(--ink); text-decoration: none; font: inherit; text-align: left; cursor: pointer;
  transition: transform var(--t-press, 120ms) var(--ease-out);
}
.create-drop svg { flex: none; color: var(--signal); }
.create-drop strong { font-size: 1rem; line-height: 1.2; white-space: nowrap; }
.create-drop svg { width: 26px; height: 26px; }
.create-drop:active { transform: scale(0.97); }
.create-drop:focus-visible, .create-make:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
@media (hover: hover) { .create-drop:hover { border-color: var(--signal); background: var(--signal-wash); } }
.create-make {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  min-height: 132px; flex: 1; padding: 14px 12px; border-radius: var(--r-lg); text-decoration: none;
  color: #fff !important;
  background: radial-gradient(120% 120% at 0% 0%, rgba(168, 85, 247, .55), transparent 60%), radial-gradient(100% 120% at 100% 100%, rgba(244, 63, 94, .35), transparent 60%), #1a0f2e;
  border: 1px solid #3b1d5e; box-shadow: 0 14px 40px rgba(88, 28, 135, .35);
  transition: transform var(--t-press, 120ms) var(--ease-out);
}
.create-makes { display: flex; flex-direction: column; gap: 12px; }
.create-make svg { width: 44px; height: 44px; }
.create-make-live {
  background: radial-gradient(120% 120% at 0% 100%, rgba(244, 63, 94, .55), transparent 60%), radial-gradient(100% 120% at 100% 0%, rgba(245, 158, 11, .3), transparent 60%), #260a10;
  border-color: #5a1a24; box-shadow: 0 14px 40px rgba(159, 18, 57, .3);
}
.create-make-live small { color: #fecdd3; }
.create-make-video {
  background: radial-gradient(120% 120% at 100% 0%, rgba(45, 212, 191, .45), transparent 60%), radial-gradient(100% 120% at 0% 100%, rgba(59, 130, 246, .35), transparent 60%), #0b1c26;
  border-color: #17404a; box-shadow: 0 14px 40px rgba(13, 110, 110, .3);
}
.create-make-video small { color: #bfe9e4; }
div.create-make { cursor: default; }
div.create-make:active { transform: none; }
.create-make svg { color: #facc15; }
.create-make strong { font: 800 clamp(1.4rem, 1.05rem + 2vw, 2rem)/1.05 var(--font-display); letter-spacing: -0.02em; }
.create-make small { color: #d8c8f5; font-size: var(--fs-sm); font-weight: 600; }
.create-make:active { transform: scale(0.98); }

/* ---------------------------------------------------------------- Downloads */
body[data-zone="downloads"] { --zone: var(--z-sauce); --zone-ink: var(--z-sauce-ink); --zone-rail: var(--z-sauce); }
.downloads-page { width: 100%; max-width: 62rem; margin: 0 auto; padding: 8px 0 32px; }
.dl-sub { margin: 4px 0 0; color: var(--ink-2); font-weight: 600; }
.dl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.dl-card { display: flex; flex-direction: column; gap: 12px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-1); }
.dl-card h2 { font-size: 1.4rem; }
.dl-card > p { margin: 0; color: var(--ink-2); line-height: 1.5; }
.dl-card > p:first-of-type { min-height: 4.5em; }
.dl-card .dl-more { margin-top: auto; }
.dl-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: center; }
.dl-btns > :only-child { grid-column: 1 / -1; }
.dl-btns .sauce-big { padding: 16px 10px; font-size: 1.05rem; display: grid; place-content: center; min-height: 84px; }
.dl-soon { background: var(--surface-2); color: var(--ink-3) !important; box-shadow: none; border: 1px dashed var(--line-strong); cursor: default; }
.dl-soon small { display: block; font-size: .72rem; font-weight: 600; margin-top: 2px; }
.dl-more { font-size: var(--fs-sm); color: var(--ink-2); }
@media (max-width: 900px) { .dl-grid { grid-template-columns: 1fr; max-width: 28rem; margin: 0 auto; } }

/* ---------------------------------------------------------------- header menu on narrow windows
   Six links don't fit between 720 and 1100 px: tighter links, and Downloads moves to the footer link. */
@media (min-width: 720px) and (max-width: 1099px) {
  .nav a { padding-inline: 10px; }
  .nav a[data-nav="downloads"] { display: none; }
}
@media (min-width: 720px) and (max-width: 899px) {
  .nav a { padding-inline: 7px; font-size: 14px; }
  .top .brand-by { display: none; }
}

/* Narrow phones: the drop buttons stack above the three big ones, labels never cut. */
@media (max-width: 360px) { .create-grid { grid-template-columns: minmax(0, 1fr); } }
.create-drop strong { white-space: normal; }
