:root {
  --gold: #d4af37;
  --gold-soft: #f1d68a;
  --bg-main: #050509;
  --bg-elevated: #12121b;
  --bg-elevated-soft: #181824;
  --text-main: #f6f6f7;
  --text-muted: #b1b1c3;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --radius-xl: 24px;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.65);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
}

body.theme-dark {
  background: radial-gradient(circle at top, #262633 0, #050509 55%);
  color: var(--text-main);
}

/* Header */

.r4x-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1.4rem;
  background: rgba(3, 3, 6, 0.96);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(16px);
}

.header-left {
  display: flex;
  align-items: center;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-size: 0.95rem;
}

.header-nav {
  display: flex;
  gap: 0.75rem;
}

.nav-link {
  padding: 0.38rem 0.9rem;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.9rem;
}

.nav-link:hover {
  border-color: var(--gold-soft);
}

.nav-link.active {
  background: var(--gold);
  color: #20160a;
}

/* Burger */

.burger-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
  border: none;
  background: none;
  cursor: pointer;
}

.burger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-main);
  border-radius: 999px;
}

/* Side menu */

.side-menu {
  position: fixed;
  inset: 0 0 0 auto;
  width: 260px;
  transform: translateX(100%);
  background: #050509;
  color: var(--text-main);
  z-index: 30;
  transition: transform 0.25s ease;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.6);
}

.side-menu.open {
  transform: translateX(0);
}

.side-menu-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1rem 1.2rem 2rem;
}

.side-menu-close {
  align-self: flex-end;
  font-size: 1.6rem;
  border: none;
  background: none;
  color: var(--text-main);
  cursor: pointer;
}

.side-menu-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

.side-menu-nav a {
  color: var(--text-main);
  text-decoration: none;
  padding: 0.3rem 0;
}

.side-menu-nav a:hover {
  color: var(--gold-soft);
}

.side-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
  z-index: 25;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.side-menu-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Main */

.main-container {
  max-width: 1100px;
  margin: 1.6rem auto 2.8rem;
  padding: 0 1.2rem;
}

.intro h1 {
  font-size: 2rem;
  margin-bottom: 0.4rem;
}

.intro p {
  max-width: 720px;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Code section */

.code-section {
  margin-top: 1.7rem;
  padding: 1.1rem 1.2rem 1.3rem;
  border-radius: var(--radius-xl);
  background: radial-gradient(circle at top left, rgba(212, 175, 55, 0.18), rgba(10, 9, 4, 0.96));
  border: 1px solid rgba(212, 175, 55, 0.65);
  box-shadow: var(--shadow-soft);
}

.code-section h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.code-section p {
  margin: 0.15rem 0;
  font-size: 0.92rem;
  color: var(--text-main);
}

.code-input-row {
  margin-top: 0.8rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.code-input-row input {
  flex: 1 1 200px;
  padding: 0.6rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(5, 5, 9, 0.85);
  color: var(--text-main);
  font-size: 0.95rem;
}

.code-input-row button {
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: var(--gold);
  color: #20160a;
  font-weight: 600;
  font-size: 0.9rem;
}

.code-input-row button:hover {
  filter: brightness(1.05);
}

.code-feedback {
  margin-top: 0.55rem;
  font-size: 0.9rem;
}

/* Filter */

.filter-section {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.8rem;
  align-items: center;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

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

.filter-btn {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(241, 214, 138, 0.55);
  background: transparent;
  color: var(--text-main);
  font-size: 0.85rem;
  cursor: pointer;
}

.filter-btn.active {
  background: var(--gold);
  color: #20160a;
}

/* Tools grid */

.tools-grid {
  margin-top: 1.6rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.1rem;
}

/* Karten – edlere Optik */

.tool-card {
  position: relative;
  border-radius: var(--radius-xl);
  padding: 1rem 1.1rem 1rem;
  overflow: hidden;
  background: linear-gradient(145deg, var(--bg-elevated) 0, var(--bg-elevated-soft) 100%);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(212, 175, 55, 0.25);
}

/* dezente Seitenlinie */

.tool-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(241, 214, 138, 0.1), rgba(212, 175, 55, 0.9));
}

/* Varianten für Wissen / Tool nur über Randton */

.tool-card.light {
  border-color: rgba(241, 214, 138, 0.45);
}

.tool-card.dark {
  border-color: rgba(125, 132, 192, 0.5);
}

/* Badge */

.tool-badges {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 0.45rem;
}

.badge {
  font-size: 0.75rem;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(8, 8, 14, 0.9);
  color: var(--text-muted);
}

.badge-kind {
  border-color: rgba(190, 190, 255, 0.6);
}

/* Card content */

.tool-title {
  font-size: 1.05rem;
  margin: 0.12rem 0 0.25rem;
  color: var(--text-main);
}

.tool-desc {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Varianten Buttons */

.tool-variants {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.variant-btn {
  padding: 0.36rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: transparent;
  color: var(--text-main);
}

/* Free Button – neutral Outline */

.variant-btn.free {
  border-color: rgba(255, 255, 255, 0.35);
}

.variant-btn.free:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Plus Button – Gold, wenn freigeschaltet */

.variant-btn.plus {
  border-color: rgba(212, 175, 55, 0.9);
  background: rgba(212, 175, 55, 0.16);
  color: var(--gold-soft);
}

.variant-btn.plus:hover {
  background: rgba(212, 175, 55, 0.25);
}

/* Gesperrte Plus Variante – zurückgenommen */

.variant-btn.plus.locked {
  border-color: rgba(130, 130, 130, 0.7);
  background: transparent;
  color: rgba(190, 190, 190, 0.85);
}

.variant-btn.plus.locked:hover {
  background: rgba(255, 255, 255, 0.03);
}

.tool-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Footer */

.r4x-footer {
  margin-top: 2.2rem;
  padding: 1rem 1.4rem 1.6rem;
  border-top: 1px solid var(--border-subtle);
  background: rgba(3, 3, 6, 0.96);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
}

.r4x-footer a {
  color: var(--gold-soft);
  text-decoration: none;
}

.footer-links {
  display: flex;
  gap: 0.6rem;
}

/* Responsive */

@media (max-width: 768px) {
  .header-nav {
    display: none;
  }

  .burger-btn {
    display: flex;
  }

  .main-container {
    margin-top: 1.2rem;
  }
}
