:root {
  --bvk-dark: #1a1a2e;
  --bvk-accent: #c0392b;
  --bvk-accent-hover: #e74c3c;
  --bvk-light: #f5f5f5;
  --bvk-white: #ffffff;
  --bvk-text: #333333;
  --bvk-text-light: #666666;
  --bvk-border: #e0e0e0;
  --sidebar-width: 280px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--bvk-text);
  background: var(--bvk-light);
}

a { color: var(--bvk-accent); text-decoration: none; }
a:hover { color: var(--bvk-accent-hover); }

img { max-width: 100%; height: auto; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bvk-white);
  border-right: 1px solid var(--bvk-border);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  padding: 1rem;
  text-align: center;
  border-bottom: 1px solid var(--bvk-border);
}

.sidebar-logo img {
  width: 100%;
  border-radius: 8px;
}

.sidebar-logo .slogan {
  color: var(--bvk-text-light);
  font-size: 0.75rem;
  margin-top: 0.3rem;
}

.sidebar-nav {
  padding: 0.5rem 0;
  flex: 1;
}

.sidebar-nav a {
  display: block;
  padding: 0.45rem 1.2rem;
  color: var(--bvk-text);
  font-size: 0.85rem;
  transition: background 0.2s, color 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: var(--bvk-light);
  color: var(--bvk-accent);
  border-left-color: var(--bvk-accent);
}

.sidebar-nav .nav-icon {
  display: inline-block;
  width: 1.3rem;
  text-align: center;
  margin-right: 0.3rem;
  font-size: 0.85rem;
}

.sidebar-nav .sub-nav {
  display: none;
}

.sidebar-nav .sub-nav.open {
  display: block;
}

.sidebar-nav .sub-nav a {
  padding: 0.25rem 1.2rem 0.25rem 2.5rem;
  font-size: 0.75rem;
  color: var(--bvk-text-light);
  border-left: 3px solid transparent;
}

.sidebar-nav .sub-nav a:hover {
  color: var(--bvk-accent);
  background: var(--bvk-light);
  border-left-color: var(--bvk-accent);
}

.sidebar-nav .nav-toggle {
  cursor: pointer;
  user-select: none;
}

.sidebar-nav .nav-toggle::after {
  content: '\25BE';
  float: right;
  margin-right: 0.5rem;
  font-size: 0.8rem;
  transition: transform 0.2s;
}

.sidebar-nav .nav-toggle.open::after {
  transform: rotate(180deg);
}

.sidebar-termine {
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--bvk-border);
  font-size: 0.75rem;
  color: var(--bvk-text-light);
}

.sidebar-termine h4 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bvk-text-light);
  margin-bottom: 0.4rem;
}

.sidebar-termine ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-termine li {
  padding: 0.15rem 0;
  line-height: 1.3;
}

.sidebar-termine .termin-date {
  font-weight: 600;
  color: var(--bvk-text);
}

.sidebar-links {
  padding: 0.5rem 1.5rem;
  font-size: 0.82rem;
}

.sidebar-links a {
  display: block;
  padding: 0.3rem 0;
  color: var(--bvk-text-light);
}

.sidebar-links a:hover {
  color: var(--bvk-accent);
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--bvk-border);
  font-size: 0.8rem;
  color: var(--bvk-text-light);
  text-align: center;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  position: fixed;
  top: 0.75rem;
  right: 1rem;
  z-index: 200;
  background: var(--bvk-white);
  border: 1px solid var(--bvk-border);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}

/* Header / Hero */
.hero {
  background: linear-gradient(135deg, #5a1a1a 0%, #7a2020 100%);
  color: #ffffff;
  padding: 1.25rem 2rem;
  text-align: center;
}

.hero h1 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.hero .subtitle {
  font-size: 0.85rem;
  opacity: 0.8;
}

.hero-info {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.hero-info-item {
  background: rgba(255,255,255,0.1);
  padding: 0.4rem 0.9rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

.hero-info-item strong {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
  margin-bottom: 0.1rem;
}

/* Page Header */
.page-header {
  background: linear-gradient(135deg, #5a1a1a 0%, #7a2020 100%);
  color: #ffffff;
  padding: 1.25rem 2rem;
}

.page-header h1 {
  font-size: 1.3rem;
  font-weight: 600;
}

.page-header .breadcrumb {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-top: 0.3rem;
}

.page-header .breadcrumb a { color: #ffffff; }

/* Content Sections */
.content-section {
  padding: 2rem;
  max-width: 960px;
  margin: 0 auto;
}

.section-card {
  background: var(--bvk-white);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.section-card h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: var(--bvk-dark);
  border-bottom: 2px solid var(--bvk-accent);
  padding-bottom: 0.5rem;
}

.section-card h3 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--bvk-dark);
}

.section-card p {
  margin-bottom: 0.75rem;
}

.section-card ul {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
  list-style: disc;
}

.section-card ul li {
  margin-bottom: 0.4rem;
}

/* Match Report */
.match-report {
  background: var(--bvk-white);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.match-report .match-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.match-report .match-header h3 {
  font-size: 1.1rem;
  color: var(--bvk-dark);
}

.match-report .match-date {
  color: var(--bvk-text-light);
  font-size: 0.9rem;
}

/* Tables */
.bvk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1rem 0;
}

.bvk-table th {
  background: var(--bvk-accent);
  color: #ffffff;
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-weight: 600;
}

.bvk-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--bvk-border);
}

.bvk-table tr:nth-child(even) {
  background: #fafafa;
}

.bvk-table tr:hover {
  background: #f0f0f0;
}

.bvk-table tr.bvk-highlight {
  background: #fdf2f2;
  font-weight: 600;
}

.result-win { color: #27ae60; font-weight: 600; }
.result-loss { color: #c0392b; font-weight: 600; }
.result-draw { color: #f39c12; font-weight: 600; }

.match-detail {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--bvk-border);
}

.match-detail:last-child { border-bottom: none; }

.match-detail h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--bvk-dark);
}

.board-table { font-size: 0.85rem; }

.lichess-puzzle {
  text-align: center;
  margin-bottom: 1rem;
}

/* Info Grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.info-card {
  background: var(--bvk-white);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border-top: 3px solid var(--bvk-accent);
}

.info-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--bvk-dark);
}

.info-card .icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

/* Contact Section */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.contact-card {
  background: var(--bvk-white);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.contact-card h3 {
  margin-bottom: 0.75rem;
  color: var(--bvk-dark);
}

/* Kontakt-Button */
.btn-kontakt {
  display: inline-block;
  background: var(--bvk-accent);
  color: #ffffff !important;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-kontakt:hover {
  background: var(--bvk-accent-hover);
  color: #ffffff !important;
}

/* Footer */
.site-footer {
  background: #1a1a2e;
  color: rgba(255,255,255,0.7);
  padding: 2rem;
  text-align: center;
  font-size: 0.85rem;
}

.site-footer a { color: rgba(255,255,255,0.9); }

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.footer-badges {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  font-size: 0.75rem;
  opacity: 0.6;
}

.footer-badges span {
  white-space: nowrap;
}

/* Scroll lock when sidebar open on mobile */
body.sidebar-open {
  overflow: hidden;
}

/* Table scroll wrapper for mobile */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1rem -0.5rem;
  padding: 0 0.5rem;
}

.table-scroll .bvk-table {
  margin: 0;
  min-width: 480px;
}

/* Responsive */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.active {
    display: block;
  }

  .menu-toggle {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .hero h1 { font-size: 1.1rem; }
  .page-header h1 { font-size: 1.1rem; }

  .hero-info { gap: 0.5rem; }

  .content-section { padding: 1.5rem 1rem; }

  /* Sidebar touch-friendly links */
  .sidebar-nav a {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }

  .sidebar-nav .sub-nav a {
    padding: 0.45rem 1.2rem 0.45rem 2.5rem;
    font-size: 0.8rem;
  }
}

/* Vereinsleben-Vorschau auf Startseite */
#vereinsleben-preview .match-report {
  margin-bottom: 1rem;
  padding: 1rem 1.5rem;
  border-left: 3px solid var(--bvk-accent);
  box-shadow: none;
}

#vereinsleben-preview .match-report:last-child {
  margin-bottom: 0;
}

/* Dark Mode Toggle */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: background 0.2s;
  line-height: 1;
}

.theme-toggle:hover {
  background: var(--bvk-border);
}

/* Dark Mode */
[data-theme="dark"] {
  --bvk-dark: #e8e8f0;
  --bvk-accent: #e85d4a;
  --bvk-accent-hover: #f07060;
  --bvk-light: #121218;
  --bvk-white: #1e1e2a;
  --bvk-text: #d4d4d8;
  --bvk-text-light: #9a9aaa;
  --bvk-border: #2e2e3e;
}

[data-theme="dark"] .sidebar {
  background: #1a1a24;
  border-right-color: #2e2e3e;
}

[data-theme="dark"] .sidebar-logo img {
  filter: invert(1);
}

[data-theme="dark"] .hero,
[data-theme="dark"] .page-header {
  background: linear-gradient(135deg, #2a0a0a 0%, #3a1010 100%);
}

[data-theme="dark"] .bvk-table th {
  background: #8b2020;
}

[data-theme="dark"] .bvk-table tr:nth-child(even) {
  background: #16161e;
}

[data-theme="dark"] .bvk-table tr:hover {
  background: #22222e;
}

[data-theme="dark"] .bvk-table tr.bvk-highlight {
  background: #2a1616;
}

[data-theme="dark"] .site-footer {
  background: #0e0e14;
}

[data-theme="dark"] .info-card {
  border-top-color: #8b2020;
}

[data-theme="dark"] .menu-toggle {
  background: #1a1a24;
  border-color: #2e2e3e;
  color: var(--bvk-text);
}

[data-theme="dark"] .theme-toggle {
  color: var(--bvk-text);
}

[data-theme="dark"] .sidebar-nav a:hover,
[data-theme="dark"] .sidebar-nav a.active {
  background: #252530;
}

[data-theme="dark"] .sidebar-nav .sub-nav a:hover {
  background: #252530;
}

[data-theme="dark"] .result-win { color: #4ade80; }
[data-theme="dark"] .result-loss { color: #f87171; }
[data-theme="dark"] .result-draw { color: #fbbf24; }

@media (max-width: 600px) {
  body { font-size: 15px; }

  .hero { padding: 1rem 1rem 0.75rem; }
  .hero h1 { font-size: 1rem; }
  .hero .subtitle { font-size: 0.8rem; }
  .hero-info { flex-direction: column; gap: 0.4rem; }
  .hero-info-item { width: 100%; text-align: center; padding: 0.35rem 0.75rem; font-size: 0.78rem; }

  .page-header { padding: 1rem; }
  .page-header h1 { font-size: 1rem; }
  .page-header .breadcrumb { font-size: 0.78rem; }

  .content-section { padding: 1rem 0.75rem; }

  .section-card { padding: 1.25rem 1rem; margin-bottom: 1rem; border-radius: 6px; }
  .section-card h2 { font-size: 1.15rem; margin-bottom: 0.75rem; }
  .section-card h3 { font-size: 1rem; margin: 1rem 0 0.4rem; }

  .match-report { padding: 1.25rem 1rem; }
  .match-report .match-header { flex-direction: column; gap: 0.25rem; }

  /* Tables: smaller + scrollable */
  .bvk-table { font-size: 0.78rem; }
  .bvk-table th, .bvk-table td { padding: 0.35rem 0.45rem; }

  /* Info-grid single column on phones */
  .info-grid { grid-template-columns: 1fr; gap: 1rem; }
  .info-card { padding: 1.25rem 1rem; }
  .info-card .icon { font-size: 1.5rem; margin-bottom: 0.3rem; }

  /* Contact grid single column */
  .contact-grid { grid-template-columns: 1fr; gap: 1rem; }

  /* Lichess iframe responsive */
  .lichess-puzzle iframe { width: 100% !important; max-width: 400px; height: auto; aspect-ratio: 400/444; }

  /* Footer compact on mobile */
  .site-footer { padding: 1.25rem 1rem; }
  .footer-links { gap: 1rem; font-size: 0.8rem; }
  .footer-badges { gap: 0.75rem; font-size: 0.7rem; }
  .footer-badges span { white-space: normal; text-align: center; }
}
