/* v0.23 card discovery (core/DISCOVERY). Every rule is scoped to html.lk-discovery,
   which card-discovery.js sets only when the flag is on: with the flag off this file changes nothing. */

/* Native-feel text: game text can't be selected, dragged or long-press-called-out. */
html.lk-discovery body { -webkit-user-select: none; user-select: none; }
/* No long-press callout on game surfaces only; links (rival, clan, help) keep theirs. */
html.lk-discovery :is(canvas, img, svg, button, .btn, .card, .card-tile, .tab) { -webkit-touch-callout: none; }
html.lk-discovery :is(canvas, img, svg) { -webkit-user-drag: none; }

/* Still selectable: fields the player types in, and codes they may need to copy by hand. */
html.lk-discovery input, html.lk-discovery textarea, html.lk-discovery [contenteditable]:not([contenteditable="false"]),
html.lk-discovery [data-selectable], html.lk-discovery [data-selectable] *,
/* Prose worth copying or reading with Speak Selection: card rule details, errors and save/restore status. */
html.lk-discovery :is(.cs-details, #home-error, .keep-status), html.lk-discovery :is(.cs-details, #home-error, .keep-status) * {
  -webkit-user-select: text; user-select: text;
  -webkit-touch-callout: default;
}
/* Private/restore codes and the invite link keep select-all (one tap selects the whole code). */
html.lk-discovery .code-field, html.lk-discovery #invite-link { -webkit-user-select: all; user-select: all; }

/* NEW: an unlocked card not used yet. Text + shape, never colour alone. */
.ct-new, .tab-new { display: none; }
html.lk-discovery .card-grid li[data-fresh] .ct-new {
  display: inline-grid; place-items: center; position: absolute; top: 7px; right: 7px;
  min-height: 17px; padding: 0 5px; border-radius: 6px;
  font-size: 9px; font-weight: 800; letter-spacing: .12em; line-height: 1;
  color: var(--tk-gilt-ink, #1a1206); background: var(--gold-hot, #f4c35a);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35);
}
html.lk-discovery #tab-cards[data-fresh] .tab-new {
  display: inline-grid; place-items: center; position: absolute; top: 5px; right: calc(50% - 22px);
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  font-size: 10px; font-weight: 800; letter-spacing: 0; line-height: 1;
  color: var(--tk-gilt-ink, #1a1206); background: var(--gold-hot, #f4c35a);
}

/* A tile painted locked (unknown ownership) never shows NEW. */
html.lk-discovery .card-grid li.locked[data-fresh] .ct-new { display: none; }

/* Locked preview: stays tappable; the requirement wraps instead of truncating at 360 px. */
html.lk-discovery .card-grid li.locked .ct-lock { max-width: 100%; white-space: normal; text-align: center; line-height: 1.2; }

/* Card-sheet demo: .cs-body is a flex column inside a scroller, so the overflow-hidden demo figure
   shrank (183 px for a 240 px canvas at 360 px) and clipped its Play/Pause bar. Never shrink it.
   (Live 0.22 bug: patches/cs-demo-noshrink.css.diff is the unflagged one-line fix.) */
html.lk-discovery .cs-demo { flex: none; }

/* Reveal mode of the card sheet. */
.cs-kicker, .cs-demo-note, #cs-continue { display: none; }
html.lk-discovery #card-sheet[data-reveal] .cs-kicker {
  display: block; margin: 0 0 2px; font-size: 10.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold-hot, #f4c35a);
}
html.lk-discovery #card-sheet[data-reveal] .cs-demo-note { display: block; margin: 0; padding: 0 12px 8px; font-size: 12px; line-height: 1.35; color: var(--muted); }
html.lk-discovery #card-sheet[data-reveal] #cs-continue { display: inline-flex; }
/* 360 px: Add to deck on its own row, then Try + Continue. */
html.lk-discovery #card-sheet[data-reveal] .cs-actions #cs-deck { grid-column: 1 / -1; }

/* v0.23.1 Cycle reveal: Add to deck opens a swap choice under the actions (legal outs only). */
.cs-swap { display: none; }
html.lk-discovery #card-sheet[data-reveal] .cs-swap:not([hidden]) { display: grid; gap: 8px; margin: 8px 0 0; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.04); }
html.lk-discovery .cs-swap-title { margin: 0; font-weight: 800; }
html.lk-discovery .cs-swap-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
html.lk-discovery .cs-swap-list .btn, html.lk-discovery .cs-swap .btn.slim { min-height: 44px; justify-content: center; }
html.lk-discovery .cs-swap-hint { margin: 0; font-size: 12px; }

/* Result screen: one Watch button per new card, on its own row under the unlock line. */
.rp-watch-row { display: none; }
html.lk-discovery .rp-watch-row:not([hidden]) { display: grid; gap: 6px; margin-top: 6px; }
html.lk-discovery .rp-watch-row .btn { width: 100%; min-height: 44px; justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  html.lk-discovery .ct-new, html.lk-discovery .tab-new { transition: none; animation: none; }
}
