:root {
  --bg: #07111f;
  --text: #f5f7fb;
  --muted: #a8b4c7;
  --glass: rgba(255, 255, 255, 0.075);
  --glass-border: rgba(255, 255, 255, 0.14);
  --shadow: 0 24px 80px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 15%, rgba(40, 100, 255, .17), transparent 28rem),
    radial-gradient(circle at 85% 80%, rgba(0, 220, 170, .11), transparent 28rem),
    linear-gradient(135deg, #07111f 0%, #0c1729 55%, #07101d 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255,255,255,.025), transparent 35%, rgba(255,255,255,.02));
}

.shell {
  width: min(1800px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 24px;
  position: relative;
  z-index: 1;
}

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(135%);
  -webkit-backdrop-filter: blur(24px) saturate(135%);
}

.hero {
  border-radius: 28px;
  padding: 28px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.eyebrow {
  letter-spacing: .22em;
  font-size: .7rem;
  font-weight: 800;
  color: #7dd3fc;
  margin-bottom: 7px;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
  margin: 0 0 10px;
  letter-spacing: -.045em;
}

.hero p, .identity span, .identity small {
  color: var(--muted);
}

.hero p { margin: 0; }

.identity {
  text-align: right;
  display: grid;
  gap: 2px;
}

.identity strong { font-size: 1.1rem; }
.identity.muted strong { color: #d8e1ef; }

.table-card {
  border-radius: 28px;
  overflow: hidden;
}

.legend {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: #cbd5e1;
  font-size: .9rem;
}

.legend > span:not(.hint) {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 14px currentColor;
}
.dot.yes { color: #43e97b; background: currentColor; }
.dot.maybe { color: #5da9ff; background: currentColor; }
.dot.no { color: #ff5c70; background: currentColor; }

.hint {
  margin-left: auto;
  color: #8ea0b8;
}

.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 245px);
}

table {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
}

th, td {
  border-right: 1px solid rgba(255,255,255,.055);
  border-bottom: 1px solid rgba(255,255,255,.055);
  text-align: center;
}

th {
  height: 67px;
  min-width: 54px;
  padding: 7px 5px;
  background: rgba(7, 17, 31, .75);
  color: #dbe5f3;
  position: sticky;
  top: 0;
  z-index: 4;
}

th .weekday {
  display: block;
  font-size: .65rem;
  color: #8fa0b7;
  font-weight: 700;
  text-transform: uppercase;
}

th .date {
  display: block;
  margin-top: 2px;
  font-size: .72rem;
}

.sticky-col {
  position: sticky;
  left: 0;
  z-index: 5;
  background: rgba(10, 23, 40, .93);
}

th.sticky-col {
  min-width: 170px;
  text-align: left;
  padding-left: 18px;
}

.person {
  min-width: 170px;
  text-align: left;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.person strong {
  display: block;
  font-size: .88rem;
}

.person small {
  display: block;
  color: #71829a;
  font-family: ui-monospace, monospace;
  font-size: .65rem;
  margin-top: 2px;
}

.avatar {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(125,211,252,.26), rgba(96,165,250,.08));
  border: 1px solid rgba(125,211,252,.2);
  color: #c7f0ff;
  font-weight: 800;
}

.choice-cell {
  min-width: 54px;
  height: 56px;
  padding: 5px;
  background: hsl(var(--day-hue, 0) var(--day-saturation, 62%) var(--day-lightness, 25%) / .13);
  transition: background .25s ease;
}

.choice {
  border: 0;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  color: white;
  font-size: 1.15rem;
  font-weight: 900;
  cursor: default;
  background: rgba(255,255,255,.055);
  transition: transform .16s ease, filter .16s ease, background .16s ease;
}

.choice.ja {
  background: rgba(50, 220, 116, .18);
  color: #59f08c;
  box-shadow: inset 0 0 0 1px rgba(89,240,140,.12);
}
.choice.nein {
  background: rgba(255, 73, 91, .18);
  color: #ff6f7e;
  box-shadow: inset 0 0 0 1px rgba(255,111,126,.12);
}
.choice.eventuell {
  background: rgba(67, 151, 255, .18);
  color: #69adff;
  box-shadow: inset 0 0 0 1px rgba(105,173,255,.12);
}

.choice-cell[data-editable="true"] .choice {
  cursor: pointer;
}
.choice-cell[data-editable="true"] .choice:hover {
  transform: translateY(-2px) scale(1.06);
  filter: brightness(1.18);
}
.choice-cell.saving .choice {
  opacity: .45;
  transform: scale(.92);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 4px;
  color: #708097;
  font-size: .72rem;
}

.orb {
  position: fixed;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: .16;
}
.orb-a { background: #3b82f6; top: -100px; right: 10%; }
.orb-b { background: #14b8a6; bottom: -110px; left: 12%; }

@media (max-width: 700px) {
  .shell { width: min(100% - 14px, 1800px); padding-top: 8px; }
  .hero { border-radius: 20px; padding: 20px; align-items: flex-start; }
  .identity { text-align: left; }
  .hero { flex-direction: column; }
  .table-card { border-radius: 20px; }
  .hint { width: 100%; margin-left: 0; }
  footer { flex-direction: column; }
}


.best-card {
  border-radius: 28px;
  margin-top: 18px;
  padding: 22px;
}

.best-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.card-kicker {
  letter-spacing: .18em;
  font-size: .68rem;
  font-weight: 800;
  color: #7dd3fc;
  margin-bottom: 5px;
}

.best-header h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -.025em;
}

.best-note {
  color: #8ea0b8;
  font-size: .78rem;
  text-align: right;
}

.best-days {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}

.best-day {
  min-height: 76px;
  border: 1px solid rgba(89,240,140,.14);
  border-radius: 17px;
  background: rgba(50,220,116,.09);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3px;
}

.best-weekday {
  color: #8ea0b8;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.best-day strong {
  font-size: 1.05rem;
}

.no-best-days {
  margin: 0;
  color: #8ea0b8;
  font-size: .9rem;
}

@media (max-width: 700px) {
  .best-card { border-radius: 20px; padding: 18px; }
  .best-header { align-items: flex-start; flex-direction: column; }
  .best-note { text-align: left; }
}


.start-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding-top: 24px;
  padding-bottom: 24px;
}

.start-card {
  width: min(560px, 100%);
  border-radius: 28px;
  padding: 38px;
}

.start-card h1 {
  margin-bottom: 12px;
}

.start-card > p {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.6;
}

.code-form {
  display: grid;
  gap: 9px;
}

.code-form label {
  font-size: .78rem;
  font-weight: 700;
  color: #cbd5e1;
}

.code-input-row {
  display: flex;
  gap: 10px;
}

.code-input-row input {
  min-width: 0;
  flex: 1;
  height: 52px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 15px;
  padding: 0 16px;
  background: rgba(0,0,0,.18);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  outline: none;
  text-transform: uppercase;
}

.code-input-row input::placeholder {
  color: #61718a;
  text-transform: none;
}

.code-input-row input:focus {
  border-color: rgba(125,211,252,.55);
  box-shadow: 0 0 0 4px rgba(125,211,252,.08);
}

.code-input-row button {
  height: 52px;
  border: 0;
  border-radius: 15px;
  padding: 0 22px;
  color: #06111f;
  background: #7dd3fc;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform .16s ease, filter .16s ease;
}

.code-input-row button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.form-error {
  margin: 4px 0 0;
  color: #ff8a97;
  font-size: .82rem;
}

@media (max-width: 560px) {
  .start-card {
    border-radius: 20px;
    padding: 26px 20px;
  }

  .code-input-row {
    flex-direction: column;
  }

  .code-input-row button {
    width: 100%;
  }
}
