/* =========================================================
   Taco Adventure — Dark Gaming Theme
   ========================================================= */
:root {
  --bg-base:     #0d1117;
  --bg-card:     #161b22;
  --bg-card2:    #1c2230;
  --border:      #30363d;
  --text:        #e6edf3;
  --text-muted:  #8b949e;
  --accent:      #f97316;
  --accent-dark: #c2410c;
  --teal:        #14b8a6;
  --green:       #22c55e;
  --blue:        #3b82f6;
  --yellow:      #eab308;
  --red:         #ef4444;
  --purple:      #a855f7;
  --twitch:      #9147ff;

  /* Bootstrap dark theme overrides — prevents BS5 from applying
     light-mode defaults (#212529 text) on our dark background */
  --bs-body-color:        #e6edf3;
  --bs-body-color-rgb:    230, 237, 243;
  --bs-body-bg:           #0d1117;
  --bs-body-bg-rgb:       13, 17, 23;
  --bs-emphasis-color:    #ffffff;
  --bs-secondary-color:   #8b949e;
  --bs-secondary-bg:      #161b22;
  --bs-tertiary-bg:       #1c2230;
  --bs-heading-color:     #e6edf3;
  --bs-link-color:        #f97316;
  --bs-link-hover-color:  #c2410c;
  --bs-border-color:      #30363d;
  --bs-table-color:       #e6edf3;
  --bs-table-bg:          transparent;
  --bs-table-border-color:#30363d;
  --bs-table-striped-bg:  rgba(255,255,255,0.03);
  --bs-table-hover-bg:    rgba(255,255,255,0.04);
  --bs-form-valid-color:  #22c55e;
  --bs-form-invalid-color:#ef4444;
  --bs-accordion-color:   #e6edf3;
  --bs-accordion-bg:      #161b22;
  --bs-accordion-btn-color: #e6edf3;
  --bs-accordion-btn-bg:  #161b22;
  --bs-accordion-active-color: #f97316;
  --bs-accordion-active-bg:    #1c2230;
}

/* Base */
body {
  background: var(--bg-base);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

/* Navbar */
.ta-navbar {
  background: var(--bg-card) !important;
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1.5rem;
}
.ta-navbar .navbar-brand { font-size: 1.25rem; letter-spacing: -0.02em; }
.ta-navbar .nav-link { color: var(--text-muted) !important; padding: 0.5rem 0.85rem; border-radius: 6px; transition: all 0.15s; font-size: 0.9rem; }
.ta-navbar .nav-link:hover, .ta-navbar .nav-link.active {
  color: var(--text) !important;
  background: rgba(255,255,255,0.07);
}
.ta-navbar .nav-link.active { color: var(--accent) !important; }

.btn-twitch {
  background: var(--twitch);
  color: #fff;
  border: none;
  font-size: 0.85rem;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
}
.btn-twitch:hover { background: #7d3cd9; color: #fff; }

/* Footer */
.ta-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Cards */
.ta-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.ta-card-header {
  background: var(--bg-card2);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 1.05rem;
}

/* Page header */
.page-hero {
  background: linear-gradient(135deg, var(--bg-card2) 0%, rgba(249,115,22,0.07) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem 2.5rem;
  margin-bottom: 1.5rem;
}
.page-hero h1 { font-size: 1.8rem; font-weight: 700; color: var(--text); }
.page-hero p { color: var(--text-muted); margin-bottom: 0; }

/* Text utilities */
.text-accent { color: var(--accent) !important; }
.text-teal   { color: var(--teal) !important; }
.text-muted-ta { color: var(--text-muted) !important; }

/* Badges / State labels */
.state-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
}
.state-picked     { background: rgba(34,197,94,0.15);  color: var(--green); border: 1px solid rgba(34,197,94,0.3); }
.state-inqueue    { background: rgba(59,130,246,0.15); color: var(--blue);  border: 1px solid rgba(59,130,246,0.3); }
.state-unlocked   { background: rgba(234,179,8,0.15);  color: var(--yellow); border: 1px solid rgba(234,179,8,0.3); }
.state-locked     { background: rgba(239,68,68,0.12);  color: var(--red);   border: 1px solid rgba(239,68,68,0.25); }
.state-notavailable { background: rgba(139,148,158,0.12); color: var(--text-muted); border: 1px solid rgba(139,148,158,0.2); }

/* Stats counters */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  text-align: center;
}
.stat-card .stat-num { font-size: 2rem; font-weight: 700; line-height: 1.1; }
.stat-card .stat-label { color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 0.3rem; }

/* DataTables overrides */
.dataTables_wrapper { color: var(--text); }
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  background: var(--bg-card2) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  border-radius: 6px !important;
  padding: 0.35rem 0.6rem !important;
}
.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_info { color: var(--text-muted); font-size: 0.85rem; }
.dataTables_wrapper .dataTables_paginate .paginate_button { color: var(--text-muted) !important; border: none !important; border-radius: 6px !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button:hover { background: var(--bg-card2) !important; color: var(--text) !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button.current { background: var(--accent) !important; color: #fff !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled { color: var(--border) !important; }

/* Tables */
.ta-table { width: 100% !important; border-collapse: separate; border-spacing: 0; }
.ta-table thead th {
  background: var(--bg-card2) !important;
  color: var(--text-muted) !important;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
  border-bottom: 1px solid var(--border) !important;
  padding: 0.75rem 1rem !important;
  white-space: nowrap;
}
.ta-table thead th.sorting::after,
.ta-table thead th.sorting_asc::after,
.ta-table thead th.sorting_desc::after { color: var(--text-muted); }
.ta-table tbody tr { border-bottom: 1px solid rgba(48,54,61,0.6); transition: background 0.1s; }
.ta-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.ta-table tbody td { padding: 0.65rem 1rem !important; vertical-align: middle; font-size: 0.92rem; border: none !important; color: var(--text) !important; }
.ta-table tbody tr:last-child { border-bottom: none; }

/* Game cover images */
.game-thumb {
  width: 56px; height: 32px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--bg-card2);
}
.game-thumb-lg {
  width: 100%; max-height: 220px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg-card2);
}

/* Stars rating */
.stars { color: var(--yellow); letter-spacing: 0.05em; font-size: 1.05em; }

/* Queue tabs */
.ta-tabs .nav-link {
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-right: 0.4rem;
  padding: 0.45rem 1rem;
  font-size: 0.875rem;
  transition: all 0.15s;
}
.ta-tabs .nav-link.active, .ta-tabs .nav-link:hover {
  color: var(--accent);
  background: rgba(249,115,22,0.1);
  border-color: rgba(249,115,22,0.4);
}

/* Vote bar */
.vote-bar-wrap { background: var(--bg-card2); border-radius: 6px; height: 8px; overflow: hidden; }
.vote-bar { background: var(--accent); height: 100%; border-radius: 6px; transition: width 0.4s; }

/* FAQ accordion */
.ta-accordion .accordion-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px !important;
  margin-bottom: 0.5rem;
  overflow: hidden;
}
.ta-accordion .accordion-button {
  background: var(--bg-card);
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 1rem 1.25rem;
}
.ta-accordion .accordion-button:not(.collapsed) {
  background: var(--bg-card2);
  color: var(--accent);
  box-shadow: none;
}
.ta-accordion .accordion-button::after { filter: invert(0.6); }
.ta-accordion .accordion-body {
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.7;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

/* Filter bar */
.filter-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end;
}
.filter-bar .form-select, .filter-bar .form-control {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.875rem;
  border-radius: 6px;
}
.filter-bar .form-select:focus, .filter-bar .form-control:focus {
  background: var(--bg-card2);
  color: var(--text);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.15);
}
.filter-bar .form-label { color: var(--text-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.3rem; }
select option { background: var(--bg-card2); }

/* Game detail page */
.game-detail-img { border-radius: 10px; max-height: 260px; object-fit: cover; width: 100%; }
.game-meta-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.game-meta-row:last-child { border-bottom: none; }
.game-meta-label { color: var(--text-muted); min-width: 130px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* Home hero */
.home-hero {
  background: linear-gradient(135deg, #0d1117 0%, rgba(249,115,22,0.06) 60%, rgba(20,184,166,0.04) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 3rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}
.home-hero::before {
  content: '';
  position: absolute; top: -40px; right: -40px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(249,115,22,0.08) 0%, transparent 70%);
  border-radius: 50%;
}
.home-hero h1 { font-size: 2.5rem; font-weight: 800; line-height: 1.15; }
.home-hero h1 span { color: var(--accent); }

/* Recent games grid */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
}
.game-card:hover { transform: translateY(-3px); border-color: rgba(249,115,22,0.5); color: var(--text); }
.game-card-img { width: 100%; height: 120px; object-fit: cover; background: var(--bg-card2); display: block; }
.game-card-body { padding: 0.75rem; }
.game-card-title { font-size: 0.875rem; font-weight: 600; line-height: 1.35; margin-bottom: 0.25rem; }
.game-card-meta { font-size: 0.75rem; color: var(--text-muted); }

/* Giveaway */
.giveaway-count {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .home-hero { padding: 1.75rem; }
  .home-hero h1 { font-size: 1.8rem; }
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .filter-bar { flex-direction: column; }
  .filter-bar > * { width: 100%; }
}
