@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800;900&display=swap');

/* ============================================================
   VARIÁVEIS DE TEMA GITHUB + IDENTIDADE ESQUENTA (LARANJA)
   ============================================================ */
:root {
  --gh-bg: #0d1117;
  --gh-header-bg: #161b22;
  --gh-card-bg: #161b22;
  --gh-card-hover: #1f242c;
  --gh-border: #30363d;
  --gh-border-subtle: #21262d;
  --gh-text: #f0f6fc;
  --gh-text-muted: #8b949e;
  
  --gh-accent: #ff6b2b;
  --gh-accent-gradient: linear-gradient(135deg, #e52e2e 0%, #ff7a00 100%);
  --gh-accent-glow: rgba(255, 107, 43, 0.15);

  color-scheme: dark;
}

body.light-theme {
  --gh-bg: #faf7f3;
  --gh-header-bg: #ffffff; /* Barra superior branca no modo claro */
  --gh-card-bg: #ffffff;
  --gh-card-hover: #f3eee7;
  --gh-border: #d0d7de;
  --gh-border-subtle: #e6dfd5;
  --gh-text: #1f2328;
  --gh-text-muted: #656d76;

  --gh-accent: #e52e2e;
  --gh-accent-gradient: linear-gradient(135deg, #dc2626 0%, #f97316 100%);
  --gh-accent-glow: rgba(234, 88, 12, 0.12);

  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--gh-bg);
  color: var(--gh-text);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: background-color 0.2s, color 0.2s;
}

button, input { font: inherit; }
button { cursor: pointer; }

/* ============================================================
   HEADER (BARRA SUPERIOR)
   ============================================================ */

.gh-header {
  height: 64px;
  background: var(--gh-header-bg);
  border-bottom: 1px solid var(--gh-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.2s, border-color 0.2s;
}

.gh-header-left, .gh-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.gh-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.gh-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
}

.gh-title {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 1.2px;
  background: var(--gh-accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Pesquisa no Canto Superior Direito */
.gh-search-wrapper {
  position: relative;
}

.gh-search-input {
  background: var(--gh-bg);
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  padding: 6px 12px;
  color: var(--gh-text);
  font-size: 13px;
  width: 220px;
  outline: none;
  transition: width 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.gh-search-input::placeholder {
  color: var(--gh-text-muted);
}

.gh-search-input:focus {
  width: 280px;
  border-color: var(--gh-accent);
  box-shadow: 0 0 0 3px var(--gh-accent-glow);
}

.gh-theme-btn {
  background: var(--gh-bg);
  border: 1px solid var(--gh-border);
  color: var(--gh-text);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 14px;
  transition: background 0.2s, border-color 0.2s;
}

.gh-theme-btn:hover {
  background: var(--gh-card-hover);
  border-color: var(--gh-accent);
}

/* ============================================================
   LAYOUT DASHBOARD (SIDEBAR + MAIN)
   ============================================================ */

.gh-layout {
  min-height: calc(100dvh - 64px);
  display: flex;
  flex-direction: column;
}

.gh-body {
  display: flex;
  flex: 1;
}

/* Sidebar Esquerda */
.gh-sidebar {
  width: 290px;
  background: var(--gh-bg);
  border-right: 1px solid var(--gh-border);
  padding: 24px 16px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gh-nav-menu {
  display: flex;
  flex-direction: column;
}

.gh-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--gh-text);
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.gh-nav-item:hover, .gh-nav-item.active {
  background: var(--gh-card-hover);
  color: var(--gh-accent);
}

.gh-divider {
  border: 0;
  border-top: 1px solid var(--gh-border-subtle);
  margin: 4px 0;
}

/* Mais Jogados na Sidebar */
.gh-sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gh-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gh-section-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--gh-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gh-repo-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gh-repo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--gh-text);
  font-size: 13.5px;
  font-weight: 700;
  transition: background 0.15s, color 0.15s;
}

.gh-repo-item:hover {
  background: var(--gh-card-hover);
  color: var(--gh-accent);
}

.gh-repo-name {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gh-repo-badge {
  font-size: 11px;
  color: var(--gh-text-muted);
  font-weight: 600;
  background: var(--gh-card-bg);
  border: 1px solid var(--gh-border);
  padding: 2px 6px;
  border-radius: 10px;
}

/* Toggle Sem Álcool na Sidebar */
.gh-alcohol-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gh-toggle-label {
  font-size: 13.5px;
  font-weight: 700;
}

.gh-toggle-desc {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--gh-text-muted);
  line-height: 1.4;
}

/* Switch Custom */
.switch-container {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}

.switch-container input { opacity: 0; width: 0; height: 0; }

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--gh-border);
  transition: .2s ease;
  border-radius: 20px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s ease;
  border-radius: 50%;
}

input:checked + .switch-slider { background: var(--gh-accent-gradient); }
input:checked + .switch-slider:before { transform: translateX(16px); }

/* Conteúdo Central */
.gh-main {
  flex: 1;
  padding: 32px 40px;
  max-width: 980px;
  display: flex;
  flex-direction: column;
}

.gh-hero {
  margin-bottom: 24px;
}

.gh-hero h1 {
  font-size: 28px;
  font-weight: 900;
  margin: 0 0 6px;
}

.gh-hero p {
  font-size: 15px;
  color: var(--gh-text-muted);
  margin: 0;
}

/* Cards dos Jogos */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.game-card {
  background: var(--gh-card-bg);
  border: 1px solid var(--gh-border);
  border-radius: 12px;
  padding: 18px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.2s, background-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.game-card:hover {
  border-color: var(--gh-accent);
  background: var(--gh-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.game-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.game-card-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.game-icon-avatar {
  font-size: 20px;
}

.game-card h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--gh-accent); /* Títulos dos jogos em Laranja */
}

.game-arrow-btn {
  color: var(--gh-accent);
  font-size: 16px;
  font-weight: 800;
  transition: transform 0.2s;
}

.game-card:hover .game-arrow-btn {
  transform: translateX(4px);
}

.game-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.game-pill {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--gh-text-muted);
  background: var(--gh-bg);
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid var(--gh-border);
}

.game-pill.intensity-leve { color: #10b981; border-color: rgba(16, 185, 129, 0.3); }
.game-pill.intensity-media { color: #f59e0b; border-color: rgba(245, 158, 11, 0.3); }
.game-pill.intensity-pesada { color: #ef4444; border-color: rgba(239, 68, 68, 0.3); }

/* Card Desativado (Em Breve) */
.game-card.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  border-style: dashed;
}

.game-card.disabled:hover {
  border-color: var(--gh-border);
  background: var(--gh-card-bg);
  transform: none;
  box-shadow: none;
}

.game-card.disabled h3 {
  color: var(--gh-text-muted);
}

/* Telas Secundárias (Hub / Regras) */
.game-detail, .game-play {
  margin-top: 8px;
}

.back-button {
  background: transparent;
  border: 0;
  color: var(--gh-accent);
  font-size: 14px;
  font-weight: 800;
  padding: 0;
  margin-bottom: 16px;
  cursor: pointer;
}

.rule-card {
  background: var(--gh-card-bg);
  border: 1px solid var(--gh-border);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 20px;
}

.rule-card h3 {
  font-size: 12px;
  color: var(--gh-accent);
  font-weight: 800;
  letter-spacing: 0.8px;
  margin: 0 0 14px;
}

.rule-card div {
  font-size: 15px;
  line-height: 1.6;
}

.hub-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.primary-button {
  background: var(--gh-accent-gradient);
  color: #ffffff;
  border: 0;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(229, 46, 46, 0.3);
  transition: opacity 0.15s, transform 0.15s;
}

.primary-button:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.secondary-button {
  background: var(--gh-card-bg);
  color: var(--gh-text);
  border: 1px solid var(--gh-border);
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  transition: background 0.15s;
}

.secondary-button:hover { background: var(--gh-card-hover); }

footer {
  margin-top: auto;
  padding-top: 40px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--gh-text-muted);
}

[hidden] { display: none !important; }

/* Modal Age Gate */
.age-gate {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.age-content {
  width: min(100%, 420px);
  background: var(--gh-card-bg);
  border: 1px solid var(--gh-border);
  border-radius: 14px;
  padding: 28px;
  text-align: center;
}

.age-brand-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.age-logo { width: 36px; height: 36px; border-radius: 8px; }
.age-brand {
  font-weight: 900;
  font-size: 20px;
  background: var(--gh-accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

#age-actions { display: grid; gap: 10px; margin-top: 20px; }

/* Banner Cookies */
.cookie-banner {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 32px), 860px);
  background: var(--gh-card-bg);
  border: 1px solid var(--gh-border);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 9999;
}

.cookie-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cookie-content p { margin: 0; font-size: 13.5px; }

/* Adaptabilidade Mobile */
@media (max-width: 768px) {
  .gh-body { flex-direction: column; }
  .gh-sidebar { width: 100%; border-right: 0; border-bottom: 1px solid var(--gh-border); }
  .gh-main { padding: 20px; }
  .gh-search-input { width: 150px; }
  .gh-search-input:focus { width: 190px; }
  .cookie-content { flex-direction: column; align-items: stretch; }
}