@font-face { font-family: "Roboto"; font-weight: 300; src: url(/fonts/Roboto-Light.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Roboto"; font-weight: 400; src: url(/fonts/Roboto-Regular.woff2) format("woff2"); font-display: swap; }
:root {
  --nacht: #01032e; --blau: #cfe6ff; --blau2: #8fb8ee; --gelb: #fff1a8; --gold: #ffd978;
  --glas: linear-gradient(145deg, rgba(190,220,255,.16), rgba(120,160,255,.05) 55%, rgba(190,220,255,.09));
  --rand: rgba(200,225,255,.26);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--nacht); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--blau); font: 300 18px/1.45 "Roboto", system-ui, sans-serif;
  background: radial-gradient(ellipse 120% 70% at 50% -10%, #0a1a6e 0%, rgba(10,26,110,0) 60%), radial-gradient(ellipse 90% 60% at 100% 100%, #08144f 0%, rgba(8,20,79,0) 70%), var(--nacht);
  background-attachment: fixed; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
#sterne { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
#seite { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 26px) 16px calc(env(safe-area-inset-bottom) + 40px); }

.kopf { text-align: center; margin-bottom: 22px; }
.kopf img { width: 84px; height: 84px; border-radius: 50%; box-shadow: 0 0 40px rgba(120,170,255,.45); }
.kopf h1 { margin: 10px 0 2px; font-weight: 300; font-size: 25px; letter-spacing: .16em; text-transform: uppercase; color: var(--blau); }
.datum { margin: 0; font-size: 17px; color: var(--gelb); letter-spacing: .04em; }

.glas {
  position: relative; margin: 0 0 16px; padding: 20px 18px 18px; border-radius: 30px; border: 1px solid var(--rand);
  background: var(--glas); -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), inset 0 -20px 40px rgba(60,100,220,.07), 0 14px 44px rgba(0,2,30,.55);
}
.glas h2 { margin: 0 0 14px 4px; font-weight: 300; font-size: 14px; letter-spacing: .24em; text-transform: uppercase; color: var(--gelb); }

.wahl { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.zeile { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 4px 6px; border-radius: 24px; cursor: pointer; user-select: none; -webkit-user-select: none; color: var(--blau); font-size: 18px; }
.zeile.keine { grid-column: 1 / -1; margin-top: 6px; border-top: 1px solid rgba(200,225,255,.12); border-radius: 0 0 24px 24px; padding-top: 10px; color: var(--blau2); }

/* die Kugel: Glas, innen ein heller Kern, wenn gewählt */
.kugel {
  position: relative; flex: none; width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(215,235,255,.55);
  background: radial-gradient(circle at 32% 26%, rgba(255,255,255,.55) 0, rgba(255,255,255,.12) 28%, rgba(120,160,255,.06) 60%, rgba(80,120,255,.14) 100%);
  box-shadow: inset 0 -5px 9px rgba(90,140,255,.28), inset 0 2px 3px rgba(255,255,255,.55), 0 2px 10px rgba(0,5,50,.5);
  transition: box-shadow .25s, background .25s, transform .15s;
}
.kugel::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fffef0 0, var(--gelb) 45%, var(--gold) 100%); opacity: 0; transform: scale(.2); transition: opacity .25s, transform .25s; }
.an > .kugel, .an .kugel { border-color: rgba(255,244,180,.95); box-shadow: inset 0 -5px 9px rgba(90,140,255,.2), inset 0 2px 3px rgba(255,255,255,.7), 0 0 0 1px rgba(255,235,150,.35), 0 0 18px rgba(255,225,120,.65), 0 0 38px rgba(130,180,255,.35); }
.an > .kugel::after, .an .kugel::after { opacity: 1; transform: scale(1); }
.zeile:active .kugel, .gross:active { transform: scale(.93); }
.an .t { color: #fff; }

/* große Kugeln mit Zahl: Schlaf */
.reihe { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; margin-bottom: 4px; }
.untertitel { margin: 14px 0 10px 4px; font-size: 15px; color: var(--blau2); letter-spacing: .06em; }
.untertitel:first-of-type { margin-top: 0; }
.gross { position: relative; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; font-size: 20px; font-weight: 300; color: var(--blau); border: 1px solid rgba(215,235,255,.5);
  background: radial-gradient(circle at 32% 24%, rgba(255,255,255,.5) 0, rgba(255,255,255,.1) 30%, rgba(100,150,255,.06) 62%, rgba(80,120,255,.16) 100%);
  box-shadow: inset 0 -8px 14px rgba(90,140,255,.28), inset 0 3px 5px rgba(255,255,255,.55), 0 4px 14px rgba(0,5,50,.5); transition: box-shadow .25s, transform .15s, color .25s, background .25s; user-select: none; -webkit-user-select: none; }
.gross.an { color: #1b1500; border-color: rgba(255,244,180,.95); background: radial-gradient(circle at 34% 28%, #fffef2 0, var(--gelb) 48%, var(--gold) 100%);
  box-shadow: inset 0 -6px 12px rgba(255,170,60,.35), inset 0 3px 5px rgba(255,255,255,.8), 0 0 22px rgba(255,225,120,.7), 0 0 46px rgba(130,180,255,.35); }
.gross.mehr { font-size: 13px; letter-spacing: .02em; }
.gross select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 18px; cursor: pointer; border-radius: 50%; }
.gross.breit { width: auto; min-width: 190px; padding: 0 30px; border-radius: 40px; height: 64px; font-size: 20px; letter-spacing: .08em; }

.knopfzeile { text-align: center; margin: 26px 0 8px; }
.eintragen { appearance: none; font: 300 21px "Roboto", sans-serif; letter-spacing: .2em; text-transform: uppercase; color: #1b1500; border: 1px solid rgba(255,244,180,.95); border-radius: 60px; padding: 18px 46px; cursor: pointer;
  background: radial-gradient(ellipse at 35% 20%, #fffef2 0, var(--gelb) 50%, var(--gold) 100%); box-shadow: inset 0 3px 5px rgba(255,255,255,.8), inset 0 -8px 14px rgba(255,170,60,.3), 0 0 30px rgba(255,225,120,.55), 0 0 70px rgba(120,170,255,.3); transition: opacity .3s, transform .15s, filter .3s; }
.eintragen:active { transform: scale(.96); }
.eintragen:disabled { opacity: .28; filter: saturate(.3); box-shadow: none; cursor: default; }
.hilfe { text-align: center; min-height: 1.4em; font-size: 15px; color: var(--blau2); margin: 10px 0 0; }
.fehler { color: #ffb8a8; }

.fertig { text-align: center; padding: 30px 18px 26px; }
.fertig .stern { width: 90px; height: 90px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; font-size: 40px; color: #1b1500; background: radial-gradient(circle at 34% 28%, #fffef2 0, var(--gelb) 48%, var(--gold) 100%); box-shadow: 0 0 34px rgba(255,225,120,.75), 0 0 80px rgba(130,180,255,.4); animation: atmen 4s ease-in-out infinite; }
.fertig h2 { margin: 14px 0 6px; font-size: 22px; letter-spacing: .08em; text-transform: none; color: var(--gelb); }
.fertig p { margin: 0 auto; max-width: 28em; color: var(--blau); }
.zusammen { text-align: left; margin-top: 18px; display: grid; gap: 8px; font-size: 16px; }
.zusammen b { display: block; font-weight: 300; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--gelb); }
.verlauf { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; margin-top: 18px; }
.punkt { width: 17px; height: 17px; border-radius: 50%; border: 1px solid rgba(215,235,255,.35); display: grid; place-items: center; font-size: 8px; color: rgba(207,230,255,.55); background: rgba(150,190,255,.07); }
.punkt.da { color: transparent; border-color: rgba(255,244,180,.9); background: radial-gradient(circle at 35% 30%, #fffef0, var(--gelb) 55%, var(--gold)); box-shadow: 0 0 10px rgba(255,225,120,.6); }
.verlauf-titel { text-align: center; margin: 22px 0 0; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--blau2); }

#fuss { text-align: center; margin-top: 8px; }
.klein { font-size: 14px; color: var(--blau2); }
.klein button { font: inherit; color: var(--gelb); background: none; border: 0; border-bottom: 1px solid rgba(255,241,168,.5); padding: 0 0 1px; cursor: pointer; }
@keyframes atmen { 50% { transform: scale(1.06); } }
@keyframes ein { from { opacity: 0; transform: translateY(8px); } }
.glas, .fertig { animation: ein .5s ease both; }
.glas:nth-child(2) { animation-delay: .06s; } .glas:nth-child(3) { animation-delay: .12s; } .glas:nth-child(4) { animation-delay: .18s; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 340px) { .wahl { grid-template-columns: 1fr; } .gross { width: 50px; height: 50px; } }

/* Umdrehen + Auswertung */
.logo { appearance: none; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; border-radius: 50%; display: inline-block; transition: transform .55s cubic-bezier(.3,.7,.3,1); }
.logo.dreht { transform: rotateY(360deg); }
.logo:active img { transform: scale(.95); }
#flaeche { perspective: 1200px; }
#flaeche.zu { animation: zu .26s ease-in forwards; }
#flaeche.auf { animation: auf .3s ease-out both; }
@keyframes zu { to { transform: rotateY(90deg); opacity: 0; } }
@keyframes auf { from { transform: rotateY(-90deg); opacity: 0; } }
.gross-zahl { text-align: center; font-size: 18px; color: var(--blau); } .gross-zahl b { font-weight: 300; font-size: 56px; color: var(--gelb); text-shadow: 0 0 22px rgba(255,225,120,.55); }
.spur { position: relative; flex: 1; height: 12px; border-radius: 12px; background: rgba(150,190,255,.1); border: 1px solid rgba(200,225,255,.22); box-shadow: inset 0 2px 4px rgba(0,5,50,.5); overflow: hidden; }
.spur.breit { display: block; margin: 12px 4px 10px; }
.fuell { display: block; height: 100%; border-radius: 12px; background: linear-gradient(90deg, #8fb8ee, var(--gelb)); box-shadow: 0 0 12px rgba(255,225,120,.6); transition: width .8s ease; }
.balkenzeile { display: flex; align-items: center; gap: 10px; min-height: 34px; font-size: 16px; }
.bname { flex: 0 0 8.2em; color: var(--blau); } .bzahl { flex: 0 0 3em; text-align: right; font-size: 14px; color: var(--blau2); }
.mitte { text-align: center; }
.paar { margin: 0 0 12px; padding: 10px 12px; border-radius: 18px; background: rgba(150,190,255,.07); border: 1px solid rgba(200,225,255,.16); }
.paarkopf { display: flex; gap: 8px; align-items: baseline; color: var(--gelb); font-size: 17px; flex-wrap: wrap; } .pfeil { color: var(--blau2); }
.paartext { margin-top: 3px; font-size: 14px; color: var(--blau2); }
.zeile-text { margin: 0 0 4px 4px; color: var(--blau); } .glas .klein { margin: 0 4px 14px; }
.klein a { color: var(--gelb); }
.untertitel.stunden { text-align: center; color: var(--gelb); margin: 14px 0 0; min-height: 1.4em; font-size: 17px; }
