/* Der Würfel — Gestaltung. Familiensprache der Nachbarseiten:
   Orbitron in kleinen Graden für Beschriftungen, Systemschrift für Fließtext. */

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

:root{
  --cy:#6fe3ff;
  --vi:#c08bff;
  --ink:#eaf3ff;
  --dim:rgba(185,215,255,.62);
  --line:rgba(150,190,230,.22);
  --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:#04050b;}
body{font-family:var(--fb);color:var(--ink);font-size:15px;line-height:1.6;
  -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 #cfe9ff;outline-offset:6px;}
[hidden]{display:none !important;}

/* ---------- Grund, Leinwand, Auflagen ---------- */

#buehne{position:fixed;inset:0;z-index:0;pointer-events:none;
  background:radial-gradient(ellipse 90% 70% at 50% 38%,#101526 0%,#090c15 48%,#04050b 100%);}
#leinwand{position:fixed;inset:0;z-index:1;display:block;width:100%;height:100%;
  touch-action:none;cursor:default;}
#leinwand.kann{cursor:grab;}
#leinwand.greift,#leinwand.dreht{cursor:grabbing;}
#vignette{position:fixed;inset:0;z-index:6;pointer-events:none;mix-blend-mode:multiply;
  background:radial-gradient(ellipse 120% 95% at 50% 46%,rgba(0,0,0,0) 40%,rgba(0,0,0,.45) 100%);}
/* Statisches Korn: ein flackerndes kostet auf einem Notebook dauerhaft
   Rechenzeit und bringt bei 2,5 % Deckkraft nichts. */
#korn{position:fixed;inset:0;z-index:7;pointer-events:none;opacity:.025;mix-blend-mode:overlay;
  background-size:180px 180px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='2'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");}

/* ---------- 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(169,192,218,.75);text-decoration:none;padding:4px 0;
  border-bottom:1px solid rgba(169,192,218,.3);transition:color .18s,border-color .18s;}
#zurueck:hover,#zurueck:focus-visible{color:var(--cy);border-bottom-color:var(--cy);}

/* ---------- Oben Mitte: der eine Anzeigeslot ---------- */

/* Volle Breite statt left:50% mit Schrumpfbreite: sonst steht dem Kasten auf
   einem schmalen Telefon nur die halbe Fensterbreite zur Verfügung. */
#slot{position:fixed;left:0;right:0;top:calc(26px + 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(200,225,255,.55);transition:opacity .9s ease;}
#slot-titel.weg{opacity:0;}
.slot-teil{transition:opacity .4s ease;}
#slot-tafel.blass{opacity:0;transition:opacity .24s ease;}
#tafel-name{font-family:var(--fd);font-weight:600;font-size:14px;letter-spacing:.2em;color:var(--ink);}
#tafel-linie{width:120px;height:1px;margin:9px auto 7px;background:rgba(150,190,230,.28);}
#tafel-fuell{display:block;height:1px;width:0;background:var(--cy);transition:width .2s linear;}
#tafel-nr{font-size:9.5px;color:var(--dim);letter-spacing:.14em;font-family:var(--fd);}
#slot-tipp{font-size:11px;color:var(--dim);letter-spacing:.06em;}
#erg-haupt{font-family:var(--fd);font-weight:600;font-size:15px;letter-spacing:.18em;color:var(--ink);}
#erg-best{margin-top:7px;font-size:11px;color:rgba(185,215,255,.6);}

/* ---------- Oben rechts: Züge und Uhr ---------- */

#zaehler{position:fixed;right:22px;top:calc(22px + var(--pt));z-index:20;text-align:right;
  opacity:0;transition:opacity .3s ease;pointer-events:none;}
#zaehler.an{opacity:1;}
#zaehler .zeile{display:flex;align-items:baseline;justify-content:flex-end;gap:10px;}
#zaehler .marke{font-family:var(--fd);font-size:9px;letter-spacing:.28em;text-transform:uppercase;
  color:rgba(180,205,235,.6);}
#zug-wert{font-family:var(--fd);font-weight:700;font-size:22px;color:var(--ink);
  font-variant-numeric:tabular-nums;}
#uhr{font-family:var(--fd);font-weight:600;font-size:13px;color:rgba(190,215,245,.7);
  font-variant-numeric:tabular-nums;margin-top:2px;}

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

#leiste{position:fixed;left:0;right:0;bottom:calc(28px + var(--pb));z-index:22;
  display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:0 12px;
  padding:0 14px;transition:opacity .2s ease;}
#leiste.starr{opacity:.4;pointer-events:none;}
#leiste .gruppe{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:0 12px;}
/* 44px Trefferfläche über Innenabstand, ohne optisch größer zu werden: die
   Unterkante zeichnet ein Pseudoelement dicht unter der Schrift statt am
   Rand des Kastens. */
#leiste 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(200,220,245,.78);padding:14px 3px;min-height:44px;transition:color .18s;}
#leiste button::after{content:"";position:absolute;left:3px;right:3px;top:calc(50% + 10px);
  height:1px;background:rgba(169,192,218,.28);transition:background .18s;}
#leiste button:hover,#leiste button:focus-visible{color:var(--cy);}
#leiste button:hover::after,#leiste button:focus-visible::after{background:var(--cy);}
#leiste .dot{color:#7f93aa;font-size:11px;}
#leiste .trenn{display:inline-block;width:1px;height:14px;margin:0 8px;
  background:rgba(150,190,230,.22);}
#b-tasten{color:rgba(169,192,218,.55) !important;}
#b-tasten:hover,#b-tasten:focus-visible{color:var(--cy) !important;}

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

#recht{position:fixed;left:22px;bottom:calc(22px + 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(169,192,218,.7);text-decoration:none;padding:6px 2px;
  transition:color .18s;}
#recht a:hover,#recht a:focus-visible{color:var(--cy);}
#recht .sep{color:rgba(169,192,218,.4);}

/* ---------- Der erste Hinweis ---------- */

#wink{position:fixed;left:0;right:0;bottom:calc(96px + var(--pb));z-index:19;text-align:center;
  font-size:11px;letter-spacing:.16em;color:rgba(185,215,255,.55);
  opacity:0;pointer-events:none;transition:opacity .3s ease;}
#wink.an{opacity:1;transition:opacity .4s ease;}

/* ---------- Tastenübersicht ---------- */

#tasten{position:fixed;right:22px;bottom:calc(78px + var(--pb));z-index:24;width:280px;max-width:calc(100vw - 44px);
  padding:14px 16px;border-radius:10px;border:1px solid rgba(120,200,255,.18);
  background:linear-gradient(180deg,rgba(10,16,32,.72),rgba(6,10,22,.5));
  -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);
  box-shadow:0 0 30px rgba(0,0,0,.35);
  transform:translate(calc(100% + 30px),0);opacity:0;pointer-events:none;
  transition:transform .22s cubic-bezier(.2,.8,.2,1),opacity .22s ease;}
#tasten.an{transform:none;opacity:1;pointer-events:auto;}
#tasten-titel{font-family:var(--fd);font-size:10px;letter-spacing:.28em;text-transform:uppercase;
  color:rgba(180,220,255,.68);margin-bottom:10px;}
.treihe{display:flex;align-items:center;gap:10px;margin:7px 0;}
.chips{display:flex;align-items:center;gap:5px;flex-wrap:wrap;flex:0 0 47%;min-width:0;}
.key{font-family:var(--fd);font-size:12px;min-width:26px;min-height:26px;padding:3px 7px;
  display:flex;align-items:center;justify-content:center;border:1px solid rgba(150,210,255,.35);
  border-radius:6px;color:#dff2ff;background:rgba(120,190,255,.06);line-height:1.25;
  box-shadow:0 2px 0 rgba(120,190,255,.12);text-align:center;}
.plus{color:rgba(180,210,240,.6);font-size:11px;}
.terkl{font-size:11px;color:rgba(185,215,255,.75);line-height:1.35;}
#tasten-fuss{margin-top:12px;padding-top:10px;border-top:1px solid var(--line);
  font-size:10.5px;color:rgba(185,215,255,.6);line-height:1.4;}

/* ---------- Buchstaben-Plaketten auf den sichtbaren Flächen ---------- */

#plaketten{position:fixed;inset:0;z-index:8;pointer-events:none;}
.plakette{position:absolute;left:0;top:0;font-family:var(--fd);font-weight:700;font-size:13px;
  color:var(--ink);text-shadow:0 0 10px rgba(0,0,6,.9);opacity:0;
  transition:opacity .18s ease;}

/* ---------- Tipp: Bogen und Beschriftung ---------- */

/* Kein hidden-Attribut: das gibt es nur an HTML-Elementen, ein SVG bliebe
   davon unberührt. Sichtbarkeit läuft deshalb über die Klasse. */
#pfeil{position:fixed;inset:0;z-index:9;pointer-events:none;width:100%;height:100%;
  opacity:0;visibility:hidden;transition:opacity .22s ease,visibility 0s linear .22s;}
#pfeil.an{opacity:1;visibility:visible;transition:opacity .22s ease,visibility 0s linear 0s;}
#pfeil-bogen{fill:none;stroke:var(--cy);stroke-width:3;stroke-linecap:round;
  filter:drop-shadow(0 0 8px rgba(111,227,255,.55));}
#pfeil-spitze{fill:var(--cy);filter:drop-shadow(0 0 8px rgba(111,227,255,.55));}
#pfeil-text{position:fixed;z-index:10;pointer-events:none;transform:translate(-50%,-50%);}
#pfeil-notation{font-family:var(--fd);font-weight:700;font-size:17px;color:var(--ink);
  text-shadow:0 0 8px rgba(0,0,6,.95),0 0 18px rgba(0,0,6,.8);}
#pfeil-klartext{font-size:9.5px;color:var(--dim);white-space:nowrap;
  text-shadow:0 0 8px rgba(0,0,6,.95);}

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

#lade{position:fixed;inset:0;z-index:60;display:flex;align-items:center;justify-content:center;
  background:#05070d;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(--cy);
  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:#05070d;}
#fehler .box{max-width:560px;color:#cfe2ff;}
#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:#9fd0ff;word-break:break-all;}

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

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

/* ---------- 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(1,2,8,.82);
  -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:#070b16;
  border:1px solid rgba(140,195,240,.26);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:#c6dcf2;text-decoration:none;
  border-radius:8px;background:#070b16;transform:translateX(44px);}
.sheet-close:hover{color:var(--cy);background:#0d1a2e;}
.sheet-box h2{font-family:var(--fd);font-weight:700;font-size:clamp(19px,2.6vw,23px);
  letter-spacing:.08em;color:#f0f8ff;margin:0 0 16px;}
.sheet-box h3{font-family:var(--fd);font-weight:600;font-size:14px;letter-spacing:.08em;
  color:var(--cy);margin:24px 0 8px;}
.sheet-box h4{font-family:var(--fd);font-weight:600;font-size:12.5px;letter-spacing:.08em;
  color:var(--vi);margin:18px 0 6px;}
.sheet-box p,.sheet-box li{font-size:14px;line-height:1.68;color:#dbe8f6;margin:0 0 10px;}
.sheet-box ul{margin:0 0 12px;padding-left:20px;}
.sheet-box a{color:var(--cy);}
.sheet-box strong{color:#f2f8ff;}
.sheet-back{margin:22px 0 0;padding-top:16px;border-top:1px solid var(--line);}

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

/* Mittelbreite Fenster: die zentrierte Zeile reicht sonst bis in die Ecke,
   in der die Rechtslinks stehen. */
@media (max-width:1000px){
  #leiste{bottom:calc(58px + var(--pb));}
  #wink{bottom:calc(126px + var(--pb));}
}
@media (max-width:520px){
  /* Der Zähler wandert unter den Titel, die Schaltflächenzeile bricht auf zwei
     Reihen um — die Beschriftungen bleiben vollständig. */
  /* Der Rückweg steht links oben; darum rutscht der Anzeigeslot darunter,
     sonst schieben sich Titel und Link ineinander. */
  #slot{top:calc(52px + var(--pt));}
  #zaehler{right:0;left:0;top:calc(106px + var(--pt));text-align:center;}
  #zaehler .zeile{justify-content:center;}
  #leiste{gap:0 6px;bottom:calc(34px + var(--pb));padding:0 6px;}
  #leiste .gruppe{gap:0 6px;}
  #leiste .trenn{display:none;}
  #leiste button{font-size:10px;letter-spacing:.1em;padding:13px 3px;}
  #leiste button::after{top:calc(50% + 9px);}
  #recht{left:0;right:0;justify-content:center;bottom:calc(4px + var(--pb));}
  #wink{bottom:calc(136px + var(--pb));font-size:10.5px;}
  #tasten{right:50%;transform:translate(50%,calc(100% + 30px));bottom:calc(122px + var(--pb));
    width:min(300px,calc(100vw - 32px));}
  #tasten.an{transform:translate(50%,0);}
  .sheet-box{padding:26px 58px 28px 20px;}
}
@media (max-height:560px){
  #wink{display:none;}
  /* Schmaler und nach rechts gerueckt: sonst deckt der geoeffnete Kasten bei 740x360 die
     Schaltflaechenzeile zu, und weil er Zeiger annimmt, kaeme man nur noch mit Esc heraus. */
  #tasten{bottom:calc(64px + var(--pb));right:14px;width:min(260px,44vw);
    max-height:calc(100vh - 150px);overflow:auto;}
}

/* ---------- 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){
  #buehne,#vignette,#korn,.scrim{display:none;}
  #leiste button,#recht a,#zurueck{color:LinkText;}
  .sheet-box{border:1px solid;}
}
