/* HALLYU DROP — readable Y2K light / dark UI contrast pass.
   Loaded after styles.css and y2k.css; deliberately does not recolour the
   photographic card fronts, matching card backs or dark cinematic theatre. */
:root[data-theme="dark"] {
  --ui-heading:#fff5fc;
  --ui-copy:#ead8f0;
  --ui-muted:#d1b9d9;
  --ui-accent:#ffb3dc;
  --ui-success:#a5f1d7;
  --ui-control-bg:#31203f;
  --ui-control-stroke:#ac80ad;
}
:root[data-theme="light"] {
  --ui-heading:#392039;
  --ui-copy:#57334f;
  --ui-muted:#694461;
  --ui-accent:#a32268;
  --ui-success:#11684c;
  --ui-control-bg:#fff9fc;
  --ui-control-stroke:#ae6b95;
}

/* Text on the site itself follows the selected theme instead of inheriting
   white-on-dark declarations from the original V2 layout. */
.brand-wordmark small,
.nav-link:not(.is-active),
.hero-description,
.hero-info,
.stat-label,
.section-topline-right,
.stage-description,
.rarities-header > p,
.rarity-tile p,
.rarity-tile .tile-rate-label,
.footnote,
.collection-subtitle,
.collection-progress-block > span,
.binder-count,
.binder-hint,
.binder-summary-item small,
.collection-bottom span,
.collection-save-caption span,
.site-footer p,
.site-footer > span,
.arena-caption,
.odds-dialog > p,
.modal-note,
.empty-state,
.pack-result,
.cooldown-copy strong,
.collection-controls input::placeholder {
  color:var(--ui-muted);
}
.hero h1,
.stage-heading h2,
.rarities-header h2,
.collection-heading h1,
.stat-value,
.collection-progress-block strong,
.binder-summary-item strong,
.rarity-tile .tile-rate,
.site-footer strong,
.odds-dialog h2,
.binder-summary-item strong {
  color:var(--ui-heading);
}
.hero-description strong,
.collection-subtitle strong,
.eyebrow,
.section-eyebrow,
.section-topline,
.cooldown-copy small,
.collection-save-caption strong,
.arena-caption .tiny-star {
  color:var(--ui-accent);
}

/* Previously hard-coded pale pastel status messages vanished in light mode. */
#saveFeedback:not(:empty) {color:var(--ui-success)}
.pack-result strong {color:var(--ui-accent)}
.cooldown-clock {color:var(--ui-success)}
:root[data-theme="light"] .cooldown-panel.is-cooling .cooldown-clock,
:root[data-theme="light"] .arena-caption.is-cooling {color:#874118}
:root[data-theme="dark"] .cooldown-panel.is-cooling .cooldown-clock,
:root[data-theme="dark"] .arena-caption.is-cooling {color:#ffe1a3}

/* Inputs, dropdown menus and their native OS option popups must each have
   both foreground and background colours (SteamOS / Firefox included). */
.collection-controls input,
.collection-controls select,
.select-wrap select,
.search-wrap input {
  color:var(--ui-heading);
  background-color:var(--ui-control-bg);
  border-color:var(--ui-control-stroke);
  -webkit-text-fill-color:var(--ui-heading);
}
.collection-controls input::placeholder,
.search-wrap input::placeholder {
  color:var(--ui-muted);
  -webkit-text-fill-color:var(--ui-muted);
  opacity:1;
}
.select-wrap option,
.collection-controls select option {
  color:var(--ui-heading);
  background:var(--ui-control-bg);
}
.search-wrap > span:not(.sr-only) {color:var(--ui-copy)}

/* Button text stays legible in all states, including hover and disabled. */
.btn-ghost,
.btn-outline,
.save-action-button,
.reset-button,
.theme-toggle,
.sound-button,
.modal-close {color:var(--ui-heading)}
.btn-primary {color:#4b2341}
.btn-primary:disabled {color:#593b52;opacity:.72}
.btn-ghost:hover,
.btn-outline:hover,
.save-action-button:hover,
.reset-button:hover {color:var(--ui-heading)}
.reset-button {border-color:var(--ui-control-stroke)}
:root[data-theme="light"] .btn-ghost,
:root[data-theme="light"] .btn-outline,
:root[data-theme="light"] .save-action-button {border-color:#a96a93}
:root[data-theme="dark"] .nav-link:hover:not(.is-active) {color:#fff7ff}
:root[data-theme="light"] .nav-link:hover:not(.is-active) {color:#392039}

/* Rarity names and percentages shouldn't become white-on-peach. Retain the
   coloured rarity borders and glows; adjust the lettering only. */
:root[data-theme="light"] .rarity-tile h3 {
  color:var(--ui-heading);
  text-shadow:0 1px 0 #ffffffaa;
}
:root[data-theme="light"] .rarity-tile .tile-star {
  filter:drop-shadow(0 1px 0 #58364a);
}
:root[data-theme="light"] .rarity-tile--common .tile-star,
:root[data-theme="light"] .rarity-tile--uncommon .tile-star {color:#6c3f72}
:root[data-theme="light"] .rarity-tile .tile-animation {color:#874118}
:root[data-theme="dark"] .rarity-tile .tile-animation {color:#ffe2aa}

/* Drop-rate modal: percentages had inline rarity hex values, and Common's
   white glyph became invisible against the bright panel. */
.odds-dialog .odds-row strong {color:var(--ui-heading)!important}
.odds-dialog .odds-row span:nth-child(2) {color:var(--ui-heading)}
:root[data-theme="light"] .odds-dialog .odds-row:first-child span:first-child {color:#55385b!important}
:root[data-theme="light"] .odds-dialog .odds-row:nth-child(2) span:first-child {color:#206747!important}
:root[data-theme="light"] .odds-dialog code {color:#8f245b}

/* Consistent, readable single-card viewer in both modes. */
.viewer-info h2 {color:var(--ui-heading)}
.viewer-note,.viewer-key-hint {color:var(--ui-muted)}
.viewer-kicker,.viewer-rarity,.viewer-group,.viewer-meta span {color:var(--ui-accent)}
.viewer-meta strong {color:var(--ui-heading)}
.viewer-nav:not(:disabled) {color:var(--ui-heading)}
:root[data-theme="dark"] .viewer-nav:not(:disabled) {color:#fff4ff}
:root[data-theme="dark"] .viewer-info h2,
:root[data-theme="dark"] .viewer-meta strong {color:#fff5fc}
:root[data-theme="light"] .viewer-flip {color:#582447}
:root[data-theme="light"] .viewer-rarity {border-color:#ad6590}

/* The opening overlay intentionally stays dark in either site mode. Only
   dark-theatre text is touched here, never the peach artwork or rarity foils. */
.opening-overlay .opening-brand i,
.opening-overlay .opening-instruction {color:#d9c5e2}
.opening-overlay .opening-intro p:last-child,
.opening-overlay .opening-finale > p:not(.opening-kicker) {color:#ebd7f0}
.opening-overlay .opening-close,
.opening-overlay .orbit-direction {color:#fff3fd}

/* Keep keyboard interactions clearly visible on pale panels. */
:root[data-theme="light"] button:focus-visible,
:root[data-theme="light"] input:focus-visible,
:root[data-theme="light"] select:focus-visible,
:root[data-theme="light"] .binder-item--view:focus-visible {
  outline:3px solid #91215d;
  outline-offset:3px;
}

/* Strongly scoped last-pass contrast adjustments for the peach skin. */
:root[data-theme="light"] .hero-description,
:root[data-theme="light"] .stage-description,
:root[data-theme="light"] .collection-subtitle,
:root[data-theme="light"] .rarities-header > p,
:root[data-theme="light"] .footnote,
:root[data-theme="light"] .site-footer p,
:root[data-theme="light"] .site-footer > span,
:root[data-theme="light"] .binder-count,
:root[data-theme="light"] .binder-hint,
:root[data-theme="light"] .collection-save-caption span,
:root[data-theme="light"] .viewer-note {color:#613650;}
:root[data-theme="dark"] .hero-description,
:root[data-theme="dark"] .stage-description,
:root[data-theme="dark"] .collection-subtitle,
:root[data-theme="dark"] .rarities-header > p,
:root[data-theme="dark"] .footnote,
:root[data-theme="dark"] .site-footer p,
:root[data-theme="dark"] .site-footer > span,
:root[data-theme="dark"] .binder-count,
:root[data-theme="dark"] .binder-hint,
:root[data-theme="dark"] .collection-save-caption span,
:root[data-theme="dark"] .viewer-note {color:#ead5eb;}
/* LOCKED is laid over the permanently peach card-back graphic; using the
   dark site theme's pale text there made it disappear. */
.binder-item.is-locked .locked-label {color:#371329;text-shadow:0 1px 1px #fff9;}
