:root{
  --hw-bg: #070a18;
  --hw-panel: rgba(255,255,255,0.06);
  --hw-panel-2: rgba(255,255,255,0.09);
  --hw-border: rgba(255,255,255,0.14);
  --hw-text: rgba(255,255,255,0.92);
  --hw-muted: rgba(255,255,255,0.64);
  /* Palette matched to the Happy Wars logo */
  --hw-accent-1: #ff6a00; /* burnt orange */
  --hw-accent-2: #ffd24a; /* golden yellow */
  --hw-link: #ffd24a;     /* use logo gold instead of blue */
  --hw-good: #00ff88;
  --hw-shadow: 0 18px 55px rgba(0,0,0,0.55);
  --hw-radius: 22px;
  --hw-wrap: 1200px;
}

/* Global background image (hero) across the whole website */
body{
  background: var(--hw-bg) url("/assets/img/background.webp") center / cover fixed no-repeat !important;
  color: var(--hw-text);
  transition: padding-top 420ms cubic-bezier(0.2, 0.9, 0.2, 1);
  /* Let CSS handle chrome spacing; JS only updates the vars on load/resize */
  padding-top: calc(var(--hw-banner-h, 0px) + var(--hw-header-h, 0px)) !important;
}
body::before{
  content:"";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 15%, rgba(255,106,0,0.22) 0%, rgba(0,0,0,0) 55%),
    radial-gradient(circle at 78% 22%, rgba(255,210,74,0.16) 0%, rgba(0,0,0,0) 55%),
    linear-gradient(180deg, rgba(7,10,24,0.92) 0%, rgba(7,10,24,0.70) 40%, rgba(7,10,24,0.92) 100%);
  z-index: -1;
  pointer-events: none;
}

/* Shared layout */
.wrap{
  max-width: var(--hw-wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.section{
  padding: 110px 0;
}

.glass{
  background: var(--hw-panel);
  border: 1px solid var(--hw-border);
  border-radius: var(--hw-radius);
  backdrop-filter: blur(10px);
  box-shadow: var(--hw-shadow);
}

/* Banner + Header */
.legal-banner{
  background: linear-gradient(90deg, rgba(255,106,0,0.88), rgba(255,210,74,0.78));
  border-bottom: 1px solid rgba(0,0,0,0.25);
  font-size: 10px;
  letter-spacing: 0.15px;
  padding: 6px 12px;
}

.legal-banner,
.header{
  will-change: transform;
  transition: transform 440ms cubic-bezier(0.2, 0.9, 0.2, 1), opacity 300ms ease;
}

body.ui-hidden .legal-banner{
  transform: translateY(calc(-1 * var(--hw-banner-h, 0px)));
  opacity: 0;
}

body.ui-hidden .header{
  transform: translateY(calc(-1 * (var(--hw-banner-h, 0px) + var(--hw-header-h, 0px))));
  opacity: 0;
}

/* When chrome is hidden, reclaim space smoothly */
body.ui-hidden{
  padding-top: 0 !important;
}

.header{
  top: var(--hw-banner-h, 0px) !important;
}

/* --- Trailer modal --- */
body.hw-modal-open{
  overflow: hidden;
}

.hw-modal{
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
}

.hw-modal.is-open{
  display: block;
}

.hw-modal-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 240ms ease;
}

.hw-modal.is-open .hw-modal-backdrop{
  opacity: 1;
}

.hw-modal-dialog{
  position: relative;
  width: min(960px, calc(100vw - 32px));
  margin: 7vh auto 0;
  border-radius: 14px;
  background: rgba(0,0,0,0.70);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 30px 90px rgba(0,0,0,0.72);
  overflow: hidden;
  transform: translateY(10px) scale(0.98);
  opacity: 0;
  transition: transform 280ms cubic-bezier(0.2, 0.9, 0.2, 1), opacity 200ms ease;
}

.hw-modal.is-open .hw-modal-dialog{
  transform: translateY(0) scale(1);
  opacity: 1;
}

.hw-modal-close{
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.55);
  color: rgba(255,255,255,0.92);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}

.hw-modal-close:hover{
  background: rgba(0,0,0,0.72);
}

.hw-modal-video{
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.hw-modal-video iframe{
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Use official-ish accent for nav underline + key CTAs */
.nav-menu a::after{
  background: linear-gradient(90deg, var(--hw-accent-1), var(--hw-accent-2)) !important;
}

.download-btn,
.btn-primary,
.download-big-btn,
.contact-btn{
  background: linear-gradient(135deg, var(--hw-accent-1) 0%, var(--hw-accent-2) 100%) !important;
  box-shadow: 0 10px 28px rgba(255,106,0,0.22) !important;
}

/* Make the header CTA less wide */
.header .download-btn{
  padding: 10px 18px !important;
  font-size: 13px !important;
  border-radius: 10px !important;
}

/* Slightly tighten nav spacing in the header */
.header .nav-menu{
  gap: 22px !important;
}

.footer-links a:hover,
.logo-subtitle{
  color: var(--hw-link) !important;
}

.header{
  background: rgba(7,10,24,0.55) !important;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(14px);
}

.header-content{
  max-width: var(--hw-wrap);
  padding: 14px 18px !important;
}

/* --- Official-style header/nav (like Happy Wars site) --- */
.hw-header{
  padding: 0 !important;
}

.hw-header-topbar{
  background: rgba(0,0,0,0.55);
  border-bottom: 0;
}

.hw-header-topbar-inner{
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hw-lang{
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: Verdana, Roboto, "Droid Sans", Arial, sans-serif;
  font-size: 12px;
  color: rgba(255,255,255,0.8);
}

.hw-lang-label{
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.9);
}

.hw-lang-item{
  padding: 4px 10px;
  border-radius: 999px;
  text-decoration: none;
  color: rgba(255,255,255,0.75);
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.25);
}
.hw-lang-item.active{
  color: #fff;
  background: rgba(255,255,255,0.14);
}

.hw-social{
  display: flex;
  align-items: center;
  gap: 10px;
}
.hw-social-link{
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.85);
  text-decoration: none;
}

.hw-social--menubar{
  justify-content: flex-end;
}

/* --- "TOP" button (like original Happy Wars site) --- */
#toTop{
  position: fixed;
  right: 20px;
  bottom: -223px; /* hidden off-screen by default */
  z-index: 1300;
  transition: bottom 220ms ease;
  pointer-events: none; /* disabled while hidden */
}

#toTop.is-visible{
  bottom: 20px;
  pointer-events: auto;
}

#toTop a{
  display: inline-block;
  text-decoration: none;
}

#toTop img{
  display: block;
  width: 231px; /* matches the original asset size */
  height: auto;
}

@media (max-width: 480px){
  #toTop img{ width: 170px; }
}

.hw-header-menubar{
  background: rgba(0,0,0,0.75);
  border-top: 0;
  border-bottom: 0;
}

.hw-header-menubar-inner{
  height: 46px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.hw-nav{
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
  grid-column: 2;
}
.hw-nav::before{
  content:"";
  position:absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,0.05) 0px, rgba(255,255,255,0.05) 1px, rgba(0,0,0,0) 1px, rgba(0,0,0,0) 10px);
  opacity: 0.25;
  pointer-events:none;
}

.hw-nav-menu{
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 26px !important;
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 0 1 auto;
  justify-content: center;
}

.hw-nav-menu a{
  font-family: Verdana, Roboto, "Droid Sans", Arial, sans-serif;
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
  color: var(--hw-accent-2) !important;
  text-shadow: 0 2px 0 rgba(0,0,0,0.55);
  position: relative;
  padding-left: 18px;
}

.hw-nav-menu a::after{ display:none !important; }

.hw-nav-menu a::before{
  content: "➜";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--hw-accent-1);
  font-size: 14px;
}

.hw-nav-menu li{
  position: relative;
}
.hw-nav-menu li + li::before{
  content: none;
}

@media (max-width: 900px){
  .hw-header-menubar-inner{
    grid-template-columns: auto 1fr auto;
  }
  .hw-nav{
    grid-column: 1 / -1;
  }
  .hw-social--menubar{
    display: none;
  }
}

@media (max-width: 900px){
  .hw-nav-menu a{ font-size: 15px; }
}

.logo-title{
  font-size: 18px;
}
.logo-subtitle{
  color: rgba(255,255,255,0.62);
}

/* Modern nav with mobile drawer */
.nav-toggle{
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: #fff;
  cursor: pointer;
}
.nav-toggle:hover{ background: rgba(255,255,255,0.12); }

.nav-menu a{
  color: rgba(255,255,255,0.78) !important;
}
.nav-menu a:hover{
  color: #fff !important;
}

/* Mobile drawer animation (avoid display toggles which feel snappy) */
body.nav-open .nav-menu{
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  visibility: visible;
  transition: transform 360ms cubic-bezier(0.2, 0.9, 0.2, 1), opacity 220ms ease, visibility 0s;
}

@media (max-width: 900px){
  .nav-toggle{ display: inline-flex; align-items:center; justify-content:center; }
  .nav-menu{
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(88vw, 360px);
    flex-direction: column;
    gap: 18px;
    padding: 100px 22px 22px;
    background: rgba(7,10,24,0.92);
    border-left: 1px solid rgba(255,255,255,0.10);
    backdrop-filter: blur(16px);
    display: flex;
    opacity: 0;
    transform: translateX(14px);
    pointer-events: none;
    visibility: hidden;
    transition: transform 360ms cubic-bezier(0.2, 0.9, 0.2, 1), opacity 220ms ease, visibility 0s linear 220ms;
    z-index: 1200;
  }
  .nav-menu li:last-child{ margin-top: 8px; }
}

/* Hero */
.hero{
  min-height: 88vh;
  padding: 60px 0 80px;
  background: transparent !important;
}
.hero::before{
  background: none !important; /* image handled globally now */
}
.hero-content{
  max-width: var(--hw-wrap);
  padding: 0 24px !important;
  grid-template-columns: 1.1fr 0.9fr !important;
  gap: 36px !important;
  align-items: stretch !important; /* make both columns share the same height */
  margin-top: -44px;
}

/* Center left hero column contents inside its box */
.hero-text{
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  min-height: 100%;
}

/* The base stylesheet shifts the logo left; override so it's centered in the left box */
.hero-text .hero-logo img{
  /* Nudge the logo left to match the original layout (image has extra transparent padding) */
  transform: translateX(clamp(-120px, -8vw, -36px)) !important;
  margin-left: 0;
  margin-right: 0;
  max-width: 100%;
  width: clamp(420px, 52vw, 860px);
  max-height: clamp(150px, 24vw, 300px);
  height: auto;
  object-fit: contain;
}
.hero-text h1{
  font-size: 64px !important;
  letter-spacing: -1px;
}
.hero-text p{
  font-size: 18px !important;
  color: var(--hw-muted) !important;
  max-width: 54ch;
}

.hero-badges{
  justify-content: flex-start;
}

.hero-cta{
  justify-content: flex-start;
}
.hero-badges .badge{
  background: rgba(255,255,255,0.08) !important;
  border-color: rgba(255,255,255,0.14) !important;
}
.btn-primary{
  border-radius: 16px !important;
}
.btn-secondary{
  border-radius: 16px !important;
  background: rgba(255,255,255,0.07) !important;
}

.hero-stats .stat-card{
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.12) !important;
  border-radius: var(--hw-radius) !important;
}

/* Hero media (slideshow) */
.hero-media{
  width: 100%;
  display: flex;
  align-items: flex-start; /* move slideshow higher in the right column */
  justify-content: center;
  min-height: 100%;
  padding-top: 6px;
}

/* Hide any remaining slider captions (remove "hw3" / filename overlay) */
.hero .hw-slide-caption{
  display: none !important;
}

/* --- Event-style gallery carousel (like the reference screenshot) --- */
.hero-media .hw-slider--event{
  width: 100%;
  max-width: 640px;
  padding: 10px 10px 12px;
  border-radius: 8px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 18px 55px rgba(0,0,0,0.55);
}

/* Override base slider positioning for this skin */
.hero-media .hw-slider--event .hw-slider-btn{
  position: static;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  font-size: 28px;
  line-height: 1;
  background: rgba(0,0,0,0.50);
  border: 2px solid rgba(255,255,255,0.22);
}

.hero-media .hw-slider--event .hw-slider-viewport{
  border-radius: 6px;
  border: 3px solid rgba(255,255,255,0.35);
  overflow: hidden;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.35);
}

.hero-media .hw-slider--event .hw-slide-img{
  border-radius: 0;
}

.hero-media .hw-slider--event .hw-slider-dots{
  display: none !important;
}

.hero-media .hw-slider--event .hw-slider-controls{
  margin-top: 10px;
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: end;
  gap: 8px;
}

.hero-media .hw-slider--event .hw-slider-meta{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hero-media .hw-slider--event .hw-slider-count{
  font-family: Verdana, Roboto, "Droid Sans", Arial, sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: #ff3b30; /* red like the original counter */
  text-shadow: 0 2px 0 rgba(0,0,0,0.75);
}

.hero-media .hw-slider--event .hw-slider-thumbs{
  width: 100%;
  display: flex;
  gap: 6px;
  justify-content: center;
  overflow: hidden;
}

.hero-media .hw-slider--event .hw-thumb{
  width: 64px;
  height: 44px;
  padding: 0;
  border-radius: 6px;
  border: 2px solid rgba(255,255,255,0.20);
  background: rgba(0,0,0,0.45);
  cursor: pointer;
  overflow: hidden;
}

.hero-media .hw-slider--event .hw-thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.05) contrast(1.05);
}

.hero-media .hw-slider--event .hw-thumb.active{
  border-color: rgba(255,210,74,0.95);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.45);
}

@media (max-width: 768px){
  .hero-media .hw-slider--event{
    max-width: 560px;
  }
  .hero-media .hw-slider--event .hw-thumb{
    width: 56px;
    height: 40px;
  }
}

.hero-media .hw-slider{
  max-width: 560px;
  transform: none;
}

@media (max-width: 768px){
  .hero-content{
    margin-top: -26px;
  }

  .hero-media .hw-slider{
    transform: none;
  }

  .hero-text .hero-logo img{
    transform: translateX(clamp(-78px, -9vw, -24px)) !important;
    width: clamp(320px, 78vw, 640px);
    max-height: clamp(130px, 22vw, 240px);
  }
}

.hero-media .hw-slider-viewport{
  border-radius: var(--hw-radius);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 18px 55px rgba(0,0,0,0.55);
}

.hero-media .hw-slide-img{
  border-radius: var(--hw-radius);
}

.hero-media .hw-slide-caption{
  left: 14px;
  right: 14px;
  bottom: 14px;
}

/* Section titles */
.section-title{
  font-size: 44px !important;
}
.section-subtitle{
  max-width: 76ch;
  margin: 0 auto 64px !important;
  color: var(--hw-muted) !important;
}

/* Make big sections feel like panels so background shows through */
.features,
.news-section,
.gallery,
.community{
  background: rgba(7,10,24,0.55) !important;
  backdrop-filter: blur(10px);
}

/* Cards */
.feature-card,
.news-card,
.community-card{
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.12) !important;
  border-radius: var(--hw-radius) !important;
}

/* Gallery polish (keeps your existing markup) */
.gallery-item{
  border-radius: var(--hw-radius) !important;
}
.hw-lightbox{
  background: rgba(0,0,0,0.88) !important;
}

/* Footer */
.footer{
  background: rgba(7,10,24,0.78) !important;
  backdrop-filter: blur(12px);
}

/* Games showcase (bottom panel like official site) */
.games-showcase{
  padding: 60px 0 110px;
}

.games-card{
  /* Match original Happy Wars `.productInfo` sizing */
  display: table;
  width: 620px;
  max-width: 100%;
  padding: 24px 30px;
  margin: 0 auto 20px;
  position: relative;
  bottom: 10px;
  background: rgba(0,0,0,0.75);
  border: 1px solid #4c4b4b;
  border-radius: 8px;
  box-shadow: 0 22px 70px rgba(0,0,0,0.60);
  overflow: hidden;
}

.games-card::before{
  content: none;
}

.games-left{
  position: relative;
  z-index: 1;
  display: table-cell;
  vertical-align: middle;
  width: 180px;
  text-align: center;
  padding-right: 18px;
}

.games-label{
  /* Match original `h3.blockList` typography */
  font-family: Verdana, Roboto, "Droid Sans", Arial, sans-serif;
  font-size: 19.2px;
  line-height: 19.2px;
  font-weight: 700;
  letter-spacing: 0;
  color: #fff;
  text-transform: uppercase;
}

.games-divider{
  position: relative;
  z-index: 1;
  display: table-cell;
  vertical-align: middle;
  width: 1px;
  background: rgba(255,255,255,0.18);
}

.games-right{
  position: relative;
  z-index: 1;
  display: table-cell;
  vertical-align: middle;
  padding-left: 22px;
}

.games-right > .games-cover,
.games-right > .games-meta{
  display: inline-block;
  vertical-align: middle;
}

.games-right > .games-cover{
  margin-right: 18px;
}

.games-cover img{
  width: 116px;
  height: 158px;
  object-fit: contain;
  border-radius: 0;
  border: none;
  box-shadow: none;
  background: transparent;
}

.games-platform--steam{
  color: #08578A;
}

/* Match original product info list structure */
.games-productInfo{
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: Verdana, Roboto, "Droid Sans", Arial, sans-serif;
}

.games-productInfo li{
  margin: 0;
  padding: 0;
}

.games-productInfo .productGenre{
  font-size: 11.4px;
  line-height: 11.41px;
  font-weight: 400;
  color: #989898;
}

.games-productInfo .productTitle{
  font-size: 15.6px;
  line-height: 20.27px;
  font-weight: 700;
  color: #fff;
}

.games-productInfo .productConsole{
  font-size: 12px;
  line-height: 16.8px;
  font-weight: 700;
  padding: 0 0 12px;
  color: rgba(255,255,255,0.74); /* base (Steam override applies) */
}

/* Ensure Steam color wins over the base `.productConsole` color */
.games-productInfo .productConsole.games-platform--steam{
  color: #08578A;
}

/* Publisher/Developer/price/Producer lines */
.games-productInfo li:not(.productGenre):not(.productTitle):not(.productConsole){
  font-size: 12px;
  line-height: 16.8px;
  color: #989898;
}

@media (max-width: 900px){
  .games-card{
    display: block;
    bottom: 0;
  }
  .games-left,
  .games-divider,
  .games-right{
    display: block;
    width: auto;
    padding: 0;
    text-align: left;
  }
  .games-divider{
    height: 1px;
    width: 100%;
    margin: 14px 0;
  }
  .games-right{
    padding-left: 0;
  }
  .games-right > .games-cover{
    margin: 0 14px 0 0;
  }
}

/* Mobile typography */
@media (max-width: 768px){
  .section{ padding: 82px 0; }
  .hero-content{ grid-template-columns: 1fr !important; }
  .hero-text h1{ font-size: 40px !important; }
  .section-title{ font-size: 32px !important; }
}

