/* Racetrack – Karopapier-Look */
@font-face {
  font-family: "Architects Daughter";
  src: url("fonts/ArchitectsDaughter-Regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Caveat";
  src: url("fonts/Caveat-VariableFont_wght.ttf") format("truetype");
  font-display: swap;
}
:root {
  /* --papier  = Hintergrund der Seite UND der Streckenzeichnung (das "Blatt")
     --flaeche = Oberfläche von Karten/Inputs/Buttons – bewusst ein eigener Ton, damit sich diese vom Papier abheben und nicht verschwimmen */
	 
  --papier: #fcfcfc;         /* Hintergrund der Seite UND der Streckenzeichnung (Canvas-Papierfläche + Rand um die Strecke) */
  --flaeche: #ffffff;        /* Oberfläche von Karten, Inputs, Buttons, Modal, Lupe, Code-Anzeige, Spieler-Chips */
  --tinte: #1e3a8a;          /* Volle Tintenfarbe: Fließtext, Mauerkontur, Diagonalen-Schnittlinie, Ziellinie (dunkles Feld), Startplatz-Rand/Ziffer */
  --tinte-hell: #41599f;     /* Hellere Tinte: Untertitel, .hinweis-Texte */
  --tinte-schwach: rgba(30, 58, 138, 0.58); /* Abgeschwächte Tinte: Sand-Punkte, Mauer-Schraffur */
  --karo: rgba(37, 99, 235, 0.22);        /* Karoraster – Seiten-Hintergrund UND Canvas-Streckenraster */
  --rand: #b6c6ea;           /* Rahmenfarbe: Karten, Inputs, Buttons, Legende-Farbfelder */
  --stift-blau: #1d4ed8;     /* Akzentfarbe Primär-Button – bewusst NICHT papiersortenabhängig */
  --stift-rot: #dc2626;      /* Akzentfarbe Fehler/Löschen – bewusst NICHT papiersortenabhängig */
}


body.papier-recycelt {
  --papier: #E5E4E2;
  --flaeche: #f2f1f0;
  --tinte: #1e3a8a;
  --tinte-hell: #41599f;
  --karo: rgba(37, 99, 235, 0.22);
  --tinte-schwach: rgba(30, 58, 138, 0.58);
  --rand: #b6c6ea;
}

body.papier-legal-pad{
    --papier: #f4f3a3;
    --flaeche: color-mix(#ffffe7 80%, #FFF 20%);
	--tinte: #243e79;
	--tinte-hell: #35508d;
	--rand: #a0a4b6;
	--karo: #8fa9e87a;
}

body.papier-dokument{
    --papier: #F4ECD8;
    --flaeche: color-mix(var(--papier) 50%, #FFF 50%);
	--tinte: #213367;
	--tinte-hell: #2A4082;
	--rand: #818389;
	--karo: rgb(37 39 42 / 22%);
}

body.papier-blaupause {
  --papier: #0d2f5c;
  --flaeche: #163f74;
  --tinte: #f4f8ff;
  --tinte-hell: #b7cbe8;
  --tinte-schwach: rgba(244, 248, 255, 0.5);
  --karo: rgba(244, 248, 255, 0.18);
  --rand: #3a6ea8;
}

body.papier-millimeterpapier {
  --papier: #fcfcfc;
  --flaeche: #fcfcfc;
  --tinte: #7a3712;
  --tinte-hell: #a5673a;
  --tinte-schwach: rgba(122, 55, 18, 0.5);
  --karo: #ff7e2980;
  --rand: #e0b78d;
  background-image:
    linear-gradient(#ffc29a 1px, transparent 1px),
    linear-gradient(90deg, #ffc29a 1px, transparent 1px),
    linear-gradient(var(--karo) 1px, transparent 1px),
    linear-gradient(90deg, var(--karo) 1px, transparent 1px);
  background-size: 5px 5px, 5px 5px, 25px 25px, 25px 25px;
}


* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--tinte);
  background-color: var(--papier);
  background-image:
    linear-gradient(var(--karo) 1px, transparent 1px),
    linear-gradient(90deg, var(--karo) 1px, transparent 1px);
  background-size: 24px 24px;
  min-height: 100vh;
}
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
h1, h2, h3 {
  font-family: "Caveat","Architects Daughter", "Comic Sans MS", cursive;
  letter-spacing: 0.5px;
  margin: 0.4em 0;
}
h1 { font-size: 2rem; }
h1 a { color: inherit; text-decoration: none; }
.untertitel { color: var(--tinte-hell); margin-top: -8px; }
.karte {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 6px;
  box-shadow: 2px 3px 0 rgba(36, 48, 63, 0.08);
  padding: 16px;
  margin: 14px 0;
}

a {color:var(--tinte)}
a:visited{color:var(--tinte)}

label { display: block; font-weight: 600; margin: 10px 0 4px; }
input[type=text], input[type=number], select {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--rand);
  border-radius: 4px;
  background: var(--flaeche); 
  width: 100%;
  max-width: 340px;
  color: var(--tinte);
}
 input[type=password]{
    border: 1px solid var(--rand);
    border-radius: 4px;
    background: var(--flaeche);
}

input[type=checkbox] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--tinte);
  border-radius: 3px;
  background: var(--flaeche);
  display: inline-block;
  position: relative;
  cursor: pointer;
  vertical-align: middle;
  margin: 0;
}
input[type=checkbox]:checked {
  background: var(--tinte);
}
input[type=checkbox]:checked::after {
  content: '';
  position: absolute;
  left: 5px; top: 1px;
  width: 5px; height: 9px;
  border: solid var(--flaeche);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
input[type=checkbox]:focus-visible {
  outline: 3px solid #7aa7e8; outline-offset: 2px;
}
button, .knopf {
  font: inherit;
  font-weight: 600;
  padding: 9px 16px;
  border: 1.5px solid var(--tinte);
  border-radius: 4px;
  background: var(--flaeche);
  color: var(--tinte);
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(36, 48, 63, 0.25);
  text-decoration: none;
  display: inline-block;
}
button:hover, .knopf:hover { background: color-mix(in srgb, var(--tinte) 6%, var(--flaeche)); }
button:active, .knopf:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 rgba(36,48,63,.25); }
button.primaer, .knopf.primaer { background: var(--stift-blau); border-color: var(--stift-blau); color: #fff; }
button.primaer:hover, .knopf.primaer:hover { background: #1a44be; }
#papiersorte{max-width: 120px;}

/* für unterschiedlich welligen Verlauf, einfach die Koordinaten in d ein wenig verschieben*/
/*d-Attribut: "M x,y" setzt den Startpunkt, "C k1x,k1y k2x,k2y ex,ey" zeichnet
je eine Kurve bis zum Endpunkt (ex,ey), gezogen von zwei Kontrollpunkten.
Für andere Welligkeit einfach die y-Werte der Kontrollpunkte leicht ändern. */
.trennlinie {
  display: block;
  width: 100%;
  height: 12px;
  margin: 10px 0;
}

.erstellt-box {
  border: 1.5px dashed var(--stift-blau);
  background: color-mix(in srgb, var(--stift-blau) 12%, var(--flaeche));
  border-radius: 6px;
  padding: 12px 14px;
  margin-top: 14px;
}

.vorschau-reihe {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
  margin-top: 10px;
}
.vorschau-reihe canvas.brett {
  flex: 0 1 420px;
  touch-action: auto;
}
.vorschau-reihe #bestenliste {
  flex: 1 1 260px;
  min-width: 0;
  max-height: 300px;
  overflow-y: auto;
}


.kopfzeile { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.kopfzeile button { padding: 5px 10px; font-size: 0.85rem; }
.kopfzeile button:nth-child(1) {margin-right:2px}


button:disabled { opacity: 0.45; cursor: not-allowed; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid #7aa7e8; outline-offset: 2px;
}
.reihe { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.fehler { color: var(--stift-rot); font-weight: 600; }
.hinweis { color: var(--tinte-hell); font-size: 0.92rem; }
.code-anzeige {
  font-family: ui-monospace, "Courier New", monospace;
  font-size: 1.5rem;
  letter-spacing: 4px;
  background: var(--flaeche);
  border: 1.5px dashed var(--tinte);
  padding: 8px 14px;
  border-radius: 4px;
  display: inline-block;
}
canvas.brett {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1.5px solid var(--tinte);
  border-radius: 4px;
  background: var(--papier);
  touch-action: none;
}

#spielerfelder {margin: 10px 0px}
.spieler-chip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--rand); border-radius: 999px;
  padding: 5px 12px; background: var(--flaeche); margin: 3px 4px 3px 0;
}
.spieler-chip .punkt { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
.spieler-chip.dran { border: 2px solid var(--tinte); font-weight: 700; }
.spieler-chip.ich { background: color-mix(in srgb, var(--stift-blau) 10%, var(--flaeche)); }

.spieler-chip .bot-stil-knopf {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; padding: 2px; margin-left: 2px;
  cursor: pointer; color: inherit; line-height: 0; box-shadow: 1px 1px 0 rgba(36, 48, 63, 0.25);
}
.spieler-chip .bot-stil-knopf:hover { opacity: 0.65; }

#chips, #wiedChips {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

table.legende td { padding: 3px 8px; }

.modal-hintergrund {
  position: fixed;
  inset: 0;
  background: rgba(36, 48, 63, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}
.modal-karte {
  max-width: 420px;
  width: 100%;
  margin: 0;
  box-shadow: 2px 2px 0 rgb(36, 48, 63, 0.25);
  background: var(--flaeche);
}
.lupe {
  position: fixed;
  border: 1.5px solid var(--tinte);
  border-radius: 8px;
  background: var(--flaeche);
  box-shadow: 0 4px 14px rgba(0,0,0,0.28);
  z-index: 200;
  touch-action: none;
}

.verlaufEntfernen {
  color: var(--stift-rot);
  text-decoration: none;
  font-weight: 700;
}
.verlaufEntfernen:hover { text-decoration: none; }

.rang-medaille {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 11px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

.rang-medaille.rang-1 {
  background: radial-gradient(circle at 35% 30%, #fff3b0, #ffd700 50%, #b8940a 100%);
  color: #4a3800;
  border: 1.5px solid #b8940a;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.7), 0 1px 2px rgba(0,0,0,0.15);
}

.rang-medaille.rang-2 {
  background: radial-gradient(circle at 35% 30%, #f5f5f5, #c0c0c0 50%, #9a9a9a 100%);
  color: #333;
  border: 1.5px solid #9a9a9a;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.7), 0 1px 2px rgba(0,0,0,0.15);
}

.rang-medaille.rang-3 {
  background: radial-gradient(circle at 35% 30%, #e8b787, #cd7f32 50%, #9c5f1f 100%);
  color: #3d2711;
  border: 1.5px solid #9c5f1f;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.5), 0 1px 2px rgba(0,0,0,0.15);
}

.rang-medaille.rang-sonstige {
  background: radial-gradient(circle at 35% 30%, #e8f5c0, #cde487 50%, #a8c85a 100%);
  color: #4a5c1f;
  border: 1.5px solid #a8c85a;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.6), 0 1px 2px rgba(0,0,0,0.15);
}

/*Fahrstiltabelle*/
.fahrstiltabelle{
	margin: 4px 0 20px 0;
    font-family: 'Caveat';
    font-size: 24px;
}
.fahrstiltabelle td:nth-child(2) {text-align: right;}
.fahrstiltabelle td:nth-child(3) {font-size: 16px; padding-left: 0px}
div.karte.modal-karte:has(.legende.fahrstiltabelle) {
    background-image: linear-gradient(var(--karo) 1px, transparent 1px),
    linear-gradient(90deg, var(--karo) 1px, transparent 1px);
    background-size: 19px 19px;
    background-origin: content-box;
	padding:16px;
}

.fahrerstil-ueberschrift{
	font-size: 36px;
	margin: 3px 0px 32px;
	font-family: 'Caveat';
}
.netzdiagramm-beschriftung{
	font-family: 'Caveat';
	font-size: 22px;
	fill: var(--tinte);
}





#botInfoOeffnen{font-size: 12px;}
.farbfeld { width: 22px; height: 16px; display: inline-block; border: 1px solid #999; vertical-align: middle; }

.mobil-anzeigen { display: none; }

/* Mobil */
@media (max-width: 640px) {
  main { padding: 10px; }
  h1 { font-size: 1.5rem; }
  .karte { padding: 12px; }
  .code-anzeige { font-size: 1.15rem; letter-spacing: 2px; padding: 6px 10px; }
  button, .knopf { padding: 9px 12px; }
  .spieler-chip { font-size: 0.85rem; padding: 4px 9px; }
  .mobil-ausblenden {display: none}
  .mobil-anzeigen { display: inline; }
  .vorschau-reihe #bestenliste { max-height: 200px; }
}

@media (max-width: 640px) {

}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

