:root{
  --bg: #17181a;
  --panel: #1f2123;
  --panel-raised: #26282b;
  --line: #34373a;
  --text: #e8e6e1;
  --text-dim: #93968f;
  --brass: #c98a3e;
  --brass-bright: #e3a95c;
  --meter-green: #6fae5c;
  --meter-red: #c1543f;
  --focus: #e3a95c;
  --radius: 3px;
  --mono: "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;
  --sans: "IBM Plex Sans", "Inter", -apple-system, Segoe UI, sans-serif;
}

@media (prefers-reduced-motion: no-preference){
  .btn:active{ transform: translateY(1px); }
}

*{ box-sizing: border-box; }

body{
  margin:0;
  background:
    radial-gradient(1200px 600px at 20% -10%, #1e2022 0%, var(--bg) 55%);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
}

.app{ max-width: 1180px; margin: 0 auto; padding: 20px 20px 0; }

/* header */
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 6px 4px 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.brand{ display:flex; align-items:center; gap:12px; }
.brand-mark{
  font-size: 26px; color: var(--brass);
  text-shadow: 0 0 18px rgba(201,138,62,0.45);
}
.brand h1{ margin:0; font-size:21px; letter-spacing:0.02em; font-weight:650; }
.brand-tag{ margin:3px 0 0; color: var(--brass-bright); font-weight: 600; font-size: 13px; }
.brand-sub{ margin:3px 0 0; color:var(--text-dim); font-size:12px; font-family: var(--mono); }

.browser-warning{
  display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  background: rgba(193,84,63,0.14);
  border: 1px solid var(--meter-red);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 0 4px 18px;
  font-size: 12.5px;
  color: var(--text);
}
.browser-warning[hidden]{ display:none; }
.browser-warning strong{ color: var(--meter-red); }

.seo-intro{
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.6;
  max-width: 900px;
  margin: 0 0 20px;
  padding: 0 4px;
}
.seo-intro strong{ color: var(--text); }
.seo-intro.no-hosting-note{ margin-top: -8px; }
.seo-intro.no-hosting-note a{ color: var(--brass); }
.seo-intro.no-hosting-note a:hover{ color: var(--brass-bright); }

.status-cluster{ display:flex; gap:10px; align-items:center; flex-wrap: wrap; }
.status-pill{
  display:flex; align-items:center; gap:7px;
  background: var(--panel-raised);
  border:1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-family: var(--mono); font-size:11.5px; color: var(--text-dim);
}
.status-pill .dot{
  width:7px; height:7px; border-radius:50%;
  background: var(--meter-red);
  box-shadow: 0 0 6px var(--meter-red);
}
.status-pill.ok .dot{ background: var(--meter-green); box-shadow:0 0 6px var(--meter-green); }
.status-pill.active .dot{ background: var(--brass-bright); box-shadow:0 0 8px var(--brass-bright); }
.status-pill.ok .label, .status-pill.active .label{ color: var(--text); }

/* download tooltip */
.tooltip-wrap{ position: relative; display:inline-block; }
.tooltip-bubble{
  display:none;
  position:absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  background: var(--panel-raised);
  border: 1px solid var(--brass);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-dim);
  z-index: 20;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.tooltip-wrap:hover .tooltip-bubble{ display:block; }

/* layout */
.layout{ display:grid; grid-template-columns: 1fr; gap:16px; padding-bottom: 90px; }

/* quickplay region: sections + a sticky ad sidebar that stays onscreen while
   the user scrolls within their Quickplay categories */
.quickplay-region{
  display:grid;
  grid-template-columns: 1fr 300px;
  gap:16px;
  align-items:start;
}
.quickplay-sections{ display:flex; flex-direction:column; gap:16px; min-width:0; }
.quickplay-sidebar{ position: sticky; top: 16px; }

/* mirrors quickplay-region's proportions so the support panel lines up with
   the ad panel directly beneath it, reading as one continuous sidebar column */
.quickplay-management-region{
  display:grid;
  grid-template-columns: 1fr 300px;
  gap:16px;
  align-items:start;
}
@media (max-width: 900px){
  .quickplay-region{ grid-template-columns: 1fr; }
  .quickplay-sidebar{ position: static; }
  .quickplay-management-region{ grid-template-columns: 1fr; }
}

.panel{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px 20px;
}
.panel-header{
  display:flex; align-items:center; gap:10px;
  margin:0 0 14px;
}
.panel-header h2{
  margin:0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-dim); font-weight:600;
}
.panel-header h2 .count{ color: var(--brass-bright); text-transform:none; letter-spacing:normal; font-family: var(--mono); }
.panel-header .stop-all-btn{ margin-left: auto; }

.collapse-toggle{
  background:none; border:1px solid var(--line); color: var(--text-dim);
  width:22px; height:22px; border-radius: var(--radius);
  cursor:pointer; font-size: 11px; line-height:1;
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0;
}
.collapse-toggle:hover{ border-color: var(--brass); color: var(--text); }
.collapse-toggle::before{ content: "▾"; }
.panel.collapsed .collapse-toggle::before{ content: "▸"; }
.panel.collapsed .panel-body{ display:none; }

.collapse-hint{
  margin: -6px 0 16px 32px;
  font-size: 10.5px;
  color: var(--text-dim);
}

.faq-jump-link{
  margin-left: auto;
  font-size: 11.5px;
  color: var(--brass-bright);
  text-decoration: none;
  white-space: nowrap;
}
.faq-jump-link:hover{ text-decoration: underline; }

.faq-item{
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-raised);
  padding: 10px 14px;
  margin-bottom: 8px;
}
.faq-item:last-child{ margin-bottom: 0; }
.faq-item summary{
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
  list-style: none;
}
.faq-item summary::-webkit-details-marker{ display:none; }
.faq-item summary::before{ content: "▸ "; color: var(--brass-bright); }
.faq-item[open] summary::before{ content: "▾ "; }
.faq-item p, .faq-item ul{ font-size: 12.5px; color: var(--text-dim); line-height:1.6; margin: 10px 0 0; }
.faq-item ul{ padding-left: 20px; }
.faq-item li{ margin-bottom: 4px; }
.faq-item code{ font-family: var(--mono); background: var(--panel); padding: 1px 5px; border-radius:2px; }

.setup-step{ margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px dashed var(--line); }
.setup-step:last-child{ border-bottom:none; margin-bottom:0; padding-bottom:0; }
.setup-step h3{ margin: 0 0 8px; font-size: 12.5px; color: var(--brass-bright); font-weight:650; }
.setup-step code{ font-family: var(--mono); background: var(--panel-raised); padding: 1px 5px; border-radius:2px; }
.hint.small-note{ margin-top: 8px; font-size: 11px; }

.row{ display:flex; align-items:center; gap:12px; margin-bottom:14px; flex-wrap:wrap; }
.row:last-child{ margin-bottom:0; }
.row.two-col{ display:grid; grid-template-columns: 1fr 1fr; gap:18px; align-items:end; }
@media (max-width: 720px){ .row.two-col{ grid-template-columns: 1fr; } }

.field{ display:flex; flex-direction:column; gap:6px; font-size:12.5px; color:var(--text-dim); }
.field span{ display:flex; align-items:center; gap:8px; }
.field em{ font-style:normal; color:#6c6f6a; font-size:11px; }
.field b{ color: var(--brass-bright); font-family: var(--mono); font-weight:600; }

input[type="text"], input[type="number"], select{
  background: var(--panel-raised);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 12.5px;
}
input:focus, select:focus, button:focus-visible{
  outline: 2px solid var(--focus); outline-offset: 1px;
}

#searchInput{ width: 100%; }
#newCategoryInput{ flex: 1; min-width: 280px; }

input[type="range"]{
  -webkit-appearance:none; appearance:none;
  height: 4px; border-radius: 2px;
  background: var(--line);
}
input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none;
  width:14px; height:14px; border-radius:50%;
  background: var(--brass-bright);
  border: 2px solid #17181a;
  cursor:pointer;
  box-shadow: 0 0 0 1px var(--brass);
}

.hint{ color: var(--text-dim); font-size: 12px; }
a{ color: var(--brass-bright); }

.btn{
  background: var(--panel-raised);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 9px 16px;
  border-radius: var(--radius);
  font-size: 13px; font-weight:600; cursor:pointer;
  font-family: var(--sans);
  text-decoration:none; display:inline-flex; align-items:center; gap:6px;
}
.btn:hover{ border-color:#4a4d4f; }
.btn.primary{ background: var(--brass); border-color: var(--brass); color:#1a1408; }
.btn.primary:hover{ background: var(--brass-bright); }
.btn.ghost{ background:transparent; }
.btn.small{ padding:6px 12px; font-size:12px; }

.mute-btn{
  border:none; background:none; cursor:pointer; font-size:13px; padding:0 0 0 4px; line-height:1;
}

/* folder chips */
.folder-chips{ display:flex; flex-direction:column; gap:6px; margin-bottom: 6px; }
.folder-chip{
  display:flex; align-items:center; gap:10px;
  background: var(--panel-raised); border:1px solid var(--line); border-radius: var(--radius);
  padding: 8px 12px;
}
.folder-chip .folder-name{ font-weight:650; font-size:13px; flex:1; }
.chip-remove{
  border:none; background:none; color: var(--meter-red); cursor:pointer; font-size:13px; padding:2px 4px;
}

/* category chips */
.category-chips{ display:flex; flex-wrap:wrap; gap:8px; }
.category-chip{
  display:flex; align-items:center; gap:8px;
  background: rgba(201,138,62,0.12); border:1px solid rgba(201,138,62,0.3);
  border-radius: 999px; padding: 6px 8px 6px 12px; font-size:12px;
  cursor: grab;
}
.category-chip.dragging{ opacity:0.4; cursor: grabbing; }
.category-chip .cat-remove{
  border:none; background:none; color: var(--meter-red); cursor:pointer; font-size:12px; line-height:1;
  width:16px; height:16px; display:flex; align-items:center; justify-content:center;
}

/* color chips (button color tags) */
.color-chips{ display:flex; flex-wrap:wrap; gap:8px; margin-top: 12px; }
.color-chip{
  display:flex; align-items:center; gap:8px;
  background: var(--panel-raised); border:1px solid var(--line);
  border-radius: 999px; padding: 4px 10px 4px 6px; font-size:12px;
}
.color-swatch{
  -webkit-appearance:none; appearance:none;
  width:20px; height:20px; border-radius:50%;
  border:1px solid var(--line); padding:0; cursor:pointer; background:none;
}
.color-swatch::-webkit-color-swatch-wrapper{ padding:2px; }
.color-swatch::-webkit-color-swatch{ border-radius:50%; border:none; }
.color-chip .color-name{ font-weight:600; }
.color-chip .chip-remove{
  border:none; background:none; color: var(--meter-red); cursor:pointer; font-size:12px; line-height:1;
  width:16px; height:16px; display:flex; align-items:center; justify-content:center;
}

/* quickbar — uniform grid of fixed-size buttons so categories don't look
   cluttered with mismatched button sizes; auto-fill keeps the count per
   row responsive to available width instead of a hardcoded number */
.quickbar{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap:8px;
}
.empty-note{ color:#6c6f6a; font-size:12.5px; margin:0; }

.quick-btn{
  position:relative;
  height: 45px;
  min-width:0;
  background: linear-gradient(180deg, var(--panel-raised), #202224);
  border: 4px solid var(--qc-color, var(--line));
  border-radius: var(--radius);
  color: var(--text);
  padding: 4px 18px 4px 8px;
  text-align:left;
  cursor: grab;
  display:flex;
  align-items:center;
  overflow:hidden;
}
.quick-btn:hover{ border-color: var(--qc-color, var(--brass)); }
.quick-btn .name{
  display:-webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow:hidden;
  font-weight:650;
  font-size:10px;
  line-height:1.18;
  width:100%;
}
.quick-btn.playing{ border-color: var(--meter-green); box-shadow: 0 0 0 1px var(--meter-green); }
.quick-btn.dragging{ opacity:0.35; cursor: grabbing; }
.quick-remove{
  position:absolute; top:3px; right:3px;
  width:14px; height:14px; border-radius:50%;
  border:1px solid var(--line); background: var(--panel);
  color: var(--text-dim); font-size:8px; line-height:1;
  display:flex; align-items:center; justify-content:center; cursor:pointer;
}
.quick-remove:hover{ border-color: var(--meter-red); color: var(--meter-red); }

/* sound list */
.sound-list{ display:flex; flex-direction:column; gap:8px; }

.sound-row{
  display:grid;
  grid-template-columns: 160px 1.4fr 1fr 96px;
  gap:14px;
  align-items:center;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
}
@media (max-width: 900px){
  .sound-row{ grid-template-columns: 1fr; }
}

.sound-row .tag-block{ display:flex; flex-direction:column; gap:6px; }
.sound-row .tag-block select{ width:100%; }

.sound-row .name-block{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.sound-row .name-block input{ background:transparent; border:none; padding:0; font-family:var(--sans); font-size:13.5px; font-weight:600; color:var(--text); width:100%; }
.sound-row .name-block .path{ font-size:10.5px; color:#6c6f6a; font-family: var(--mono); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.sound-row .vol-block{ display:flex; flex-direction:column; gap:4px; }
.sound-row .vol-block span{ font-size:10.5px; color:var(--text-dim); font-family:var(--mono); }

.sound-row .actions{ display:flex; gap:8px; }
.round-btn{
  width:36px; height:36px; border-radius:50%;
  border:none; cursor:pointer;
  font-size:14px; display:flex; align-items:center; justify-content:center;
}
.play-btn{ background: var(--brass); color:#1a1408; }
.play-btn:hover{ background: var(--brass-bright); }
.stop-btn{ background: var(--panel); border:1px solid var(--line); color: var(--text-dim); }
.stop-btn:hover{ border-color: var(--meter-red); color: var(--meter-red); }
.local-btn{ background: var(--panel); border:1px solid var(--line); color: var(--text-dim); font-size:13px; }
.local-btn:hover{ border-color: var(--brass); color: var(--brass); }

/* feedback trigger link, sits at the bottom of the support sidebar panel */
.feedback-link{
  display:inline-flex; align-items:center; gap:6px;
  margin-top:14px;
  color: var(--brass); font-size:12.5px; font-weight:600;
  text-decoration:none;
}
.feedback-link:hover{ color: var(--brass-bright); }

/* feedback modal, simulated popup window centered over everything */
.feedback-overlay{
  position: fixed; inset: 0;
  background: rgba(10,10,10,0.65);
  display:flex; align-items:center; justify-content:center;
  z-index: 1000;
  padding: 20px;
}
.feedback-overlay[hidden]{ display:none; }

.feedback-modal{
  position: relative;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-width: 440px; width:100%;
  padding: 28px 24px 24px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
}
.feedback-modal h3{ margin:0 0 6px; color:var(--text); font-family:var(--sans); font-size:16px; }
.feedback-modal .hint{ margin:0 0 16px; }

.feedback-close{
  position:absolute; top:10px; right:10px;
  width:28px; height:28px; border-radius:50%;
  border:1px solid var(--line); background:var(--panel);
  color:var(--text-dim); cursor:pointer; font-size:13px;
  display:flex; align-items:center; justify-content:center;
}
.feedback-close:hover{ color: var(--meter-red); border-color: var(--meter-red); }

#feedbackForm{ display:flex; flex-direction:column; gap:12px; }
#feedbackForm .field{ display:flex; flex-direction:column; gap:4px; font-size:12.5px; color:var(--text-dim); font-family:var(--sans); }
#feedbackForm input, #feedbackForm textarea{
  background: var(--panel); border:1px solid var(--line); border-radius: var(--radius);
  color: var(--text); padding:8px 10px; font-family: var(--sans); font-size:13.5px; resize: vertical;
}
#feedbackForm input:focus, #feedbackForm textarea:focus{ outline:none; border-color: var(--focus); }
#feedbackForm button[type="submit"]{ align-self:flex-start; margin-top:4px; }

.feedback-toast{
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  background: var(--panel-raised);
  border-radius: var(--radius);
  font-family: var(--sans); font-weight:600; color: var(--meter-green);
  font-size:15px; text-align:center; padding: 0 20px;
}
.feedback-toast[hidden]{ display:none; }
.feedback-toast.error{ color: var(--meter-red); }
.sound-row.playing{ border-color: var(--meter-green); }
.sound-row.playing .play-btn{ background: var(--meter-green); color:#0d1a0c; }

/* ad slot: lives in the sticky Quickplay sidebar, kept in its own panel
   away from any button/slider per AdSense's ad/content separation policy */
.ad-panel{
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  min-height: 100px;
}
.ad-label{
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6c6f6a;
}
.ad-panel ins.adsbygoogle{ width: 100%; }

/* support / donate sidebar, sits directly above the ad panel */
.support-panel{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.support-text{
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
}
.kofi-link{ width: 100%; justify-content: center; }
.kofi-qr{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.kofi-qr img{
  width: 100px;
  height: 100px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
  padding: 6px;
}
.qr-caption{
  font-size: 10.5px;
  color: var(--text-dim);
  font-family: var(--mono);
}

/* log bar */
.log-bar{
  position:fixed; bottom:0; left:0; right:0;
  background: #101112;
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size:11.5px; color: var(--text-dim);
  padding: 8px 20px;
}

/* site footer: legal links + trademark disclaimer, sits above the fixed log bar */
.site-footer{
  max-width: 1180px;
  margin: 8px auto 60px;
  padding: 18px 4px 0;
  border-top: 1px solid var(--line);
  text-align: center;
}
.footer-links{
  display:flex; align-items:center; justify-content:center; gap:10px;
  font-size: 12.5px; margin-bottom: 12px;
}
.footer-links a{ color: var(--text-dim); text-decoration: none; }
.footer-links a:hover{ color: var(--brass-bright); text-decoration: underline; }
.footer-sep{ color: var(--line); }
.footer-disclaimer{
  max-width: 820px;
  margin: 0 auto 8px;
  color: #6c6f6a;
  font-size: 11px;
  line-height: 1.6;
}
.footer-copyright{
  color: #6c6f6a;
  font-size: 11px;
  margin: 0;
}
