/* ========================================
   Games Section - Watauga Systems
   Landing page + game wrapper styles
   ======================================== */

/* --- Games Hero (Landing Page) --- */
.games-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--dark-brown) 100%);
  padding: 8rem 0 3rem;
  position: relative;
  overflow: hidden;
}
.games-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(51,101,130,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.games-breadcrumb {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color var(--transition);
}
.games-breadcrumb:hover { color: rgba(255,255,255,0.8); }
.games-breadcrumb-sep {
  color: rgba(255,255,255,0.3);
  margin: 0 0.4rem;
  font-size: 0.85rem;
}
.games-breadcrumb-current {
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
}

.games-hero h1 {
  color: var(--white);
  font-size: 2.4rem;
  margin-top: 1rem;
  margin-bottom: 0.75rem;
}

.games-hero p {
  color: rgba(255,255,255,0.7);
  font-size: 1.1rem;
  max-width: 560px;
}

/* --- Games Grid (Landing Page) --- */
.games-section {
  padding: 4rem 0 6rem;
  background: var(--off-white);
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.game-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: var(--border-radius);
  border: 1px solid rgba(0,0,0,0.06);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all var(--transition);
}
.game-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(37,54,65,0.1);
  border-color: rgba(51,101,130,0.2);
}
.game-card:hover .game-card-cta {
  color: var(--steel-blue);
}

.game-card-preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  overflow: hidden;
}

.game-card-preview svg.game-thumb {
  width: 100%;
  height: 100%;
  display: block;
}

.game-card-icon {
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.game-card-icon svg {
  width: 40px;
  height: 40px;
  color: rgba(255,255,255,0.7);
}

.game-card-info {
  padding: 1.75rem;
}

.game-card-info h2 {
  font-size: 1.3rem;
  margin-bottom: 0.6rem;
  color: var(--navy);
}

.game-card-info p {
  color: #555;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.game-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.game-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--steel-blue);
  background: rgba(51,101,130,0.08);
  padding: 0.25rem 0.7rem;
  border-radius: 50px;
  letter-spacing: 0.2px;
}

.game-card-cta {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--navy);
  transition: color var(--transition);
}

/* --- Game Wrapper Page --- */
.game-page-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--near-black);
}

/* Toolbar below navbar */
.game-toolbar {
  background: rgba(22, 19, 20, 0.98);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding-top: 72px; /* clear the fixed navbar */
}

.game-toolbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
}

.game-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.game-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition);
}
.game-back-link:hover { color: rgba(255,255,255,0.85); }
.game-back-link svg {
  width: 16px;
  height: 16px;
}

.game-toolbar-sep {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.1);
}

.game-toolbar-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1;
}

.game-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.game-kb-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(184,150,12,0.12);
  border: 1px solid rgba(184,150,12,0.2);
  border-radius: 6px;
  color: #D4AA1A;
  cursor: pointer;
  padding: 5px 10px;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  transition: all var(--transition);
}
.game-kb-link:hover {
  background: rgba(184,150,12,0.2);
  color: #F0D44A;
}
.game-kb-link svg {
  width: 15px;
  height: 15px;
}

.game-fullscreen-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.game-fullscreen-btn:hover {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
}
.game-fullscreen-btn svg {
  width: 18px;
  height: 18px;
}

/* Game iframe container */
.game-container {
  flex: 1;
  position: relative;
  background: #000;
  min-height: 0;
}

.game-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Fullscreen mode */
.game-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
}
.game-fullscreen .game-iframe {
  width: 100vw;
  height: 100vh;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .games-hero {
    padding: 7rem 0 2.5rem;
  }
  .games-hero h1 {
    font-size: 1.8rem;
  }

  .games-grid {
    grid-template-columns: 1fr;
  }

  .game-card-preview {
    min-height: 140px;
    padding: 2rem;
  }

  .game-toolbar-title {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .games-hero h1 {
    font-size: 1.5rem;
  }
  .game-card-icon {
    width: 60px;
    height: 60px;
  }
  .game-card-icon svg {
    width: 30px;
    height: 30px;
  }
}

/* ========================================
   Knowledgebase — Eternal Empires
   ======================================== */

.kb-body {
  background: #0F1118;
  color: #CBD5E1;
  font-family: var(--font-body);
}

/* Header */
.kb-header {
  background: linear-gradient(135deg, #1A1F2E 0%, #0F1118 100%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 6.5rem 0 2.5rem;
}
.kb-breadcrumb {
  font-size: 0.82rem;
  margin-bottom: 1rem;
}
.kb-breadcrumb a {
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  transition: color 0.2s;
}
.kb-breadcrumb a:hover { color: rgba(255,255,255,0.8); }
.kb-sep {
  color: rgba(255,255,255,0.2);
  margin: 0 0.4rem;
}
.kb-current {
  color: rgba(255,255,255,0.6);
}
.kb-title {
  font-family: 'Cinzel', serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: #F1F5F9;
  margin-bottom: 0.4rem;
}
.kb-subtitle {
  color: rgba(255,255,255,0.5);
  font-size: 1.05rem;
}

/* Layout */
.kb-layout {
  display: flex;
  gap: 2.5rem;
  padding-top: 2rem;
  padding-bottom: 4rem;
  align-items: flex-start;
}

/* Sidebar */
.kb-sidebar {
  position: sticky;
  top: 80px;
  width: 240px;
  flex-shrink: 0;
}
.kb-sidebar-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: rgba(255,255,255,0.7);
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  width: 100%;
  margin-bottom: 0.75rem;
}
.kb-sidebar-toggle svg {
  width: 18px;
  height: 18px;
}
.kb-nav-section {
  margin-bottom: 1.5rem;
}
.kb-nav-section h3 {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 0.5rem;
  padding-left: 0.75rem;
}
.kb-nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.15s;
}
.kb-nav-link:hover {
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.85);
}
.kb-nav-link.active {
  background: rgba(184,150,12,0.12);
  color: #D4AA1A;
  font-weight: 600;
}
.kb-empire-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.kb-play-btn {
  display: block;
  text-align: center;
  margin-top: 1.5rem;
  padding: 0.65rem 1rem;
  background: linear-gradient(135deg, #B8960C, #D4AA1A);
  color: #0F1118;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
}
.kb-play-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(184,150,12,0.3);
}

/* Content */
.kb-content {
  flex: 1;
  min-width: 0;
}

.kb-article {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 2.5rem;
  margin-bottom: 2rem;
}
.kb-article h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: #F1F5F9;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.kb-article h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #E2E8F0;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}
.kb-article p {
  line-height: 1.75;
  margin-bottom: 1rem;
  color: #94A3B8;
}
.kb-article ul, .kb-article ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}
.kb-article li {
  line-height: 1.7;
  margin-bottom: 0.5rem;
  color: #94A3B8;
}
.kb-article strong { color: #CBD5E1; }
.kb-article em { color: #B8960C; font-style: italic; }
.kb-article kbd {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #CBD5E1;
}

/* Callout */
.kb-callout {
  background: rgba(184,150,12,0.08);
  border-left: 3px solid #B8960C;
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  font-size: 0.92rem;
  color: #CBD5E1;
}

/* Phase list */
.kb-phase-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.kb-phase {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.kb-phase-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(184,150,12,0.15);
  color: #D4AA1A;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.kb-phase-body { flex: 1; }
.kb-phase-body h4 {
  font-size: 1rem;
  color: #E2E8F0;
  margin-bottom: 0.3rem;
}
.kb-phase-body p {
  font-size: 0.9rem;
  margin-bottom: 0;
}
.kb-phase-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0.15rem 0.6rem;
  border-radius: 50px;
  margin-bottom: 0.4rem;
}
.kb-phase-tag.auto {
  background: rgba(76,175,130,0.15);
  color: #4CAF82;
}
.kb-phase-tag.player {
  background: rgba(33,150,176,0.15);
  color: #2196B0;
}

/* Card type grid */
.kb-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.kb-type-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 1.25rem;
}
.kb-type-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.75rem;
}
.kb-type-card h4 {
  font-size: 1rem;
  color: #E2E8F0;
  margin-bottom: 0.4rem;
}
.kb-type-card p {
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}
.kb-type-meta {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
  font-weight: 600;
}

/* Rules grid */
.kb-rules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1rem 0;
}
.kb-rule {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 1.25rem;
}
.kb-rule h5 {
  font-size: 0.95rem;
  color: #D4AA1A;
  margin-bottom: 0.4rem;
}
.kb-rule p {
  font-size: 0.88rem;
  margin-bottom: 0;
}

/* Table */
.kb-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}
.kb-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255,255,255,0.4);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.kb-table td {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: #94A3B8;
}
.kb-table td strong { color: #E2E8F0; }

/* Empire articles */
.kb-empire-header {
  border-left: 4px solid;
  border-radius: 0;
  margin: -2.5rem -2.5rem 2rem;
  overflow: hidden;
}
.kb-empire-banner {
  padding: 2rem 2.5rem;
}
.kb-empire-banner h2 {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0.3rem;
}
.kb-empire-motto {
  font-style: italic;
  color: rgba(255,255,255,0.5) !important;
  font-size: 1.05rem;
  margin-bottom: 0 !important;
}

.kb-empire-banner.rome { background: linear-gradient(135deg, rgba(184,150,12,0.12), rgba(212,170,26,0.05)); }
.kb-empire-banner.egypt { background: linear-gradient(135deg, rgba(200,150,42,0.12), rgba(232,184,74,0.05)); }
.kb-empire-banner.japan { background: linear-gradient(135deg, rgba(139,26,26,0.15), rgba(184,48,48,0.05)); }
.kb-empire-banner.polynesia { background: linear-gradient(135deg, rgba(0,96,112,0.15), rgba(0,136,152,0.05)); }

.kb-empire-stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.kb-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.kb-stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255,255,255,0.3);
}
.kb-stat-val {
  font-weight: 700;
  font-size: 0.95rem;
}

/* Leader card */
.kb-leader-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 1.5rem;
  margin: 1rem 0;
}
.kb-leader-card.rome-border { border-left: 3px solid #B8960C; }
.kb-leader-card.egypt-border { border-left: 3px solid #C8962A; }
.kb-leader-card.japan-border { border-left: 3px solid #8B1A1A; }
.kb-leader-card.polynesia-border { border-left: 3px solid #006070; }

.kb-leader-stats {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 1rem;
}
.kb-leader-ability {
  margin-bottom: 1rem;
}
.kb-leader-ability:last-child { margin-bottom: 0; }
.kb-leader-ability h5 {
  font-size: 0.95rem;
  color: #D4AA1A;
  margin-bottom: 0.3rem;
}
.kb-leader-ability p {
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* Game card list */
.kb-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.kb-game-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #94A3B8;
}
.kb-game-card strong { color: #E2E8F0; }
.kb-cost {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: #D4AA1A;
  background: rgba(184,150,12,0.1);
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  margin-left: 0.3rem;
}
.kb-stats {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  margin-left: 0.3rem;
}

/* Affinity grid */
.kb-affinity-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1rem 0;
}
.kb-affinity {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-left: 3px solid;
  border-radius: 0 10px 10px 0;
  padding: 1.25rem;
}
.kb-affinity h4 {
  font-size: 1rem;
  color: #E2E8F0;
  margin-bottom: 0.4rem;
}
.kb-affinity p {
  font-size: 0.88rem;
  margin-bottom: 0;
}

/* Tips grid */
.kb-tips-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1rem 0;
}
.kb-tip {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 1.25rem;
}
.kb-tip h4 {
  font-size: 0.95rem;
  color: #D4AA1A;
  margin-bottom: 0.4rem;
}
.kb-tip p {
  font-size: 0.88rem;
  margin-bottom: 0;
}

/* Footer */
.kb-footer {
  background: rgba(255,255,255,0.02);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 2rem 0;
  text-align: center;
}
.kb-footer p {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.3);
  margin-bottom: 0.5rem;
}
.kb-footer a {
  color: #D4AA1A;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
.kb-footer a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 960px) {
  .kb-card-grid,
  .kb-rules-grid,
  .kb-affinity-grid,
  .kb-tips-grid {
    grid-template-columns: 1fr;
  }
  .kb-empire-stats {
    flex-wrap: wrap;
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .kb-layout {
    flex-direction: column;
  }
  .kb-sidebar {
    position: relative;
    top: auto;
    width: 100%;
  }
  .kb-sidebar-toggle {
    display: flex;
  }
  .kb-nav {
    display: none;
  }
  .kb-nav.open {
    display: block;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
  }
  .kb-article {
    padding: 1.5rem;
  }
  .kb-empire-header {
    margin: -1.5rem -1.5rem 1.5rem;
  }
  .kb-empire-banner {
    padding: 1.5rem;
  }
  .kb-title {
    font-size: 1.6rem;
  }
}
