/* ============================================
   PLAYGROUND MK-2 SPECIFIC STYLES
   Two decks and a mixer
   ============================================ */

/* === MK-2 VARIABLES === */
:root {
    --mk2-fg-rgb: 255, 255, 255;
    --mk2-groove: rgba(255, 255, 255, .11);
    --mk2-pad: clamp(12px, 1.8vw, 22px);
    --mk2-accent: #d4c5a0;

    --bg-primary: #0a0a0a;
    --bg-secondary: #111;
    --text-primary: #fff;
    --text-secondary: #fff;
    --text-tertiary: #999;
    --border-primary: #1e1e1e;
    --active-bg: #e0e0e0;
    --active-text: #0a0a0a;
}

/* kill playground-core grain and vignette */
body::before, body::after { display: none !important; }

/* === BODY OVERRIDES === */
body {
    font-size: 13px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* === HEADER OVERRIDES === */
.header {
    padding: 0.8rem var(--mk2-pad);
    background: #0a0a0a;
    border-bottom: 1px solid #1e1e1e;
    flex-wrap: wrap;
}
.header::after { display: none; }

/* === KNOW HOW PANEL === */
.knowhow-panel {
    grid-column: 1 / -1;
    padding: 12px var(--mk2-pad);
    border-top: 1px solid var(--border-primary);
    font-size: 11px;
    line-height: 1.8;
    color: #fff;
    display: flex;
    flex-wrap: wrap;
    gap: 16px 32px;
}
.knowhow-panel[hidden] { display: none; }
.knowhow-section { min-width: 200px; flex: 1; }
.knowhow-section strong { color: var(--mk2-accent); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.knowhow-section em { font-style: normal; color: var(--mk2-accent); }
.knowhow-section a { color: var(--mk2-accent); text-decoration: underline; }

.mk2-hint {
    color: var(--text-tertiary);
    font-size: 0.7rem;
    letter-spacing: .08em;
    cursor: default;
    border-color: transparent;
}

/* === VISUALIZER === */
.viz {
    display: block;
    width: 100%;
    height: 48px;
    border-bottom: 1px solid var(--border-primary);
}

/* === Z-INDEX ABOVE GRAIN === */
.rig, .crate {
    position: relative;
    z-index: 2;
}

/* === RIG LAYOUT === */
.rig {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 330px 1fr;
    align-items: start;
}

/* === FILE PICKER (hidden input inside label) === */
.file-pick {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

/* === DECK === */
.deck {
    padding: var(--mk2-pad);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.deck.over .disc,
.deck.over .slot {
    outline: 1px dashed var(--text-primary);
    outline-offset: 10px;
}
.head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    min-height: 1.5em;
}
.letter {
    font-weight: 700;
    font-size: 20px;
    line-height: 1;
    color: var(--mk2-accent);
}
.track {
    font-size: 11.5px;
    opacity: .6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}
.track:hover { opacity: 1; }
.body {
    display: flex;
    gap: var(--mk2-pad);
    align-items: stretch;
    justify-content: center;
}

/* === PLATTER === */
.platter {
    position: relative;
    flex: 1;
    max-width: min(42vh, 520px);
    aspect-ratio: 1;
}
.slot {
    position: absolute;
    inset: 4%;
    border-radius: 50%;
    border: 1px solid rgba(var(--mk2-fg-rgb), .14);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 10.5px;
    letter-spacing: .16em;
    cursor: pointer;
    text-align: center;
    padding: 24%;
}
/* === DISC === */
.disc {
    position: absolute;
    inset: 4%;
    border-radius: 50%;
    display: none;
    background: repeating-radial-gradient(circle at 50% 50%, rgba(255,255,255,.06) 0 1px, transparent 1px 3px), radial-gradient(circle at 50% 50%, #1a1a1a 32%, #0f0f0f 33%, #0f0f0f);
    border: 1px solid rgba(var(--mk2-fg-rgb), .22);
    cursor: grab;
    touch-action: none;
    will-change: transform;
    z-index: 3;
}
.deck.loaded .disc { display: block; }
.deck.loaded .slot { display: none; }
.deck.live .disc {
    border-color: var(--mk2-accent);
    box-shadow: 0 0 30px rgba(212, 197, 160, .12), inset 0 0 20px rgba(212, 197, 160, .04);
}
.deck.grab .disc { cursor: grabbing; border-color: rgba(var(--mk2-fg-rgb), .55); }
.label {
    position: absolute;
    inset: 33%;
    border-radius: 50%;
    background: #c8c0b0;
    color: var(--active-text);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: clamp(13px, 3vw, 17px);
}
.label::after {
    content: "";
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--active-text);
}


/* === PITCH COLUMN === */
.pitchcol {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-top: 6px;
}
.pitchcol .cap { font-size: 10px; letter-spacing: .18em; color: var(--text-secondary); }
.pitchcol .num { font-variant-numeric: tabular-nums; font-size: 10.5px; opacity: .8; }

/* === FOOT === */
.foot {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.speed { display: flex; }
.speed button { width: 40px; border-right-width: 0; }
.speed button:last-child { border-right-width: 1px; }
.speed button.on { background: var(--mk2-accent); color: var(--active-text); }

/* === BUTTONS === */
.deck button,
.mixer button,
.crate button,
.shelf button,
.rec button {
    font: inherit;
    color: var(--text-primary);
    background: transparent;
    border: 1px solid rgba(var(--mk2-fg-rgb), .55);
    border-radius: 0;
    height: 32px;
    min-width: 40px;
    padding: 0 8px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background .12s linear, color .12s linear;
    font-size: 11px;
    letter-spacing: .06em;
}
.deck button:hover:not([disabled]),
.mixer button:hover:not([disabled]),
.crate button:hover:not([disabled]),
.shelf button:hover:not([disabled]),
.rec button:hover:not([disabled]) {
    background: var(--active-bg);
    color: var(--active-text);
}
.deck button:focus-visible,
.mixer button:focus-visible,
.crate button:focus-visible,
.rec button:focus-visible {
    outline: 2px solid var(--text-primary);
    outline-offset: 2px;
}
.deck button[disabled],
.mixer button[disabled],
.shelf button[disabled] {
    opacity: .26;
    cursor: default;
}
.time {
    font-variant-numeric: tabular-nums;
    font-size: 11px;
    opacity: .5;
    margin-left: auto;
}

/* === MIXER === */
.mixer {
    align-self: stretch;
    border-left: 1px solid var(--border-primary);
    border-right: 1px solid var(--border-primary);
    padding: var(--mk2-pad);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.mx-head {
    font-size: 10px;
    letter-spacing: .2em;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}
.strips { display: grid; grid-template-columns: 1fr 1fr; gap: var(--mk2-pad); }
.strip { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 4px; }
.strip + .strip { border-left: 1px solid var(--border-primary); padding-left: calc(var(--mk2-pad) - 4px); }
.strip .ch { font-weight: 700; font-size: 15px; text-shadow: 0 0 8px rgba(212, 197, 160, .2); }

/* === KNOBS === */
.knobs { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.knob {
    width: 34px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: ns-resize;
    touch-action: none;
}
.knob svg { width: 28px; height: 28px; overflow: visible; display: block; }
.knob .ring { fill: none; stroke: rgba(var(--mk2-fg-rgb), .22); stroke-width: 1; }
.knob .arc { fill: none; stroke: var(--text-primary); stroke-width: 2; }
.knob .tick { stroke: var(--text-primary); stroke-width: 1.4; }
.knob .det { stroke: rgba(var(--mk2-fg-rgb), .35); stroke-width: 1; }
.knob .lab { font-size: 10px; letter-spacing: .1em; color: var(--text-secondary); text-align: center; white-space: nowrap; }
.knob:hover .lab, .knob:focus-visible .lab { color: var(--text-primary); }
.knob:focus-visible { outline: 1px solid var(--text-primary); outline-offset: 3px; }

/* === VOLUME + METER === */
.vol { display: flex; gap: 9px; align-items: stretch; height: 100px; }
.meter { width: 5px; display: flex; flex-direction: column-reverse; gap: 2px; justify-content: flex-start; }
.meter i { flex: 1; background: rgba(var(--mk2-fg-rgb), .13); }
.meter i.on { background: var(--mk2-accent); box-shadow: 0 0 3px var(--mk2-accent); }
.meter i.pk { background: var(--mk2-accent); opacity: .5; }

/* === FADERS === */
.fader { position: relative; width: 26px; cursor: ns-resize; touch-action: none; }
.fader .trk {
    position: absolute; left: 50%; top: 0; bottom: 0;
    width: 1px; transform: translateX(-.5px);
    background: rgba(var(--mk2-fg-rgb), .45);
}
.fader .det {
    position: absolute; left: 0; right: 0; top: 50%;
    height: 1px; background: rgba(var(--mk2-fg-rgb), .25);
}
.fader .cap {
    position: absolute; left: 0; right: 0; height: 11px;
    background: #c8c0b0; transform: translateY(50%);
}
.fader:focus-visible { outline: 1px solid var(--text-primary); outline-offset: 4px; }

/* Horizontal fader */
.fader.h { width: 100%; height: 26px; cursor: ew-resize; }
.fader.h .trk { left: 0; right: 0; top: 50%; bottom: auto; width: auto; height: 1px; transform: translateY(-.5px); }
.fader.h .det { top: 0; bottom: 0; left: 50%; right: auto; width: 1px; height: auto; }
.fader.h .cap { top: 0; bottom: 0; height: auto; width: 11px; left: auto; right: auto; transform: translateX(-50%); }

/* === CROSSFADER === */
.xf-block { display: flex; flex-direction: column; gap: 5px; border-top: 1px solid var(--border-primary); padding-top: 10px; }
.xf-lab { display: flex; justify-content: space-between; font-size: 10px; letter-spacing: .16em; color: var(--text-secondary); }
.xf-lab b { font-size: 13px; color: var(--text-primary); opacity: .35; transition: opacity .12s linear; }
.xf-lab b.on { opacity: 1; }

/* === MASTER + CUE === */
.mst {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    border-top: 1px solid var(--border-primary); padding-top: 8px;
}
.cuebar { display: flex; flex-direction: column; gap: 8px; }
.cuebar button { height: 26px; min-width: 0; padding: 0 10px; font-size: 10px; letter-spacing: .14em; align-self: flex-start; }
.cuebar button.on { background: var(--mk2-accent); color: var(--active-text); }
.cue-io { display: flex; gap: 8px; width: 100%; }
.cue-io label {
    display: flex; flex-direction: column; gap: 4px;
    font-size: 10px; letter-spacing: .12em; color: var(--text-secondary); flex: 1; min-width: 0;
}
.cue-io select {
    font: inherit; font-size: 10px; color: var(--text-primary); background: var(--bg-primary);
    border: 1px solid rgba(var(--mk2-fg-rgb), .35); border-radius: 0;
    padding: 4px 20px 4px 6px; height: 26px;
    width: 100%; text-overflow: ellipsis; overflow: hidden; white-space: nowrap;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 8 5' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L4 4L7 1' stroke='%23999' stroke-width='1'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 6px center;
    font-weight: 400; cursor: pointer;
}
.cue-io select:focus-visible { outline: 1px solid var(--text-primary); outline-offset: 2px; }
.cue-msg { font-size: 10px; letter-spacing: .08em; color: var(--text-secondary); line-height: 1.6; }
.strip .cue { height: 22px; min-width: 0; padding: 0 9px; font-size: 10px; letter-spacing: .14em; border-color: rgba(var(--mk2-fg-rgb), .3); }
.strip .cue.on { background: var(--mk2-accent); color: var(--active-text); border-color: var(--mk2-accent); }
.mst .cap { font-size: 10px; letter-spacing: .18em; color: var(--text-secondary); }

/* === SHELF === */
.shelf { display: flex; flex-direction: column; gap: 5px; border-top: 1px solid var(--border-primary); padding-top: 10px; }
.shelf .row { display: flex; align-items: center; gap: 9px; min-height: 18px; }
.shelf .k { font-size: 10px; letter-spacing: .16em; color: var(--text-secondary); width: 74px; flex: none; }
.shelf .v { font-size: 10.5px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .85; }
.shelf .v.vacio { opacity: .3; }
.shelf button { height: 20px; min-width: 0; padding: 0 8px; font-size: 10px; letter-spacing: .12em; border-color: rgba(var(--mk2-fg-rgb), .3); }

/* === CRATE === */
.crate { border-top: 1px solid var(--border-primary); padding: var(--mk2-pad); display: flex; flex-direction: column; gap: 12px; }
.crate-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.crate-head .cap { font-size: 10px; letter-spacing: .2em; color: var(--text-secondary); }
.crate-head button,
.crate-add-label { height: 24px; min-width: 0; padding: 0 10px; font-size: 10px; letter-spacing: .12em; }
.crate-add-label {
    display: inline-grid; place-items: center; cursor: pointer; position: relative;
    color: var(--text-primary); background: transparent;
    border: 1px solid rgba(var(--mk2-fg-rgb), .55); transition: background .12s linear, color .12s linear;
}
.crate-add-label:hover { background: var(--active-bg); color: var(--active-text); }
.crate-head input[type="url"] {
    font: inherit; font-size: 10px; color: var(--text-primary); background: transparent;
    border: 0; border-bottom: 1px solid rgba(var(--mk2-fg-rgb), .25); padding: 3px 0;
    flex: 1; min-width: 140px; max-width: 340px;
}
.crate-head input[type="url"]::placeholder { color: var(--text-secondary); letter-spacing: .08em; }
.crate-head input[type="url"]:focus { outline: 0; border-bottom-color: var(--text-primary); }
.crate.over { outline: 1px dashed var(--text-primary); outline-offset: -6px; }
.crate-items { display: flex; flex-wrap: wrap; gap: 8px; }
.crate-empty { font-size: 10px; letter-spacing: .1em; color: var(--text-secondary); }
.rec {
    border: 1px solid rgba(var(--mk2-fg-rgb), .22); padding: 8px 9px;
    display: flex; flex-direction: column; gap: 7px; width: 190px;
}
.rec .n { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .85; }
.rec .go { display: flex; gap: 6px; align-items: center; }
.rec button { height: 20px; min-width: 24px; padding: 0 7px; font-size: 10px; letter-spacing: .1em; border-color: rgba(var(--mk2-fg-rgb), .3); }
.rec button.x { margin-left: auto; border-color: transparent; color: var(--text-secondary); }
.rec button.x:hover { background: transparent; color: var(--text-primary); }
.rec.puesto { border-color: rgba(var(--mk2-fg-rgb), .7); }



/* === FOOTER OVERRIDE === */
.footer {
    margin-top: 0;
    padding: var(--mk2-pad);
}

/* === DECK TOGGLE (mobile) === */
.deck-toggle {
    display: none;
    grid-column: 1 / -1;
}
.deck-toggle button {
    font: inherit; font-size: 13px; font-weight: 700;
    flex: 1; height: 36px; cursor: pointer;
    background: transparent; color: var(--text-tertiary);
    border: 1px solid var(--border-primary); border-radius: 0;
    transition: background .12s linear, color .12s linear;
}
.deck-toggle button + button { border-left: 0; }
.deck-toggle button.on { background: var(--active-bg); color: var(--active-text); }

/* === RESPONSIVE === */
@media (max-width: 1000px) {
    .rig { grid-template-columns: 1fr; }
    .deck-toggle { display: flex; }
    .deck[data-id="B"] { display: none; }
    .rig.show-b .deck[data-id="A"] { display: none; }
    .rig.show-b .deck[data-id="B"] { display: flex; }
    .mixer {
        border-left: 0; border-right: 0;
        border-top: 1px solid var(--border-primary);
        border-bottom: 1px solid var(--border-primary);
        max-width: 520px; margin: 0 auto; width: 100%;
    }
    .platter { max-width: min(75vw, 340px); }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
