/* Lines, posting, chemistry, the day-kept banner, the Packs/Lines tabs and the
   unlock chooser. Ported from docs/mockups/lineup-chemistry.html (approved).
   The chemistry timing (560 ms connector draw, 140 ms card stagger) is its own
   timeline from spec §9, not a UI transition. Tokens live in tokens.css. */

/* ------------------------------------------------------------------ tabs */
.tabs { flex: none; display: flex; gap: 6px; margin: 0 0 10px; }
.tab {
  min-height: var(--tap); padding: 0 14px; border: 0; border-radius: 9px; background: none; color: var(--frost);
  font: 800 17px var(--font-display); letter-spacing: .02em; cursor: pointer; transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.tab.on { background: var(--ice); color: var(--rink); }
.tab:active { transform: scale(var(--press)); }
.pane { flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* ----------------------------------------------------------------- lines */
.lines-screen { display: flex; flex-direction: column; gap: 14px; padding-bottom: 8px; }
.lines-screen .lines { position: relative; }
.lines-screen .aura-cv { position: absolute; inset: -10px -16px; width: calc(100% + 32px); height: calc(100% + 20px); pointer-events: none; filter: blur(1.2px); z-index: 2; }
.lines-screen .line { position: relative; margin-top: 12px; }
.lines-screen .line:first-child { margin-top: 0; }
.lines-screen .lh { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; min-height: 22px; }
.lines-screen .lh > b { font: 800 17px var(--font-display); letter-spacing: .02em; }
.lines-screen .lh > b small { margin-left: 6px; white-space: nowrap; font: 600 12px var(--font-body); color: var(--frost); letter-spacing: 0; }
.boosts { display: flex; flex: none; gap: 5px; }
.boost { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 5px; font-size: 11.5px; font-weight: 700; opacity: 0; transform: scale(.9); }
.boost svg { width: 9px; height: 9px; }
.boost.xpb { color: var(--chem); background: rgba(92,255,122,.12); box-shadow: inset 0 0 0 1px rgba(92,255,122,.35); }
.boost.cb { color: var(--coin); background: rgba(169,139,255,.14); box-shadow: inset 0 0 0 1px rgba(169,139,255,.35); }
.line.linked .boost { opacity: 1; transform: none; transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out); }
.line.linked .boost.cb { transition-delay: 80ms; }

.lines-screen .slots { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; z-index: 1; }
/* Spans slot centres --a to --b of the 4-column grid (8 px gaps). */
.conn {
  position: absolute; top: 59px; height: 3px; margin-top: -1.5px; border-radius: 2px; z-index: 0;
  left: calc((100% - 24px) * (var(--a, 0) + .5) / 4 + var(--a, 0) * 8px);
  width: calc((100% - 24px) * (var(--b, 1) - var(--a, 0)) / 4 + (var(--b, 1) - var(--a, 0)) * 8px);
  background: linear-gradient(90deg, rgba(92,255,122,.35), var(--chem), rgba(92,255,122,.35));
  box-shadow: 0 0 10px 2px rgba(92,255,122,.55), 0 0 26px 6px rgba(92,255,122,.25);
  clip-path: inset(0 100% 0 0);
}
.line.linked .conn { clip-path: inset(0 0 0 0); transition: clip-path 560ms var(--ease-in-out); }
.line.instant .conn, .line.instant .boost, .line.instant .slot .card { transition: none !important; }

.lines-screen .slot {
  position: relative; display: block; width: 100%; height: 104px; padding: 0; border: 0; background: none;
  color: var(--ice); text-align: left; font: inherit; z-index: 1;
}
.lines-screen button.slot { cursor: pointer; transition: transform 160ms var(--ease-out); }
.lines-screen button.slot:active { transform: scale(var(--press)); }
.lines-screen button.slot:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 10px; }
.slot .pl { position: absolute; left: 0; right: 0; top: -1px; text-align: center; font-size: 10.5px; font-weight: 700; color: var(--frost); }
.slot .body { position: absolute; left: 0; right: 0; top: 15px; bottom: 0; border-radius: 9px; }
.slot .card { display: flex; flex-direction: column; padding: 6px 7px; border: 2px solid #4a5875; background: var(--boards-2); transition: box-shadow 280ms var(--ease-out), border-color 280ms var(--ease-out); }
.slot .card .o { font: 900 22px/.9 var(--font-display); }
.slot .card .n { margin-top: auto; font: 800 13px/1 var(--font-display); overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.slot .card.r-std .o { color: #b8c4d9; }
.slot .card.r-rare { border-color: var(--blueline); background: linear-gradient(180deg, rgba(61,139,255,.18), rgba(18,28,51,0) 55%), var(--boards-2); }
.slot .card.r-rare .o { color: #8fbaff; }
.slot .card.r-gold { border-color: var(--gold); background: linear-gradient(180deg, rgba(247,192,74,.24), rgba(18,28,51,0) 55%), var(--boards-2); }
.slot .card.r-gold .o { color: var(--gold); }
.slot.lk .card { box-shadow: 0 0 0 1.5px var(--chem), 0 0 14px 2px rgba(92,255,122,.45); }
.slot.sel .card { box-shadow: 0 0 0 2px var(--ice); }
.slot.lk.sel .card { box-shadow: 0 0 0 2px var(--ice), 0 0 14px 2px rgba(92,255,122,.45); }
.slot .tick { position: absolute; right: 5px; top: 5px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--ice); color: var(--rink); }
.slot .tick svg { width: 11px; height: 11px; }
.slot .open { display: grid; place-items: center; border: 2px solid #d7dce6; background: linear-gradient(160deg, #5d6080, #34374f 70%); }
.slot .open span { font: 900 18px var(--font-display); color: rgba(255,255,255,.85); }
.slot .open small { position: absolute; bottom: 6px; left: 0; right: 0; text-align: center; font-size: 10px; font-weight: 700; color: #dfe5f1; }
.slot .locked { display: grid; place-items: center; padding: 4px; border: 1.5px dashed #34405e; text-align: center; color: var(--dim); background: repeating-linear-gradient(135deg, #0f182c 0 6px, #0c1426 6px 12px); }
.slot .locked svg { display: block; width: 14px; height: 14px; margin: 0 auto 4px; }
.slot .locked span { display: block; font-size: 10px; font-weight: 700; line-height: 1.25; }
.slot .locked.new { border-color: var(--seam); color: var(--frost); }
.rest-note { margin: 0; padding: 12px; border: 1px dashed var(--seam); border-radius: 9px; color: var(--frost); font-size: 13px; }

/* The selected slot's post: text, Copy and open, Posted, and for YouTube the Short. */
.post-panel { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; padding: 12px 13px; border: 1px solid var(--seam); border-radius: 14px; background: var(--boards); }
.pp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pp-head b { font: 800 15px var(--font-display); letter-spacing: .02em; }
.pp-time { color: var(--frost); font-size: 12px; text-align: right; }
.pp-text { max-height: 140px; margin: 0; overflow-y: auto; overscroll-behavior: contain; font-size: 14.5px; line-height: 1.5; white-space: pre-line; user-select: text; -webkit-user-select: text; -webkit-touch-callout: default; }
.pp-note { margin: 0; color: #ffb3bb; font-size: 12.5px; }
.pp-hint { margin: 0; color: var(--frost); font-size: 12px; }
.pp-actions { display: flex; gap: 8px; }
.pp-actions button {
  display: inline-flex; flex: 1; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 12px;
  border-radius: 12px; font: 700 15px var(--font-body); cursor: pointer; transition: transform 160ms var(--ease-out), opacity 160ms var(--ease-out);
}
.pp-actions button:active { transform: scale(var(--press)); }
.pp-actions button svg { width: 16px; height: 16px; }
.btn-copy { border: 1px solid var(--seam); background: var(--boards-2); color: var(--ice); }
.btn-posted, .btn-filmed { border: 0; background: var(--gold); color: #1a1205; }
.pp-actions button:disabled { cursor: default; transform: none; opacity: .45; }
.pp-actions button.done { opacity: 1; background: rgba(92,255,122,.14); color: var(--chem); box-shadow: inset 0 0 0 1px rgba(92,255,122,.4); }
.pp-short { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid var(--seam); }
.pp-actions button:focus-visible, .tab:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.lines-panel { padding: 12px 13px; border: 1px solid var(--seam); border-radius: 14px; background: rgba(12,20,38,.9); }
.lines-panel .prow { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; }
.lines-panel .prow b { font: 800 20px var(--font-display); font-variant-numeric: tabular-nums; }

.kept-banner {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px;
  background: linear-gradient(90deg, rgba(255,51,71,.22), rgba(255,51,71,.06)); box-shadow: inset 0 0 0 1px rgba(255,51,71,.5), 0 0 18px rgba(255,51,71,.25);
}
.kept-banner b { font: 900 24px/1 var(--font-display); color: #ff6b79; letter-spacing: .02em; }
.kept-banner span { color: var(--ice); font-size: 13px; }
.kept-banner.pop { animation: kept-pop 280ms var(--ease-out); }
@keyframes kept-pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------- unlock chooser */
.unlock-back {
  position: fixed; inset: 0; z-index: 25; display: grid; place-items: end center; padding: 16px;
  padding-bottom: calc(var(--safe-bottom) + 16px); background: rgba(3,8,20,.72);
  opacity: 0; transition: opacity 220ms var(--ease-out);
}
.unlock-back.on { opacity: 1; }
.unlock {
  display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 398px; max-height: 100%; overflow-y: auto;
  padding: 18px 16px 10px; border: 1px solid var(--seam); border-radius: 18px; background: var(--boards);
  transform: translateY(16px); transition: transform 260ms var(--ease-out);
}
.unlock-back.on .unlock { transform: none; }
.unlock-title { margin: 0; font: 900 30px/1 var(--font-display); color: #ff6b79; }
.unlock-title:focus { outline: none; }
.unlock-sub { margin: 0 0 4px; color: var(--frost); font-size: 14px; }
.unlock-list { display: grid; gap: 8px; }
.unlock-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 0 14px;
  border: 1px solid var(--seam); border-radius: 12px; background: var(--boards-2); color: var(--ice); text-align: left; cursor: pointer;
  transition: transform 160ms var(--ease-out), border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.unlock-opt b { font: 800 20px var(--font-display); }
.unlock-opt span { color: var(--frost); font-size: 13px; }
.unlock-opt:active { transform: scale(var(--press)); }
.unlock-opt[aria-checked="true"] { border-color: var(--chem); box-shadow: 0 0 0 1px var(--chem), 0 0 14px rgba(92,255,122,.35); }
.unlock-go {
  height: 54px; margin-top: 4px; border: 0; border-radius: 14px; background: var(--gold); color: #1a1205;
  font: 700 16px var(--font-body); cursor: pointer; transition: transform 160ms var(--ease-out), opacity 160ms var(--ease-out);
}
.unlock-go:active { transform: scale(var(--press)); }
.unlock-go:disabled { opacity: .4; cursor: default; transform: none; }
.unlock-opt:focus-visible, .unlock-go:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* Reduced motion: the connector fades in instead of drawing (as in the mockup). */
@media (prefers-reduced-motion: reduce) {
  .conn { clip-path: none !important; opacity: 0; }
  .line.linked .conn { opacity: 1; }
}
