/* Weinduell: Pflaume gegen Petrol */

:root {
  --grund: #ECEEE9;
  --flaeche: #F8F9F6;
  --tinte: #1E2624;
  --leise: #5B6662;
  --linie: #D2D8D1;
  --fokus: #2F6F8F;
  --links: #5E3366;
  --links-hell: #EFE6F1;
  --rechts: #1F5F73;
  --rechts-hell: #E0EDF1;
  --gut: #3E7A4F;
  --schlecht: #9B2C2C;
  --stern: #B08A2E;
  /* Schriften wie im Kellerbuch: nur Systemschriften, nichts wird nachgeladen */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --grund: #181D1C; --flaeche: #212826; --tinte: #E5EAE7; --leise: #9BA6A1; --linie: #34413D; --fokus: #7FB8D4;
    --links: #C6A0D0; --links-hell: #33263A; --rechts: #7CBACB; --rechts-hell: #1C2E35;
    --gut: #7CC08E; --schlecht: #E08484; --stern: #D9B65E;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --grund: #181D1C; --flaeche: #212826; --tinte: #E5EAE7; --leise: #9BA6A1; --linie: #34413D; --fokus: #7FB8D4;
  --links: #C6A0D0; --links-hell: #33263A; --rechts: #7CBACB; --rechts-hell: #1C2E35;
  --gut: #7CC08E; --schlecht: #E08484; --stern: #D9B65E;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--grund); color: var(--tinte); font: 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0; }
p { margin: 0 0 .8em; }
:focus-visible { outline: 2px solid var(--fokus); outline-offset: 2px; }
.huelle { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.hinweis { color: var(--leise); font-size: .88rem; }

/* Kopf */
.band { height: 6px; background: linear-gradient(90deg, var(--links) 50%, var(--rechts) 50%); }
.kopf { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; flex-wrap: wrap; }
.marke { font-family: var(--serif); font-size: 2rem; font-weight: 600; letter-spacing: -.01em; line-height: 1; text-decoration: none; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: .92rem; }
.nav a, .nav span { padding: 6px 10px; border-radius: 8px; text-decoration: none; }
.nav a:hover { background: var(--flaeche); }
.nav .ich { color: var(--leise); }

/* Arena: die zweigeteilte Startseite */
.arena-kopf { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 24px; padding: 28px 0 22px; border-bottom: 1px solid var(--linie); }
.teamname { font-size: clamp(1.6rem, 3.2vw, 2.6rem); }
.teamname.links { color: var(--links); }
.teamname.rechts { color: var(--rechts); }
.arena-kopf .rechts-text { text-align: right; }
.mitglieder { color: var(--leise); font-size: .88rem; margin: 4px 0 0; }
.stand { text-align: center; }
.stand-zahl { font-family: var(--serif); font-size: clamp(2.6rem, 6vw, 4.2rem); line-height: 1; font-weight: 600; font-variant-numeric: lining-nums; display: flex; gap: .25em; justify-content: center; align-items: baseline; }
.stand-zahl .l { color: var(--links); }
.stand-zahl .r { color: var(--rechts); }
.stand-zahl .trenner { color: var(--leise); font-size: .7em; }
.stand-text { font-size: .82rem; color: var(--leise); margin-top: 6px; }

.filterbox { padding: 10px 0 14px; }
.filterbox summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: .9rem; color: var(--leise); padding: 4px 0; border-radius: 6px; }
.filterbox summary::-webkit-details-marker { display: none; }
.filterbox summary::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); }
.filterbox[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.filterbox summary:hover { color: var(--tinte); }
.filterbox .aktiv-text { color: var(--tinte); }
.filterleiste { display: flex; flex-wrap: wrap; gap: 10px 32px; padding: 12px 0 2px; }
.filter-zurueck { font-size: .88rem; color: var(--leise); align-self: center; }
.filter { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.filter-titel { font-size: .85rem; font-weight: 600; color: var(--leise); margin-right: 4px; }
.filter a { padding: 5px 12px; border: 1px solid var(--linie); border-radius: 999px; text-decoration: none; font-size: .88rem; color: var(--leise); }
.filter a:hover { color: var(--tinte); border-color: var(--leise); }
.filter a[aria-current="true"] { background: var(--flaeche); color: var(--tinte); border-color: var(--tinte); font-weight: 600; }

.umschalter { display: none; }
.arena { display: grid; grid-template-columns: 1fr 1fr; padding-bottom: 56px; }
.seite { padding: 6px 28px 0 0; min-width: 0; }
.seite.rechts { padding: 6px 0 0 28px; border-left: 1px solid var(--linie); }
.seite-kopf { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; min-height: 40px; }
.seite-kopf p { margin: 0; color: var(--leise); font-size: .92rem; }
.liste { display: grid; gap: 12px; }
.leer-hinweis { padding: 28px 20px; border: 1px dashed var(--linie); border-radius: 10px; color: var(--leise); text-align: center; }

/* Weinkarte */
.karte { display: block; position: relative; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; padding: 16px 18px; text-decoration: none; }
.karte-link { color: inherit; text-decoration: none; }
.karte-link::after { content: ""; position: absolute; inset: 0; border-radius: 10px; }
.karte-link:focus-visible { outline: none; }
.karte:has(.karte-link:focus-visible) { outline: 2px solid var(--fokus); outline-offset: 2px; }
.shop-hinweis a { position: relative; z-index: 1; color: var(--leise); text-decoration: underline; text-decoration-color: var(--linie); text-underline-offset: 3px; }
.shop-hinweis a:hover { color: var(--tinte); text-decoration-color: var(--tinte); }
.seite.links .karte { border-left: 4px solid var(--links); }
.seite.rechts .karte { border-left: 4px solid var(--rechts); }
.karte:hover { border-color: var(--leise); }
.seite.links .karte:hover { border-left-color: var(--links); }
.seite.rechts .karte:hover { border-left-color: var(--rechts); }
.karte.ist-abgelehnt { opacity: .62; }
.karte-oben { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.karte h3 { font-size: 1.2rem; }
.weingut { color: var(--leise); font-size: .93rem; margin-top: 2px; }
.fakten { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .88rem; margin: 10px 0 0; padding: 0; list-style: none; }
.farbe { display: inline-flex; align-items: center; gap: 6px; }
.farbe::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--punkt, #888); box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); }
.farbe-rot { --punkt: #7A1E33; }
.farbe-weiss { --punkt: #D9C766; }
.farbe-rose { --punkt: #E59BA6; }
.farbe-schaum { --punkt: #C9D6A0; }
.farbe-suess { --punkt: #B9762D; }
.karte-unten { display: flex; justify-content: space-between; align-items: center; gap: 6px 10px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--linie); font-size: .86rem; color: var(--leise); }
.status { font-size: .78rem; padding: 2px 9px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.status-offen { color: var(--leise); }
.status-angenommen { color: var(--gut); }
.status-abgelehnt { color: var(--schlecht); }
.sterne { color: var(--stern); letter-spacing: 1px; white-space: nowrap; }
.sterne.leer { color: var(--leise); letter-spacing: 0; }

/* Knöpfe und Formulare */
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: .92rem; font-weight: 600; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--tinte); background: var(--tinte); color: var(--grund); cursor: pointer; text-decoration: none; white-space: nowrap; }
.knopf:hover { filter: brightness(1.12); }
.knopf.zweit { background: transparent; color: var(--tinte); border-color: var(--linie); }
.knopf.zweit:hover { border-color: var(--tinte); filter: none; }
.knopf.links { background: var(--links); border-color: var(--links); color: #fff; }
.knopf.rechts { background: var(--rechts); border-color: var(--rechts); color: #fff; }
.knopf.gut { background: var(--gut); border-color: var(--gut); color: #fff; }
.knopf.schlecht { background: transparent; border-color: var(--schlecht); color: var(--schlecht); }
.knopf.klein { padding: 5px 10px; font-size: .85rem; }
:root[data-theme="dark"] .knopf.links, :root[data-theme="dark"] .knopf.rechts, :root[data-theme="dark"] .knopf.gut { color: #1B1214; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .knopf.links, :root:not([data-theme="light"]) .knopf.rechts, :root:not([data-theme="light"]) .knopf.gut { color: #1B1214; } }

.feld { display: grid; gap: 5px; margin-bottom: 14px; }
.feld > label, .feld > .beschriftung { font-size: .88rem; font-weight: 600; }
input[type="text"], input[type="password"], input[type="number"], select, textarea {
  font: inherit; padding: 9px 11px; border: 1px solid var(--linie); border-radius: 8px; background: var(--flaeche); color: var(--tinte); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--tinte); outline-offset: 0; border-color: var(--tinte); }
textarea { min-height: 120px; resize: vertical; }
.raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.feld .fehler-text { color: var(--schlecht); font-size: .85rem; }
.knopfreihe { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.sterne-wahl { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.sterne-wahl input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sterne-wahl label { font-size: 1.8rem; line-height: 1; color: var(--linie); cursor: pointer; padding: 0 1px; }
.sterne-wahl input:checked ~ label, .sterne-wahl label:hover, .sterne-wahl label:hover ~ label { color: var(--stern); }
.sterne-wahl input:focus-visible + label { outline: 2px solid var(--tinte); border-radius: 4px; }

/* Meldungen */
.meldung { padding: 10px 14px; border-radius: 8px; margin: 6px 0 10px; background: var(--rechts-hell); }
.meldung.fehler { background: var(--links-hell); }

/* Einzelseiten */
.schmal { max-width: 720px; margin: 28px auto 64px; }
.schmal h1 { font-size: 2rem; margin-bottom: 16px; }
.tafel { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; padding: 20px; }
.tafel + .tafel { margin-top: 16px; }
.tafel h2 { font-size: 1.25rem; margin-bottom: 10px; }
.zurueck { display: inline-block; margin-top: 20px; color: var(--leise); font-size: .9rem; text-decoration: none; }
.zurueck:hover { color: var(--tinte); }

.detail { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 36px; padding: 18px 0 64px; }
.teamchip { display: inline-block; font-size: .8rem; padding: 2px 10px; border-radius: 999px; color: #fff; background: var(--links); margin-bottom: 12px; }
.teamchip.rechts { background: var(--rechts); }
:root[data-theme="dark"] .teamchip { color: #1B1214; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .teamchip { color: #1B1214; } }
.detail h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
.detail .weingut { font-size: 1.05rem; margin: 6px 0 20px; }
.steckbrief { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0 0 24px; padding: 16px 0; border-top: 1px solid var(--linie); border-bottom: 1px solid var(--linie); }
.steckbrief dt { color: var(--leise); font-size: .9rem; }
.steckbrief dd { margin: 0; }
.shoplink { color: var(--tinte); text-decoration-color: var(--leise); text-underline-offset: 3px; overflow-wrap: anywhere; }
.shoplink:hover { text-decoration-color: var(--tinte); }
.shop-hinweis { color: var(--leise); }
.zwischen { font-size: 1.25rem; margin: 0 0 8px; }
.text { max-width: 68ch; white-space: pre-line; }
.eigene { display: flex; gap: 10px; align-items: center; margin: 18px 0 24px; color: var(--leise); font-size: .95rem; }
.entscheidung-stand { font-size: 1.05rem; margin-bottom: 10px; }
.entscheidung-stand.angenommen { color: var(--gut); }
.entscheidung-stand.abgelehnt { color: var(--schlecht); }
.begruendung { border-left: 3px solid var(--linie); padding-left: 12px; color: var(--leise); }
.schnitt { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.schnitt .zahl { font-family: var(--serif); font-size: 2rem; }
.bewertung { padding: 12px 0; border-top: 1px solid var(--linie); }
.bewertung-kopf { display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; }
.bewertung p { margin: 6px 0 0; white-space: pre-line; }
.trennlinie { border: 0; border-top: 1px solid var(--linie); margin: 18px 0; }

/* Verwaltung */
.tabelle-huelle { overflow-x: auto; }
.tabelle { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabelle th, .tabelle td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--linie); vertical-align: middle; }
.tabelle th { color: var(--leise); font-weight: 600; font-size: .85rem; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline select { width: auto; }
.inline label { font-size: .88rem; display: inline-flex; gap: 5px; align-items: center; }
.ohne-team { color: var(--schlecht); font-weight: 600; }

@media (max-width: 820px) {
  .arena-kopf { grid-template-columns: 1fr 1fr; gap: 14px; padding-top: 18px; }
  .stand { grid-column: 1 / -1; order: -1; }
  .umschalter { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 0 14px; }
  .umschalter button { font: inherit; font-weight: 600; padding: 9px; border-radius: 8px; border: 1px solid var(--linie); background: var(--flaeche); color: var(--tinte); cursor: pointer; }
  .umschalter button.links[aria-pressed="true"] { background: var(--links); border-color: var(--links); color: #fff; }
  .umschalter button.rechts[aria-pressed="true"] { background: var(--rechts); border-color: var(--rechts); color: #fff; }
  .arena { grid-template-columns: 1fr; }
  .seite, .seite.rechts { padding: 0; border: 0; }
  .arena[data-aktiv="links"] .seite.rechts, .arena[data-aktiv="rechts"] .seite.links { display: none; }
  .detail { grid-template-columns: 1fr; gap: 24px; }
  .raster { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
