/* The sales page: the original Rivality landing design, lifted from the classic game. */
:where(.lp, .lp *) { margin: 0; padding: 0; }
#landing { position: fixed; inset: 0; overflow-y: auto; overflow-x: hidden; background: #0d0f0a; font-family: 'Open Sans', sans-serif; font-weight: 400; user-select: text; -webkit-user-select: text; -webkit-overflow-scrolling: touch; }
/* ===== LANDING PAGE ===== */
.lp { --lp-accent: #c0392b; --lp-dark: #0d0f0a; --lp-sand: #f5f0e8; --lp-card: #1a1d16; }

.lp-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: transparent;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
}
.lp-topbar.scrolled {
  background: rgba(13,15,10,0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.lp-topbar.scrolled .lp-btn-ghost {
  background: var(--lp-accent); color: #fff; border-color: var(--lp-accent);
}
.lp-topbar.scrolled .lp-btn-ghost:hover { background: #e74c3c; border-color: #e74c3c; }

.lp-logo {
  font-family: 'Rajdhani', sans-serif; font-weight: 700;
  font-size: 1.4rem; letter-spacing: 6px; text-transform: uppercase;
  color: #fff;
}
.lp-logo span { color: var(--lp-accent); }
.lp-nav { display: flex; gap: 8px; }
.lp-btn {
  font-family: 'Rajdhani', sans-serif; font-weight: 700;
  font-size: 0.85rem; letter-spacing: 2px; text-transform: uppercase;
  padding: 10px 20px; border-radius: 6px; cursor: pointer;
  text-decoration: none; border: none; transition: all 0.2s;
}
.lp-btn-ghost { background: none; color: rgba(255,255,255,0.7); border: 1px solid rgba(255,255,255,0.3); }
.lp-btn-ghost:hover { color: #fff; border-color: rgba(255,255,255,0.6); }
.lp-btn-primary { background: var(--lp-accent); color: #fff; }
.lp-btn-primary:hover { background: #e74c3c; }

/* Topbar center: server status */
.lp-topbar-center {
  position: absolute; left: 50%; transform: translateX(-50%);
}
.lp-topbar-status {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Rajdhani', sans-serif; font-weight: 700;
  font-size: 0.95rem; letter-spacing: 1.5px; text-transform: uppercase;
  color: #fff; white-space: nowrap;
}
.lp-topbar-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: #27ae60; box-shadow: 0 0 6px rgba(39,174,96,0.7);
  animation: lp-pulse 2s infinite;
}
.lp-topbar-sep { color: rgba(255,255,255,0.3); }
@media (max-width: 600px) {
  .lp-topbar-center { display: none; }
}

/* Hero */
.lp-hero {
  position: relative; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden;
}
.lp-hero-bg {
  position: absolute; inset: 0;
  background: url('img/war_wide.jpg?v=1') center center / cover no-repeat;
}
.lp-hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(13,15,10,0.35) 0%, rgba(13,15,10,0.3) 40%, rgba(13,15,10,0.45) 80%, var(--lp-dark) 100%);
}
.lp-hero-content { position: relative; z-index: 1; text-align: center; padding: 0 24px; }
.lp-hero h1 {
  font-family: 'Rajdhani', sans-serif; font-weight: 700;
  font-size: clamp(3.5rem, 10vw, 7rem); letter-spacing: clamp(8px, 2vw, 20px);
  text-transform: uppercase; color: #fff;
  line-height: 1; margin-bottom: 12px;
  text-shadow: 0 4px 40px rgba(0,0,0,0.6);
}
.lp-hero-sub {
  font-family: 'Rajdhani', sans-serif; font-weight: 600;
  font-size: clamp(1rem, 2.5vw, 1.4rem); letter-spacing: clamp(4px, 1vw, 10px);
  text-transform: uppercase; color: #fff;
  margin-bottom: 40px;
}
.lp-hero-cta {
  font-family: 'Rajdhani', sans-serif; font-weight: 700;
  font-size: 1.1rem; letter-spacing: 3px; text-transform: uppercase;
  padding: 16px 48px; border-radius: 8px;
  background: var(--lp-accent); color: #fff; border: none; cursor: pointer;
  box-shadow: 0 4px 30px rgba(192,57,43,0.5);
  transition: all 0.2s;
}
.lp-hero-cta:hover { background: #e74c3c; transform: translateY(-2px); box-shadow: 0 8px 40px rgba(192,57,43,0.6); }
.lp-server-badge {
  margin-top: 24px;
  text-align: center;
}
.lp-server-name {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  margin-bottom: 8px;
}
.lp-countdown {
  display: flex;
  justify-content: center;
  gap: 12px;
}
.lp-countdown .cd-block {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lp-countdown .cd-num {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
  color: #fff;
  line-height: 1;
  min-width: 40px;
  text-align: center;
}
.lp-countdown .cd-label {
  font-family: 'Open Sans', sans-serif;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.65);
  margin-top: 2px;
}
.lp-players-online {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 14px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255,255,255,0.78);
  letter-spacing: 0.5px;
}
.lp-players-online .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.lp-players-online .dot-green {
  background: #27ae60;
  box-shadow: 0 0 6px rgba(39,174,96,0.6);
  animation: lp-pulse 2s infinite;
}
.lp-players-online .dot-amber {
  background: #d4a017;
  box-shadow: 0 0 6px rgba(212,160,23,0.4);
}
@keyframes lp-pulse { 0%,100% { opacity:1; } 50% { opacity:0.4; } }
.lp-scroll-hint {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  z-index: 1; color: rgba(255,255,255,0.3); font-size: 1.5rem;
  animation: lp-bounce 2s infinite;
}
@keyframes lp-bounce { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(8px); } }

/* Sections */
.lp-section {
  padding: 80px 24px; max-width: 1100px; margin: 0 auto;
}
.lp-film { padding-bottom: 40px; }
.lp-film video { display: block; width: 100%; aspect-ratio: 16 / 9; margin-top: 24px; background: #000; border-radius: 10px; border: 1px solid rgba(255,255,255,0.12); box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.lp-film video.sq { aspect-ratio: 1 / 1; }
.lp-dark-bg { background: var(--lp-dark); }
.lp-sand-bg { background: var(--lp-sand); }
.lp-section-tag {
  font-family: 'Rajdhani', sans-serif; font-weight: 700;
  font-size: 0.8rem; letter-spacing: 4px; text-transform: uppercase;
  color: var(--lp-accent); margin-bottom: 8px;
}
.lp-section-title {
  font-family: 'Rajdhani', sans-serif; font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.5rem); letter-spacing: 2px;
  text-transform: uppercase; margin-bottom: 16px;
}
.lp-dark-bg .lp-section-title { color: #fff; }
.lp-sand-bg .lp-section-title { color: var(--lp-dark); }
.lp-section-desc {
  font-size: 1rem; line-height: 1.7; max-width: 680px;
}
.lp-dark-bg .lp-section-desc { color: rgba(255,255,255,0.78); }
.lp-sand-bg .lp-section-desc { color: #444; }

/* Feature grid (intro) */
.lp-features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px; margin-top: 40px;
}
.lp-feature {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px; padding: 24px;
}
.lp-feature-icon {
  width: 48px; height: 48px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; margin-bottom: 14px;
}
.lp-feature-icon.eco { background: rgba(39,174,96,0.15); color: #27ae60; }
.lp-feature-icon.mil { background: rgba(192,57,43,0.15); color: #c0392b; }
.lp-feature-icon.def { background: rgba(41,128,185,0.15); color: #2980b9; }
.lp-feature-icon.map { background: rgba(212,160,23,0.15); color: #d4a017; }
.lp-feature h3 {
  font-family: 'Rajdhani', sans-serif; font-weight: 700;
  font-size: 1.1rem; color: #fff; letter-spacing: 1px;
  margin-bottom: 6px;
}
.lp-feature p { font-size: 0.85rem; color: rgba(255,255,255,0.72); line-height: 1.5; }

/* Building / troop cards */
.lp-card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px; margin-top: 32px;
}
.lp-card {
  background: #fff; border: 1px solid #e0dbd3; border-radius: 12px;
  overflow: hidden; transition: transform 0.2s, box-shadow 0.2s;
}
.lp-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.lp-card-img {
  width: 100%; aspect-ratio: 1; object-fit: cover; display: block;
  background: #f5f0e8;
}
.lp-card-body { padding: 10px 12px; }
.lp-card-name {
  font-family: 'Rajdhani', sans-serif; font-weight: 700;
  font-size: 0.95rem; color: #1a1a1a; letter-spacing: 0.5px;
}
.lp-card-desc {
  font-size: 0.75rem; color: #555; line-height: 1.4; margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.lp-card-stats {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px;
}
.lp-stat-pill {
  font-family: 'Rajdhani', sans-serif; font-weight: 700;
  font-size: 0.72rem; padding: 3px 8px; border-radius: 4px;
  letter-spacing: 0.5px;
}
.lp-stat-pill.atk { background: rgba(192,57,43,0.1); color: #c0392b; }
.lp-stat-pill.def { background: rgba(41,128,185,0.1); color: #2980b9; }
.lp-stat-pill.spd { background: rgba(39,174,96,0.1); color: #27ae60; }
.lp-stat-pill.cost { background: rgba(212,160,23,0.1); color: #d4a017; }
.lp-stat-pill.lvl { background: rgba(0,0,0,0.07); color: #555; }
.lp-stat-pill.time { background: rgba(155,89,182,0.1); color: #8e44ad; }

/* Category tabs */
.lp-tabs {
  display: flex; gap: 8px; margin-top: 24px; flex-wrap: wrap;
}
.lp-tab {
  font-family: 'Rajdhani', sans-serif; font-weight: 700;
  font-size: 0.8rem; letter-spacing: 1.5px; text-transform: uppercase;
  padding: 8px 18px; border-radius: 6px; cursor: pointer;
  border: 1px solid #e0dbd3; background: #fff; color: #555;
  transition: all 0.2s;
}
.lp-tab.active { background: var(--lp-dark); color: #fff; border-color: var(--lp-dark); }

/* Dark card variant for troops */
.lp-troop-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px; margin-top: 32px;
}
.lp-troop-card {
  display: flex; gap: 14px; align-items: center;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px; padding: 16px; transition: border-color 0.2s;
}
.lp-troop-card:hover { border-color: rgba(255,255,255,0.15); }
.lp-troop-img {
  width: 72px; height: 72px; border-radius: 10px;
  object-fit: cover; flex-shrink: 0; background: rgba(255,255,255,0.06);
}
.lp-troop-info { flex: 1; min-width: 0; }
.lp-troop-name {
  font-family: 'Rajdhani', sans-serif; font-weight: 700;
  font-size: 1.05rem; color: #fff; letter-spacing: 0.5px;
}
.lp-troop-desc {
  font-size: 0.78rem; color: rgba(255,255,255,0.72); line-height: 1.4; margin-top: 2px;
}
.lp-troop-stats {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px;
}
.lp-troop-stat {
  font-family: 'Rajdhani', sans-serif; font-weight: 700;
  font-size: 0.72rem; padding: 3px 8px; border-radius: 4px;
  letter-spacing: 0.5px;
}
.lp-troop-stat.atk { background: rgba(192,57,43,0.2); color: #e74c3c; }
.lp-troop-stat.def { background: rgba(41,128,185,0.2); color: #5dade2; }
.lp-troop-stat.spd { background: rgba(39,174,96,0.2); color: #2ecc71; }
.lp-troop-stat.cost { background: rgba(212,160,23,0.2); color: #f1c40f; }
.lp-troop-stat.time { background: rgba(155,89,182,0.2); color: #bb8fce; }

/* Combat info */
.lp-combat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px; margin-top: 32px;
}
.lp-combat-card {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px; padding: 24px;
}
.lp-combat-card h4 {
  font-family: 'Rajdhani', sans-serif; font-weight: 700;
  font-size: 1.1rem; color: #fff; letter-spacing: 1px;
  margin-bottom: 8px;
}
.lp-combat-card p { font-size: 0.85rem; color: rgba(255,255,255,0.72); line-height: 1.6; }
.lp-combat-card .lp-stat-row {
  display: flex; justify-content: space-between; padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 0.85rem;
}
.lp-combat-card .lp-stat-row span:first-child { color: rgba(255,255,255,0.75); }
.lp-combat-card .lp-stat-row span:last-child { font-family: 'Rajdhani', sans-serif; font-weight: 700; color: #fff; }

/* FAQ */
.lp-faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px; margin-top: 40px;
}
.lp-faq-card {
  background: #fff; border: 1px solid #e0dbd3; border-radius: 14px;
  padding: 22px 24px;
}
.lp-faq-card h4 {
  font-family: 'Rajdhani', sans-serif; font-weight: 700;
  font-size: 1rem; color: var(--lp-dark); letter-spacing: 0.3px;
  margin-bottom: 8px;
}
.lp-faq-card p { font-size: 0.85rem; color: #444; line-height: 1.6; }

/* Footer CTA */
.lp-footer-cta {
  text-align: center; padding: 80px 24px 60px;
  background: var(--lp-dark);
  border-top: 1px solid rgba(255,255,255,0.06);
}
.lp-footer-cta h2 {
  font-family: 'Rajdhani', sans-serif; font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.5rem); letter-spacing: 3px;
  text-transform: uppercase; color: #fff; margin-bottom: 12px;
}
.lp-footer-cta p { color: rgba(255,255,255,0.75); margin-bottom: 32px; font-size: 0.95rem; }
.lp-footer-cta .lp-hero-cta { display: inline-block; }
.lp-footer-copy {
  text-align: center; padding: 20px; background: var(--lp-dark);
  border-top: 1px solid rgba(255,255,255,0.04);
  font-size: 0.75rem; color: rgba(255,255,255,0.7);
  font-family: 'Rajdhani', sans-serif; letter-spacing: 2px;
}

/* ===== LOGIN ===== */
#login-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  height: 100dvh;
  background: url('img/war_wide.jpg?v=1') center center / cover no-repeat;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  padding: 20px;
}

#login-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0.75) 100%);
}

#login-screen > * { position: relative; z-index: 1; }

#login-screen h1 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: 10px;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
  margin-bottom: 0.2rem;
}

#login-screen p {
  color: rgba(255,255,255,0.7);
  margin-bottom: 2rem;
  font-size: 0.9rem;
  letter-spacing: 3px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(320px, 85vw);
}

.login-input {
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  padding: 14px 16px;
  font-size: 16px; /* prevents iOS zoom */
  font-family: 'Open Sans', sans-serif;
  border-radius: 8px;
  outline: none;
}

.login-input:focus { border-color: rgba(255,255,255,0.6); background: rgba(255,255,255,0.18); }
.login-input::placeholder { color: rgba(255,255,255,0.4); }

.login-btn {
  background: rgba(255,255,255,0.95);
  color: #1a1a1a;
  border: none;
  padding: 14px;
  font-size: 1rem;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 8px;
  cursor: pointer;
}

.login-btn:active { transform: scale(0.97); }

.login-error {
  color: #ff6b6b;
  font-size: 0.78rem;
  text-align: center;
  min-height: 1.2em;
}

/* additions for the new game */
#login-screen .back { position: absolute; top: calc(14px + env(safe-area-inset-top)); left: 16px; background: rgba(0,0,0,.35); color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; padding: 8px 14px; font-family: 'Rajdhani', sans-serif; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; z-index: 2; }
#login-screen .swap { background: none; color: rgba(255,255,255,.85); font-size: .85rem; text-decoration: underline; padding: 6px; font-family: 'Open Sans', sans-serif; }
#login-screen .google { margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; }
.lp-or { display: flex; align-items: center; gap: 10px; margin-top: 8px; color: rgba(255,255,255,.5); font-size: .75rem; }
.lp-or::before, .lp-or::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.2); }
.lp-top5 { max-width: 420px; margin: 0 auto 28px; text-align: left; font-family: 'Rajdhani', sans-serif; }
.lp-footer-copy a { color: inherit; margin-left: 10px; }

/* Painted game art instead of the old photo cards */
.lp-card-img { object-fit: contain; padding: 10px 8px 6px; background: #d9ae6c url('img/ground.jpg?v=2') center / 180px; }
.lp-troop-img { object-fit: contain; padding: 5px; background: #d9ae6c url('img/ground.jpg?v=2') center / 140px; }
@media (max-width: 700px) { .lp-hero-bg, #login-screen { background-image: url('img/war_tall.jpg?v=1'); } }
