:root {
  --bg: #0a0d14;
  --panel: #131826;
  --panel-2: #1b2233;
  --line: #262f45;
  --text: #e7ecf7;
  --text-dim: #8a93ab;
  --accent: #6ea2ff;      /* Flying-blau aus dem Spiel */
  --warn: #ffb454;
  --danger: #ff5a5a;

  --card-w: 2.5in;
  --card-h: 3.5in;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ================= Bildschirm ================= */

.topbar {
  display: flex;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), var(--bg));
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-mark { color: var(--accent); font-size: 22px; text-shadow: 0 0 12px rgba(110,162,255,.7); }
.brand-name { font-weight: 800; letter-spacing: 0.14em; font-size: 18px; }
.brand-sub { color: var(--text-dim); font-size: 13px; letter-spacing: 0.04em; }

main { max-width: 720px; margin: 0 auto; padding: 24px 20px 8px; }

.controls {
  display: grid;
  gap: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
}

.control-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.stepper {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  width: fit-content;
}
.stepper button {
  background: var(--panel-2);
  color: var(--text);
  border: none;
  width: 44px;
  font-size: 20px;
  cursor: pointer;
}
.stepper button:active { background: var(--accent); color: #04101f; }
.stepper input {
  width: 80px;
  text-align: center;
  background: var(--bg);
  color: var(--text);
  border: none;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  font-size: 16px;
  font-weight: 700;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.hint { color: var(--text-dim); font-size: 12.5px; margin: 8px 0 0; }
.print-hint {
  background: rgba(255, 180, 84, 0.1);
  border: 1px solid rgba(255, 180, 84, 0.35);
  color: #ffd8a8;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.5;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: none;
  font-size: 15px;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--accent); }

.actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  flex: 1 1 auto;
  padding: 14px 18px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  min-height: 48px;
}
.btn.primary {
  background: var(--accent);
  color: #04101f;
  border-color: var(--accent);
  box-shadow: 0 0 22px rgba(110,162,255,.35);
}
.btn.ghost { background: transparent; color: var(--text); }
.btn:active { transform: translateY(1px); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 16px 4px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-item::before { content: ""; width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend-item.common::before { background: #7ee787; }
.legend-item.uncommon::before { background: var(--accent); }
.legend-item.rare::before { background: var(--warn); }
.legend-item.endless::before { background: var(--danger); }

.status { text-align: center; color: var(--text-dim); font-size: 13px; min-height: 18px; margin: 4px 0 20px; }

/* ---- Bildschirm-Vorschau (mit Overlay) ---- */
#preview { padding: 0 12px 60px; display: flex; flex-direction: column; align-items: center; gap: 28px; }

.psheet {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, var(--card-w)));
  grid-auto-rows: var(--card-h);
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  max-width: 100%;
  overflow-x: auto;
}

.pcard {
  position: relative;
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 6px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.pcard img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard .tag {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 4px 6px 5px;
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(0deg, rgba(0,0,0,.85), rgba(0,0,0,0));
  text-shadow: 0 1px 2px rgba(0,0,0,.8);
  display: flex;
  justify-content: space-between;
  gap: 4px;
}
.pcard .rarity-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 9px; height: 9px;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(0,0,0,.6);
}
.pcard.common .rarity-dot { background: #7ee787; }
.pcard.uncommon .rarity-dot { background: var(--accent); }
.pcard.rare .rarity-dot { background: var(--warn); }
.pcard.endless .rarity-dot { background: var(--danger); }

@media (max-width: 480px) {
  :root { --card-w: 27vw; --card-h: 37.8vw; }
  .psheet { grid-template-columns: repeat(3, var(--card-w)); gap: 6px; padding: 8px; }
}
