/* ==========================================================================
   Klickspiel.net – Custom Styles (Bootstrap 5.3 Ergänzung)
   Updated color system: blue-forward, harmonized, cleaner neutrals
   ========================================================================== */

:root {
  /* Core palette (blue-first) */
  --ks-primary: #2563eb;           /* Blue 600 */
  --ks-primary-dark: #1d4ed8;      /* Blue 700 */
  --ks-primary-soft: #60a5fa;      /* Blue 400 */
  --ks-primary-rgb: 37, 99, 235;   /* for rgba() */

  /* Supporting palette (cool + one warm accent for focus/CTAs) */
  --ks-secondary: #14b8a6;         /* Teal 500 */
  --ks-secondary-dark: #0f766e;    /* Teal 700 */
  --ks-accent: #f59e0b;            /* Amber 500 (warm accent for focus states) */

  /* Neutrals */
  --ks-dark: #0f172a;              /* Slate 900 */
  --ks-muted: #475569;             /* Slate 600 */
  --ks-light: #f8fafc;             /* Slate 50 */
  --ks-surface: #ffffff;
  --ks-border: #e2e8f0;            /* Slate 200 */

  /* Status */
  --ks-success: #16a34a;           /* Green 600 */
  --ks-warning: #f59e0b;           /* Amber 500 */
  --ks-danger: #dc2626;            /* Red 600 */

  /* Backgrounds */
  --ks-game-bg: #eff6ff;           /* Blue 50-ish */
  --ks-page-bg: #f3f6ff;           /* subtle blue tint */

  /* Shape */
  --ks-radius: 1rem;
}

/* Typography */
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--ks-dark);
  background-color: var(--ks-page-bg);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--ks-dark);
}

/* Navbar */
.navbar-brand {
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--ks-primary) !important;
}

.navbar {
  box-shadow: 0 2px 10px rgba(2, 6, 23, .06);
  background-color: var(--ks-surface) !important;
}

.nav-link {
  font-weight: 600;
  transition: color .2s;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--ks-primary) !important;
}

/* Hero / Header */
.hero-section {
  background: linear-gradient(135deg, var(--ks-primary), var(--ks-primary-soft));
  color: #fff;
  padding: 3rem 0;
  border-radius: 0 0 2rem 2rem;
}

.hero-section h1 {
  color: #fff;
  font-size: 2.2rem;
}

@media (min-width: 768px) {
  .hero-section h1 {
    font-size: 2.8rem;
  }
}

/* Game Cards */
.game-card {
  border: 1px solid rgba(226, 232, 240, .8);
  border-radius: var(--ks-radius);
  box-shadow: 0 6px 18px rgba(2, 6, 23, .06);
  transition: transform .2s, box-shadow .2s, border-color .2s;
  overflow: hidden;
  background: var(--ks-surface);
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(2, 6, 23, .10);
  border-color: rgba(37, 99, 235, .25);
}

.game-card .card-body {
  padding: 1.5rem;
}

.game-card .card-title {
  font-weight: 700;
  color: var(--ks-dark);
}

.game-card .card-icon {
  font-size: 2.5rem;
  margin-bottom: .75rem;
  color: var(--ks-primary);
}

/* Game Area */
.game-area {
  background: var(--ks-surface);
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: var(--ks-radius);
  box-shadow: 0 8px 30px rgba(2, 6, 23, .08);
  padding: 2rem;
  text-align: center;
}

.game-area .click-zone {
  background: linear-gradient(135deg, var(--ks-primary), var(--ks-primary-soft));
  color: #fff;
  border: none;
  border-radius: var(--ks-radius);
  min-height: 200px;
  width: 100%;
  font-size: 1.5rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform .1s, filter .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.game-area .click-zone:hover {
  filter: brightness(1.03);
}

.game-area .click-zone:active {
  transform: scale(.97);
}

.game-area .click-zone:focus-visible {
  outline: 3px solid rgba(245, 158, 11, .9);
  outline-offset: 3px;
}

/* Timer Buttons */
.timer-btn {
  border-radius: 2rem;
  padding: .5rem 1.25rem;
  font-weight: 700;
  border: 2px solid rgba(37, 99, 235, .35);
  color: var(--ks-primary);
  background: rgba(37, 99, 235, .06);
  transition: all .2s;
}

.timer-btn:hover,
.timer-btn.active {
  background: var(--ks-primary);
  color: #fff;
  border-color: var(--ks-primary);
}

/* Stats Display */
.stat-box {
  background: var(--ks-light);
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: .75rem;
  padding: 1rem;
  text-align: center;
}

.stat-box .stat-value {
  font-size: 2rem;
  font-weight: 900;
  color: var(--ks-primary);
  line-height: 1.2;
}

.stat-box .stat-label {
  font-size: .85rem;
  color: var(--ks-muted);
  margin-top: .25rem;
}

/* Results Table */
.results-table {
  font-size: .9rem;
}

.results-table th {
  background: var(--ks-primary);
  color: #fff;
  font-weight: 700;
}

/* CTA Buttons */
.btn-ks-primary {
  background: var(--ks-primary);
  color: #fff;
  border: none;
  border-radius: 2rem;
  padding: .65rem 1.5rem;
  font-weight: 800;
  transition: background .2s, transform .1s, box-shadow .2s;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .18);
}

.btn-ks-primary:hover {
  background: var(--ks-primary-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(37, 99, 235, .22);
}

.btn-ks-primary:focus-visible {
  outline: 3px solid rgba(245, 158, 11, .9);
  outline-offset: 2px;
}

.btn-ks-secondary {
  background: var(--ks-secondary);
  color: #fff;
  border: none;
  border-radius: 2rem;
  padding: .65rem 1.5rem;
  font-weight: 800;
  transition: background .2s, transform .1s;
}

.btn-ks-secondary:hover {
  background: var(--ks-secondary-dark);
  color: #fff;
  transform: translateY(-1px);
}

/* Breadcrumb */
.breadcrumb {
  background: transparent;
  padding: .5rem 0;
  font-size: .9rem;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "›";
}

/* FAQ Section */
.faq-section .accordion-button {
  font-weight: 700;
  color: var(--ks-dark);
}

.faq-section .accordion-button:not(.collapsed) {
  background-color: rgba(var(--ks-primary-rgb), .08);
  color: var(--ks-primary);
}

.faq-section .accordion-button:focus {
  box-shadow: 0 0 0 .25rem rgba(var(--ks-primary-rgb), .22);
}

/* Footer */
.site-footer {
  background: #0b1220;
  color: rgba(226, 232, 240, .75);
  padding: 2.5rem 0 1.5rem;
}

.site-footer a {
  color: rgba(226, 232, 240, .92);
  text-decoration: none;
  transition: color .2s, opacity .2s;
}

.site-footer a:hover {
  color: var(--ks-secondary);
}

.site-footer h5 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 1rem;
}

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--ks-surface);
  box-shadow: 0 -6px 26px rgba(2, 6, 23, .16);
  z-index: 9999;
  padding: 1.25rem;
  border-top: 3px solid var(--ks-primary);
}

.cookie-banner.hidden {
  display: none;
}

.cookie-banner h6 {
  font-weight: 800;
}

.cookie-banner .btn {
  border-radius: 2rem;
  font-weight: 700;
  padding: .4rem 1.25rem;
}

.cookie-settings {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, .55);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cookie-settings.hidden {
  display: none;
}

.cookie-settings-dialog {
  background: var(--ks-surface);
  border-radius: var(--ks-radius);
  max-width: 480px;
  width: 90%;
  padding: 2rem;
  border: 1px solid rgba(226, 232, 240, .9);
  box-shadow: 0 14px 50px rgba(2, 6, 23, .28);
}

/* Reaction Test Colors */
.reaction-wait {
  background: var(--ks-danger) !important;
}

.reaction-ready {
  background: var(--ks-success) !important;
}

.reaction-early {
  background: var(--ks-warning) !important;
  color: var(--ks-dark) !important;
}

/* Canvas Game */
.game-canvas-wrapper {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.game-canvas-wrapper canvas {
  width: 100%;
  border-radius: .75rem;
  display: block;
  background: #93c5fd; /* soft sky-blue */
}

/* Tap Zone (Mobile) */
.tap-zone {
  background: linear-gradient(135deg, var(--ks-secondary), var(--ks-secondary-dark));
  color: #fff;
  border: none;
  border-radius: var(--ks-radius);
  min-height: 250px;
  width: 100%;
  font-size: 1.8rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform .05s, filter .2s;
}

.tap-zone:hover {
  filter: brightness(1.03);
}

.tap-zone:active {
  transform: scale(.96);
}

/* Progress Bar */
.game-progress {
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(226, 232, 240, .9);
}

.game-progress .bar {
  height: 100%;
  background: var(--ks-primary);
  border-radius: 4px;
  transition: width .1s linear;
}

/* Internal Link Cards */
.internal-link-card {
  border: 2px solid rgba(226, 232, 240, .9);
  border-radius: var(--ks-radius);
  padding: 1rem;
  text-decoration: none;
  color: var(--ks-dark);
  display: block;
  background: var(--ks-surface);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}

.internal-link-card:hover {
  border-color: rgba(37, 99, 235, .45);
  box-shadow: 0 10px 24px rgba(2, 6, 23, .08);
  transform: translateY(-2px);
  color: var(--ks-dark);
}

/* Section Spacing */
.content-section {
  padding: 2.5rem 0;
}

.content-section:nth-child(even) {
  background: var(--ks-surface);
}

/* Responsive Adjustments */
@media (max-width: 575.98px) {
  .game-area {
    padding: 1.25rem;
  }

  .stat-box .stat-value {
    font-size: 1.5rem;
  }

  .hero-section {
    padding: 2rem 0;
    border-radius: 0 0 1rem 1rem;
  }
}

/* Skip to Content Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ks-primary);
  color: #fff;
  padding: .5rem 1rem;
  border-radius: 0 0 .5rem .5rem;
  z-index: 10001;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(2, 6, 23, .18);
}

.skip-link:focus {
  top: 0;
  color: #fff;
}

/* History List */
.history-list {
  max-height: 300px;
  overflow-y: auto;
}

/* Print */
@media print {
  .navbar, .cookie-banner, .site-footer, .cookie-settings {
    display: none !important;
  }
}
