/*
 * Gemeinsame Basis der Web-App. Gleiche Gestaltung wie die Spielseite (assets/play.css):
 * reduziert, Schwarz-Weiß, folgt automatisch dem Hell-/Dunkelmodus des Geräts.
 */
@font-face {
  font-family: "Hanken Grotesk";
  src: url("fonts/hanken-grotesk.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* Hell (Standard) */
:root {
  color-scheme: light;
  --ink: #000000;
  --paper: #ffffff;
  --graphite: #6b6b6b;
  --line: #e3e3e3;
  --panel: #f6f6f6;
  --hover-bg: #f6f6f6;
  --hover-line: #c4c4c4;
  --soft-text: #333333;
  --invert-text: rgba(255, 255, 255, .65);
  --red: #e5383b;
  --green: #12924a;
  --card-shadow: 0 0 0 1px rgba(0, 0, 0, .08), -6px 0 14px -6px rgba(0, 0, 0, .22);

  --text: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --display: var(--text);
  --code: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Dunkel */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #ffffff;
    --paper: #000000;
    --graphite: #8c8c8c;
    --line: #2e2e2e;
    --panel: #0e0e0e;
    --hover-bg: #0c0c0c;
    --hover-line: #4a4a4a;
    --soft-text: #cfcfcf;
    --invert-text: rgba(0, 0, 0, .55);
    --red: #ff5a52;
    --green: #22b55f;
    --card-shadow: -6px 0 16px -6px rgba(0, 0, 0, .55);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--text);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px; border-radius: 20px;
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  font: 600 16px/1 var(--text); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { opacity: .85; }
.btn:disabled { opacity: .3; cursor: not-allowed; }
.btn-line { background: transparent; color: var(--ink); border-color: var(--line); font-weight: 500; }
.btn-line:hover { opacity: 1; background: var(--hover-bg); border-color: var(--hover-line); }
.btn-danger { color: var(--red); }
.btn-danger:hover { border-color: var(--red); }
.btn-small { min-height: 40px; padding: 0 16px; border-radius: 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--ink); outline-offset: 2px;
}

.textlink {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: var(--ink);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px;
}
.textlink:hover { text-decoration-thickness: 2px; }
.textlink.quiet { color: var(--graphite); }

/* ---------- Spielkarten: Rang oben links, Farbe unten links (wie auf der Spielseite) ---------- */
.pcard {
  --w: 84px;
  position: relative; flex: none;
  width: var(--w); height: calc(var(--w) * 1.45);
  border-radius: calc(var(--w) * .17);
  background: #fff; color: #000;
  box-shadow: var(--card-shadow);
}
.pcard svg { display: block; fill: #000; width: 100%; height: 100%; }
.pcard .rank {
  position: absolute; top: 9%; left: 15%;
  font-weight: 500; font-size: calc(var(--w) * .38); line-height: 1; letter-spacing: -.04em;
}
.pcard .suit { position: absolute; left: 15%; bottom: 10%; width: calc(var(--w) * .25); height: calc(var(--w) * .25); }
.pcard.red { color: var(--red); }
.pcard.red .suit svg { fill: var(--red); }
.pcard.back::before {
  content: ""; position: absolute; inset: calc(var(--w) * .08);
  border-radius: calc(var(--w) * .1);
  background: repeating-linear-gradient(135deg, #000 0 2px, transparent 2px 8px);
}
.pcard + .pcard { margin-left: calc(var(--w) * -.36); }
.cards-spread .pcard + .pcard { margin-left: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
