/* =====================================================================
   COCKPIT-LAYOUT für große Bildschirme (PC, Laptop, Tablet quer):
   Deck A | Mixer | Deck B – alles auf einer Bildschirmhöhe, ohne Scrollen.
   Auf kleinen Bildschirmen (Handy) bleibt alles untereinander.
   ===================================================================== */

/* Radiofenster: breiter, damit mehr Sender nebeneinander passen */
.radio { width:min(1200px, 100%); max-height:92vh; }
.list { grid-template-columns:repeat(auto-fill, minmax(210px, 1fr)); }

/* Playlist-Knopf gibt es nur im Cockpit */
.pl-btn { display:none; }

@media (min-width: 1180px) and (min-height: 600px) {
  html, body { height:100%; }
  body { height:100vh; overflow-y:auto; overflow-x:hidden; }

  /* ---------- Kopfzeile: Logo links, Knöpfe rechts ---------- */
  header.top { width:100%; max-width:1800px; display:flex; align-items:center; justify-content:space-between;
               gap:16px; padding:8px 18px 4px; flex:none; }
  header.top .hint { display:none; }
  h1.brand { font-size:clamp(24px, 2.4vw, 34px); margin:4px 0 16px 4px; }
  .topbar { margin:0; justify-content:flex-end; }
  .tools button, .radio-btn { padding:7px 11px; font-size:13px; }
  .radio-btn { padding:8px 16px; }
  footer { display:none; }

  /* ---------- Hauptbereich: Raster aus 3 Spalten und 4 Zeilen ----------
       Teller A      | Aufnahme + Radio | Teller B
       ───────────── Crossfader unter beiden Tellern ─────────────
       Lautstärke A  | Master           | Lautstärke B
       Rest Deck A   | Sound-Pads       | Rest Deck B                     */
  .console { width:calc(100% - 24px); max-width:1800px; flex:1; min-height:0; margin:0 12px 12px; padding:12px;
             display:grid; grid-template-columns:minmax(0,1fr) clamp(270px, 24vw, 360px) minmax(0,1fr);
             grid-template-rows:auto auto auto 1fr; gap:10px 12px; }
  .decks, .deck, .mixer { display:contents; }
  .deck.a .deck-head { grid-column:1; grid-row:1; }
  .deck.b .deck-head { grid-column:3; grid-row:1; }
  .mix-grid          { grid-column:2; grid-row:1; }
  .xf-box            { grid-column:1 / -1; grid-row:2; }
  .deck.a .deck-vol  { grid-column:1; grid-row:3; }
  .master            { grid-column:2; grid-row:3; }
  .deck.b .deck-vol  { grid-column:3; grid-row:3; }
  .deck.a .deck-rest { grid-column:1; grid-row:4; }
  .pads-panel        { grid-column:2; grid-row:4; }
  .deck.b .deck-rest { grid-column:3; grid-row:4; }

  /* Deck-Bereiche bekommen jeweils einen eigenen Rahmen */
  .deck-head, .deck-vol, .deck-rest { border:1px solid var(--line); border-radius:14px; padding:8px 14px; min-height:0; }
  .deck.drag .deck-head, .deck.drag .deck-vol, .deck.drag .deck-rest { border-color:var(--c); box-shadow:0 0 20px var(--c); }
  .deck-head { display:flex; flex-direction:column; justify-content:center; }
  .deck-head .title { margin:0 0 4px; font-size:12px; min-height:16px; }
  .deck .disc { width:clamp(96px, min(calc(100vh - 548px), 24vw), 270px); margin:2px auto 4px; flex:none; }
  .deck .disc .label { font-size:clamp(16px, 2vw, 26px); }

  /* Lautstärke-Zeile */
  .deck-vol { display:flex; align-items:center; padding:6px 14px; }
  .deck-vol .slider { width:100%; margin:0; font-size:13px; font-weight:700; color:var(--c); grid-template-columns:80px 1fr 48px; }
  .deck-vol input[type=range] { height:8px; }
  .deck-vol input[type=range]::-webkit-slider-thumb { width:24px; height:24px; }

  /* Rest des Decks */
  .deck-rest { position:relative; display:flex; flex-direction:column; }
  canvas.bars { height:30px; margin:2px 0 4px; }
  canvas.wave { height:34px; }
  .time { font-size:11px; margin-top:1px; }
  .deck .buttons { margin:4px 0; gap:6px; }
  .deck .buttons > * { padding:7px 11px; font-size:13px; }
  .deck .play { min-width:84px; }
  .row { margin:2px 0; gap:5px; }
  .row button { padding:5px 9px; min-width:30px; }
  .knobs { margin:2px 0; }
  .knob svg { width:44px; height:44px; }
  .deck .slider { margin:2px 0; font-size:12px; grid-template-columns:70px 1fr 48px; }
  .deck .tempo-row { grid-template-columns:60px 1fr 48px auto; }

  /* Playlist als aufklappbare Liste */
  .pl-btn { display:inline-block; }
  .pl-btn[hidden] { display:none; }
  .deck .playlist { display:none; position:absolute; z-index:5; left:10px; right:10px; top:10px; max-height:85%;
                    margin:0; background:#0b0b14f2; box-shadow:0 0 20px var(--c); border-color:var(--c); }
  .deck.pl-open .playlist:not([hidden]) { display:block; }
  .deck.pl-open .pl-btn { background:var(--c); color:#07070c; }

  /* ---------- Mixer ---------- */
  .mix-grid { grid-template-columns:1fr; gap:10px; margin:0; align-content:center; }
  .xf-box { margin:0; border:1px solid var(--line); border-radius:14px; padding:6px 14px 8px; }
  .xf-box .lbl, .xf-box input, .xf-box small { width:min(900px, 100%); margin-left:auto; margin-right:auto; }
  .xf-box .lbl { display:flex; margin-bottom:4px; font-size:12px; }
  .xf-box small { display:none; }
  .master { margin:0; display:flex; flex-direction:column; justify-content:center; padding:6px 12px; }
  .master h3 { display:none; }
  .master .slider { margin:0; font-size:13px; font-weight:700; color:var(--a); grid-template-columns:60px 1fr 44px; }
  .pads-panel { margin:0; }
  .panel { padding:9px 12px; }
  .panel h3 { margin:0 0 7px; font-size:11px; }
  .panel small { margin-top:5px; font-size:11px; }
  .rec { padding:7px 10px; }
  #recList { max-height:40px; overflow:auto; margin-top:4px; }
  .radio-ch button#rMixBtn { padding:7px 10px; }
  .assign { margin-top:6px; }
  .assign button { padding:4px 10px; }
  #vu { margin-top:6px; height:12px; }
  .pads { grid-template-columns:repeat(3,1fr); gap:6px; margin-bottom:4px; }
  .pad { padding:7px 4px; font-size:10px; }
  .pad span { font-size:18px; }
  .pads-panel .slider { margin:0; font-size:12px; grid-template-columns:70px 1fr 0; }
  .credits { display:none !important; }

  /* Lernmodus-Hinweis oben, damit er nichts verdeckt */
  #learn { bottom:auto; top:70px; }
}

/* Breite Bildschirme: unterer Deck-Bereich zweispaltig (spart Höhe → größere Teller) */
@media (min-width: 1180px) and (min-height: 600px) {
  .deck-rest { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); column-gap:14px; align-content:center;
               grid-template-areas:"bars bars" "wave wave" "time time" "btns knobs" "cues knobs" "fx fx" "tempo tempo"; }
  .deck-rest > canvas.bars { grid-area:bars; }
  .deck-rest > canvas.wave { grid-area:wave; }
  .deck-rest > .time { grid-area:time; }
  .deck-rest > .buttons { grid-area:btns; justify-content:flex-start; }
  .deck-rest > .hotcues { grid-area:cues; justify-content:flex-start; }
  .deck-rest > .knobs { grid-area:knobs; align-self:center; }
  .deck-rest > .row:not(.hotcues) { grid-area:fx; }
  .deck-rest > .tempo-row { grid-area:tempo; }
  .deck-rest > .buttons { flex-wrap:nowrap; }
}
/* Auf schmaleren Bildschirmen "Songs laden" zu "Laden" kürzen, damit die Knöpfe in eine Zeile passen */
@media (min-width: 1180px) and (max-width: 1500px) and (min-height: 600px) {
  .deck-rest .buttons .long { display:none; }
  .deck-rest .buttons .short { display:inline; }
}
.buttons .short { display:none; }

/* ---------- Vollbild-Modus: kompakte Kopfzeile, größere Teller ---------- */
@media (min-width: 1180px) and (min-height: 600px) {
  body.is-full header.top { padding:4px 18px 0; }
  body.is-full h1.brand { font-size:clamp(20px, 1.9vw, 28px); margin:2px 0 12px 4px; }
  body.is-full .tools button, body.is-full .radio-btn { padding:5px 10px; font-size:12px; }
  body.is-full .console { margin-bottom:8px; }
  body.is-full .deck .disc { width:clamp(100px, min(calc(100vh - 528px), 26vw), 320px); }
}
body.is-full #fullBtn { border-color:var(--a); color:var(--a); box-shadow:0 0 12px var(--a); }

/* Niedrige Bildschirme (z. B. Laptop 1366×768 mit Browserleiste): noch etwas dichter */
@media (min-width: 1180px) and (min-height: 600px) and (max-height: 760px) {
  .mix-grid .panel small#recInfo, .xf-box small { display:none; }
  canvas.bars { height:26px; }
  .knob svg { width:40px; height:40px; }
  .knob span { font-size:9px; }
  .pad span { font-size:15px; }
}
@media (min-width: 1180px) and (min-height: 600px) and (max-height: 700px) {
  .mixer, .mix-grid { gap:6px; }
  .panel { padding:6px 10px; }
  .panel h3 { margin-bottom:4px; }
  #rMixInfo { display:none; }
  .pads { gap:4px; }
  .pad { padding:4px 2px; }
  .pad span { font-size:13px; }
  .xf-box { padding:6px 10px; }
  h1.brand { margin-bottom:12px; }
  canvas.bars { display:none; }                  /* Frequenzbalken weglassen, Wellenform bleibt */
  .deck .disc { width:clamp(96px, min(calc(100vh - 505px), 24vw), 270px); }
  body.is-full .deck .disc { width:clamp(96px, min(calc(100vh - 485px), 26vw), 300px); }
  .knob svg { width:36px; height:36px; }
  .deck-head .title { margin-bottom:2px; }
  .deck-vol, .master { padding-top:4px; padding-bottom:4px; }
}
