/* Shared look: colours from docs/design.md, the top bar, buttons, first run and the crate. */
/* The colours are in theme.css (two palettes, dark and light). */
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-size: 15px; overflow: hidden; }
[hidden] { display: none !important; }
code { font-family: var(--mono); font-size: .85em; color: var(--text); }
.grow { flex-grow: 1; }
.muted { color: var(--muted); }
.hint { font-size: 13px; line-height: 1.4; }
.error-line { font-size: 13px; color: var(--rec); min-height: 1em; }

/* top bar */
.topbar { flex-shrink: 0; display: flex; align-items: center; }
.wordmark { display: flex; align-items: center; }

/* buttons */
.btn { height: 38px; padding: 0 16px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--raised); color: var(--text); font-family: inherit; font-size: 14px; cursor: pointer; }
.btn:hover:not(:disabled) { border-color: var(--line-3); }
.btn:disabled { opacity: .4; cursor: default; }
.btn-accent { border: none; font-weight: 600; padding: 0 22px; }
.btn-accent-outline { border: 1px solid var(--accent); background: transparent; font-weight: 600; font-size: 15px; }
.btn-close { width: 36px; height: 36px; font-size: 18px; cursor: pointer; }
.link-btn { border: none; background: none; font-family: inherit; font-size: 13px; cursor: pointer; padding: 2px; }
.footer-row { display: flex; align-items: center; gap: 10px; }

/* screens and cards (the 960x640 panels) */
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; }
.card-screen { align-items: center; justify-content: center; padding: 20px; }
.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 10; }
#review.overlay { z-index: 20; }
.card { width: 960px; max-width: 100%; height: 640px; max-height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.card-body { flex-grow: 1; min-height: 0; }
.two-col, .add-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); }
.col-left { border-right: 1px solid var(--line); padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.col-right { padding: 22px 26px; display: flex; flex-direction: column; gap: 14px; min-height: 0; }

/* fields */
.welcome-title { font-size: 19px; font-weight: 600; margin: 0; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field .hint { margin: 0; }
.name-input { height: 46px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--field); color: var(--text); font-family: var(--sans); font-weight: 600; font-size: 20px; }
.name-input::placeholder { color: var(--faint); }
.name-input:focus, .tag-grid input:focus { outline: none; border-color: var(--accent); }
.swatches { display: flex; gap: 10px; }
.swatch { width: 54px; height: 30px; border-radius: 4px; border: 2px solid transparent; cursor: pointer; box-shadow: inset 0 -8px 0 #0002; }
.swatch[aria-checked="true"] { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.freq-row { display: flex; align-items: center; gap: 18px; }
.tuner { -webkit-appearance: none; appearance: none; flex-grow: 1; height: 28px; background: transparent; margin: 0; cursor: pointer; }
.tuner::-webkit-slider-runnable-track { height: 4px; background: #050505; border-radius: 2px; box-shadow: 0 1px 0 #ffffff1a; }
.tuner::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 28px; margin-top: -12px; border-radius: 3px; background: linear-gradient(90deg, #9a9b97, #f2f2ee 45%, #a7a8a4); border: 1px solid #5d5e5a; box-shadow: 0 2px 4px #0006; }

/* main screen: the crate */
.songs { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0; }
.song { display: grid; grid-template-columns: 26px 84px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 4px 10px; border-radius: 6px; font-size: 14px; }
.song .num { font-size: 12px; }
.song .line1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song .line1 .by { color: var(--muted); }
.song .line2 { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song .tag { justify-self: end; font-family: var(--mono); font-size: 12px; letter-spacing: 1px; }
.song .tag.look { color: var(--accent); }
.song .tag.time { color: var(--faint); }
.empty { flex-grow: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; }
.empty p { margin: 0; }

/* Songs that just arrived glow for a moment */
.song.new { animation: arrived 4s ease-out; }
@keyframes arrived { from { background: var(--accent-bg); } to { background: transparent; } }

/* Playing a crate song */
#crate-list .song { cursor: pointer; }
#crate-list .song:hover { background: var(--field); }
#crate-list .song.current { background: var(--raised); }
#crate-list .song.current .line1 { color: var(--accent); } /* selection: accent (the display yellow is for lit segments) */

/* Dropping songs straight onto the main screen */
#main.files-over .main-grid { outline: 2px dashed var(--accent); outline-offset: -8px; border-radius: 12px; }


/* Where a tape is named (the Mix name, the J-card's title and note), the typing looks like the
   label: Permanent Marker (design.md). The empty-field hint stays plain. */
.label-input { letter-spacing: .3px; }
.label-input::placeholder { font-family: var(--sans); font-weight: 400; }

/* A greyed-out button (setOff in api.js): looks off, but a tap shows why. */
.is-off, .is-off:hover { opacity: .42; cursor: help; box-shadow: none; }
.btn.is-off:hover { border-color: var(--line-2); }
.why-tip { position: fixed; z-index: 50; box-sizing: border-box; padding: 9px 12px; border-radius: 6px; border: 1px solid var(--accent);
  background: #1f1a14; color: var(--text); font-size: 13px; line-height: 1.4; box-shadow: 0 8px 24px #000a; pointer-events: none; }

/* the menu under the member's name (Phase 7): their email, signing out */
.me { position: relative; }
.me-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 300px; display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line-2); }
.me-row { display: flex; gap: 6px; }
.me-row .name-input { flex-grow: 1; min-width: 0; }
.me-signout { align-self: flex-start; margin-top: 4px; }
.chip-in { display: block; padding-top: 10px; border-top: 1px solid var(--line-2); font-size: 12px; line-height: 1.4; text-decoration: none; }
.chip-in:hover { color: var(--text); text-decoration: underline; }
.me-about { font-size: 13px; text-decoration: none; padding-top: 6px; }
.me-about:hover { text-decoration: underline; }
.terms-note { font-size: 13px; }
