/* ============ Reset & Grundlagen ============ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-bg: #0a0e1c;
  --color-text: #eef1f8;
  --color-text-muted: #a3adc4;
  --color-primary: #6366f1;
  --color-primary-hover: #4f52e0;
  --color-accent: #22d3ee;
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-bg-hover: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.14);
  --radius: 22px;
  --container-width: 1100px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* ============ Liquid-Glass-Hintergrund ============ */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 20% -10%, rgba(99, 102, 241, 0.18), transparent 55%),
    radial-gradient(ellipse at 90% 10%, rgba(34, 211, 238, 0.12), transparent 50%),
    var(--color-bg);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  animation: drift 24s ease-in-out infinite alternate;
}

.blob-1 {
  width: 480px;
  height: 480px;
  top: -140px;
  left: -120px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.55), transparent 70%);
}

.blob-2 {
  width: 420px;
  height: 420px;
  top: 30%;
  right: -150px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.4), transparent 70%);
  animation-delay: -8s;
}

.blob-3 {
  width: 380px;
  height: 380px;
  bottom: -160px;
  left: 30%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.4), transparent 70%);
  animation-delay: -16s;
}

@keyframes drift {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(60px, 40px) scale(1.12);
  }
}

@media (prefers-reduced-motion: reduce) {
  .blob {
    animation: none;
  }
}

/* ============ Glas-Effekt ============ */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-left: none;
  border-right: none;
  border-top: none;
  border-radius: 0;
  box-shadow: none;
  background: rgba(10, 14, 28, 0.55);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--color-text);
}

.logo-mark {
  display: inline-flex;
  width: 28px;
  height: 28px;
  color: var(--color-primary);
}

.logo-mark svg {
  width: 100%;
  height: 100%;
}

.logo-text {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ============ Dashboard ============ */
.dashboard {
  padding: 3rem 1.25rem 4rem;
}

.dash-head {
  margin-bottom: 2rem;
}

.dash-title {
  font-size: clamp(1.9rem, 5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.dash-hello {
  color: var(--color-accent);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.dash-subtitle {
  color: var(--color-text-muted);
  margin-top: 0.35rem;
}

/* Aktionen unter der Überschrift (statt überladener Kopfzeile) */
.dash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.pill:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.1);
}

.pill-primary {
  color: var(--color-text);
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.18);
}

.pill-primary:hover {
  border-color: rgba(99, 102, 241, 0.7);
  background: rgba(99, 102, 241, 0.28);
}

.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.subject-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.6rem 1.5rem;
  border-radius: var(--radius);
  color: var(--color-text);
  text-decoration: none;
  transition: transform 0.2s ease, background-color 0.2s ease,
    border-color 0.2s ease;
}

a.subject-card:hover {
  transform: translateY(-4px);
  background: var(--glass-bg-hover);
  border-color: rgba(99, 102, 241, 0.5);
}

a.subject-card:active {
  transform: translateY(-1px) scale(0.99);
}

.subject-card--soon {
  opacity: 0.65;
  border-style: dashed;
}

.subject-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.subject-icon {
  font-size: 2rem;
  line-height: 1;
}

.subject-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}

.tag-active {
  color: #86efac;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.tag-soon {
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
}

.subject-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subject-desc {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  flex-grow: 1;
}

.subject-cta {
  margin-top: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-accent);
}

/* ============ Buttons ============ */
.btn {
  display: inline-block;
  padding: 0.8rem 1.8rem;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.2s ease,
    border-color 0.2s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background-color: var(--color-primary);
  color: #fff;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
}

/* ============ Footer ============ */
.site-footer {
  border-top: 1px solid var(--glass-border);
  padding: 1.75rem 0;
}

.footer-inner {
  display: flex;
  justify-content: center;
}

.footer-note {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* ============ Login ============ */
.login-wrapper {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 400px;
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
}

.login-logo {
  justify-content: center;
  margin-bottom: 1.75rem;
}

.login-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login-subtitle {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-top: 0.4rem;
  margin-bottom: 1.75rem;
}

.login-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  border-radius: 12px;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  text-align: center;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.login-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.login-input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.6;
}

.login-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.login-btn {
  margin-top: 0.75rem;
  width: 100%;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.login-alt {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.login-alt a {
  color: var(--color-accent);
  font-weight: 600;
  text-decoration: none;
}

.login-alt a:hover {
  text-decoration: underline;
}

/* ============ Header rechts: Avatar + Nutzer + Logout ============ */
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-avatar {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  text-decoration: none;
}

.header-avatar svg {
  width: 100%;
  height: 100%;
}

.logout-link {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.logout-link:hover {
  color: var(--color-text);
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.1);
}

/* ============ Coins & Shop ============ */
.coin-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.12);
  color: #fcd34d;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
}

a.coin-badge:hover {
  border-color: rgba(251, 191, 36, 0.6);
  background: rgba(251, 191, 36, 0.2);
}

.shop {
  padding: 2.5rem 1.25rem 4rem;
}

.shop-hero {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1.75rem;
  border-radius: var(--radius);
}

.big-avatar {
  width: 110px;
  height: 110px;
  flex-shrink: 0;
}

.big-avatar svg,
.shop-item .prev svg {
  width: 100%;
  height: 100%;
}

.shop-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.shop-sub {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  max-width: 480px;
  margin-top: 0.35rem;
}

.shop-sub b {
  color: #fcd34d;
}

.shop-section-title {
  margin: 2rem 0 1rem;
  font-size: 1.2rem;
  font-weight: 700;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.shop-item {
  padding: 1.1rem 0.9rem;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  text-align: center;
}

.shop-item .prev {
  width: 72px;
  height: 72px;
}

.shop-item-name {
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.3;
}

.shop-item-price {
  font-size: 0.85rem;
  color: #fcd34d;
  font-weight: 700;
}

.shop-btn {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.2rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  /* transparenter Rahmen: sonst sind Varianten mit Rahmen 2px höher */
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.35rem 1.1rem;
  background: var(--color-primary);
  color: #fff;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.shop-btn:hover:not([disabled]) {
  background: var(--color-primary-hover);
}

.shop-btn[disabled] {
  cursor: not-allowed;
  opacity: 0.45;
}

.shop-btn.owned {
  background: transparent;
  border-color: var(--glass-border);
  color: var(--color-text);
}

.shop-btn.owned:hover {
  background: rgba(255, 255, 255, 0.08);
}

.shop-btn.equipped {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  color: #86efac;
  opacity: 1;
}

.shop-loading {
  color: var(--color-text-muted);
  padding: 2rem 0;
}

/* ============ Responsive ============ */
@media (max-width: 700px) {
  .container {
    padding-inline: 1rem;
  }

  .dashboard {
    padding: 1.75rem 1rem 2.5rem;
  }

  .subject-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .shop {
    padding: 1.75rem 1rem 2.5rem;
  }

  /* Shop-Kopf gestapelt und zentriert statt gequetscht nebeneinander */
  .shop-hero {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
    padding: 1.5rem 1.25rem;
  }

  .shop-sub {
    margin-inline: auto;
  }

  .shop-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
  }

  .shop-item {
    padding: 0.9rem 0.6rem;
  }

  .shop-section-title {
    margin: 1.5rem 0 0.85rem;
    font-size: 1.05rem;
  }

  /* Auf dem Shop-Kopf nur der Pfeil – der Text sprengt sonst die Zeile */
  .back-link-text {
    display: none;
  }

  .blob {
    filter: blur(70px);
  }

  /* Platz, damit der schwebende Buddy nichts verdeckt */
  .site-footer {
    padding-bottom: 6rem;
  }
}

@media (max-width: 380px) {
  .logo-text {
    font-size: 1rem;
  }

  .coin-badge {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
  }
}
