:root {
  --ink: #0a1310;
  --paper: #0b1411;
  --card-bg: #13211b;
  --acid: #d9eb74;
  --moss: #223c32;
  --gold: #f59e0b;
  --line: rgba(255, 255, 255, 0.1);
  --text-main: #f2efe9;
  --text-dim: #94a3b8;
  --font-serif: "Fraunces", serif;
  --font-mono: "DM Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 0;
  color: var(--text-main);
  background: var(--paper);
  font-family: var(--font-mono);
  overflow-x: hidden;
  min-height: 100vh;
}

a { color: inherit; }

/* Subtle Analog Film Grain */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: 0.14;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
}

/* Page Frame: Fits effortlessly in 1 screen */
.page-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  max-width: 1720px;
  margin: 0 auto;
}

/* Compact Top Header */
.home-header {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 3vw, 40px);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #0b1411;
  background: var(--acid);
  font-size: 12px;
  font-weight: bold;
}

.brand-text-group {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font: 700 17px/1.1 var(--font-serif);
  letter-spacing: -0.03em;
  color: #fff;
}

.brand-tagline {
  font-size: 8.5px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.badge-status strong {
  color: #10b981;
}

.badge-zen {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--acid);
  font-size: 9.5px;
  letter-spacing: 0.04em;
}

/* Main Games Stage (Zero Scrolling on Desktop) */
.home-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px clamp(16px, 3vw, 40px) 8px;
}

.stage-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
}

.intro-left .kicker {
  margin: 0 0 4px 0;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--acid);
  text-transform: uppercase;
}

.intro-left h1 {
  margin: 0;
  font: 600 clamp(20px, 2vw, 28px)/1.1 var(--font-serif);
  letter-spacing: -0.04em;
  color: #fff;
}

.intro-desc {
  max-width: 440px;
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-dim);
}

/* 5-Column Grid: Exactly 5 Games on 1 Screen */
.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
}

.game-card {
  min-height: 330px;
  max-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
  padding: 18px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  text-decoration: none;
  background: var(--card-bg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1),
              border-color 0.3s ease,
              box-shadow 0.35s ease;
}

.game-card:hover {
  transform: translateY(-6px);
  border-color: rgba(217, 235, 116, 0.65);
  box-shadow: 0 20px 44px -8px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(217, 235, 116, 0.35);
}

/* Background Art & Smooth Zoom */
.game-card .card-bg {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.game-card:hover .card-bg {
  transform: scale(1.08);
}

/* Dark cinematic vignette overlay */
.game-card:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(11, 20, 17, 0.1) 0%,
    rgba(11, 20, 17, 0.55) 45%,
    rgba(11, 20, 17, 0.96) 90%
  );
  pointer-events: none;
}

/* Card Badge Index */
.card-index {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 3;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #e2e8f0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 3px 9px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Card Content Details */
.card-content {
  position: relative;
  z-index: 3;
}

.card-tag {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--acid);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.game-card h3 {
  margin: 0 0 8px 0;
  font: 600 clamp(18px, 1.35vw, 22px)/1.15 var(--font-serif);
  letter-spacing: -0.04em;
  color: #fff;
}

.game-card p {
  margin: 0;
  color: #cbd5e1;
  font-size: 11px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 11px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #f1f5f9;
}

.card-action span:last-child {
  transition: transform 0.25s ease, color 0.25s ease;
}

.game-card:hover .card-action span:last-child {
  transform: translate(3px, -3px);
  color: var(--acid);
}

.game-card:hover .card-action span:first-child {
  color: var(--acid);
}

/* AdSlot Wrapper (Safe Banner) */
.ad-slot-wrapper {
  margin-top: 10px;
  border-radius: 8px;
  overflow: hidden;
}

.ad-slot-inner {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Compact Bottom Footer */
.home-footer {
  height: 38px;
  padding: 0 clamp(16px, 3vw, 40px);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.footer-principles {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-principles a {
  text-decoration: underline;
  color: inherit;
}

.footer-principles a:hover {
  color: var(--acid);
}

/* Responsive: Medium Laptops / Tablets (3 on top + 2 below) */
@media (max-width: 1180px) and (min-width: 768px) {
  .game-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }
  .game-card {
    min-height: 340px;
  }
}

/* Responsive: Mobile View */
@media (max-width: 767px) {
  .home-header {
    height: 56px;
    padding: 0 16px;
  }
  .brand-name {
    font-size: 16px;
  }
  .badge-zen {
    display: none;
  }
  .home-main {
    padding: 14px 16px;
  }
  .stage-intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 14px;
  }
  .intro-desc {
    font-size: 11px;
  }
  .game-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .game-card {
    min-height: 220px;
    padding: 16px;
  }
  .home-footer {
    height: auto;
    padding: 16px;
    flex-direction: column;
    gap: 8px;
    text-align: center;
    margin-bottom: 76px; /* Bảo vệ Safe Bottom Margin cho Mobile AdSense */
  }
}
