/* ================================================================
   layout.css – Projekt Seevan v2
   Einzige CSS fuer alle Unterseiten.
   ================================================================ */

/* ── Reset & Basis ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #111;
  --bg2:     #161616;
  --bg3:     #1c1c1c;
  --bg4:     #202020;
  --card:    #161616;
  --fg:      #eee;
  --muted:   #b7b7b7;
  --subtle:  #777;
  --line:    #222;
  --line2:   #2a2a2a;
  --accent:  #4bd;
  --cat-books: #4bd;
  --cat-music: #d84b4b;
  --cat-games: #c8a84b;
  --cat-merch: #7e4bd8;
}

html {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.35) transparent;
  height: 100%;
}
body {
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar              { width: 8px; height: 8px; }
::-webkit-scrollbar-track        { background: transparent; }
::-webkit-scrollbar-thumb        { background: rgba(255,255,255,.35); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover  { background: rgba(255,255,255,.55); }

a, a:visited { color: #fff; text-decoration: none; }
a:hover, a:focus-visible { opacity: .9; }

.muted  { color: var(--muted);  font-size: 12px; }
.subtle { color: var(--subtle); font-size: 12px; }


/* ================================================================
   GEMEINSAME SEITEN-WRAPPER (Werke, Werkstatt, Im Handel)
   ================================================================ */

#werke, #workshop, #handel {
  max-width: 1180px;
  margin: 24px auto 40px;
  padding: 0 16px 24px;
}

#werke h1, #workshop h1, #handel h1 { font-size: 28px; margin: 0 0 8px; }
#werke .intro, #workshop .intro, #handel .intro {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--muted);
}

/* ── Toolbar (Tabs + Suche) ── */
.toolbar {
  margin: 8px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab {
  border: 1px solid var(--line2);
  background: var(--bg3);
  color: #ddd;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}
.tab.active {
  background: #2f2f2f;
  border-color: var(--accent);
  color: #fff;
}

.search input {
  width: 100%;
  max-width: 420px;
  background: #131313;
  border: 1px solid var(--line2);
  color: var(--fg);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}
.search input::placeholder { color: var(--subtle); }

/* ── Kartenliste ── */
.item-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 8px;
}

/* ── Karte (alle Seiten) ── */
.card {
  position: relative;
  padding: 18px 16px 16px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--bg4);
  box-shadow: 0 8px 24px rgba(0,0,0,.30);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0);
  pointer-events: none;
}

/* Kategorie-Farben fuer Handel */
.card-music { --cat: var(--cat-music); }
.card-books { --cat: var(--cat-books); }
.card-games { --cat: var(--cat-games); }
.card-merch { --cat: var(--cat-merch); }
.card-music::before, .card-books::before,
.card-games::before, .card-merch::before {
  border-color: color-mix(in srgb, var(--cat) 35%, transparent);
}

/* ── Card-Struktur ── */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.cat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--cat, #8fd3ff);
}
.status-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  color: #ddd;
}
.status-badge[data-status="in arbeit"]      { border-color: #e4b14a; color: #ffe9ba; }
.status-badge[data-status="veroeffentlicht"]{ border-color: var(--accent); color: #c9f3ff; }
.status-badge[data-status="planung"]        { border-color: var(--subtle); color: #ddd; }

.card-top  { display: flex; gap: 16px; }
.card-cover { flex: 0 0 auto; width: 160px; max-width: 40%; border-radius: 12px; overflow: hidden; }
.card-cover img {
  display: block; width: 100%; height: auto;
  border-radius: 12px; background: #0d0d0d;
  box-shadow: 0 12px 26px rgba(0,0,0,.55);
}
/* cover_ratio gesetzt: Bild füllt Rahmen exakt */
.card-cover[style*="aspect-ratio"] { box-shadow: 0 12px 26px rgba(0,0,0,.55); }
.card-cover[style*="aspect-ratio"] img { height: 100%; object-fit: cover; border-radius: 0; box-shadow: none; }
.card-body  { flex: 1 1 auto; display: flex; flex-direction: column; gap: 6px; }
.card-title { font-size: 20px; font-weight: 800; margin: 0; }

.card-meta { font-size: 13px; color: var(--muted); }
.card-meta span + span::before { content: " · "; margin: 0 4px; }

.card-badges {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 4px 0 2px; font-size: 11px; color: var(--muted);
}
.card-badges span { padding: 1px 7px; border-radius: 999px; border: 1px solid #333; }

.card-desc { margin: 4px 0 0; color: #ddd; font-size: 14px; line-height: 1.6; white-space: pre-line; }

.card-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Handel-spezifisch: meta-row mit links/rechts */
.card-meta-row { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--muted); }
.card-meta-row .meta-cat { font-weight: 600; color: var(--cat, var(--muted)); }
.card-meta-row .meta-tags { opacity: .9; }

/* ── Buttons ── */
.btn {
  flex: 1 1 auto;
  text-align: center;
  background: var(--bg3);
  border: 1px solid var(--line2);
  color: #ddd;
  padding: 9px 14px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  display: inline-block;
}
.btn:hover    { filter: brightness(1.08); }
.btn-primary  { border-color: var(--cat, var(--accent)); color: #fff; }
.btn-ghost    { background: transparent; border-color: var(--line2); color: var(--muted); }
.btn-ghost:hover { border-color: var(--accent); color: var(--fg); filter: none; }
.btn-shop     { }
.btn-full     { flex: 1 1 100%; }

/* Button-Positions-Wrapper (optional, vom Content Creator gesetzt) */
.btn-wrap            { display: flex; }
.btn-wrap--left      { justify-content: flex-start; }
.btn-wrap--center    { justify-content: center; }
.btn-wrap--right     { justify-content: flex-end; }
.btn-wrap--full      { display: block; }
.btn-wrap--full .btn { display: block; width: 100%; }


/* ================================================================
   TRACKLISTE (Im Handel – Musik)
   ================================================================ */

.tracklist { margin-top: 8px; }
.tracklist-head { font-size: 12px; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .06em; }
.tracklist-list { list-style: none; display: flex; flex-direction: column; gap: 0; }

.track { display: flex; align-items: center; gap: 4px; padding: 5px 0; border-bottom: 1px solid #1a1a1a; }
.track:last-child { border-bottom: none; }
.track--playing .track-title { color: var(--accent); }

.track-label { font-family: monospace; font-size: 12px; color: #aaa; min-width: 2em; }
.track-video-btn {
  flex: 0 0 auto; border: none; font-size: 8px;
  width: 14px; height: 14px; border-radius: 3px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1; margin: 0 3px;
}
.track-video-btn.has-video { background: #f00; color: #fff; cursor: pointer; }
.track-video-btn.has-video:hover { filter: brightness(1.1); }
.track-video-btn.no-video  { background: #333; color: var(--subtle); cursor: default; }
.track-title  { flex: 1 1 auto; font-size: 14px; }
.track-length { flex: 0 0 auto; min-width: 3em; text-align: right; font-size: 12px; color: #aaa; font-variant-numeric: tabular-nums; }
.track-demo-btn {
  flex: 0 0 auto; border: 1px solid var(--line2); background: var(--bg3);
  color: #ddd; font-size: 11px; padding: 3px 10px; border-radius: 999px; cursor: pointer; margin-left: 6px;
}
.track-demo-btn:hover { filter: brightness(1.1); }
.track-demo-btn[data-state="playing"] { border-color: var(--accent); color: #fff; }


/* ================================================================
   MODALS (gemeinsam)
   ================================================================ */

.modal-back {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.modal {
  background: #141414;
  border: 1px solid var(--line2);
  border-radius: 16px;
  max-width: 520px; width: 92%;
  padding: 16px 16px 14px;
  position: relative;
}
.modal-close {
  position: absolute; top: 10px; right: 10px;
  background: transparent; border: none;
  color: #aaa; cursor: pointer; font-size: 20px; line-height: 1;
}
.modal-close:hover { color: #fff; }
.modal-body { margin-top: 8px; }
.modal-title { font-size: 18px; margin: 0 0 8px; }
.modal-sub   { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.modal-text  { white-space: pre-line; color: #ddd; font-size: 14px; line-height: 1.6; }
.modal-video { width: 100%; border-radius: 12px; border: 1px solid var(--line2); background: #0d0d0d; margin-bottom: 12px; }

/* Galerie im Modal (Werkstatt Schaufenster) */
.modal-gallery { display: flex; flex-direction: column; gap: 10px; }
.gallery-main  { width: 100%; border-radius: 12px; border: 1px solid var(--line2); background: #0d0d0d; }
.gallery-thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.gallery-thumb {
  width: 96px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line2); background: #0f0f0f; cursor: pointer; padding: 0;
}
.gallery-thumb img { display: block; width: 100%; height: auto; }

/* Shop-Modal (Im Handel) */
.shop-list { display: grid; gap: 8px; margin-top: 10px; }

/* Audio-Modal (Werke) */
.modal-overlay { position: fixed; inset: 0; display: none; z-index: 9999; }
.modal-overlay[aria-hidden="false"] { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(3px); }
.modal-dialog {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%,-50%);
  width: min(480px,92vw);
  background: var(--bg);
  border: 1px solid #1e1e1e;
  border-radius: 12px;
  padding: 18px 20px 22px;
  box-shadow: 0 24px 80px rgba(0,0,0,.65);
}
.modal-dialog h3    { font-size: 18px; margin: 0 0 12px; text-align: center; font-weight: 500; }
.audio-player       { width: 100%; }
.modal-dialog .modal-close { position: absolute; top: 8px; right: 10px; }


/* ================================================================
   SOUNDPOOL
   ================================================================ */

:root {
  --sp-card-bg:  #121212;
  --sp-card-br:  10px;
  --sp-accent:   #4bd;
  --sp-text:     #e7eaee;
  --sp-text-dim: rgba(255,255,255,.72);
  --sp-audio-h:  28px;
}

.sp * { box-sizing: border-box; }
.sp   { width: 100%; position: relative; }

.sp-container { max-width: min(1200px,94vw); margin: 0 auto; padding: 0 8px; }
.sp-panel     { background: var(--sp-card-bg); border: 1px solid #1e1e1e; border-radius: var(--sp-card-br); padding: 12px; }
.sp-title     { color: #fff; font-weight: 600; }
.sp-meta      { color: var(--sp-text-dim); font-size: 12px; }

.sp-header { position: sticky; top: 10px; z-index: 20; background: transparent; border: 0; padding: 0; margin: 0; }
.sp-header .sp-container {
  background: var(--sp-card-bg); border: 1px solid #1e1e1e;
  border-radius: var(--sp-card-br); padding: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35); overflow: hidden;
}
.sp-header .sp-header-inner {
  display: grid; gap: 10px;
  grid-template-columns: 1fr repeat(6, minmax(140px,1fr)) auto;
  align-items: center;
}
.sp-header .sp-h-left  { grid-column: 1 / -1; display: contents; }
.sp-header .sp-h-right { justify-self: end; display: flex; gap: 10px; align-items: center; }
.sp-header input[type="search"], .sp-header select {
  background: #0b0b0b; color: #fff; border: 1px solid #222;
  border-radius: 8px; padding: 8px 10px; min-height: 38px;
}
.sp-toggle { display: none !important; }

.sp-body { padding: 10px 0; }
.sp-list { display: grid; gap: 12px; }

.sp-card {
  display: grid; grid-template-columns: 1fr auto; gap: 10px;
  background: var(--sp-card-bg); border: 1px solid #1e1e1e;
  border-radius: var(--sp-card-br); padding: 14px 16px;
  width: 100%; box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.sp-sub { color: var(--sp-text-dim); font-size: 13px; }
.sp-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.sp-chip  { background: rgba(255,255,255,.06); border: 1px solid #2a2a2a; border-radius: 999px; padding: 3px 8px; font-size: 12px; }
.sp-chip.is-type  { color: #b0ffc8; border-color: #2b6b4b; background: rgba(30,110,70,.18); }
.sp-chip.is-bpm   { color: #ddd; }
.sp-chip.is-key   { color: #cfe8ff; }
.sp-chip.is-genre { color: #9ecbff; border-color: #2b3f6b; background: rgba(30,60,110,.18); }
.sp-chip.is-sub   { color: #d6a9ff; border-color: #4b2b6b; background: rgba(80,30,110,.18); }
.sp-chip.tempo-slow  { color: #9ecbff; border-color: #2b3f6b; background: rgba(30,60,110,.18); }
.sp-chip.tempo-mid   { color: #b6ffba; border-color: #2b6b3f; background: rgba(30,110,70,.18); }
.sp-chip.tempo-fast  { color: #ffc2a6; border-color: #6b3f2b; background: rgba(110,60,30,.18); }
.sp-chip.energy-low  { color: #9ecbff; border-color: #2b3f6b; background: rgba(30,60,110,.18); }
.sp-chip.energy-mid  { color: #ffe699; border-color: #6b5a2b; background: rgba(110,90,40,.18); }
.sp-chip.energy-high { color: #ffb3c1; border-color: #6b2b2b; background: rgba(110,30,30,.18); }

.sp-right   { display: grid; gap: 8px; align-content: start; justify-items: end; }
.sp-actions { display: flex; gap: 6px; }
.sp-btn {
  background: #0b0c0f; border: 1px solid #2a2e36;
  color: #fff; padding: 8px 10px; border-radius: 8px;
  text-decoration: none; font-size: 13px; cursor: pointer;
}
.sp-btn:hover { border-color: var(--sp-accent); }
.sp-btn[disabled] { opacity: .5; pointer-events: none; }
.sp-btn-accent { border-color: var(--sp-accent); }
.sp-btn.sp-btn-accent:not([disabled]) { background: linear-gradient(180deg,#1a9be6,#157bb7); border-color: #1a9be6; }
#dl-start[disabled] { opacity: .55; cursor: not-allowed; }

.sp-audio-row { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; margin-top: 8px; }
.sp-audio-row .sp-inline { flex: 1 1 auto; min-width: 0; }
.sp-audio-row .sp-dl     { flex: 0 0 auto; white-space: nowrap; }

audio.sp-inline { width: 100%; height: var(--sp-audio-h); color-scheme: dark; }
audio.sp-inline::-webkit-media-controls-enclosure { background: #0f0f10; border: 1px solid #232323; border-radius: 10px; overflow: hidden; }
audio.sp-inline::-webkit-media-controls-panel     { background: transparent; }
audio.sp-inline::-webkit-media-controls-timeline,
audio.sp-inline::-webkit-media-controls-volume-slider {
  height: 6px; background: #222 !important; border-radius: 999px;
  transform: scaleY(.55); transform-origin: center;
}
audio.sp-inline::-webkit-media-controls-current-time-display,
audio.sp-inline::-webkit-media-controls-time-remaining-display { color: #cfd3d8; }
audio.sp-inline::-webkit-media-controls-download-button { display: none !important; }

.sp-footer { position: sticky; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 20; background: transparent; border: 0; padding: 0; margin: 0; }
.sp-footer .sp-container { background: var(--sp-card-bg); border: 1px solid #1e1e1e; border-radius: var(--sp-card-br); padding: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.sp-pager { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; align-items: center; }
.sp-page  { min-width: 36px; text-align: center; }
.sp-page.current { border-color: var(--sp-accent); color: #fff; }

.sp-modal { position: fixed; inset: 0; display: none; z-index: 9999; }
.sp-modal[aria-hidden="false"] { display: block; }
.sp-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(3px); }
.sp-modal-dialog {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: min(600px,92vw); background: var(--sp-card-bg); color: var(--sp-text);
  border: 1px solid #1e1e1e; border-radius: 12px; padding: 18px 20px;
  box-shadow: 0 24px 80px rgba(0,0,0,.65);
}
#dl-title.sp-title { font-size: 22px; margin: 0 0 2px; }
#dl-file.sp-meta   { display: block; margin-bottom: 10px; color: #b6bcc6; }
.sp-subtitle       { margin: 0 0 12px; color: #9aa3ad; font-size: 13px; }
.sp-checks         { display: grid; gap: 0; margin: 8px 0 14px; padding: 0; }
.sp-checks li      { list-style: none; padding: 8px 0; margin: 0; }
.sp-checks li + li { border-top: 1px solid #22252b; }
.sp-checks label   { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; }
.sp-checks input[type="checkbox"] { accent-color: var(--sp-accent); margin-top: 2px; }
.sp-modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

html, body { height: auto !important; overflow: auto !important; }
body { display: block !important; }
main { overflow: visible !important; height: auto !important; }

@media (max-width: 1100px) {
  .sp-header .sp-header-inner { grid-template-columns: 1fr 1fr 1fr 1fr; }
  .sp-header .sp-h-right      { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 700px)  { .sp-header .sp-header-inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px)  { .sp-header .sp-header-inner { grid-template-columns: 1fr; } }


/* ================================================================
   HOME
   ================================================================ */

.intro {
  text-align: center;
  padding: 60px 20px 40px;
}
.intro h1 { font-size: 32px; margin-bottom: 15px; }
.intro h2  { font-size: 26px; margin-bottom: 15px; }
.intro p   { font-size: 16px; color: #aaa; line-height: 1.6; }

.container {
  display: flex; gap: 20px; justify-content: center; flex-wrap: wrap;
  max-width: 1000px; margin: 0 auto; padding: 20px;
}
.container > .card {
  background: #1b1b1b;
  border-radius: 12px;
  padding: 20px;
  flex: 1 1 400px;
  max-width: 450px;
  /* Reset der generischen .card-Styles */
  border: 1px solid transparent;
  box-shadow: none;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}
.container > .card::before { display: none; }
.container > .card img { max-width: 100%; border-radius: 8px; margin-bottom: 15px; }
.container > .card h2  { margin: 0 0 10px; font-size: 18px; }

.tags { margin-top: 15px; display: flex; flex-wrap: wrap; gap: 10px; }
.tag  { background: #333; padding: 6px 12px; border-radius: 20px; font-size: 12px; color: #ddd; }
.tag:hover { background: #555; }

.ps-social { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
.ps-img    { width: 28px; height: 28px; object-fit: contain; }
.ps-social a { transition: transform .15s ease, opacity .15s ease; opacity: .92; }
.ps-social a:hover { opacity: 1; transform: translateY(-1px) scale(1.05); }


/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 800px) {
  .card-top { flex-direction: column; }
  .card-cover { width: 60%; max-width: 260px; margin-inline: auto; }
}
@media (max-width: 540px) {
  #werke, #workshop, #handel { margin-top: 18px; padding-inline: 12px; }
  .card { padding-inline: 14px; }
  .card-cover { width: 100%; max-width: 260px; }
  .card-actions { flex-direction: column; }
}
