/*  Vars  */
:root{
  --bg: #2b2b2f;
  --text: #e0e6f1;
  --muted: #c7ccd1;
  --accent-1: #9b264b;      /* red */
  --accent-2: #23b0cf;      /* blue */
  --surface: #1f1f23;
  --ring: rgba(255,255,255,.20);
  --btn-br: rgba(0,0,0,.15);
  --btn-br2: rgba(0,0,0,.35);
  --maxw: 1200px;
}

*{ box-sizing:border-box }
html,body{ height:100% }
body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* auth flash guard */
.user-only { display: none; }


/* Layout*/
.container {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 3rem;
  box-sizing: border-box;
}

/* Sticky footer*/
html, body {
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
}

body {
  background-color: #1a1a1a;
  color: #ddd;
}

main { flex: 1; }

/* Topbar*/
.topbar{
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  box-shadow: 0 1px 0 rgba(0,0,0,.25);
}

.nav{
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-left, .nav-right{
  display:flex;
  align-items:center;
  gap: 8px;
}

.brand{
  display:inline-block;
  padding: 8px 10px;
  margin-right: 10px;
  text-decoration: none;
  font-weight: 700;
  color: #fff;
  border-radius: 8px;
  background: rgba(0,0,0,.18);
  border: 1px solid var(--btn-br);
}

.nav-item{ position: relative }
.nav-link{
  display:inline-block;
  padding: 8px 12px;
  color: #fff;
  text-decoration: none;
  background: rgba(0,0,0,.18);
  border: 1px solid var(--btn-br);
  border-radius: 8px;
  backdrop-filter: saturate(120%) blur(.5px);
}
.nav-link:hover{ outline:2px solid var(--ring) }

/* Dropdown */
.has-menu .menu{
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  min-width: 200px;
  padding: 8px;
  display: none;
  background: #141418;
  border: 1px solid var(--btn-br2);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
.has-menu:hover .menu{ display: block }
.menu a{
  display:block;
  padding: 10px 12px;
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
}
.menu a:hover{ background:#1f1f23 }

/* Buttons */
.btn{
  display:inline-block;
  padding: 10px 14px;
  color: #fff;
  text-decoration: none;
  border-radius: 10px;
  border: 1px solid var(--btn-br2);
  background: #00000066;
}
.btn:hover{ outline: 2px solid var(--ring) }
.btn.outline{
  background: transparent;
  border: 1px solid #ffffff55;
}
.btn.lg{ padding: 14px 18px; font-size: 18px }

/*  Hero (element + bg layer)  */
.hero{
  position: relative;
  min-height: 60vh;
  display: grid;
  align-items: center;
  overflow: clip;
}
.hero-bg{
  position:absolute; inset:0;
  background:
    linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.75)),
    url("images/heroes-bg.png") center/cover no-repeat;
}
.hero-inner{ position: relative; }
.hero-title{ margin:0 0 8px; font-size: 44px; letter-spacing:.5px }
.hero-sub{ margin:0 0 18px; color: var(--muted) }
.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;   /* centers them horizontally */
}


/*  Cards  */
.grid3{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.card{
  background: var(--surface);
  border: 1px solid var(--btn-br2);
  border-radius: 14px;
  overflow: hidden;
}
.card-media{
  height: 160px;
  background: linear-gradient(90deg, #3b3b40, #2b2b31);
}
.card-body{ padding: 14px }
.card-title{ margin:0 0 8px; font-size: 20px }
.card-link{
  display:inline-block;
  margin-top:6px;
  color:#9cdcff;
  text-decoration:none;
}
.card-link:hover{ text-decoration:underline }

/*  Footer  */
.footer{ padding: 20px 0; border-top: 1px solid #00000055; background:#17171b }
.footer-inner{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
}
.footer-links{ display:flex; gap:14px }
.footer-links a{ color: var(--muted); text-decoration:none }
.footer-links a:hover{ color:#fff }
.copy{ margin:0; color: var(--muted) }

/*  Media  */
@media (max-width: 960px){
  .grid3{ grid-template-columns: 1fr; }
  .hero-title{ font-size: 34px }
  .nav-left{ gap:6px }
  .brand{ display:none }
}

/*  Map  */
.map-preview { text-align: center; margin-top: 1.5rem; }
.map-preview img {
  max-width: 80%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.45);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.map-preview img:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 25px rgba(0,0,0,0.6);
}
.caption {
  color: #aaa;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/*  War bar  */
.warbar { margin-top: 2.5rem; }
.warbar-tagline{
  text-align: center;
  font-size: .95rem;
  color: rgba(255,255,255,.75);
  margin-bottom: .75rem;
}
.warbar-wrap{
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  --red: 50%;
  --blue: calc(100% - var(--red));
}
.warbar-bar{
  height: 28px;
  border-radius: 12px;
  background:
    linear-gradient(90deg,
      #e30d0d 0%,
      #e30d0d var(--red),
      #17d7ea var(--red),
      #17d7ea 100%);
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,.35),
    0 6px 18px rgba(0,0,0,.25);
}
.warbar-legend{
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  font-size: .8rem;
  color: rgba(255,255,255,.6);
  margin-top: .4rem;
  user-select: none;
}
.warbar-legend .red{ color:#ff6b6b; }
.warbar-legend .blue{ color:#8eeaff; }
.warbar-pop{
  position: absolute;
  left: var(--red);
  top: 0;
  transform: translate(-50%, -40%);
  background: #0f1318;
  color: #e8eef6;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  padding: .35rem .6rem;
  font-size: .8rem;
  line-height: 1;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
}
.warbar-pop::after{
  content:"";
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  width: 10px; height: 10px;
  background: #0f1318;
  border-left: 1px solid rgba(255,255,255,.12);
  border-bottom: 1px solid rgba(255,255,255,.12);
  transform-origin: center;
  rotate: 45deg;
}
.warbar-pop .warbar-pop-text{ white-space: nowrap; }
.warbar-wrap:hover .warbar-pop,
.warbar-wrap:focus-within .warbar-pop{
  opacity: 1;
  transform: translate(-50%, -80%);
}
@media (max-width: 640px){
  .warbar-bar{ height: 22px; }
  .warbar-pop{ font-size: .75rem; }
}

/*  Hero (alt bg)  */
.hero {
  background: 
    linear-gradient(rgba(0,0,0,0.55), rgba(0,0,0,0.55)),
    url("images/heroes-bg.png") center/cover no-repeat;
  color: #fff;
  padding: 6rem 1rem 8rem;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.hero h1 { font-size: 2rem; font-weight: 700; margin-bottom: 1rem; }
.hero p {
  max-width: 600px;
  margin: 0 auto 2rem;
  color: rgba(255,255,255,0.85);
}
.hero-actions { display: flex; justify-content: center; gap: 1rem; }

/*  Width overrides  */
:root {
  --page-max: 1600px;
  --page-pad: clamp(16px, 3vw, 48px);
}
.container,
.nav.container,
.section.container,
.hero-inner,
.footer-inner {
  width: 100%;
  max-width: var(--page-max) !important;
  margin-inline: auto;
  padding-inline: var(--page-pad);
  box-sizing: border-box;
}
.hero { padding-inline: 0; }
.warbar-wrap {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-pad);
  box-sizing: border-box;
}
.topbar { width: 100%; }
.nav.container {
  max-width: none !important;
  width: 100%;
  padding-inline: 2rem;
  justify-content: space-between;
  box-sizing: border-box;
}

/*  Full-bleed topbar patch  */
.topbar.container { max-width:none !important; padding-inline:0 !important; margin-inline:0 !important; }
.topbar {
  position: sticky; top: 0; z-index: 100;
  width: 100vw !important;
  margin-left: 50% !important; transform: translateX(-50%) !important;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  box-shadow: 0 1px 0 rgba(0,0,0,.25);
  padding-inline: 0 !important; isolation: isolate;
}
.topbar .nav {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: clamp(1rem, 2vw, 2rem);
}
body { overflow-x: hidden; }

/* --- Auth pages --- */
.auth {
  display: grid;
  place-items: start center;
  padding-block: clamp(32px, 8vh, 96px);
}

.auth-card{
  width: min(520px, 100%);
  background: var(--surface);
  border: 1px solid var(--btn-br2);
  border-radius: 16px;
  padding: clamp(18px, 3vw, 28px);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}

.auth-title{
  margin: 0 0 10px;
  font-size: clamp(22px, 2.2vw, 28px);
  letter-spacing: .3px;
}

.auth-form { display: grid; gap: 14px; }

.auth-form label { display: grid; gap: 6px; font-size: .95rem; color: var(--muted); }
.auth-form input{
  appearance: none;
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--btn-br);
  background: #00000066;
  color: var(--text);
  outline: none;
}
.auth-form input:focus{ outline: 2px solid var(--ring); }

.auth-actions{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.auth-alert{
  margin: 8px 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 120, 120, .25);
  background: rgba(255, 60, 60, .08);
  color: #ffbcbc;
  font-size: .95rem;
}

.auth-link{
  color: #9cdcff;
  text-decoration: none;
  font-size: .95rem;
}
.auth-link:hover{ text-decoration: underline; }
