/* ═══════════════════════════════════════════════════════
   CCG Builder — Neon Arcana Theme
   Cipherfall visual language: void-black | cyan | magenta | amber
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;700;900&family=Share+Tech+Mono&family=Inter:wght@400;600;700&display=swap');

:root {
  --bg:           #06070f;
  --surface:      #0b0c1a;
  --surface-2:    #10122a;
  --surface-3:    #181a32;
  --ink:          #d8eeff;
  --ink-soft:     #6a88aa;
  --cyan:         #00e5ff;
  --cyan-dim:     rgba(0, 229, 255, 0.15);
  --magenta:      #cc00ff;
  --magenta-dim:  rgba(204, 0, 255, 0.15);
  --amber:        #ffab00;
  --amber-dim:    rgba(255, 171, 0, 0.15);
  --ok:           #00e676;
  --ok-dim:       rgba(0, 230, 118, 0.12);
  --warn:         #ff9100;
  --warn-dim:     rgba(255, 145, 0, 0.12);
  --err:          #ff1744;
  --err-dim:      rgba(255, 23, 68, 0.12);
  --line:         rgba(0, 229, 255, 0.1);
  --line-bright:  rgba(0, 229, 255, 0.28);
  --radius:       8px;
  --mono:         'Share Tech Mono', 'SF Mono', 'Consolas', 'Menlo', monospace;
  --sans:         'Inter', system-ui, -apple-system, sans-serif;
  --display:      'Orbitron', var(--sans);
  --shadow:       0 4px 24px rgba(0, 0, 0, 0.7);
  --glow-cyan:    0 0 6px rgba(0, 229, 255, 0.7), 0 0 18px rgba(0, 229, 255, 0.35);
  --glow-magenta: 0 0 6px rgba(204, 0, 255, 0.7), 0 0 18px rgba(204, 0, 255, 0.35);
  --glow-amber:   0 0 6px rgba(255, 171, 0, 0.7), 0 0 18px rgba(255, 171, 0, 0.35);
  --glow-ok:      0 0 6px rgba(0, 230, 118, 0.7), 0 0 18px rgba(0, 230, 118, 0.35);
  --glow-err:     0 0 6px rgba(255, 23, 68, 0.7),  0 0 18px rgba(255, 23, 68, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }

/* Ensure [hidden] always wins over any display rule in author CSS */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(ellipse 900px 500px at -5% -8%,  rgba(0, 229, 255, 0.08)  0%, transparent 60%),
    radial-gradient(ellipse 700px 600px at 108% 95%, rgba(204, 0, 255, 0.08)  0%, transparent 60%),
    radial-gradient(ellipse 400px 300px at 55%  50%, rgba(204, 0, 255, 0.03) 0%, transparent 70%),
    var(--bg);
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.12) 3px,
    rgba(0, 0, 0, 0.12) 4px
  );
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: multiply;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  letter-spacing: 0.06em;
  line-height: 1.2;
}

header {
  padding: 28px 24px 14px;
  max-width: 1260px;
  margin: 0 auto;
  position: relative;
}

header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 24px; right: 24px;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), var(--magenta), transparent);
  opacity: 0.5;
}

h1 {
  margin: 0 0 6px;
  font-size: clamp(1.6rem, 2.8vw, 2.6rem);
  font-weight: 900;
  background: linear-gradient(90deg, var(--cyan) 0%, #80b3ff 45%, var(--magenta) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.45));
}

p.lead {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

main {
  max-width: 1260px;
  margin: 14px auto 32px;
  padding: 0 24px;
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.tab-btn {
  border: 1px solid var(--line-bright);
  background: var(--surface-2);
  color: var(--ink-soft);
  border-radius: 4px;
  padding: 7px 14px;
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 120ms, border-color 120ms, background 120ms, box-shadow 120ms;
  position: relative;
}

.tab-btn::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--cyan);
  opacity: 0;
  transition: opacity 120ms;
}

.tab-btn:hover {
  color: var(--cyan);
  border-color: var(--cyan);
  background: var(--cyan-dim);
  box-shadow: var(--glow-cyan);
}

.tab-btn[aria-selected="true"] {
  border-color: var(--cyan);
  background: var(--cyan-dim);
  color: var(--cyan);
  box-shadow: var(--glow-cyan);
}

.tab-btn[aria-selected="true"]::before { opacity: 1; }

.tab-panel {
  display: none;
  background: var(--surface);
  border: 1px solid var(--line-bright);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.tab-panel.active { display: block; }

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.card {
  grid-column: span 12;
  border: 1px solid var(--line-bright);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface-2);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 60px; height: 3px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  border-radius: 0 0 3px 0;
}

.card h2 {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.card h3 {
  margin: 8px 0 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hint {
  color: var(--ink-soft);
  font-size: 0.86rem;
  margin: 4px 0 6px;
  line-height: 1.45;
}

.main-layout {
  display: grid;
  gap: 14px;
  grid-template-columns: 268px minmax(0, 1fr);
  align-items: start;
}

.main-content { grid-column: 2; min-width: 0; }

.global-action-rail {
  grid-column: 1;
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 28px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (max-width: 900px) {
  .main-layout { grid-template-columns: minmax(0, 1fr); }
  .main-content { grid-column: 1; }
  .global-action-rail { display: none; }
}

.row {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end;
  margin-bottom: 10px;
}

.field { grid-column: span 12; }

.field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

input, select, textarea, button { font: inherit; }

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-bright);
  border-radius: 4px;
  padding: 8px 10px;
  background: var(--surface-3);
  color: var(--ink);
  transition: border-color 120ms, box-shadow 120ms;
  outline: none;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.18), var(--glow-cyan);
}

input[type="text"][readonly],
input[type="number"][readonly] { opacity: 0.6; cursor: default; }

select option { background: var(--surface-3); color: var(--ink); }

textarea {
  min-height: 240px;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.5;
  resize: vertical;
}

button {
  border: 1px solid var(--line-bright);
  background: var(--surface-3);
  color: var(--ink);
  border-radius: 4px;
  padding: 8px 14px;
  cursor: pointer;
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 120ms, border-color 120ms, background 120ms, box-shadow 120ms;
}

button:hover:not(:disabled) {
  color: var(--cyan);
  border-color: var(--cyan);
  background: var(--cyan-dim);
  box-shadow: var(--glow-cyan);
}

button.primary {
  border-color: var(--magenta);
  background: var(--magenta-dim);
  color: var(--magenta);
  box-shadow: 0 0 4px rgba(204, 0, 255, 0.3);
}

button.primary:hover:not(:disabled) {
  background: rgba(204, 0, 255, 0.25);
  box-shadow: var(--glow-magenta);
  color: #e080ff;
}

button.secondary {
  border-color: var(--amber);
  background: var(--amber-dim);
  color: var(--amber);
  box-shadow: 0 0 4px rgba(255, 171, 0, 0.25);
}

button.secondary:hover:not(:disabled) {
  background: rgba(255, 171, 0, 0.22);
  box-shadow: var(--glow-amber);
  color: #ffd040;
}

button.ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: transparent;
}

button.ghost:hover:not(:disabled) {
  color: var(--ink);
  border-color: var(--line-bright);
  background: var(--surface-3);
  box-shadow: none;
}

button:disabled { opacity: 0.35; cursor: not-allowed; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.icon-btn:hover {
  color: var(--cyan);
  border-color: var(--cyan);
  background: rgba(0, 229, 255, 0.06);
}

.icon-btn--ok {
  color: #4caf50;
  border-color: #4caf50;
  background: rgba(76, 175, 80, 0.08);
}

.files-howto {
  border: 1px solid var(--line-bright);
  border-radius: 8px;
  background: rgba(0, 229, 255, 0.06);
  padding: 10px 12px;
  margin: 10px 0 12px;
}

.files-howto h3 {
  margin: 0 0 6px;
}

.files-howto ol {
  margin: 0 0 0 18px;
  padding: 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.5;
}

.files-subsection {
  border-top: 1px dashed var(--line);
  margin-top: 12px;
  padding-top: 10px;
}

.files-subsection h3 {
  margin: 0 0 8px;
}

.files-actions {
  margin-top: 2px;
}

.files-fullpath {
  word-break: break-all;
  margin-top: 6px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line-bright);
  border-radius: var(--radius);
}

table { width: 100%; border-collapse: collapse; min-width: 760px; }

/* Wildcard table: auto-size columns to content, widen only as needed */
table[aria-label="Wildcard ratios"] {
  width: auto;
  min-width: 0;
  table-layout: auto;
}

th, td {
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 0.88rem;
}

th {
  background: var(--surface-3);
  color: var(--cyan);
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid var(--line-bright);
}

tbody tr:hover { background: rgba(0, 229, 255, 0.04); }

.rarity-color-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.rarity-color-swatch {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: inline-block;
  flex: 0 0 auto;
}

.status {
  padding: 8px 12px;
  border-radius: 6px;
  margin: 6px 0;
  border: 1px solid;
  font-size: 0.88rem;
  border-left-width: 3px;
}

.status.warn  { background: var(--warn-dim);  border-color: rgba(255, 145, 0, 0.4); color: #ffc060; }
.status.error { background: var(--err-dim);   border-color: rgba(255, 23, 68, 0.4);  color: #ff6080; }
.status.ok    { background: var(--ok-dim);    border-color: rgba(0, 230, 118, 0.4);  color: #60ffa0; }
.status.pending { background: var(--amber-dim); border-color: rgba(255, 171, 0, 0.4); color: var(--amber); }

/* report page styles (used by exported HTML report) */
body.report-page {
  margin: 26px;
}

body.report-page::before {
  display: none;
}

.report-page h1,
.report-page h2,
.report-page h3 {
  margin: 0 0 12px;
  text-transform: uppercase;
}

.report-page h1 {
  font-size: 1.9rem;
}

.report-page h2 {
  font-size: 0.92rem;
  color: var(--cyan);
  letter-spacing: 0.1em;
}

.report-page h3 {
  font-size: 0.78rem;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
}

.report-page section {
  margin: 0 0 16px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line-bright);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.report-page section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), transparent);
}

.report-page table {
  width: 100%;
  border-collapse: collapse;
}

.report-page th,
.report-page td {
  border-bottom: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: top;
  font-size: 0.9rem;
}

.report-page th {
  background: var(--surface-3);
  color: var(--cyan);
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.report-page tbody tr:hover {
  background: rgba(0, 229, 255, 0.04);
}

.report-page .meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.report-page .k {
  font-size: 0.72rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--display);
}

.report-page .v {
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--ink);
}

.report-page .subgrid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.report-page .note {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin-top: 10px;
}

.report-page ol {
  margin-top: 8px;
}

.report-page li {
  margin: 0 0 5px;
}

.report-page .status-pass,
.report-page .status-review {
  font-family: var(--display);
  letter-spacing: 0.08em;
  font-size: 0.74rem;
  font-weight: 700;
}

.report-page .status-pass {
  color: #60ffa0;
}

.report-page .status-review {
  color: #ffd040;
}

@media (max-width: 700px) {
  body.report-page {
    margin: 14px;
  }
}

.privacy-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.banner-dismiss {
  border: 1px solid var(--line-bright);
  background: transparent;
  color: var(--ink-soft);
  border-radius: 4px;
  padding: 4px 9px;
  font-family: var(--display);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}

.banner-dismiss:hover {
  color: var(--cyan);
  border-color: var(--cyan);
  background: var(--cyan-dim);
}

.gdpr-banner {
  padding: 14px 16px;
  margin-top: 8px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.gdpr-banner[hidden] { display: none !important; }

.gdpr-banner-body {
  flex: 1;
  min-width: 0;
}

.gdpr-title {
  display: block;
  font-family: var(--display);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: inherit;
  margin-bottom: 6px;
}

.gdpr-text {
  margin: 4px 0;
  font-size: 0.82rem;
  color: inherit;
  opacity: 0.85;
  line-height: 1.5;
}

.gdpr-list {
  margin: 6px 0 6px 18px;
  padding: 0;
  font-size: 0.80rem;
  color: inherit;
  opacity: 0.85;
  line-height: 1.6;
}

.gdpr-list code {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink);
  background: rgba(0, 229, 255, 0.08);
  padding: 1px 4px;
  border-radius: 3px;
}

.gdpr-accept {
  white-space: nowrap;
  align-self: flex-start;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ── License gate overlay ───────────────────────────────────────────── */
.license-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.license-overlay[hidden] { display: none !important; }

.license-modal {
  max-width: 520px;
  width: calc(100% - 40px);
  border-radius: 10px;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.7);
}

.license-title {
  font-family: var(--display);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: inherit;
  margin: 0 0 4px;
}

.license-body {
  margin: 0;
  font-size: 0.88rem;
  color: inherit;
  opacity: 0.9;
  line-height: 1.55;
}

.license-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.license-btn {
  display: inline-block;
  border-radius: 4px;
  padding: 8px 18px;
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  border: 2px solid currentColor;
  transition: background 0.15s, color 0.15s;
}

.license-btn-primary {
  background: #60ffa0;
  color: #0b0c1a;
  border-color: #60ffa0;
}

.license-btn-primary:hover {
  background: #a0ffc0;
  border-color: #a0ffc0;
}

.license-btn-ghost {
  background: transparent;
  color: inherit;
}

.license-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}


  display: inline-block;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 0.72rem;
  font-family: var(--mono);
  border: 1px solid;
  margin-right: 6px;
  letter-spacing: 0.04em;
}

.pill.fp { color: #ff8ad8; background: rgba(204, 0, 255, 0.18); border-color: rgba(204, 0, 255, 0.45); }
.pill.tc { color: var(--cyan);  background: var(--cyan-dim);  border-color: rgba(0, 229, 255, 0.4); }

.rule-row {
  border: 1px solid var(--line-bright);
  border-radius: 6px;
  background: var(--surface-3);
  padding: 10px 12px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  transition: border-color 120ms;
}

.rule-row:hover { border-color: rgba(0, 229, 255, 0.35); }
.rule-row .txt  { flex: 1; }

.rule-row .title {
  font-weight: 700;
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 0.9rem;
}

.rule-row .adv  { font-size: 0.8rem; color: var(--ink-soft); }
.rule-controls  { display: flex; gap: 6px; }

.mono  { font-family: var(--mono); }
.muted { color: var(--ink-soft); }

.empty-start {
  border: 1px dashed rgba(0, 229, 255, 0.3);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 10px;
  background: var(--cyan-dim);
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.two-col { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }

.history-stack {
  display: grid;
  gap: 6px;
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  margin-top: 8px;
  padding-right: 2px;
}

.history-stack::-webkit-scrollbar       { width: 4px; }
.history-stack::-webkit-scrollbar-track { background: transparent; }
.history-stack::-webkit-scrollbar-thumb { background: var(--line-bright); border-radius: 2px; }

.history-item {
  border: 1px solid var(--line-bright);
  border-radius: 4px;
  background: var(--surface-3);
  padding: 7px 10px;
  color: var(--ink-soft);
  transition: border-color 100ms, color 100ms;
}

.history-area {
  font-family: var(--display);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--cyan);
  margin-bottom: 3px;
}

.history-action {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.25;
  color: inherit;
}

.history-item.active {
  border-color: var(--cyan);
  background: var(--cyan-dim);
  color: var(--cyan);
  box-shadow: 0 0 6px rgba(0, 229, 255, 0.2);
}

.history-item.redo  { opacity: 0.35; }
.history-empty { color: var(--ink-soft); font-size: 0.82rem; font-family: var(--mono); }

.tiny-btn {
  padding: 2px 7px;
  min-width: 26px;
  line-height: 1.1;
  font-weight: 700;
  font-size: 0.78rem;
  border-radius: 3px;
}

.fraction-control {
  display: inline-grid;
  grid-template-columns: 26px auto 26px;
  align-items: center;
  gap: 4px;
  width: max-content;
}

.fraction-control input {
  min-width: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.per-card-cell {
  display: grid;
  grid-template-columns: 92px 30px 30px auto;
  align-items: center;
  gap: 6px;
  justify-content: flex-start;
}

.per-card-value {
  display: inline-block;
  min-width: 92px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
}

.fraction-control span {
  min-width: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
  padding: 0 2px;
}

.stacked-fraction {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.frac-bar {
  align-self: stretch;
  width: 100%;
  min-width: 0;
  height: 1px;
  background: var(--ink-soft);
  opacity: 0.5;
  border-radius: 1px;
}

.frac-pct {
  font-size: 0.72rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  margin-top: 2px;
}

.lcd-part {
  min-width: 24px;
  display: inline-block;
  text-align: center;
}

.wildcard-num-input,
.wildcard-den-input {
  width: 52px;
  min-width: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.pin-col {
  text-align: center;
  vertical-align: middle;
}

.pin-col input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--amber);
}

tr.row-pinned > td {
  border-top: 1px solid rgba(255, 255, 255, 0.20);
  border-bottom: 1px solid rgba(255, 255, 255, 0.20);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  filter: saturate(1.2) brightness(1.08);
}

tr.row-pinned > td:first-child {
  box-shadow: inset 4px 0 0 rgba(255, 255, 255, 0.24), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* ── Wildcard table column banding ─────────────────────────────────── */
/* Columns: 1 Rarity | 2 Pin | 3 Fraction | 4 LCD | 5 Reduced | 6 Status */
table[aria-label="Wildcard ratios"] th:nth-child(1),
table[aria-label="Wildcard ratios"] td:nth-child(1) {
  border-right: 1px solid var(--line-bright);
}
table[aria-label="Wildcard ratios"] th:nth-child(2),
table[aria-label="Wildcard ratios"] td:nth-child(2) {
  background: rgba(255, 171, 0, 0.06);
  border-right: 1px solid rgba(255, 171, 0, 0.20);
}
table[aria-label="Wildcard ratios"] th:nth-child(3),
table[aria-label="Wildcard ratios"] td:nth-child(3) {
  background: rgba(0, 229, 255, 0.05);
  border-right: 1px solid var(--line-bright);
}
table[aria-label="Wildcard ratios"] th:nth-child(4),
table[aria-label="Wildcard ratios"] td:nth-child(4) {
  background: rgba(128, 100, 255, 0.08);
  border-right: 1px solid var(--line-bright);
}
table[aria-label="Wildcard ratios"] th:nth-child(5),
table[aria-label="Wildcard ratios"] td:nth-child(5) {
  background: rgba(216, 238, 255, 0.04);
  border-right: 1px solid var(--line-bright);
}
/* Status (col 6) — no tint */

/* Pinned row overrides */
tr.row-pinned > td:nth-child(2) { border-right: 1px solid rgba(216, 238, 255, 0.45); }
tr.row-pinned > td:nth-child(3) { border-right: 1px solid rgba(216, 238, 255, 0.35); }
tr.row-pinned > td:nth-child(4) { border-right: 1px solid rgba(216, 238, 255, 0.35); }
tr.row-pinned > td:nth-child(5) { border-right: 1px solid rgba(216, 238, 255, 0.35); }

.pin-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.slot-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  margin-bottom: 14px;
}

.slot-tile {
  border: 1px solid var(--line-bright);
  border-radius: 6px;
  padding: 10px;
  background: var(--surface-3);
  transition: border-color 120ms;
}

.slot-tile:hover { border-color: rgba(204, 0, 255, 0.4); }

.slot-tile strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--display);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.wildcard-rainbow-tile {
  border-color: rgba(255, 122, 102, 0.6);
  background:
    linear-gradient(135deg, rgba(0, 229, 255, 0.16), rgba(204, 0, 255, 0.13) 30%, rgba(255, 171, 0, 0.13) 52%, rgba(124, 255, 0, 0.11) 72%, rgba(77, 163, 255, 0.15));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 0 12px rgba(0, 229, 255, 0.12);
}

.wildcard-rainbow-label {
  padding: 2px 6px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.26), rgba(204, 0, 255, 0.22), rgba(255, 171, 0, 0.24), rgba(124, 255, 0, 0.22), rgba(77, 163, 255, 0.24));
  color: #eaf8ff;
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.wildcard-rainbow-control {
  border-color: rgba(255, 122, 102, 0.7);
  background-image: linear-gradient(90deg, rgba(0, 229, 255, 0.06), rgba(204, 0, 255, 0.07), rgba(255, 171, 0, 0.08), rgba(124, 255, 0, 0.07), rgba(77, 163, 255, 0.06));
}

.slot-summary {
  margin: 6px 0 12px;
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.error-pulse { animation: errorPulse 1.1s ease-out 1; }

@keyframes errorPulse {
  0%   { box-shadow: 0 0 0 0    rgba(255, 23, 68, 0.7); border-color: var(--err); }
  60%  { box-shadow: 0 0 0 12px rgba(255, 23, 68, 0);   border-color: var(--err); }
  100% { box-shadow: 0 0 0 0    rgba(255, 23, 68, 0); }
}

.toast-host {
  position: fixed;
  top: 16px; right: 16px;
  z-index: 2000;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-width: 260px;
  max-width: min(92vw, 420px);
  border: 1px solid var(--line-bright);
  border-left: 3px solid var(--cyan);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: var(--shadow);
  padding: 10px 14px;
  font-size: 0.88rem;
  opacity: 0;
  transform: translateY(-8px) translateX(6px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.toast.show  { opacity: 1; transform: translateY(0) translateX(0); }

.toast.error {
  border-left-color: var(--err);
  background: var(--err-dim);
  color: #ff8099;
  box-shadow: var(--glow-err), var(--shadow);
}

@media (min-width: 981px) {
  .field.sm-8 { grid-column: span 8; }
  .field.sm-6 { grid-column: span 6; }
  .field.sm-4 { grid-column: span 4; }
  .field.sm-3 { grid-column: span 3; }
  .field.sm-2 { grid-column: span 2; }
}

@media (max-width: 600px) {
  .two-col { grid-template-columns: 1fr; }
  .field.sm-8, .field.sm-6, .field.sm-4, .field.sm-3, .field.sm-2 { grid-column: span 12; }
}

hr {
  border: none; height: 1px; margin: 14px 0;
  background: linear-gradient(90deg, var(--cyan), var(--magenta), transparent);
  opacity: 0.3;
}

input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--cyan); cursor: pointer; }

#globalAlert:not(:empty) {
  margin-top: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 23, 68, 0.4);
  border-left: 3px solid var(--err);
  border-radius: 6px;
  background: var(--err-dim);
  color: #ff8099;
  font-size: 0.88rem;
}

footer {
  max-width: 1260px;
  margin: 8px auto 28px;
  padding: 14px 24px;
  font-size: 0.78rem;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  position: relative;
}

footer::before {
  content: '';
  position: absolute;
  top: 0; left: 24px; right: 24px;
  height: 1px;
  background: linear-gradient(90deg, var(--magenta), var(--cyan), transparent);
  opacity: 0.35;
}

footer a { color: var(--cyan); text-decoration: none; transition: color 120ms, text-shadow 120ms; }
footer a:hover { color: #80f0ff; text-shadow: var(--glow-cyan); }

@media print {
  .tabs, .actions, #filesTab, #configTab { display: none !important; }
  body { background: #fff; color: #000; }
  body::before { display: none; }
  h1 { -webkit-text-fill-color: #000; background: none; filter: none; }
  .tab-panel { display: block !important; box-shadow: none; border: none; background: #fff; }
  .card { background: #fff; border-color: #ccc; }
  .card::before { display: none; }
  footer { display: none; }
}

@keyframes neonFlicker {
  0%, 97%, 100% { opacity: 1; }
  98%            { opacity: 0.6; }
  99%            { opacity: 0.9; }
}
