/* Play It Backwards — black / off-white / muted red. Mobile-first. */
:root {
  --bg: #000;
  --bg-2: #0a0a0a;
  --ink: #e9e4da;
  --ink-dim: #8e887c;
  --line: #1f1d1a;
  --red: #8a2b2b;
  --red-2: #a53434;
  --red-dim: #4a1c1c;
  --mono: "Courier Prime", "Courier New", Courier, "Nimbus Mono PS", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Arial, sans-serif;
  --wrap: 680px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.55;
  min-height: 100dvh; display: flex; flex-direction: column;
}
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Masthead */
.masthead { padding: 56px 0 28px; border-bottom: 1px solid var(--line); }
.kicker { font-family: var(--mono); font-size: 12px; letter-spacing: .28em; color: var(--red-2); margin: 0 0 18px; }
.headline {
  font-family: var(--mono); font-weight: 400; font-size: clamp(28px, 7vw, 46px);
  line-height: 1.1; letter-spacing: .02em; margin: 0 0 14px; text-transform: uppercase;
}
.headline em { font-style: normal; color: var(--red-2); }
.lede { color: var(--ink-dim); font-size: 17px; margin: 0; max-width: 42ch; }

/* Tool */
main { flex: 1; padding: 36px 0 48px; }
.tool { position: relative; }
.drop {
  display: flex; gap: 16px; align-items: center; cursor: pointer;
  border: 1px dashed #3a3732; border-radius: 4px; padding: 22px 18px;
  background: var(--bg-2); transition: border-color .15s, background .15s;
}
.drop:hover, .drop:focus-visible, .drop.over { border-color: var(--red-2); background: #0e0b0b; outline: none; }
.drop-mark { font-size: 28px; color: var(--red-2); font-family: var(--mono); line-height: 1; }
.drop-text { display: flex; flex-direction: column; gap: 4px; }
.drop-text strong { font-weight: 600; }
.drop-text span { color: var(--ink-dim); font-size: 13px; }
.drop.busy { pointer-events: none; opacity: .6; }

.status { font-family: var(--mono); font-size: 13px; color: var(--ink-dim); min-height: 1.4em; margin: 14px 0 0; }
.status.working::after { content: "▌"; animation: blink 1s steps(2) infinite; margin-left: 2px; }
@keyframes blink { to { visibility: hidden; } }
.error { margin: 14px 0 0; padding: 12px 14px; border-left: 3px solid var(--red-2); background: #140a0a; color: var(--ink); font-size: 14px; }
.error[hidden] { display: none; }

.player { margin-top: 26px; border: 1px solid var(--line); border-radius: 4px; padding: 18px; background: var(--bg-2); }
.player[hidden] { display: none; }
.meta { display: flex; justify-content: space-between; gap: 12px; font-family: var(--mono); font-size: 12px; color: var(--ink-dim); margin-bottom: 14px; }
.meta-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.transport { display: grid; grid-template-columns: auto auto 1fr; gap: 12px; align-items: center; }
.btn {
  appearance: none; border: 1px solid #3a3732; background: transparent; color: var(--ink);
  font: 600 13px/1 var(--sans); letter-spacing: .06em; padding: 12px 16px; border-radius: 3px;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s, border-color .15s, color .15s; min-height: 44px;
}
.btn:hover, .btn:focus-visible { border-color: var(--red-2); outline: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn-play { width: 52px; height: 52px; padding: 0; border-radius: 50%; border-color: var(--red); background: var(--red-dim); font-size: 16px; }
.btn-play .ico-pause { display: none; }
.btn-play.playing .ico-play { display: none; }
.btn-play.playing .ico-pause { display: inline; font-size: 13px; }
.btn-ghost { font-size: 15px; padding: 0 14px; min-width: 44px; }
.btn-accent { background: var(--red); border-color: var(--red); color: #fff; }
.btn-accent:hover, .btn-accent:focus-visible { background: var(--red-2); border-color: var(--red-2); }

.seek-wrap { min-width: 0; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 0; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 3px; background: #2a2724; border-radius: 2px; }
input[type=range]::-moz-range-track { height: 3px; background: #2a2724; border-radius: 2px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); margin-top: -7.5px; border: 2px solid var(--bg); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--ink); border: 2px solid var(--bg); }
input[type=range]:focus-visible { outline: 1px solid var(--red-2); outline-offset: 4px; }
.times { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; color: var(--ink-dim); }

.speed { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.speed label { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; letter-spacing: .18em; color: var(--ink-dim); }
.speed output { color: var(--ink); letter-spacing: 0; }
.speed-presets { display: flex; gap: 6px; margin-top: 4px; }
.speed-presets button {
  flex: 1; background: transparent; border: 1px solid var(--line); color: var(--ink-dim);
  font: 12px/1 var(--mono); padding: 9px 0; border-radius: 3px; cursor: pointer; min-height: 36px;
}
.speed-presets button.on, .speed-presets button:hover { color: var(--ink); border-color: var(--red-2); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.actions .btn-accent { flex: 1 1 220px; }
.note { font-size: 12px; color: var(--ink-dim); margin: 16px 0 0; font-family: var(--mono); }

/* AdSense container: visible only when configured */
.adspace { margin-top: 44px; }
.adspace[hidden] { display: none; }
.adspace-label { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .22em; color: var(--ink-dim); text-transform: uppercase; margin-bottom: 8px; }
.adspace-unit { min-height: 100px; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }

/* Site Upgrader editorial promo */
.promo { margin-top: 44px; padding: 26px 22px; border: 1px solid #2a2320; border-radius: 4px; background: linear-gradient(180deg, #0c0909, #000); }
.promo[hidden] { display: none; }
.promo-label { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .22em; color: var(--red-2); text-transform: uppercase; margin-bottom: 12px; }
.promo-head { font-family: var(--mono); font-weight: 400; font-size: clamp(20px, 5vw, 28px); margin: 0 0 8px; letter-spacing: .02em; }
.promo-copy { margin: 0 0 18px; color: var(--ink-dim); }
.promo-copy strong { color: var(--ink); }
.promo-cta { width: 100%; }
@media (min-width: 520px) { .promo-cta { width: auto; } }

/* Footer + DEED LEVEL */
.foot { border-top: 1px solid var(--line); padding: 18px 0 26px; color: var(--ink-dim); font-size: 12px; }
.foot-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.deed { margin-left: auto; display: inline-flex; flex-direction: column; align-items: flex-end; gap: 3px; opacity: .72; }
.deed-label { font-family: var(--mono); font-size: 9px; letter-spacing: .26em; color: var(--ink-dim); }
.deed-counter { display: inline-flex; gap: 1px; }
.deed-counter .dg {
  display: inline-block; width: 11px; height: 16px; line-height: 16px; text-align: center;
  font: 11px/16px var(--mono); color: var(--ink); background: linear-gradient(180deg, #1a1816, #060606);
  border: 1px solid #2a2724; border-radius: 1px; box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.deed-counter .sep { display: inline-block; width: 4px; text-align: center; font: 11px/16px var(--mono); color: var(--ink-dim); }

@media (prefers-reduced-motion: reduce) { .status.working::after { animation: none; } }
