/* Unter Glas — Gestaltung. Familiensprache der Nachbarseiten:
   Orbitron in kleinen Graden für Beschriftungen, Systemschrift für Fließtext.
   Statt Cyan ein warmer Honigton, passend zum Holz des Kastens. */

@font-face{
  font-family:'Orbitron';
  font-style:normal;
  font-weight:100 900;
  font-display:swap;
  src:url('../../fonts/orbitron.woff2') format('woff2');
}

:root{
  --ak:#f2c46a;
  --ink:#f4ede0;
  --dim:rgba(238,222,196,.62);
  --line:rgba(240,210,160,.2);
  --fd:'Orbitron','Segoe UI',system-ui,-apple-system,Arial,sans-serif;
  --fb:'Segoe UI',system-ui,-apple-system,Roboto,Helvetica,Arial,sans-serif;
  --pt:env(safe-area-inset-top,0px);
  --pb:env(safe-area-inset-bottom,0px);
}

*{box-sizing:border-box;margin:0;padding:0;}
html,body{width:100%;height:100%;overflow:hidden;background:#0b0806;}
/* der Kasten steht in einem dunklen Raum, von oben angeleuchtet */
body{font-family:var(--fb);color:var(--ink);font-size:15px;line-height:1.6;
  background:radial-gradient(ellipse 85% 75% at 50% 42%,#2a1d14 0%,#140e0a 55%,#080605 100%);
  -webkit-font-smoothing:antialiased;-webkit-user-select:none;user-select:none;}
.vh{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;
  clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0;}
:focus-visible{outline:2px solid #ffe2a8;outline-offset:6px;}
[hidden]{display:none !important;}

#leinwand{position:fixed;inset:0;z-index:1;display:block;width:100%;height:100%;
  touch-action:none;cursor:crosshair;}

/* ---------- Ruhe: die Bedienung tritt zurück ---------- */

#zurueck,#slot,#stand,#leiste,#futterwahl,#recht,#karte,#wink{transition:opacity .6s ease;}
body.ruhig #zurueck,body.ruhig #stand,body.ruhig #leiste,body.ruhig #futterwahl,
body.ruhig #recht,body.ruhig #wink{opacity:0;pointer-events:none;}
body.ruhig #leinwand{cursor:none;}
body.ohne-ui #zurueck,body.ohne-ui #stand,body.ohne-ui #leiste,body.ohne-ui #futterwahl,
body.ohne-ui #recht,body.ohne-ui #wink,body.ohne-ui #slot,body.ohne-ui #karte{opacity:0 !important;pointer-events:none !important;}

/* ---------- Oben links: Rückweg ---------- */

#zurueck{position:fixed;left:22px;top:calc(22px + var(--pt));z-index:20;
  font-family:var(--fd);font-size:10.5px;letter-spacing:.18em;text-transform:lowercase;
  color:rgba(226,206,176,.78);text-decoration:none;padding:4px 0;
  border-bottom:1px solid rgba(226,206,176,.3);transition:color .18s,border-color .18s,opacity .6s ease;
  text-shadow:0 1px 6px rgba(0,0,0,.7);}
#zurueck:hover,#zurueck:focus-visible{color:var(--ak);border-bottom-color:var(--ak);}

/* ---------- Oben Mitte: Titel und Meldungen ---------- */

#slot{position:fixed;left:0;right:0;top:calc(24px + var(--pt));z-index:20;
  text-align:center;pointer-events:none;padding:0 16px;}
#slot-titel{margin:0;font-family:var(--fd);font-weight:600;font-size:13px;letter-spacing:.42em;
  color:rgba(250,232,200,.7);transition:opacity .9s ease;text-shadow:0 1px 8px rgba(0,0,0,.8);}
#slot-titel.weg{opacity:0;}
#meldung{max-width:620px;margin:-18px auto 0;font-size:13px;letter-spacing:.02em;line-height:1.5;
  color:var(--ink);opacity:0;transform:translateY(-4px);transition:opacity .5s ease,transform .5s ease;
  text-shadow:0 1px 3px rgba(0,0,0,.95),0 0 14px rgba(0,0,0,.8);}
#meldung.an{opacity:1;transform:none;}

/* ---------- Oben rechts: Stand der Kolonie ---------- */

#stand{position:fixed;right:22px;top:calc(18px + var(--pt));z-index:20;text-align:right;
  pointer-events:none;text-shadow:0 1px 4px rgba(0,0,0,.85);}
#stand .zeile{display:flex;align-items:baseline;justify-content:flex-end;gap:10px;}
#stand .oben{font-family:var(--fd);font-weight:600;font-size:13px;letter-spacing:.14em;color:var(--ink);
  font-variant-numeric:tabular-nums;}
#s-uhr{color:rgba(240,222,190,.75);}
#s-jahr{font-family:var(--fd);font-size:9.5px;letter-spacing:.24em;text-transform:uppercase;color:var(--dim);min-height:0;}
#stand .zahlen{font-size:11px;color:var(--dim);gap:6px;margin-top:2px;}
#stand b{font-family:var(--fd);font-weight:600;font-size:11.5px;color:var(--ink);font-variant-numeric:tabular-nums;}
#stand .dot{color:rgba(230,205,170,.45);}

/* ---------- Unten Mitte: die Schaltflächenzeile ---------- */

#leiste{position:fixed;left:0;right:0;bottom:calc(26px + var(--pb));z-index:22;
  display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:0 12px;
  padding:0 14px;pointer-events:none;}
#leiste>*{pointer-events:auto;}
#leiste .gruppe{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:0 10px;}
#leiste button,#futterwahl button{position:relative;background:none;border:0;cursor:pointer;touch-action:manipulation;
  font-family:var(--fd);font-size:11px;letter-spacing:.16em;text-transform:uppercase;
  color:rgba(236,220,196,.8);padding:14px 3px;min-height:44px;transition:color .18s;
  text-shadow:0 1px 5px rgba(0,0,0,.9);}
#leiste button::after,#futterwahl button::after{content:"";position:absolute;left:3px;right:3px;top:calc(50% + 10px);
  height:1px;background:rgba(230,205,170,.26);transition:background .18s;}
#leiste button:hover,#leiste button:focus-visible,#futterwahl button:hover,#futterwahl button:focus-visible{color:var(--ak);}
#leiste button:hover::after,#leiste button:focus-visible::after,#futterwahl button:hover::after{background:var(--ak);}
#leiste button[aria-pressed="true"],#futterwahl button[aria-pressed="true"]{color:var(--ak);}
#leiste button[aria-pressed="true"]::after,#futterwahl button[aria-pressed="true"]::after{background:var(--ak);height:2px;}
#leiste .dot,#futterwahl .dot{color:rgba(210,180,140,.55);font-size:11px;}
#leiste .trenn{display:inline-block;width:1px;height:14px;margin:0 6px;background:rgba(240,210,160,.22);}
#b-mehr{color:rgba(226,206,176,.6) !important;}
#b-mehr:hover,#b-mehr:focus-visible,#b-mehr[aria-expanded="true"]{color:var(--ak) !important;}

#futterwahl{position:fixed;left:0;right:0;bottom:calc(72px + var(--pb));z-index:22;
  display:flex;align-items:center;justify-content:center;gap:0 10px;pointer-events:none;}
#futterwahl>*{pointer-events:auto;}
#futterwahl button{font-size:10px;padding:10px 3px;min-height:36px;}

/* ---------- Unten links: Rechtstexte ---------- */

#recht{position:fixed;left:22px;bottom:calc(20px + var(--pb));z-index:22;
  font-family:var(--fd);font-size:10px;letter-spacing:.18em;display:flex;align-items:center;gap:9px;}
#recht a{color:rgba(226,206,176,.7);text-decoration:none;padding:6px 2px;transition:color .18s;
  text-shadow:0 1px 4px rgba(0,0,0,.85);}
#recht a:hover,#recht a:focus-visible{color:var(--ak);}
#recht .sep{color:rgba(226,206,176,.4);}

/* ---------- Hinweis zum Werkzeug ---------- */

#wink{position:fixed;left:0;right:0;bottom:calc(112px + var(--pb));z-index:19;text-align:center;
  font-size:12px;letter-spacing:.06em;color:rgba(246,232,206,.85);padding:0 16px;
  opacity:0;pointer-events:none;transition:opacity .3s ease;text-shadow:0 1px 3px rgba(0,0,0,.95),0 0 12px rgba(0,0,0,.8);}
#wink.an{opacity:1;transition:opacity .4s ease;}

/* ---------- Bildtext während der Kamerafahrt ---------- */

#bildtext{position:fixed;left:clamp(22px,5vw,72px);bottom:calc(clamp(44px,9vh,96px) + var(--pb));z-index:18;
  max-width:min(560px,calc(100vw - 44px));pointer-events:none;opacity:0;transform:translateY(8px);
  transition:opacity 1.4s ease,transform 1.4s ease;text-shadow:0 1px 3px rgba(0,0,0,.95),0 0 18px rgba(0,0,0,.8);}
#bildtext.an{opacity:1;transform:none;}
#bt-kopf{display:inline-block;font-family:var(--fd);font-weight:600;font-size:12px;letter-spacing:.3em;
  text-transform:uppercase;color:var(--ak);padding-bottom:7px;margin-bottom:7px;border-bottom:1px solid rgba(242,196,106,.4);}
#bt-zeile{font-size:18px;letter-spacing:.02em;line-height:1.45;color:var(--ink);}
body.ohne-ui #bildtext{opacity:0 !important;}

/* ---------- Karte der ausgewählten Ameise ---------- */

#karte{position:fixed;left:22px;top:calc(64px + var(--pt));z-index:24;width:250px;max-width:calc(100vw - 44px);
  padding:14px 16px 12px;border-radius:10px;border:1px solid rgba(240,200,140,.2);
  background:linear-gradient(180deg,rgba(28,18,10,.82),rgba(18,12,8,.66));
  -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);box-shadow:0 0 30px rgba(0,0,0,.4);}
#k-zu{position:absolute;right:6px;top:4px;background:none;border:0;cursor:pointer;font-size:22px;line-height:1;
  color:rgba(236,220,196,.7);padding:6px 8px;}
#k-zu:hover,#k-zu:focus-visible{color:var(--ak);}
#k-name{font-family:var(--fd);font-weight:700;font-size:14px;letter-spacing:.12em;color:var(--ak);padding-right:26px;}
#k-kaste{font-size:11px;color:var(--dim);margin-top:2px;}
#k-tut{font-size:13px;color:var(--ink);margin-top:8px;}
#k-traegt{font-size:12px;color:rgba(240,226,200,.78);}
#k-zahlen{font-size:11px;color:var(--dim);margin-top:8px;padding-top:8px;border-top:1px solid var(--line);line-height:1.5;}
#k-folgen{margin-top:10px;background:none;border:1px solid rgba(242,196,106,.4);border-radius:6px;cursor:pointer;
  font-family:var(--fd);font-size:10px;letter-spacing:.16em;text-transform:uppercase;color:var(--ak);padding:7px 10px;}
#k-folgen:hover,#k-folgen:focus-visible{background:rgba(242,196,106,.1);}

/* ---------- Mehr: Chronik, Kolonie, Einstellungen ---------- */

#mehr{position:fixed;right:22px;bottom:calc(78px + var(--pb));z-index:26;width:340px;max-width:calc(100vw - 44px);
  max-height:calc(100vh - 170px);overflow-y:auto;overscroll-behavior:contain;
  padding:16px 18px;border-radius:12px;border:1px solid rgba(240,200,140,.2);
  background:linear-gradient(180deg,rgba(28,18,10,.9),rgba(18,12,8,.82));
  -webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);box-shadow:0 0 40px rgba(0,0,0,.45);
  transform:translate(calc(100% + 30px),0);opacity:0;pointer-events:none;-webkit-user-select:text;user-select:text;
  transition:transform .22s cubic-bezier(.2,.8,.2,1),opacity .22s ease;}
#mehr.an{transform:none;opacity:1;pointer-events:auto;}
#mehr section+section{margin-top:16px;padding-top:14px;border-top:1px solid var(--line);}
#mehr h2{font-family:var(--fd);font-size:10px;letter-spacing:.28em;text-transform:uppercase;color:rgba(242,214,160,.75);
  font-weight:600;margin-bottom:8px;}
#chronik{list-style:none;max-height:210px;overflow-y:auto;font-size:12px;line-height:1.45;color:rgba(244,234,214,.9);}
#chronik li{padding:4px 0;border-bottom:1px solid rgba(240,210,160,.08);}
#chronik .wann{display:block;font-family:var(--fd);font-size:9px;letter-spacing:.14em;color:var(--dim);}
#statistik{display:grid;grid-template-columns:1fr 1fr;gap:6px 14px;font-size:12px;}
#statistik dt{font-size:10.5px;color:var(--dim);}
#statistik dd{font-family:var(--fd);font-size:12px;color:var(--ink);font-variant-numeric:tabular-nums;}
.schalter{display:flex;align-items:flex-start;gap:9px;font-size:12.5px;color:rgba(244,234,214,.9);margin:7px 0;cursor:pointer;}
.schalter input{accent-color:#e0a840;width:16px;height:16px;margin-top:1px;flex:none;}
.fein{font-size:11px;color:var(--dim);line-height:1.45;margin:4px 0 10px 25px;}
#b-neu{background:none;border:1px solid rgba(242,196,106,.35);border-radius:6px;cursor:pointer;
  font-family:var(--fd);font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:rgba(242,214,160,.85);padding:8px 10px;}
#b-neu:hover,#b-neu:focus-visible{background:rgba(242,196,106,.1);color:var(--ak);}
.tasten{list-style:none;font-size:12px;color:rgba(244,234,214,.85);display:grid;gap:5px;}
.key{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:20px;padding:0 5px;margin:0 2px;
  font-family:var(--fd);font-size:10px;border:1px solid rgba(240,200,140,.35);border-radius:5px;color:#fff1d6;
  background:rgba(240,200,140,.06);}

/* ---------- Laden und Fehler ---------- */

#lade{position:fixed;inset:0;z-index:60;display:flex;align-items:center;justify-content:center;
  background:#0b0806;transition:opacity .8s ease;}
#lade.weg{opacity:0;pointer-events:none;}
#lade span{font-family:var(--fd);font-size:13px;letter-spacing:.4em;color:var(--ak);
  animation:blink 1.4s ease-in-out infinite;}
@keyframes blink{0%,100%{opacity:.3;}50%{opacity:1;}}
#fehler{position:fixed;inset:0;z-index:70;display:flex;align-items:center;justify-content:center;
  text-align:center;padding:40px;background:#0b0806;}
#fehler .box{max-width:560px;color:#f2e4cc;}
#fehler h2{font-family:var(--fd);font-weight:600;font-size:17px;letter-spacing:.12em;}
#fehler p{margin-top:14px;line-height:1.6;font-size:14px;}
#fehler-datei{font-family:monospace;font-size:13px;color:#ffd890;word-break:break-all;}

/* ---------- Ohne JavaScript ---------- */

#ohnejs{display:none;position:fixed;inset:0;z-index:50;overflow:auto;padding:26px 22px;background:#0b0806;}
#ohnejs .karte{max-width:44ch;margin:0 auto 16px;padding:14px 16px;border:1px solid var(--line);
  border-radius:10px;background:rgba(28,18,10,.85);font-size:14px;color:#efe2cc;}
#ohnejs a{color:var(--ak);}

/* ---------- Rechtstexte: reines CSS, funktioniert ohne Skript ---------- */

.sheet{position:fixed;inset:0;z-index:80;display:flex;align-items:center;justify-content:center;
  padding:calc(18px + var(--pt)) 16px calc(18px + var(--pb));
  visibility:hidden;opacity:0;transition:opacity .25s ease,visibility 0s linear .25s;}
.sheet:target{visibility:visible;opacity:1;transition:opacity .25s ease,visibility 0s linear 0s;}
.scrim{position:absolute;inset:0;background:rgba(8,5,3,.84);
  -webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);}
.sheet-box{position:relative;width:min(680px,100%);max-height:88vh;overflow-y:auto;
  overscroll-behavior:contain;padding:30px 68px 34px 30px;background:#140e09;
  border:1px solid rgba(240,200,140,.24);border-radius:14px;
  box-shadow:0 30px 90px rgba(0,0,0,.75);-webkit-user-select:text;user-select:text;}
.sheet-close{position:sticky;top:10px;float:right;z-index:2;display:inline-block;font-size:26px;
  line-height:1;margin:-16px 0 0 8px;padding:6px 10px;color:#ecdcc0;text-decoration:none;
  border-radius:8px;background:#140e09;transform:translateX(44px);}
.sheet-close:hover{color:var(--ak);background:#24180e;}
.sheet-box h2{font-family:var(--fd);font-weight:700;font-size:clamp(19px,2.6vw,23px);
  letter-spacing:.08em;color:#fff6e6;margin:0 0 16px;}
.sheet-box h3{font-family:var(--fd);font-weight:600;font-size:14px;letter-spacing:.08em;
  color:var(--ak);margin:24px 0 8px;}
.sheet-box h4{font-family:var(--fd);font-weight:600;font-size:12.5px;letter-spacing:.08em;
  color:#e8a878;margin:18px 0 6px;}
.sheet-box p,.sheet-box li{font-size:14px;line-height:1.68;color:#efe3cf;margin:0 0 10px;}
.sheet-box ul{margin:0 0 12px;padding-left:20px;}
.sheet-box a{color:var(--ak);}
.sheet-box strong{color:#fff6e6;}
.sheet-back{margin:22px 0 0;padding-top:16px;border-top:1px solid var(--line);}

/* ---------- Schmale Fenster ---------- */

@media (max-width:1000px){
  #leiste{bottom:calc(54px + var(--pb));}
  #futterwahl{bottom:calc(100px + var(--pb));}
  #wink{bottom:calc(140px + var(--pb));}
  #mehr{bottom:calc(110px + var(--pb));}
}
@media (max-width:620px){
  #slot{top:calc(50px + var(--pt));}
  #stand{right:0;left:0;top:calc(10px + var(--pt));text-align:center;padding-left:120px;padding-right:14px;}
  #stand .zeile{justify-content:flex-end;}
  #meldung{margin-top:0;font-size:12px;}
  #slot-titel{display:none;}
  #leiste{gap:0 4px;bottom:calc(30px + var(--pb));padding:0 6px;}
  #leiste .gruppe{gap:0 5px;}
  #leiste .trenn{display:none;}
  #leiste button{font-size:9.5px;letter-spacing:.1em;padding:12px 2px;min-height:40px;}
  #leiste button::after{top:calc(50% + 9px);}
  #futterwahl{bottom:calc(122px + var(--pb));}
  #recht{left:0;right:0;justify-content:center;bottom:calc(2px + var(--pb));}
  #wink{bottom:calc(160px + var(--pb));font-size:11px;}
  #karte{left:12px;top:auto;bottom:calc(170px + var(--pb));width:calc(100vw - 24px);}
  #bildtext{left:16px;right:16px;bottom:calc(64px + var(--pb));}
  #bt-kopf{font-size:9.5px;letter-spacing:.22em;}
  #bt-zeile{font-size:13.5px;}
  #mehr{right:12px;left:12px;width:auto;bottom:calc(126px + var(--pb));max-height:calc(100vh - 220px);}
  .sheet-box{padding:26px 58px 28px 20px;}
}
@media (max-height:520px){
  #wink{display:none;}
  #slot-titel{display:none;}
  #mehr{bottom:calc(64px + var(--pb));max-height:calc(100vh - 90px);}
}

/* ---------- Bewegung reduzieren ---------- */

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{transition-duration:.001ms !important;animation:none !important;}
  #lade span{opacity:.95;}
}

/* ---------- Erzwungene Farben ---------- */

@media (forced-colors: active){
  #leiste button,#recht a,#zurueck,#futterwahl button{color:LinkText;}
  .sheet-box,#mehr,#karte{border:1px solid;}
}
