/* Bierkalender – Etikett-Optik: Flaschengrün, Malzbraun, Bernstein */
:root {
  --ink: #2E1F14;
  --ink-soft: #6B5844;
  --bg: #E7EBE0;
  --paper: #FFFDF8;
  --amber: #C77D14;
  --amber-deep: #8F560A;
  --amber-pale: #F7E4BE;
  --hop: #1F4A33;
  --hop-pale: #D7E5D3;
  --danger: #A3362A;
  --line: #CDC6B4;
  --font-head: "Zilla Slab", Rockwell, "Roboto Slab", Georgia, serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 var(--font-body);
}
img { max-width: 100%; display: block; }
a { color: var(--hop); text-underline-offset: .18em; }
a:hover { color: var(--amber-deep); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: 2.3rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.45rem; font-weight: 700; margin-top: 1.6em; }
.h-sub { font-size: 1.15rem; }
small { color: var(--ink-soft); font-size: .85em; }
.lead { font-size: 1.1rem; color: var(--ink-soft); max-width: 62ch; }
.hint { color: var(--ink-soft); font-size: .92rem; max-width: 70ch; }
.muted { color: var(--ink-soft); }
.strong { font-weight: 700; }

/* Kopf */
.site-header { background: var(--hop); color: #F3F1E7; border-bottom: 4px solid var(--amber); }
.site-header__inner {
  max-width: 1180px; margin: 0 auto; padding: .7rem 1.25rem;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1.5rem;
}
.brand { display: flex; align-items: center; gap: .55rem; color: inherit; text-decoration: none; font: 700 1.5rem var(--font-head); }
.brand:hover { color: var(--amber-pale); }
.brand__cap { width: 34px; height: 34px; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1.2rem; }
.site-nav a, .site-nav .linklike { color: #F3F1E7; text-decoration: none; font-size: .98rem; }
.site-nav a:hover, .site-nav .linklike:hover { color: var(--amber-pale); text-decoration: underline; }

.page { max-width: 1180px; margin: 0 auto; padding: 1.8rem 1.25rem 4rem; }
.narrow { max-width: 30rem; }
.narrow--wide { max-width: 44rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.page-head h1 { margin-bottom: 0; }
.crumb { margin: 0 0 .3rem; font-size: .95rem; }

/* Formulare */
form.inline { display: inline; margin: 0; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
label { display: flex; flex-direction: column; gap: .3rem; font-weight: 700; }
label small { font-weight: 400; }
label.check { flex-direction: row; align-items: baseline; gap: .55rem; font-weight: 400; }
input, select, textarea {
  font: inherit; color: inherit; background: var(--paper);
  border: 1.5px solid var(--line); border-radius: 6px; padding: .55rem .7rem; width: 100%;
}
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--hop); }
input:focus, select:focus, textarea:focus { border-color: var(--amber); outline: none; box-shadow: 0 0 0 3px var(--amber-pale); }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 700; margin-bottom: .4rem; padding: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.checklist { display: flex; flex-direction: column; gap: .35rem; max-height: 22rem; overflow: auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: 700 1rem var(--font-body); color: #fff; background: var(--amber-deep);
  border: 2px solid var(--amber-deep); border-radius: 999px; padding: .6rem 1.35rem;
  text-decoration: none; cursor: pointer; align-self: flex-start;
}
.btn:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--ghost { background: transparent; color: var(--amber-deep); }
.btn--ghost:hover { background: var(--amber-pale); color: var(--ink); border-color: var(--amber-deep); }
.btn--danger { background: var(--danger); border-color: var(--danger); }
.btn:disabled { opacity: .6; cursor: progress; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--hop); cursor: pointer; text-decoration: underline; }

/* Meldungen */
.flashes { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1.4rem; }
.flash { margin: 0; padding: .7rem 1rem; border-radius: 6px; border-left: 6px solid var(--hop); background: var(--hop-pale); }
.flash--error { border-color: var(--danger); background: #F6DCD7; }
.flash--info { border-color: var(--amber); background: var(--amber-pale); }
.note { margin: 0 0 1.2rem; }
.empty { padding: 1.2rem 1.4rem; background: var(--paper); border: 2px dashed var(--line); border-radius: 10px; max-width: 60ch; }
.lock { padding: .8rem 1rem; background: var(--amber-pale); border-radius: 8px; max-width: 70ch; }

.panel { max-width: 46rem; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 1.2rem 1.4rem; }
.panel h2 { margin-top: 0; }
fieldset.panel legend { font-family: var(--font-head); font-size: 1.15rem; padding: 0 .3rem; }

/* Kronkorken – das wiederkehrende Motiv */
.cap {
  --cap: var(--amber);
  display: inline-grid; place-items: center; flex: none;
  width: 2.1em; height: 2.1em; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #F2C56B, var(--cap) 60%);
  border: .2em dotted #7A4A08;
  color: #3A2205; font: 700 .95rem/1 var(--font-head);
  box-shadow: 0 1px 0 rgba(46, 31, 20, .35);
}
.cap--big { font-size: 1.5rem; }
.door-head { display: flex; align-items: center; gap: .9rem; margin-bottom: 1.2rem; }
.door-head h1 { margin: 0; }

/* Kalenderliste */
.cal-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1.4rem; }
.cal-tile { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cal-tile:hover { border-color: var(--amber); color: var(--ink); }
.cal-tile__img { aspect-ratio: 4 / 3; background: var(--hop); display: grid; place-items: center; font-size: 3rem; overflow: hidden; }
.cal-tile__img img { width: 100%; height: 100%; object-fit: cover; }
.cal-tile__text { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .2rem; }
.cal-tile__year { font: 700 2.4rem/1 var(--font-head); color: var(--amber-deep); }
.cal-tile__name { font-weight: 700; }
.cal-tile__progress { color: var(--ink-soft); font-size: .92rem; display: flex; flex-direction: column; gap: .35rem; margin-top: .4rem; }
.bar { height: 8px; background: var(--hop-pale); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--amber); }

/* Kalender mit Türchen */
.cal-stage { position: relative; border-radius: 10px; overflow: hidden; border: 3px solid var(--hop); background: var(--hop); }
.cal-stage img { width: 100%; height: auto; user-select: none; }
.cal-photo { border-radius: 10px; border: 3px solid var(--hop); }
.door { position: absolute; display: block; border-radius: 4px; border: 2px solid transparent; transition: background-color .15s, border-color .15s; }
.door .cap { position: absolute; top: 3px; left: 3px; font-size: clamp(.55rem, 1.2vw, .9rem); }
a.door:hover, a.door:focus-visible { border-color: #fff; background: rgba(255, 253, 248, .18); }
.door--locked { background: rgba(46, 31, 20, .45); }
.door--locked .cap { --cap: #B9AE98; filter: grayscale(.6); }
.door--empty .cap { --cap: #B9AE98; }
.door--rated { background: rgba(31, 74, 51, .55); }
.door--rated .cap { --cap: #8DBF8A; }
.door--rated::after { content: "✓"; position: absolute; right: 6px; bottom: 2px; color: #fff; font: 700 clamp(1rem, 2.4vw, 1.8rem) var(--font-head); }
.door--opened { border-color: var(--amber); border-style: dashed; }
.door--available { border-color: rgba(255, 253, 248, .75); }
.door--today { border-color: var(--amber); border-width: 3px; animation: today 2.4s ease-in-out infinite; }
@keyframes today { 50% { box-shadow: 0 0 0 6px rgba(199, 125, 20, .55); } }
@media (prefers-reduced-motion: reduce) { .door--today { animation: none; } }

.day-strip { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .5rem; }
.day > a, .day > span { display: flex; flex-direction: column; gap: .2rem; height: 100%; padding: .55rem .7rem; border-radius: 8px; background: var(--paper); border: 1.5px solid var(--line); color: var(--ink); text-decoration: none; }
.day > a:hover { border-color: var(--amber); }
.day__num { font: 700 1.4rem/1 var(--font-head); }
.day__beer { font-size: .85rem; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.day--locked > a, .day--locked > span, .day--empty > span { background: transparent; border-style: dashed; color: var(--ink-soft); }
.day--rated > a, .day--rated > span { background: var(--hop-pale); border-color: var(--hop); }
.day--opened > a { background: var(--amber-pale); border-color: var(--amber); }
.day--available > a { border-color: var(--amber-deep); }
.day--today > a { box-shadow: 0 0 0 3px var(--amber); }
.legend { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; font-size: .88rem; color: var(--ink-soft); margin-top: 1rem; }
.legend__item::before { content: ""; display: inline-block; width: .9em; height: .9em; border-radius: 3px; margin-right: .4em; vertical-align: -.1em; border: 1.5px solid var(--line); background: var(--paper); }
.legend__item.day--available::before { border-color: var(--amber-deep); }
.legend__item.day--opened::before { background: var(--amber-pale); border-color: var(--amber); }
.legend__item.day--rated::before { background: var(--hop-pale); border-color: var(--hop); }
.legend__item.day--locked::before { background: transparent; border-style: dashed; }

/* Bier und Bewertung */
.beer-card { padding: 1.2rem 1.5rem; margin-bottom: 1.4rem; background: var(--hop); color: #F3F1E7; border-radius: 10px; border-left: 10px solid var(--amber); max-width: 44rem; }
.beer-card__name { font: 700 1.9rem/1.15 var(--font-head); margin: 0; }
.beer-card__meta { margin: .2rem 0 0; color: inherit; opacity: .85; }
.door-head .beer-card__meta { color: var(--ink-soft); opacity: 1; }
.score__row { display: grid; grid-template-columns: repeat(10, minmax(2.2rem, 1fr)); gap: .3rem; max-width: 34rem; }
.score__opt { position: relative; font-weight: 700; }
.score__opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.score__opt span { display: grid; place-items: center; height: 2.5rem; border-radius: 6px; border: 1.5px solid var(--line); background: var(--paper); }
.score__opt input:hover + span { border-color: var(--amber); }
.score__opt input:checked + span { background: var(--amber); border-color: var(--amber-deep); color: #2A1803; }
.score__opt input:focus-visible + span { outline: 3px solid var(--hop); outline-offset: 1px; }
@media (max-width: 30rem) { .score__row { grid-template-columns: repeat(5, 1fr); } }

.who__list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; }
.who__list li { display: flex; align-items: center; gap: .45rem; }
.pill { display: inline-block; font-size: .78rem; font-weight: 700; padding: .12rem .55rem; border-radius: 99px; background: #E3DED2; color: var(--ink-soft); }
.pill--rated { background: var(--hop); color: #fff; }
.pill--opened { background: var(--amber-pale); color: var(--amber-deep); }

/* Tabellen */
.scroll-x { overflow-x: auto; margin-bottom: 1rem; }
.table, .matrix { border-collapse: collapse; background: var(--paper); font-variant-numeric: tabular-nums; }
.table { width: 100%; }
.table th, .table td, .matrix th, .matrix td { padding: .5rem .7rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table thead th, .matrix thead th { font-size: .85rem; color: var(--ink-soft); border-bottom: 2px solid var(--ink); white-space: nowrap; }
.num { text-align: right !important; }
.table tr.is-top td { background: var(--amber-pale); }
.matrix tbody th { font-weight: 400; white-space: nowrap; }
.matrix tr.is-me th, .matrix tr.is-me td { background: #F3EEDF; }
.matrix tfoot th, .matrix tfoot td { border-top: 2px solid var(--ink); border-bottom: 0; font-weight: 700; }
.matrix--input td { padding: .3rem; }
.matrix--input input[type="number"] { width: 4.2rem; text-align: center; }
.matrix--input input:not([type]) { min-width: 14rem; }

.days { display: flex; flex-direction: column; gap: .5rem; }
.day-detail { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: .2rem 1rem; }
.day-detail[open] { padding-bottom: .8rem; }
.day-detail summary { display: flex; align-items: center; gap: .8rem; padding: .55rem 0; cursor: pointer; list-style: none; }
.day-detail summary::-webkit-details-marker { display: none; }
.day-detail__title { flex: 1; font-weight: 700; }
.day-detail__title small { font-weight: 400; display: block; }
.day-detail__score { font-variant-numeric: tabular-nums; color: var(--ink-soft); white-space: nowrap; }

.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 1rem; }
.note-item { margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.note-item img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.note-item figcaption { padding: .7rem .9rem; }

/* Verwaltung */
.subnav { display: flex; gap: .3rem; margin-bottom: 1.5rem; border-bottom: 2px solid var(--line); }
.subnav a { padding: .5rem 1rem; text-decoration: none; color: var(--ink-soft); font-weight: 700; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.subnav a[aria-current="page"] { color: var(--ink); border-color: var(--amber); }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1.4rem; align-items: start; }
.thumb { max-height: 10rem; width: auto; border-radius: 6px; border: 1px solid var(--line); }
.pager { display: flex; gap: 1rem; }
.danger-zone { margin-top: 3rem; padding: 1rem 1.2rem; border: 1.5px solid var(--danger); border-radius: 10px; max-width: 40rem; }
.danger-zone summary { cursor: pointer; font-weight: 700; color: var(--danger); }
.radio-cards { display: flex; flex-direction: column; gap: .5rem; }
.test-send { margin-top: 1.4rem; }

/* Türchen-Editor */
.editor { display: grid; grid-template-columns: 14rem 1fr; gap: 1.4rem; align-items: start; }
.editor__side { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: 1rem; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; }
.editor__stage { position: relative; user-select: none; border: 3px solid var(--hop); border-radius: 6px; overflow: hidden; }
.editor__stage img { width: 100%; height: auto; pointer-events: none; }
.editor__layer { position: absolute; inset: 0; cursor: crosshair; touch-action: none; }
.ed-door { position: absolute; border: 2px solid var(--amber); background: rgba(199, 125, 20, .22); cursor: pointer; }
.ed-door span { position: absolute; top: 2px; left: 2px; background: var(--amber); color: #2A1803; font: 700 .8rem/1 var(--font-head); padding: .15rem .3rem; border-radius: 3px; }
.ed-door.is-selected { border-color: #fff; box-shadow: 0 0 0 2px var(--hop); background: rgba(31, 74, 51, .35); }
.ed-door.is-drawing { border-style: dashed; pointer-events: none; }
.ed-list { list-style: none; padding: 0; margin: 0; max-height: 50vh; overflow: auto; font-size: .92rem; }
.ed-list li { display: flex; justify-content: space-between; padding: .15rem .3rem; border-radius: 4px; }
.ed-list li.is-selected { background: var(--amber-pale); }
.ed-list li:not(.is-set) .linklike { color: var(--ink-soft); }
.ed-del { color: var(--danger) !important; font-size: .82rem; }
@media (max-width: 50rem) {
  .editor { grid-template-columns: 1fr; }
  .editor__side { position: static; }
  .ed-list { display: none; }
  h1 { font-size: 1.85rem; }
}
.panel--wide { max-width: none; }
.import-errors { padding: 1rem 1.3rem; margin-bottom: 1.4rem; background: #F6DCD7; border-left: 6px solid var(--danger); border-radius: 6px; }
.import-errors h2 { margin-top: 0; font-size: 1.2rem; }
.import-errors ul { margin: 0; padding-left: 1.2rem; }
.templates { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: baseline; }
code { font-size: .92em; background: var(--hop-pale); padding: .05rem .3rem; border-radius: 3px; }
.lookup { margin-top: 2rem; } .lookup h3 { font-size: 1.1rem; margin-top: 1.2rem; }
.beer-card--photo { display: flex; gap: 1.2rem; align-items: center; }
.beer-card--photo img { width: 7.5rem; height: 7.5rem; object-fit: cover; border-radius: 8px; border: 3px solid var(--amber); flex: none; }
.beer-card__edit { margin: .5rem 0 0; font-size: .92rem; }
.beer-card__edit a { color: var(--amber-pale); }
.bottle-photo img { max-height: 24rem; width: auto; border-radius: 10px; border: 3px solid var(--hop); margin-bottom: 1.4rem; }
.thumb-sm { width: 2.6rem; height: 2.6rem; object-fit: cover; border-radius: 6px; flex: none; }
.awards { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; }
.award { display: flex; gap: .9rem; align-items: flex-start; background: var(--paper); border: 1px solid var(--line); border-left: 6px solid var(--amber); border-radius: 10px; padding: 1rem 1.1rem; }
.award__emoji { font-size: 2rem; line-height: 1; }
.award__title { font-size: 1.05rem; margin: 0 0 .15rem; color: var(--amber-deep); }
.award__who { font: 700 1.25rem/1.25 var(--font-head); margin: 0; }
.award__detail { margin: .25rem 0 0; color: var(--ink-soft); font-size: .92rem; }
.bar--big { height: 14px; max-width: 30rem; margin: 1rem 0 .4rem; }
.stats-line { display: flex; flex-wrap: wrap; gap: .5rem 1.6rem; }
@media (max-width: 30rem) { .beer-card--photo { flex-direction: column; align-items: flex-start; } }
