/* ============================================================
   Here I Stand – Main Stylesheet
   Theme: Dark parchment / historical / 16th century feel
   ============================================================ */

:root {
  --bg-dark: #1a1209;
  --bg-card: #241a0e;
  --bg-card2: #2e2010;
  --border: #5a3e1b;
  --border-light: #7a5a2a;
  --gold: #c8a84b;
  --gold-light: #e0c070;
  --gold-dark: #8a6820;
  --red: #8b2020;
  --red-light: #c04040;
  --text: #e8d9b0;
  --text-muted: #9a8060;
  --text-dark: #5a4020;
  --white: #f5ecd8;
  --shadow: 0 4px 24px rgba(0,0,0,0.6);
  --radius: 6px;

  /* Faction colors */
  --ottoman:    #27ae60;   /* green   */
  --hapsburg:   #fbe559;   /* yellow  */
  --england:    #c0392b;   /* red     */
  --france:     #2980b9;   /* blue    */
  --papacy:     #8e44ad;   /* purple  */
  --protestant: #7b4f2e;   /* brown   */

  /* VQ / TM additional faction colors */
  --spain:    #f39c12;   /* yellow (same as hapsburg) */
  --hre:      #1a1a1a;   /* black  (VQ HRE) */
  --prot-vq:  #e67e22;   /* orange (VQ Protestants) */
  --muslim:   #27ae60;   /* green  (same as ottoman, TM Muslims) */
  --portugal: #b0394a;   /* burgundy */
}

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

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  background-color: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at top, #2a1a08 0%, var(--bg-dark) 60%);
}

/* ---- Typography ---- */
h1, h2, h3 { color: var(--gold); letter-spacing: 0.03em; }
h1 { font-size: 2.2rem; }
h2 { font-size: 1.6rem; border-bottom: 1px solid var(--border); padding-bottom: 0.4rem; margin-bottom: 1rem; }
h3 { font-size: 1.2rem; color: var(--gold-light); }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); text-decoration: underline; }
small { color: var(--text-muted); font-size: 0.85rem; }

/* ---- Layout ---- */
.page { display: none; }
.page.active { display: block; }

#app { min-height: 100vh; display: flex; flex-direction: column; }

/* ---- Navbar ---- */
nav {
  background: var(--bg-card);
  border-bottom: 2px solid var(--gold-dark);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  box-shadow: var(--shadow);
}
.nav-brand {
  font-size: 1.3rem;
  color: var(--gold);
  font-weight: bold;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
}
.nav-brand:hover { color: var(--gold-light); }

.nav-logo {
  height: 42px;
  width: auto;
  display: block;
  filter: drop-shadow(0 1px 4px rgba(200,168,75,0.3));
}
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a, .nav-links button {
  color: var(--text);
  font-size: 0.95rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0.3rem 0;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links button:hover { color: var(--gold); text-decoration: none; }
.nav-links .active-link { color: var(--gold); border-bottom: 2px solid var(--gold); }
.nav-alert-link { color: var(--gold-light) !important; font-weight: 600; }

/* ---- User dropdown menu ---- */
.nav-user-menu { position: relative; }
.nav-user-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 0.9rem; padding: 0.2rem 0.4rem;
  display: flex; align-items: center; gap: 0.3rem;
}
.nav-user-btn:hover { color: var(--gold); }
.nav-user-caret { font-size: 0.65rem; opacity: 0.7; }
.nav-user-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 0.4rem);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  min-width: 150px; z-index: 200; flex-direction: column; padding: 0.35rem 0;
}
.nav-user-dropdown.open { display: flex; }
.nav-user-dropdown a {
  padding: 0.5rem 1rem; font-size: 0.88rem; color: var(--text-muted);
  text-decoration: none; white-space: nowrap;
}
.nav-user-dropdown a:hover { color: var(--gold); background: rgba(255,255,255,0.04); }

/* ---- Games pagination ---- */
.games-pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 1rem; margin-top: 1rem;
}

/* ---- Main content ---- */
main { flex: 1; padding: 2rem; max-width: 1100px; margin: 0 auto; width: 100%; }

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 1.5rem; }
.hof-card { min-width: 220px; flex: 1; cursor: pointer; padding: 1rem 1.2rem; transition: border-color 0.2s; }
.hof-card:hover { border-color: var(--gold); }

/* ---- Auth pages ---- */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bg-dark);
  background-image: radial-gradient(ellipse at center, #2a1a08 0%, var(--bg-dark) 70%);
}
.auth-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}
.auth-box h1 {
  text-align: center;
  margin-bottom: 0.3rem;
  font-size: 1.8rem;
}
.auth-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.9rem;
}
.auth-logo {
  text-align: center;
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

/* ---- Forms ---- */
.form-group { margin-bottom: 1.2rem; }
label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--gold-light);
  font-size: 0.9rem;
}
input, select, textarea {
  width: 100%;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.6rem 0.8rem;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
}
select option { background: var(--bg-card); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: bold;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.03em;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--gold-dark);
  color: var(--white);
  border: 1px solid var(--gold);
}
.btn-primary:hover { background: var(--gold); color: var(--bg-dark); }
.btn-danger { background: var(--red); color: var(--white); border: 1px solid var(--red-light); }
.btn-danger:hover { background: var(--red-light); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Alerts ---- */
.alert {
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  border: 1px solid;
}
.alert-error { background: #3b1010; border-color: var(--red-light); color: #f08080; }
.alert-success { background: #0d2b0d; border-color: #27ae60; color: #7fd97f; }
.alert-info { background: #0d2030; border-color: #2980b9; color: #70b8f0; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; min-width: max-content; border-collapse: collapse; font-size: 0.92rem; }
th {
  background: var(--bg-card2);
  color: var(--gold);
  text-align: left;
  padding: 0.7rem 1rem;
  border-bottom: 2px solid var(--border);
  font-weight: normal;
  letter-spacing: 0.04em;
}
td { padding: 0.65rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(200,168,75,0.05); }

/* ---- Badges ---- */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: bold;
  letter-spacing: 0.04em;
}
.badge-admin  { background: #3b2000; color: var(--gold); border: 1px solid var(--gold-dark); }
.badge-mod    { background: #1a1e3a; color: #7fa8e8; border: 1px solid #3a5fa0; }
.badge-player { background: #1a2a1a; color: #7fd97f; border: 1px solid #27ae60; }
.badge-win { background: #0d3020; color: #50e090; border: 1px solid #27ae60; }
.badge-in-progress { background: #1a1a30; color: #70b8f0; border: 1px solid #2980b9; }
.badge-completed { background: #1a1a1a; color: var(--text-muted); border: 1px solid var(--border); }

/* ---- Faction colors ---- */
/* HIS */
.faction-ottoman { color: var(--ottoman); }
.faction-hapsburg { color: var(--hapsburg); }
.faction-england { color: var(--england); }
.faction-france { color: var(--france); }
.faction-papacy { color: var(--papacy); }
.faction-protestant { color: var(--protestant); }
/* VQ additional */
.faction-spain { color: var(--hapsburg); }          /* yellow */
.faction-hre { color: #ffffff; background:#1a1a1a; border-radius:3px; padding:0 3px; } /* black */
.faction-protestant-vq { color: #e67e22; }          /* orange */
/* TM additional */
.faction-muslim { color: var(--muslim); }           /* green */
.faction-portugal { color: #b0394a; }               /* burgundy */

.faction-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 0.4rem;
}
.dot-ottoman { background: var(--ottoman); }
.dot-hapsburg { background: var(--hapsburg); }
.dot-england { background: var(--england); }
.dot-france { background: var(--france); }
.dot-papacy { background: var(--papacy); }
.dot-protestant { background: var(--protestant); }
/* VQ additional dots */
.dot-spain { background: var(--hapsburg); }
.dot-hre { background: var(--hre); }
.dot-protestant-vq { background: #e67e22; }
/* TM additional dots */
.dot-muslim { background: var(--muslim); }
.dot-portugal { background: #b0394a; }

/* ---- Dashboard stats ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  text-align: center;
}
.stat-value { font-size: 2rem; color: var(--gold); font-weight: bold; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem; }

/* ---- New game form ---- */
.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.player-slot {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.player-slot-title { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 1.5rem; }
.tab {
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
  font-size: 0.95rem;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ---- ELO history sparkline area ---- */
.elo-badge {
  font-size: 1.4rem;
  color: var(--gold);
  font-weight: bold;
}
.elo-delta { font-size: 0.85rem; margin-left: 0.3rem; }
.elo-delta.up { color: #50e090; }
.elo-delta.down { color: var(--red-light); }

/* ---- Loader ---- */
.loader {
  display: flex; align-items: center; justify-content: center;
  padding: 3rem;
  color: var(--text-muted);
  font-style: italic;
}
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 0.6rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Modals (unified) ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
}

/* ---- Player profile ---- */
.profile-header {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 1.5rem;
}
.profile-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--gold-dark);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  font-weight: bold;
  flex-shrink: 0;
}
.profile-name { font-size: 1.3rem; color: var(--gold); font-weight: bold; }
.profile-meta { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.2rem; }

.faction-wins-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin: 1rem 0;
}
.faction-win-card {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem;
  text-align: center;
  font-size: 0.8rem;
}
.faction-win-card .wins { font-size: 1.3rem; font-weight: bold; color: var(--gold); }

/* ---- Profile tournament honours ---- */
.profile-honours {
  display: flex; flex-wrap: wrap; gap: 0.7rem;
  margin: 1rem 0 1.2rem;
}
.honour-badge {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--bg-card2); border: 1px solid var(--gold-dark);
  border-radius: var(--radius); padding: 0.55rem 0.9rem;
  flex: 1; min-width: 200px;
}
.honour-medal { font-size: 2rem; line-height: 1; flex-shrink: 0; }
.honour-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.honour-tournament { font-size: 0.95rem; font-weight: 700; color: var(--gold-light); margin-top: 0.1rem; }

/* ---- Country flag (flag-icons library) ---- */
.flag-img {
  font-size: 13px;   /* fi uses em units — this controls the rendered size */
  vertical-align: middle;
  margin-right: 0.35rem;
  border: 1px solid rgba(90,62,27,0.25);
  border-radius: 1px;
}
/* Direct <img> flags (e.g. Kurdistan from Wikimedia) */
.flag-img-direct {
  height: 13px;
  width: auto;
  vertical-align: middle;
  margin-right: 0.35rem;
  border: 1px solid rgba(90,62,27,0.25);
  border-radius: 1px;
}
.country-name { vertical-align: middle; }

/* ---- Ranking page ---- */
.ranking-filters {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
  align-items: center;
}
.ranking-filters input,
.ranking-filters select { width: auto; min-width: 160px; }

.col-rank { width: 3rem; text-align: center; }
.rank-num { font-size: 1.1rem; font-weight: bold; color: var(--text-muted); }

.player-name-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

/* Large flags for ranking table */
.flag-lg {
  font-size: 22px;       /* fi uses em — this sets rendered size */
  flex-shrink: 0;
  border: 1px solid rgba(90,62,27,0.2);
  border-radius: 2px;
  vertical-align: middle;
}
.flag-img-direct.flag-lg {
  height: 16px;
  width: auto;
  flex-shrink: 0;
  border: 1px solid rgba(90,62,27,0.2);
  border-radius: 2px;
  vertical-align: middle;
}
.flag-lg-placeholder {
  display: inline-block;
  width: 29px;   /* ~22px * 4:3 */
  flex-shrink: 0;
}

/* ---- Clickable row ---- */
.clickable:hover td { background: rgba(200,168,75,0.08); cursor: pointer; }

/* ---- Karma ---- */
.karma-score  { font-weight: 600; }
.karma-yellow { color: #f39c12; }
.karma-red    { color: #e74c3c; }

.karma-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.karma-row:last-child { border-bottom: none; }

.karma-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-card2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold-light);
  flex-shrink: 0;
}

.karma-name { flex: 1; font-weight: 500; }

.karma-btns { display: flex; gap: 0.4rem; }

.karma-btn {
  padding: 0.3rem 0.8rem;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.15s;
}
.karma-btn:hover { border-color: rgba(255,255,255,0.35); color: var(--text); }
.karma-yes-btn.selected { background: rgba(39,174,96,0.25); border-color: #27ae60; color: #2ecc71; }
.karma-no-btn.selected  { background: rgba(231,76,60,0.25);  border-color: #e74c3c; color: #e74c3c; }

/* ---- Games filters ---- */
.games-filters {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.games-filters select {
  flex: 1;
  min-width: 130px;
}

/* ---- Report form meta grid ---- */
.report-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

/* ---- Hamburger button ---- */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  align-items: center;
  justify-content: center;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: all 0.2s;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hamburger { display: flex; }

  nav { position: relative; }

  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border-bottom: 2px solid var(--gold-dark);
    box-shadow: var(--shadow);
    z-index: 999;
    gap: 0.8rem;
  }
  .nav-links.open { display: flex; }

  .nav-links a, .nav-links button {
    font-size: 1rem;
    padding: 0.4rem 0;
    width: 100%;
    text-align: left;
  }

  main { padding: 1rem; }
  nav { padding: 0 1rem; }
  .auth-box { padding: 1.5rem 1rem; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }

  .faction-wins-grid { grid-template-columns: repeat(2, 1fr); }

  .report-meta-grid { grid-template-columns: 1fr; }

  /* Mobile: user dropdown – expand container full-width so dropdown doesn't clip off left edge */
  .nav-user-menu { width: 100%; }
  .nav-user-dropdown { left: 0; right: auto; min-width: 0; width: 100%; }

  /* Stack 2-col form grids on mobile */
  .modal-box [style*="grid-template-columns:1fr 1fr"],
  .modal-box [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Make stat cards smaller */
  .stat-value { font-size: 1.5rem; }

  /* Better touch targets for buttons */
  .btn { padding: 0.7rem 1.2rem; min-height: 44px; }

  /* Make modal full-width on small screens */
  .modal-box {
    max-width: 100% !important;
    margin: 0;
    border-radius: 0;
    max-height: 100vh;
  }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-overlay .modal-box {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
  }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .players-grid { grid-template-columns: 1fr; }
  .ranking-filters { flex-direction: column; }
  .ranking-filters input, .ranking-filters select { min-width: 0; }
  .games-filters { flex-direction: column; }
  .games-filters select { min-width: 0; }

  th, td { padding: 0.5rem 0.6rem; font-size: 0.85rem; }
}

/* ============================================================
   Game type tabs
   ============================================================ */

.game-tabs {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.game-tab {
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card2);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.game-tab:hover {
  background: var(--bg-dark);
  color: var(--text);
  border-color: var(--border-light);
}

.game-tab.active {
  background: var(--gold-dark);
  color: var(--gold-light);
  border-color: var(--gold);
}

/* Small badge to show HIS / VQ / TM in game/tournament rows */
.game-type-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.05em;
  vertical-align: middle;
}

/* ============================================================
   Landing / Home page
   ============================================================ */

/* ---- Hero ---- */
.home-hero {
  text-align: center;
  padding: 3.5rem 2rem 2.8rem;
  background: radial-gradient(ellipse at center top, #2e1c06 0%, var(--bg-dark) 68%);
  border-bottom: 1px solid var(--border);
}

.home-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.6rem;
}

.home-logo {
  max-width: min(600px, 92vw);
  height: auto;
  filter: drop-shadow(0 6px 28px rgba(200, 168, 75, 0.35));
}

.home-hero-title {
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  color: var(--gold-light);
  font-variant: small-caps;
  letter-spacing: 0.07em;
  margin-bottom: 0.7rem;
  line-height: 1.25;
}

.home-hero-subtitle {
  font-size: clamp(0.92rem, 2vw, 1.08rem);
  color: var(--text);
  max-width: 660px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

.home-hero-cta {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---- WhatsApp CTA ---- */
.home-wa-section {
  background: linear-gradient(135deg, #0a2e1a 0%, #154d2b 50%, #0a2e1a 100%);
  border-top: 2px solid #25d366;
  border-bottom: 2px solid #25d366;
  padding: 2.2rem 2rem;
}

.home-wa-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.home-wa-icon {
  font-size: 4.5rem;
  flex-shrink: 0;
  line-height: 1;
  filter: drop-shadow(0 2px 12px rgba(37,211,102,0.5));
}

.home-wa-text { flex: 1; min-width: 240px; }

.home-wa-text h2 {
  color: #25d366;
  border: none;
  padding: 0;
  margin-bottom: 0.5rem;
  font-size: clamp(1.15rem, 3vw, 1.6rem);
}

.home-wa-text p {
  color: #b8f0c8;
  font-size: 0.98rem;
  line-height: 1.55;
  margin: 0;
}

.home-wa-text strong {
  color: #e8faf0;
}

.btn.home-wa-btn {
  background: #25d366;
  color: #0a2e1a;
  border: 2px solid #1ebe5a;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.85rem 2.2rem;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 4px 22px rgba(37,211,102,0.45);
  letter-spacing: 0.01em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn.home-wa-btn:hover {
  background: #1ebe5a;
  color: #0a2e1a;
  box-shadow: 0 6px 30px rgba(37,211,102,0.65);
  transform: translateY(-2px);
  text-decoration: none;
}

/* ---- Community flags ---- */
.home-community {
  padding: 2.8rem 2rem 2rem;
  text-align: center;
  background: var(--bg-dark);
}

.home-community > h2 {
  margin-bottom: 0.5rem;
  border: none;
  font-size: 1.7rem;
}

.home-community-sub {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.93rem;
}

.home-flags-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem 0.8rem;
  max-width: 860px;
  margin: 0 auto;
}

.home-flag-big {
  width: 72px !important;
  height: 50px !important;
  border-radius: 4px;
  box-shadow: 0 3px 14px rgba(0,0,0,0.6);
  display: inline-block;
  background-size: cover;
  flex-shrink: 0;
}

/* ---- The Games section ---- */
.home-games {
  padding: 2.5rem 2rem 3.5rem;
  background: linear-gradient(180deg, var(--bg-dark) 0%, #1e1208 100%);
}

.home-games > h2 {
  text-align: center;
  border: none;
  font-size: 1.7rem;
  margin-bottom: 1.8rem;
}

.home-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.5rem;
  max-width: 1120px;
  margin: 0 auto;
}

.home-game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem 1.6rem 1.5rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.home-game-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.home-game-card.his::before { background: linear-gradient(90deg, var(--gold-dark), var(--gold-light)); }
.home-game-card.vq::before  { background: linear-gradient(90deg, #1a4c7a, #5b9bd5); }
.home-game-card.tm::before  { background: linear-gradient(90deg, #7a1a1a, #e74c3c); }

.home-game-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 0.18rem 0.55rem;
  border-radius: 3px;
  margin-bottom: 0.8rem;
  align-self: flex-start;
}

.his .home-game-badge  { background: rgba(200,168,75,0.13); color: var(--gold); border: 1px solid var(--gold-dark); }
.vq .home-game-badge   { background: rgba(91,155,213,0.13); color: #5b9bd5;    border: 1px solid #2a5a8a; }
.tm .home-game-badge   { background: rgba(192,57,43,0.13);  color: #e74c3c;    border: 1px solid #8b2020; }

.home-game-title {
  font-size: 1.4rem;
  color: var(--gold-light);
  margin-bottom: 0.2rem;
  border: none;
  padding: 0;
}

.home-game-period {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.1rem;
  font-style: italic;
}

.home-game-desc {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.65;
  margin-bottom: 1.3rem;
  flex: 1;
}

.home-game-factions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.1rem;
}

.home-game-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
  margin-top: auto;
}

.home-game-gmt-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: opacity 0.15s;
}
.home-game-gmt-link:hover { opacity: 0.75; }

/* Mobile adjustments */
@media (max-width: 600px) {
  .home-wa-inner { flex-direction: column; text-align: center; }
  .home-wa-icon  { font-size: 3.5rem; }
  .btn.home-wa-btn { width: 100%; justify-content: center; }
  .home-hero { padding: 2.5rem 1.2rem 2rem; }
  .home-games { padding: 2rem 1rem 2.5rem; }
  .home-community { padding: 2rem 1rem 1.5rem; }
  .nav-logo { height: 34px; }
  .home-flag-big { width: 56px !important; height: 39px !important; }
}

/* ============================================================
   Info & Links page
   ============================================================ */

.info-section {
  margin-bottom: 1.5rem;
}

.info-section h3 {
  color: var(--gold-light);
  font-size: 1.15rem;
  margin-bottom: 0.8rem;
}

.info-section h4 {
  color: var(--gold);
  font-size: 1rem;
  margin-bottom: 0.6rem;
  border: none;
  padding: 0;
}

.info-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.8rem;
  margin-top: 0.5rem;
}

.info-game-card {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
}

.info-game-title {
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.info-game-card p {
  color: var(--text-muted);
  font-size: 0.87rem;
  line-height: 1.5;
  margin: 0;
}

.info-links-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.info-link-btn {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  color: var(--gold-light);
  text-decoration: none;
  font-size: 0.93rem;
  transition: border-color 0.15s, background 0.15s;
}

.info-link-btn:hover {
  border-color: var(--gold);
  background: var(--bg-dark);
  color: var(--gold-light);
  text-decoration: none;
}

.info-link-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.info-tool {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
}

.info-tool-title {
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.35rem;
  font-size: 0.93rem;
}

.info-tool p {
  color: var(--text-muted);
  font-size: 0.87rem;
  line-height: 1.5;
  margin: 0;
}

.info-three-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1.2rem;
}

.info-col-title {
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.info-ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.info-ul li a {
  color: var(--text);
  font-size: 0.88rem;
  text-decoration: none;
  transition: color 0.12s;
}

.info-ul li a:hover {
  color: var(--gold-light);
}

.council-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.6rem;
}

.council-member {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.8rem;
  font-size: 0.9rem;
  color: var(--text);
}

.council-member .fi {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.council-member.clickable:hover {
  border-color: var(--gold-dark);
  color: var(--gold-light);
  cursor: pointer;
}

/* ---- Clickable link text (in tables) ---- */
.clickable-link {
  cursor: pointer;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.clickable-link:hover { color: var(--gold-light); text-decoration: underline; }

/* ---- Games page – player filter ---- */
.games-player-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.games-player-filter select { min-width: 180px; }
.player-chips-row { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.player-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--gold-dark);
  color: var(--white);
  border-radius: 12px;
  padding: 0.2rem 0.6rem;
  font-size: 0.82rem;
}
.chip-remove { cursor: pointer; font-weight: bold; opacity: 0.8; line-height: 1; }
.chip-remove:hover { opacity: 1; }
