/* MIX-ED DJ Studio: phone layout (assets/js/dj-phone.js adds body.ph-on and
   builds #ph from the Studio's own controls). Everything here is scoped to
   body.ph-on, so the computer layout is untouched. */

body.ph-on.flx4-skin main { max-width: none; padding-left: 10px; padding-right: 10px; }
body.ph-on .section-title { margin-top: 14px !important; font-size: 1.35rem; }
body.ph-on .section-sub, body.ph-on .booth-rule, body.ph-on .flx4-audio-bar:not(:has(.stuck)) { display: none; }
body.ph-on .flx4-skin .flx4-booth, body.ph-on.flx4-skin .flx4-booth { margin: 0; }
body.ph-on.flx4-skin .flx4-screens-panel { margin: 0 0 10px; padding: 8px 10px; border-radius: 12px; }
body.ph-on.flx4-skin .flx4-topbar { margin: 0; }
body.ph-on.flx4-skin .flx4-displays { display: none; }   /* the two screens now live in their decks */
body.ph-on.flx4-skin .bfx-bar { margin-top: 8px; }
body.ph-on.flx4-skin .flx4-photo-shell { display: none; }   /* the photo controller and anything not moved */
body.ph-on.flx4-skin .booth-foot { margin: 10px 0 0; }

/* ── the three sections ── */
.ph { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.ph-deck > *, .ph-mixer > * { min-width: 0; }
.ph-deck, .ph-mixer {
  position: relative; background: #101014; border: 1px solid #26262e; border-radius: 16px; padding: 10px;
  display: grid; gap: 10px; align-content: start; min-width: 0;
}
.ph-deck-tag { display: flex; justify-content: space-between; align-items: center; margin: -2px 2px -4px; }
.ph-deck-tag .ph-lbl { color: #ff914d; font-size: 11px; letter-spacing: .14em; }
.ph-lbl { font: 700 10px/1.2 system-ui, -apple-system, sans-serif; letter-spacing: .08em; color: #9a9aa8; text-align: center; text-transform: uppercase; }
.ph-turn { display: none; text-align: center; padding: 8px 12px; border-radius: 10px; background: rgba(255,145,77,.1); border: 1px dashed rgba(255,145,77,.45); }
.ph-turn .ph-lbl { color: #ffb98a; font-size: 11px; letter-spacing: .04em; text-transform: none; font-weight: 600; }
@media (orientation: portrait) { .ph-turn { display: block; } }

/* every moved control: out of the photo's % positions, into the layout */
.ph .fx-hot, .ph .fx-knob, .ph .fx-fader, .ph .fx-jog, .ph .fx-bpm, .ph .fx-pitch-out, .ph .fx-vu {
  position: relative !important; left: auto !important; top: auto !important;
  width: auto !important; height: auto !important; box-sizing: border-box;
}
.ph .fx-hot { -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.ph .fx-knob, .ph .fx-fader, .ph .fx-jog { touch-action: none; -webkit-user-select: none; user-select: none; }
.ph .flx4-display { padding: 8px 10px; min-height: 0; }
.ph .flx4-display .wave-zoom { display: none; }

/* buttons that show their name */
.ph .fx-hot[data-ph]::before {
  content: attr(data-ph); white-space: nowrap;
  font: 800 11px/1 system-ui, -apple-system, sans-serif; letter-spacing: .06em; color: #e8e8ee;
}
.ph .fx-hot[data-ph] {
  display: flex !important; align-items: center; justify-content: center;
  min-height: 38px; padding: 0 8px; border-radius: 10px !important;
  background: linear-gradient(180deg, #2a2a33, #1a1a20); border: 1px solid #3a3a46 !important;
  box-shadow: 0 2px 0 #0b0b0e;
}
.ph .fx-hot[data-ph]:active { transform: translateY(1px); box-shadow: none; }
.ph .fx-hot.active[data-ph], .ph .fx-hot.on[data-ph], .ph .fx-hot[aria-pressed="true"][data-ph] { border-color: #ff914d !important; box-shadow: 0 0 12px rgba(255,145,77,.45); }
.ph .fx-hot.active[data-ph]::before, .ph .fx-hot.on[data-ph]::before, .ph .fx-hot[aria-pressed="true"][data-ph]::before { color: #ffb98a; }

/* ── deck ── */
.ph-deck-main { display: grid; grid-template-columns: minmax(0, 1fr) 74px; gap: 10px; align-items: stretch; }
.ph-jogwrap { position: relative; aspect-ratio: 1 / 1; width: 100%; height: auto; max-width: 330px; justify-self: center; align-self: center; }
.ph .fx-jog {
  position: absolute !important; inset: 0 !important; width: 100% !important; height: 100% !important; border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #ff914d 0 3.2%, transparent 3.4%),
    radial-gradient(circle at 50% 50%, #1b1b22 0 30%, transparent 30.5%),
    repeating-radial-gradient(circle at 50% 50%, #232329 0 2px, #1d1d23 2px 4px),
    #1d1d23;
  box-shadow: 0 0 0 1px #3a3a46, inset 0 0 0 calc(var(--ring, 23%) * 0) transparent, 0 10px 26px rgba(0,0,0,.55);
  overflow: hidden;
}
/* the outer ring (last 23% of the radius: nudge the tempo) drawn as a band */
.ph .fx-jog::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, transparent 0 75.5%, #34343e 76%, #2a2a33 88%, #3e3e4a 99%, transparent 100%);
}
.ph .fx-jog::after {
  content: ""; position: absolute; inset: 11.5%; border-radius: 50%; pointer-events: none;
  border: 1px solid rgba(255,255,255,.07);
}
.ph .fx-jog .jog-rotor::before { width: 12px; height: 12px; left: calc(50% - 6px); top: 3.2%; opacity: .9; }
.ph .fx-jog.zone-ring::before { background: radial-gradient(circle at 50% 50%, transparent 0 75.5%, #4a3426 76%, #6a3f22 88%, #ff914d 99%, transparent 100%); }
.ph .fx-jog.zone-platter { box-shadow: 0 0 0 2px #ff914d, 0 10px 26px rgba(0,0,0,.55); }
.ph .fx-bpm {
  position: absolute !important; left: 50% !important; top: 62% !important; transform: translateX(-50%);
  font-size: 15px !important; pointer-events: none; z-index: 2;
}
.ph-side { display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 8px; }
.ph .ph-load::before { color: #7dd3fc !important; }
.ph .ph-load.empty { animation: load-pulse 1.6s ease-in-out infinite; }
.ph-pitch { display: grid; grid-template-rows: auto minmax(110px, 1fr) auto; gap: 4px; justify-items: center; }
.ph .fx-pitch-out { font-size: 12px !important; }
.ph .fx-fader {
  background: linear-gradient(90deg, transparent calc(50% - 2px), #0b0b0e calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px)),
              repeating-linear-gradient(180deg, transparent 0 9px, rgba(255,255,255,.12) 9px 10px);
  border-radius: 6px; background-color: #15151a; border: 1px solid #2c2c36;
}
.ph .fx-fader.horz {
  background: linear-gradient(180deg, transparent calc(50% - 2px), #0b0b0e calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px)),
              repeating-linear-gradient(90deg, transparent 0 11px, rgba(255,255,255,.12) 11px 12px);
  background-color: #15151a;
}
.ph-pitch .fx-fader { width: 46px !important; height: 100% !important; min-height: 110px; }
.ph .fx-fader.vert .fader-cap { width: 120%; height: 24px; border-radius: 5px; }
.ph .fx-fader.horz .fader-cap { width: 30px; height: 120%; border-radius: 5px; }

.ph-transport { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; }
.ph-big { display: flex; gap: 10px; }
.ph .ph-cue, .ph .ph-play { width: 60px !important; height: 60px !important; border-radius: 50% !important; }
.ph .ph-play::before { color: #4ade80 !important; font-size: 13px !important; letter-spacing: 0 !important; white-space: nowrap; }
.ph .ph-cue::before { color: #ffb98a !important; font-size: 13px !important; }
.ph .ph-play.active { border-color: #4ade80 !important; box-shadow: 0 0 18px rgba(74,222,128,.5) !important; outline: none !important; }
.ph .ph-cue.active { border-color: #ff914d !important; box-shadow: 0 0 18px rgba(255,145,77,.5) !important; outline: none !important; }
.ph-loops { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.ph-loops .fx-hot[data-ph] { min-height: 40px; min-width: 0; padding: 0 1px; border-radius: 50% / 46% !important; }
.ph-loops .fx-hot[data-ph]::before { font-size: 9px; letter-spacing: 0; }
.ph .ph-side .fx-hot[data-ph] { min-width: 0; padding: 0 4px; }

.ph-padbox { display: grid; gap: 6px; }
.ph-modes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.ph-modes .fx-hot[data-ph] { min-height: 28px; padding: 0 2px; border-radius: 7px !important; }
.ph-modes .fx-hot[data-ph]::before { font-size: 9px; letter-spacing: .03em; }
.ph-pads { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.ph .fx-pad {
  min-height: 52px; border-radius: 10px !important; background: #1b1b22 !important; border: 1px solid #34343e !important;
  font-size: 12px !important; color: rgba(255,255,255,.5); padding: 4px 7px !important;
}
.ph .fx-pad.set { background: rgba(var(--hc-rgb, 255,145,77), .55) !important; border-color: rgba(var(--hc-rgb, 255,145,77), .9) !important; color: #fff; }
.ph .fx-pad:active { background: rgba(255,145,77,.35) !important; }

/* ── mixer ── */
.ph-eq { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: start; }
.ph-strip { display: grid; gap: 6px; justify-items: center; }
.ph-cell { display: grid; gap: 3px; justify-items: center; }
.ph .fx-knob { width: 48px !important; height: 48px !important; border-radius: 50%; }
.ph .fx-knob::before { width: 100% !important; height: 100% !important; background: radial-gradient(circle at 40% 35%, #3a3a44, #1c1c22 70%) !important; box-shadow: 0 0 0 1px #45454f, 0 3px 8px rgba(0,0,0,.5); }
.ph .fx-knob::after { top: 6% !important; height: 38% !important; width: 3px !important; left: calc(50% - 1.5px) !important; background: #ff914d !important; }
.ph .ph-cell.sm .fx-knob { width: 38px !important; height: 38px !important; }
.ph-centre { display: grid; gap: 10px; justify-items: center; padding-top: 2px; }
.ph-vus { display: flex; gap: 6px; height: 150px; }
.ph .fx-vu { width: 12px !important; height: 100% !important; }
.ph-smart { display: grid; gap: 6px; }
.ph-smart .fx-hot[data-ph] { min-height: 32px; padding: 0 6px; }
.ph-smart .fx-hot[data-ph]::before { font-size: 8.5px; }
.ph-chfaders { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; justify-items: center; }
.ph-chf { display: grid; gap: 4px; justify-items: center; }
.ph-chf .fx-fader { width: 52px !important; height: 150px !important; }
.ph-xf { display: grid; gap: 4px; }
.ph-xf .fx-fader { height: 58px !important; width: 100% !important; }
.ph-fx { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; border-top: 1px solid #26262e; padding-top: 10px; }
.ph-fx > .ph-lbl { width: 100%; color: #7dd3fc; }
.ph-fx .fx-hot[data-ph] { min-height: 36px; min-width: 44px; }
.ph .ph-fxon.on, .ph .ph-fxon.active { border-color: #22c55e !important; }

/* ── sideways: Deck 1 | mixer | Deck 2, like the real controller ── */
@media (orientation: landscape) {
  body.ph-on .site-header { position: static; }
  body.ph-on .section-title { display: none; }
  .ph { grid-template-columns: minmax(0, 1fr) minmax(190px, .82fr) minmax(0, 1fr); gap: 8px; }
  .ph-deck, .ph-mixer { padding: 8px; gap: 8px; }
  .ph-deck-main { grid-template-columns: minmax(0, 1fr) 64px; }
  .ph-jogwrap { max-width: min(100%, 52vh); }
  .ph-pitch .fx-fader { width: 38px !important; }
  .ph .ph-cue, .ph .ph-play { width: 54px !important; height: 54px !important; }
  .ph-transport { grid-template-columns: minmax(0, 1fr); }
  .ph-big { justify-content: center; }
  .ph .fx-knob { width: 40px !important; height: 40px !important; }
  .ph .ph-cell.sm .fx-knob { width: 32px !important; height: 32px !important; }
  .ph-vus, .ph-chf .fx-fader { height: 120px !important; }
  .ph .fx-pad { min-height: 42px; }
  .ph .flx4-display .deck-foot .loop-sizes { display: none; }
}
@keyframes load-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(56,189,248,0); } 50% { box-shadow: 0 0 0 3px rgba(56,189,248,.45); } }

/* ── a real DDJ-FLX4 plugged into the phone / tablet ── */
/* USE FLX4 stays on the screens bar on a phone (the computer skin hides it on narrow screens) */
body.ph-on.flx4-skin .midi-btn:not([hidden]) { display: inline-flex !important; }
.ph-ctrl-toggle { display: none; }
body.ph-ctrl-avail .ph-ctrl-toggle {
  display: block; justify-self: center; font: 700 12px/1 system-ui, sans-serif; letter-spacing: .04em;
  color: #e8e8ee; background: #1a1a20; border: 1px solid #3a3a46; border-radius: 999px; padding: 9px 16px; cursor: pointer;
}
/* controller in charge: just the two deck screens, big */
body.ph-on.ph-ctrl .ph-turn,
body.ph-on.ph-ctrl .ph-deck-main,
body.ph-on.ph-ctrl .ph-transport,
body.ph-on.ph-ctrl .ph-padbox,
body.ph-on.ph-ctrl .ph-mixer { display: none; }
body.ph-on.ph-ctrl .ph .flx4-display { padding: 12px 14px; }
body.ph-on.ph-ctrl .ph .flx4-display .wave-zoom { display: block; }
body.ph-on.ph-ctrl .ph .flx4-display .deck-title { font-size: 1.15rem; }
@media (orientation: landscape) {
  body.ph-on.ph-ctrl .ph { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  body.ph-on.ph-ctrl .ph-ctrl-toggle { grid-column: 1 / -1; }
}
@media (orientation: portrait) { body.ph-on.flx4-skin .flx4-brand { display: none; } body.ph-on.flx4-skin .flx4-topbar { grid-template-columns: 1fr auto; } }
