/* OT-Security-Adventskalender – Blaupause/Schaltschrank-Design, ohne externe Ressourcen */
:root {
  --bg: #0b1726;
  --bg-2: #0f2036;
  --grid: rgba(120, 170, 230, .07);
  --panel: #132a45;
  --panel-2: #183457;
  --line: #24476f;
  --text: #e7eef7;
  --muted: #93a8c2;
  --accent: #f5c518;      /* Warngelb */
  --accent-ink: #1a1400;
  --ok: #3ddc84;
  --stop: #ff5a52;
  --link: #8cc8ff;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #eef3f9;
    --bg-2: #e3ebf5;
    --grid: rgba(30, 80, 140, .07);
    --panel: #ffffff;
    --panel-2: #f4f8fc;
    --line: #c9d6e6;
    --text: #102236;
    --muted: #4f6681;
    --accent: #e0aa00;
    --accent-ink: #1a1400;
    --ok: #13a35a;
    --stop: #d63a33;
    --link: #0b5cad;
    --shadow: 0 8px 24px rgba(16, 34, 54, .10);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
a { color: var(--link); }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.mono, .num, .plate, .kicker, .code, .lock, .bignum, .tip-label, .quiz-label, .year {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

/* Kopf */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 0; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 1.05rem; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 6px; flex: none;
  background: repeating-linear-gradient(135deg, var(--accent) 0 6px, #111 6px 12px);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.25);
}
.year { color: var(--accent); }
.by { color: var(--muted); font-size: .9rem; text-decoration: none; }
.by:hover { color: var(--accent); }

/* Hero */
.hero { padding: 26px 0 30px; max-width: 760px; }
.kicker { color: var(--accent); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 10px; }
h1 { font-size: clamp(1.7rem, 4.2vw, 2.7rem); line-height: 1.15; margin: 0 0 14px; letter-spacing: -.01em; }
.lead { color: var(--muted); font-size: 1.12rem; margin: 0; }

/* Schaltschrank */
.cabinet {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow);
}
.cabinet-head { display: flex; align-items: center; gap: 12px; margin: 2px 2px 16px; }
.warn { flex: 1; height: 10px; border-radius: 3px; background: repeating-linear-gradient(135deg, var(--accent) 0 10px, #161616 10px 20px); opacity: .9; }
.plate {
  font-size: .75rem; letter-spacing: .12em; color: var(--muted);
  border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; white-space: nowrap;
}
.grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; } .cabinet { padding: 12px; } .plate { display: none; } .by { display: none; } }
@media (max-width: 440px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.door {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  min-height: 132px; padding: 12px; border-radius: 12px; text-decoration: none; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.door .num { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.door .led {
  position: absolute; top: 14px; right: 14px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--stop); box-shadow: 0 0 8px var(--stop);
}
.door.open .led { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.door .dtitle { font-size: .86rem; line-height: 1.3; margin-top: 10px; color: var(--text); hyphens: auto; hyphenate-limit-chars: 12 5 5; overflow-wrap: break-word; }
.door .go { font-size: .78rem; color: var(--accent); margin-top: 8px; }
.door .lock { font-size: .72rem; color: var(--muted); }
.door.locked { background:
  repeating-linear-gradient(0deg, transparent 0 7px, rgba(127,127,127,.06) 7px 8px), var(--bg-2);
  cursor: not-allowed; }
.door.locked .num { color: var(--muted); }
.door.open:hover, .door.open:focus-visible { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); }
.door.today { border: 2px solid var(--accent); background: linear-gradient(180deg, rgba(245,197,24,.14), var(--bg-2)); }
.door.today::after {
  content: "HEUTE"; position: absolute; bottom: 10px; right: 10px;
  font: 700 .62rem/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .1em;
  color: var(--accent-ink); background: var(--accent); padding: 4px 6px; border-radius: 4px;
}
@media (max-width: 560px) {
  .door { min-height: 104px; padding: 10px; }
  .door .num { font-size: 1.3rem; }
  .door .dtitle { font-size: .8rem; hyphens: auto; }
  .door .go { display: none; }
  .door.today::after { display: none; }
}

.note { max-width: 760px; padding: 34px 0 10px; }
.note h2 { font-size: 1.2rem; margin: 0 0 8px; }
.note p { color: var(--muted); margin: 0; }

/* Artikel */
.article { max-width: 780px; }
.crumb { margin: 4px 0 18px; }
.crumb a { text-decoration: none; }
.door-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 26px; }
.bignum {
  flex: none; width: 84px; height: 84px; border-radius: 16px; display: grid; place-items: center;
  font-size: 2.2rem; font-weight: 800; color: var(--accent-ink); background: var(--accent);
  box-shadow: var(--shadow);
}
@media (max-width: 560px) { .door-head { flex-direction: column; gap: 14px; } .bignum { width: 64px; height: 64px; font-size: 1.7rem; } }

.prose { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 8px 28px 24px; box-shadow: var(--shadow); }
@media (max-width: 560px) { .prose { padding: 4px 18px 18px; } }
.prose h2 { font-size: 1.22rem; margin: 26px 0 8px; }
.prose p, .prose li { font-size: 1.04rem; overflow-wrap: break-word; hyphens: auto; }
h1 { hyphens: auto; overflow-wrap: break-word; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 4px 0; }
.prose code { font-size: .92em; background: var(--bg-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }

.tip {
  margin: 22px 0; padding: 14px 18px; border-radius: 12px;
  background: rgba(245, 197, 24, .10); border-left: 5px solid var(--accent);
}
.tip p { margin: 4px 0 0; }
.tip-label, .quiz-label {
  display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent-ink); background: var(--accent); border-radius: 4px; padding: 2px 7px;
}
.quiz { margin: 22px 0; border: 1px dashed var(--line); border-radius: 12px; padding: 12px 16px; background: var(--bg-2); }
.quiz summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.quiz summary::-webkit-details-marker { display: none; }
.quiz summary::after { content: "Auflösung anzeigen ▾"; margin-left: auto; font-weight: 400; font-size: .85rem; color: var(--muted); }
.quiz[open] summary::after { content: "▴"; }
.quiz p { margin: 12px 0 2px; }

.pager { display: flex; justify-content: space-between; gap: 12px; margin: 22px 0 0; flex-wrap: wrap; }
.pager a { text-decoration: none; font-weight: 600; }
.muted { color: var(--muted); }

/* 403/404 */
.denied { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); }
.denied .code { color: var(--stop); font-weight: 700; letter-spacing: .1em; margin: 0 0 8px; }
.denied p { color: var(--muted); }
.btn {
  display: inline-block; margin-top: 6px; padding: 10px 18px; border-radius: 10px; font-weight: 700;
  text-decoration: none; color: var(--accent-ink); background: var(--accent);
}

/* Fuß */
.foot { margin: 48px 0 30px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.foot p { margin: 4px 0; }
.foot .fine { font-size: .8rem; }

@media (prefers-reduced-motion: reduce) { .door { transition: none; } }


/* ---------------- Weihnachtliches ---------------- */
:root { --ribbon: #c8102e; --ribbon-2: #e23a4f; --snow: rgba(255,255,255,.85); }
@media (prefers-color-scheme: light) { :root { --snow: rgba(120,150,195,.55); } }

.wrap { position: relative; z-index: 1; }
.snow {
  position: fixed; inset: -200px 0 0 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(2px 2px at 20px 30px, var(--snow) 50%, transparent 52%),
    radial-gradient(3px 3px at 90px 140px, var(--snow) 50%, transparent 52%),
    radial-gradient(2px 2px at 160px 60px, var(--snow) 50%, transparent 52%),
    radial-gradient(2.5px 2.5px at 130px 190px, var(--snow) 50%, transparent 52%),
    radial-gradient(1.5px 1.5px at 50px 110px, var(--snow) 50%, transparent 52%),
    radial-gradient(2px 2px at 185px 170px, var(--snow) 50%, transparent 52%);
  background-size: 200px 200px;
  opacity: .55;
  animation: snow 18s linear infinite;
}
.snow-2 { background-size: 320px 320px; opacity: .3; animation-duration: 30s; filter: blur(.6px); }
@keyframes snow { from { transform: translateY(0); } to { transform: translateY(200px); } }
.snow-2 { animation-name: snow2; }
@keyframes snow2 { from { transform: translate(0,0); } to { transform: translate(40px,320px); } }
@media (prefers-reduced-motion: reduce) { .snow { animation: none; } }

.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; max-width: none; padding-bottom: 0; }
.hero-text { max-width: 760px; padding-bottom: 30px; }
.tree { width: 200px; height: auto; flex: none; filter: drop-shadow(0 8px 24px rgba(61,220,132,.25)); margin-right: 30px; }
@media (max-width: 760px) { .tree { display: none; } .hero-text { padding-bottom: 20px; } }

.garland {
  height: 70px; margin: 0 -6px -34px; position: relative; z-index: 2;
  background: url(/static/garland.svg) repeat-x center top / 300px 70px;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.35));
}
.cabinet { padding-top: 40px; }

/* Geschlossene Türchen = verpackte Geschenke */
.door.locked {
  background:
    linear-gradient(90deg, transparent calc(70% - 5px), var(--ribbon) calc(70% - 5px), var(--ribbon-2) 70%, var(--ribbon) calc(70% + 5px), transparent calc(70% + 5px)),
    linear-gradient(180deg, transparent calc(42% - 5px), var(--ribbon) calc(42% - 5px), var(--ribbon-2) 42%, var(--ribbon) calc(42% + 5px), transparent calc(42% + 5px)),
    repeating-linear-gradient(45deg, rgba(255,255,255,.035) 0 10px, transparent 10px 20px),
    var(--bg-2);
}
.door .bow {
  position: absolute; left: 70%; top: 42%; width: 46px; height: 31px; transform: translate(-50%, -62%);
  background: url(/static/bow.svg) no-repeat center / contain;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.4));
}
.door.locked .lock { position: relative; z-index: 1; align-self: flex-start; background: var(--bg-2); border-radius: 4px; padding: 1px 5px; margin-left: -5px; }
.door.locked .num { position: relative; z-index: 1; }
.door.locked .led { z-index: 1; }

/* Heute: goldener Rahmen + kleiner Stern */
.door.today::before {
  content: "★"; position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  color: var(--accent); font-size: 22px; line-height: 1; text-shadow: 0 0 12px rgba(245,197,24,.7);
}
