/*
  Cardmarket Converter — clean, responsive, accessible theme
  Drop this into a new stylesheet and link it after any default styles.
  Designed to be resilient even if exact IDs/classes vary.
*/

/* ------------------------------
   1) Reset and base variables
--------------------------------*/
*, *::before, *::after { box-sizing: border-box; }

:root {
  /* Palette (light) */
  --bg: #0b0f14;
  --surface: #0f1520;
  --elev-1: #151b26;
  --elev-2: #1b2330;
  --muted: #7a8699;
  --text: #eaf0f6;
  --text-soft: #c7d1df;
  --brand: #5ab0ff;
  --brand-strong: #2f9bff;
  --accent: #7cffd9;
  --danger: #ff5d6c;
  --warn: #ffb454;
  --ok: #30d158;
  --border: #243045;
  --shadow: 0 10px 30px rgba(18, 28, 45, 0.45);

  /* Sizing & rhythm */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --gap-1: 8px;
  --gap-2: 12px;
  --gap-3: 16px;
  --gap-4: 24px;
  --gap-5: 32px;

  /* Typography */
  --font-ui: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Effects */
  --focus: 0 0 0 3px rgba(90, 176, 255, 0.5);
  --ring: 0 0 0 1px var(--brand);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f9fc;
    --surface: #ffffff;
    --elev-1: #ffffff;
    --elev-2: #f2f6fc;
    --muted: #5a6678;
    --text: #0f1722;
    --text-soft: #344055;
    --brand: #2f7cf5;
    --brand-strong: #1d6af0;
    --accent: #12b886;
    --danger: #e5484d;
    --warn: #f3a81a;
    --ok: #2bb673;
    --border: #dce3ee;
    --shadow: 0 10px 30px rgba(15, 23, 34, 0.12);
    --focus: 0 0 0 3px rgba(47, 124, 245, 0.35);
  }
}

/* ------------------------------
   2) Page layout and typography
--------------------------------*/
html, body {
  height: 100%;
}

body {
  margin: 0;
  background: radial-gradient(1200px 800px at 20% -20%, rgba(90, 176, 255, 0.08), transparent 60%),
              radial-gradient(900px 600px at 120% 20%, rgba(124, 255, 217, 0.08), transparent 60%),
              var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container,
.wrapper,
.main {
  width: min(1100px, 100%);
  margin-inline: auto;
  padding: clamp(16px, 3vw, 32px);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

h1, h2, h3 {
  line-height: 1.2;
  margin: 0 0 var(--gap-4);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(28px, 2.6vw, 40px); }
h2 { font-size: clamp(20px, 2vw, 28px); color: var(--text-soft); }
p { margin: 0 0 var(--gap-3); color: var(--text-soft); }

/* ------------------------------
   3) Header and hero
--------------------------------*/
.site-header {
  padding: clamp(24px, 3vw, 40px) 0;
}

.hero {
  display: grid;
  gap: var(--gap-4);
  align-items: start;
  grid-template-columns: 1fr;
}

.hero .title {
  display: flex;
  flex-direction: column;
  gap: var(--gap-2);
}

.badge {
  align-self: start;
  display: inline-flex;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), transparent);
  color: var(--text-soft);
  font-size: 12px;
}

/* ------------------------------
   4) Form and fields
--------------------------------*/
form, .form, .form-grid {
  display: grid;
  gap: var(--gap-4);
}

.form-grid {
  grid-template-columns: 1fr;
}

@media (min-width: 960px) {
  .form-grid.two-col {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.field {
  display: grid;
  gap: var(--gap-2);
}

label {
  font-weight: 600;
  color: var(--text);
}

.helper {
  color: var(--muted);
  font-size: 13px;
}

input[type="text"],
input[type="search"],
input[type="url"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  color: var(--text);
  background: var(--elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

textarea {
  min-height: 220px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  tab-size: 2;
  background:
    linear-gradient(var(--elev-1), var(--elev-1)) padding-box,
    radial-gradient(100% 100% at 0% 0%, rgba(90,176,255,0.25), transparent) border-box;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: var(--ring), var(--focus);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
}

/* Likely IDs on the page — safe if absent */
#decklist, #your-decklist { min-height: 260px; }
#cardmarket-list, #cardmarketList { min-height: 260px; }

/* ------------------------------
   5) Buttons and actions
--------------------------------*/
.button-row, .actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-2);
  align-items: center;
}

button,
input[type="submit"],
input[type="button"],
.btn {
  appearance: none;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.06s ease, box