/*
 * Klicker-Konfigurator — Kundenansicht
 * Design-Tokens 1:1 aus littleplott.de (frontend/static/style.css):
 * Mintgrün · Weiß · Schwarz, Nunito · Inter, Polka-Dots.
 * Schriften liegen lokal unter /static/fonts (keine Google-Fonts-Anfrage).
 */

/* ------------------------------------------------------------- Schriften */
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/static/fonts/nunito-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/static/fonts/nunito-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 800; font-display: swap;
  src: url('/static/fonts/nunito-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 900; font-display: swap;
  src: url('/static/fonts/nunito-latin-900-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/static/fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/static/fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/static/fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/static/fonts/inter-latin-700-normal.woff2') format('woff2'); }

/* ---------------------------------------------------------------- Tokens */
:root {
  --mint:        #7ECBC4;
  --mint-light:  #A8DDD8;
  --mint-soft:   #E4F5F3;
  --mint-deep:   #4FA9A1;
  --mint-xdeep:  #35857E;

  --ink:         #1A1A1A;
  --ink-muted:   #555555;
  --ink-soft:    #909090;
  --bg:          #F7FAFA;
  --bg-warm:     #EEF8F7;
  --card:        #FFFFFF;
  --line:        #D9EEEC;
  --line-soft:   #EAF6F5;

  --success:     #2E7D5A;
  --success-bg:  #E4F2EC;
  --error:       #C0392B;
  --error-bg:    #FBECEA;
  --warning:     #D68910;
  --warning-bg:  #FEF9E7;

  --shadow-sm: 0 2px 8px rgba(78,169,161,.09);
  --shadow-md: 0 6px 24px rgba(78,169,161,.13);
  --shadow-lg: 0 16px 48px rgba(78,169,161,.16);

  --r-sm: 8px; --r: 16px; --r-md: 20px; --r-lg: 28px; --r-full: 9999px;
  --font-display: 'Nunito', 'Trebuchet MS', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg); color: var(--ink);
  line-height: 1.65; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
/* Polka-Dot-Textur wie im Shop */
body::before {
  content: ""; position: fixed; inset: 0;
  background-image: radial-gradient(circle, rgba(126,203,196,.18) 1px, transparent 1px);
  background-size: 28px 28px; pointer-events: none; z-index: 0;
}
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -.01em; }
a { color: var(--mint-deep); text-decoration: none; transition: color .15s; }
a:hover { color: var(--mint-xdeep); }

/* ---------------------------------------------------------------- Header */
.kopf {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 24px;
}
.marke {
  font-family: var(--font-display); font-weight: 900; font-size: 1.3rem;
  letter-spacing: -.02em; color: var(--ink); line-height: 1;
}
.marke span { color: var(--mint-deep); }
.kopf .zurueck {
  font-size: .9rem; font-weight: 600; color: var(--ink-muted);
  border: 1px solid var(--line); border-radius: var(--r-full); padding: 7px 15px;
}
.kopf .zurueck:hover { background: var(--mint-soft); color: var(--mint-xdeep); }

/* ---------------------------------------------------------------- Layout */
.buehne-layout {
  position: relative; z-index: 1;
  display: grid; gap: 24px; padding: 24px;
  grid-template-columns: minmax(320px, 1.05fr) minmax(320px, .95fr);
  max-width: 1280px; margin: 0 auto; align-items: start;
}
@media (max-width: 900px) { .buehne-layout { grid-template-columns: 1fr; padding: 16px; } }

/* ------------------------------------------------------------ 3D-Ansicht */
.ansicht {
  background: linear-gradient(165deg, #ffffff 0%, var(--bg-warm) 100%);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 14px; position: sticky; top: 86px;
}
@media (max-width: 900px) { .ansicht { position: static; } }
#buehne {
  width: 100%; aspect-ratio: 4 / 3; display: block; touch-action: none;
  border-radius: var(--r-md); cursor: grab;
}
#buehne:active { cursor: grabbing; }
.kein-webgl #buehne { display: none; }
.fallback { display: none; }
.kein-webgl .fallback { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; }
.fb-koerper {
  display: flex; gap: 6px; padding: 12px; border-radius: 16px;
  box-shadow: var(--shadow-lg); max-width: 92%; flex-wrap: wrap;
}
.fb-stein {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 900;
  box-shadow: inset 0 -3px 8px rgba(0,0,0,.16);
}
.webgl-hinweis { font-size: .8rem; color: var(--ink-muted); margin: 8px 6px 0; }
.ansicht-leiste {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  margin-top: 12px; font-size: .82rem; color: var(--ink-muted);
}
.schalter { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.tipp { margin-left: auto; color: var(--ink-soft); }
@media (max-width: 560px) { .tipp { margin-left: 0; } }

/* --------------------------------------------------------------- Auswahl */
.auswahl h1 { font-size: 1.85rem; font-weight: 900; margin-bottom: 6px; }
.intro { color: var(--ink-muted); margin-bottom: 20px; }
.geteilt {
  background: var(--success-bg); border: 1px solid #bfe0d1; color: var(--success);
  padding: 10px 14px; border-radius: var(--r-sm); font-size: .9rem; margin-bottom: 14px;
}

.block {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-sm); padding: 16px 18px; margin-bottom: 16px;
}
.block h2 {
  font-size: 1.05rem; font-weight: 800; margin-bottom: 12px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.gewaehlt {
  font-family: var(--font-body); font-size: .82rem; font-weight: 600; color: var(--ink-muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.punkt {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,.12); display: inline-block;
}

/* Farbauswahl: nur Kreise. Der Name der gewählten Farbe steht in der Überschrift. */
.farben { display: flex; flex-wrap: wrap; gap: 10px; }
.farbe {
  position: relative; width: 34px; height: 34px; padding: 0;
  border-radius: 50%; border: 2px solid #fff; cursor: pointer;
  background: var(--farbe, #ccc);
  box-shadow: 0 0 0 1px rgba(0,0,0,.14), inset 0 -3px 6px rgba(0,0,0,.18);
  transition: transform .1s, box-shadow .15s;
}
.farbe:hover { transform: translateY(-2px) scale(1.06); }
.farbe.aktiv {
  box-shadow: 0 0 0 2px var(--mint-deep), 0 0 0 5px rgba(126,203,196,.35),
              inset 0 -3px 6px rgba(0,0,0,.18);
  transform: scale(1.06);
}
/* Farben mit Aufpreis bekommen einen kleinen Punkt */
.farbe.mit-aufpreis::after {
  content: ""; position: absolute; right: -1px; bottom: -1px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--warning); border: 1.5px solid #fff;
}

.zeichen { margin-top: 16px; }
.zeichen h4 {
  font-family: var(--font-body); font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft);
  margin: 14px 0 8px;
}
.zeichen-grid { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); }
.zeichen-btn {
  border: 1.5px solid var(--line); background: #fff; border-radius: var(--r-sm);
  padding: 9px 0; font-family: var(--font-display); font-size: 1.15rem; font-weight: 900;
  color: var(--ink); cursor: pointer; line-height: 1.1; transition: border-color .15s, background .15s;
}
.zeichen-btn:hover { border-color: var(--mint); }
.zeichen-btn.aktiv {
  border-color: var(--mint-deep); background: var(--mint-soft);
  box-shadow: 0 0 0 3px rgba(126,203,196,.3);
}

/* ------------------------------------------------------------- Abschluss */
.abschluss {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-md); padding: 18px;
}
.preis-zeile { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.preis { font-family: var(--font-display); font-size: 1.9rem; font-weight: 900; line-height: 1.1; }
.preis-klein { font-size: .8rem; color: var(--ink-muted); }
.preis-label { font-size: .75rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; }
.menge { font-size: .8rem; color: var(--ink-muted); display: flex; flex-direction: column; gap: 4px; }
.menge input {
  width: 84px; border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 8px 10px; font: inherit; font-size: .95rem; text-align: center;
}
.warnung {
  background: var(--error-bg); border: 1px solid #f0c8c2; color: var(--error);
  padding: 10px 13px; border-radius: var(--r-sm); font-size: .87rem; margin-bottom: 12px;
}

.btn {
  border: 0; border-radius: var(--r-full); padding: 11px 20px; font-family: var(--font-body);
  font-size: .92rem; font-weight: 700; background: var(--mint-deep); color: #fff;
  cursor: pointer; transition: background .15s, transform .1s, box-shadow .15s;
}
.btn:hover:not(:disabled) { background: var(--mint-xdeep); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.gross { width: 100%; margin-top: 16px; font-size: 1rem; padding: 15px; }
.btn.ghost { background: var(--mint-soft); color: var(--mint-xdeep); }
.btn.ghost:hover { background: var(--mint-light); color: var(--ink); }
.btn.klein { padding: 6px 13px; font-size: .8rem; }
.abschluss .btn.ghost { width: 100%; margin-top: 8px; }
.teilen-ergebnis { margin-top: 10px; display: flex; gap: 6px; font-size: .82rem; }
.teilen-ergebnis input {
  flex: 1; border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 9px; font: inherit; font-size: .8rem;
}
.lieferhinweis { font-size: .82rem; color: var(--ink-muted); margin-top: 14px; }
.hinweis { font-size: .87rem; color: var(--ink-muted); }
.muted { color: var(--ink-muted); font-size: .82rem; }
.muted.klein { font-size: .78rem; margin: -4px 0 8px; }
.block h3 {
  font-size: .95rem; font-weight: 800; margin: 16px 0 8px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

/* ------------------------------------------------- Leiste (Dein Wort) */
.leiste-rahmen {
  background: var(--mint-soft); border: 2px dashed var(--mint);
  border-radius: var(--r); padding: 10px; transition: background .15s, border-color .15s;
}
.leiste {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-height: 62px;
}
.leiste.ziel-aktiv, .leiste-rahmen:has(.leiste.ziel-aktiv) {
  background: #d4efe9; border-color: var(--mint-deep);
}
.stein-chip {
  position: relative; cursor: grab; user-select: none; touch-action: none;
  border-radius: 14px; padding: 3px; border: 2px solid transparent;
  transition: transform .1s, border-color .15s;
}
.stein-chip:hover { transform: translateY(-2px); }
.stein-chip.aktiv { border-color: var(--mint-deep); box-shadow: 0 0 0 3px rgba(126,203,196,.3); }
.stein-chip.wird-gezogen { opacity: .35; }
.stein-bild {
  display: flex; align-items: center; justify-content: center;
  width: 50px; height: 50px; border-radius: 12px;
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 900; line-height: 1;
  box-shadow: inset 0 -3px 7px rgba(0,0,0,.18), var(--shadow-sm);
}
.stein-chip .weg {
  position: absolute; top: -7px; right: -7px; width: 22px; height: 22px;
  border: 2px solid #fff; border-radius: 50%; background: var(--ink); color: #fff;
  font-size: 13px; line-height: 1; cursor: pointer; padding: 0;
  opacity: .55; transition: opacity .15s, transform .1s; touch-action: manipulation;
}
.stein-chip:hover .weg, .stein-chip.aktiv .weg { opacity: 1; }
.stein-chip .weg:hover { transform: scale(1.15); }
.eigen-punkt {
  position: absolute; bottom: 1px; left: 4px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--mint-deep);
}
.leer-platz {
  flex: 1; min-width: 130px; min-height: 50px; border-radius: 12px;
  border: 2px dashed var(--mint); display: flex; align-items: center;
  justify-content: center; color: var(--mint-xdeep); font-size: .82rem;
  background: rgba(255,255,255,.5);
}
.leiste-aktionen {
  display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap;
}

/* Geltungsbereich der Farben */
.bereich-wahl {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  font-size: .85rem; margin-bottom: 4px;
}
.bereich-wahl label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.bereich-wahl input:disabled + span { opacity: .5; }

/* Ziehen: Schwebendes Abbild */
.drag-ghost {
  position: fixed; left: 0; top: 0; z-index: 999; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px; background: var(--card); color: var(--ink);
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 900;
  box-shadow: var(--shadow-lg); border: 2px solid var(--mint-deep);
}
body.zieht-gerade { cursor: grabbing; user-select: none; }
.zeichen-btn { touch-action: none; }

/* Testbetrieb */
.test-fahne {
  background: var(--warning-bg); color: var(--warning); border: 1px solid #f0dfae;
  border-radius: var(--r-full); padding: 3px 12px; font-size: .74rem; font-weight: 700;
}
.sperre { display: flex; justify-content: center; padding: 8vh 20px; position: relative; z-index: 1; }
.sperre-box {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-md); padding: 28px; max-width: 420px; width: 100%;
}
.sperre-box h1 { font-size: 1.5rem; font-weight: 900; margin-bottom: 8px; }
.sperre-box p { color: var(--ink-muted); font-size: .92rem; }
.sperre-box label { display: block; margin: 18px 0 6px; font-size: .82rem; color: var(--ink-muted); }
.sperre-box input {
  width: 100%; border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 11px; font: inherit;
}
