/* === Klondike Solitaire — Card Table Theme === */
:root {
  --felt: #0a5c1a;
  --felt-dark: #073f12;
  --card-bg: #faf3e6;
  --card-red: #c0392b;
  --card-black: #1a1a2e;
  --gold: #d4a017;
  --gold-light: #f0c040;
  --text: #e8e0d0;
  --text-dark: #1a1a2e;
  --surface: rgba(0,0,0,0.25);
  --surface-light: rgba(255,255,255,0.08);
  --shadow: 0 4px 16px rgba(0,0,0,0.4);
}
[data-theme="light"] {
  --felt: #0d7a2e;
  --felt-dark: #0a5c1a;
  --card-bg: #fffef5;
  --text: #222;
  --text-dark: #111;
  --surface: rgba(0,0,0,0.08);
  --surface-light: rgba(0,0,0,0.04);
  --shadow: 0 4px 12px rgba(0,0,0,0.15);
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--felt);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Navigation */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--felt-dark);
  border-bottom: 2px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.15em;
}
.nav-brand img { height: 32px; width: 32px; border-radius: 6px; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.9em;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.nav-links a:hover { opacity: 1; color: var(--gold-light); }

/* Theme toggle */
#themeToggle {
  background: none;
  border: 1.5px solid var(--gold);
  color: var(--text);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 1.1em;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s;
}
#themeToggle:hover { background: var(--surface-light); }

/* Language dropdown */
.lang-switch { position: relative; }
.lang-btn {
  background: var(--surface);
  border: 1px solid var(--gold);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.88em;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.lang-btn:hover { background: var(--surface-light); }
.lang-btn::after { content: '\25BE'; font-size: 0.7em; }
.lang-dropdown {
  display: none;
  position: absolute;
  top: 110%;
  right: 0;
  background: var(--felt-dark);
  border: 1px solid var(--gold);
  border-radius: 8px;
  min-width: 150px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 200;
  box-shadow: var(--shadow);
}
.lang-dropdown.open { display: block; }
.lang-dropdown a {
  display: block;
  padding: 8px 16px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.88em;
  transition: background 0.15s;
}
.lang-dropdown a:hover,
.lang-dropdown a.active { background: var(--surface-light); color: var(--gold-light); }

/* Main hero */
.hero {
  text-align: center;
  padding: 28px 16px 12px;
  max-width: 800px;
  margin: 0 auto;
}
.hero h1 {
  font-size: clamp(1.5em, 3.5vw, 2.2em);
  font-weight: 800;
  color: var(--gold-light);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}
.hero p {
  font-size: 1.02em;
  opacity: 0.9;
  line-height: 1.55;
  max-width: 620px;
  margin: 0 auto 12px;
}

/* Game controls */
.game-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 16px 14px;
}
.game-toolbar button {
  background: var(--surface);
  border: 1px solid var(--gold);
  color: var(--text);
  padding: 7px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.92em;
  font-weight: 600;
  transition: all 0.2s;
  letter-spacing: 0.2px;
}
.game-toolbar button:hover { background: var(--gold); color: #111; }
.game-toolbar .score-board {
  font-size: 0.95em;
  opacity: 0.85;
  background: var(--surface);
  padding: 6px 14px;
  border-radius: 20px;
  font-variant-numeric: tabular-nums;
}

/* Game canvas */
.game-wrap {
  display: flex;
  justify-content: center;
  padding: 0 8px 20px;
}
#gameCanvas {
  border-radius: 12px;
  box-shadow: var(--shadow);
  background: radial-gradient(ellipse at center, #0d7d25 0%, #063f10 100%);
  max-width: 100%;
  height: auto;
}
[data-theme="light"] #gameCanvas {
  background: radial-gradient(ellipse at center, #169a35 0%, #0a5c1a 100%);
}

/* Game intro text */
.intro-block {
  max-width: 740px;
  margin: 0 auto 20px;
  padding: 0 16px;
  text-align: center;
  line-height: 1.7;
  font-size: 0.98em;
  opacity: 0.88;
}

/* Highlights grid */
.highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  max-width: 900px;
  margin: 0 auto 28px;
  padding: 0 16px;
}
.highlight-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 18px 18px 16px;
  transition: transform 0.2s, border-color 0.2s;
}
.highlight-card:hover { transform: translateY(-2px); border-color: var(--gold); }
.highlight-card h3 {
  font-size: 1.05em;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 6px;
}
.highlight-card p { font-size: 0.9em; opacity: 0.85; line-height: 1.5; }

/* FAQ */
.faq-section {
  max-width: 800px;
  margin: 0 auto 32px;
  padding: 0 16px;
}
.faq-section h2 {
  text-align: center;
  font-size: 1.4em;
  color: var(--gold-light);
  margin-bottom: 16px;
}
.faq-item {
  background: var(--surface);
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
}
.faq-q {
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.98em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  transition: background 0.15s;
}
.faq-q:hover { background: var(--surface-light); }
.faq-q::after { content: '+'; font-size: 1.3em; opacity: 0.6; }
.faq-item.open .faq-q::after { content: '\2013'; }
.faq-a {
  display: none;
  padding: 4px 18px 16px;
  font-size: 0.92em;
  opacity: 0.85;
  line-height: 1.6;
}
.faq-item.open .faq-a { display: block; }

/* Footer */
.site-footer {
  background: var(--felt-dark);
  border-top: 2px solid var(--gold);
  padding: 20px 16px 24px;
  text-align: center;
  margin-top: auto;
}
.site-footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.site-footer .footer-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.9em;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.site-footer .footer-links a:hover { opacity: 1; color: var(--gold-light); }
.footer-email { font-size: 0.85em; opacity: 0.6; margin-bottom: 4px; }
.footer-copy { font-size: 0.8em; opacity: 0.5; }

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--felt-dark);
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 999;
  box-shadow: var(--shadow);
  transition: transform 0.35s ease;
  max-width: 480px;
  width: calc(100% - 32px);
}
.cookie-banner.visible { transform: translateX(-50%) translateY(0); }
.cookie-banner p { font-size: 0.85em; flex: 1; line-height: 1.5; }
.cookie-banner button {
  background: var(--gold);
  border: none;
  color: #111;
  padding: 7px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.88em;
  white-space: nowrap;
}

/* Responsive */
@media (max-width: 560px) {
  .top-nav { padding: 8px 12px; flex-wrap: wrap; gap: 8px; }
  .nav-links { gap: 10px; }
  .highlights { grid-template-columns: 1fr; }
  .hero p { font-size: 0.94em; }
  .cookie-banner { flex-direction: column; text-align: center; }
}
