/* ==========================================================================
   ModDongGam - Global Stylesheet
   Dark theme, mobile-first, vanilla CSS (no framework)
   ========================================================================== */

:root {
  --bg:            #0d1117;
  --bg-alt:        #131a23;
  --surface:       #161d27;
  --surface-2:     #1d2633;
  --border:        #26313f;
  --text:          #e6edf3;
  --text-muted:    #8b98a9;
  --accent:        #00e58a;
  --accent-dark:   #00b86e;
  --accent-soft:   rgba(0, 229, 138, 0.12);
  --danger:        #ff5c7a;
  --warn:          #ffc247;
  --radius:        14px;
  --radius-sm:     8px;
  --shadow:        0 8px 28px rgba(0, 0, 0, 0.45);
  --maxw:          1200px;
  --font:          "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
}

/* --------------------------------------------------------------------------
   Ad placeholders
   -------------------------------------------------------------------------- */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 18px auto;
  background: repeating-linear-gradient(
    45deg, var(--surface), var(--surface) 10px, var(--surface-2) 10px, var(--surface-2) 20px
  );
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  overflow: hidden;
}

.ad-728x90  { width: 728px; max-width: 100%; height: 90px; }
.ad-300x250 { width: 300px; max-width: 100%; height: 250px; }
.ad-320x50  { width: 320px; max-width: 100%; height: 50px; }

/* 728x90 shown on desktop only, 320x50 on mobile only */
.ad-desktop { display: flex; }
.ad-mobile  { display: none; }
/* --------------------------------------------------------------------------
   Header / Navigation
   -------------------------------------------------------------------------- */
.topbar-ad {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 17, 23, 0.94);
  border-bottom: 1px solid var(--border);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}
.logo:hover { color: var(--text); }
.logo-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #00a2ff);
  color: #04120c;
  font-size: 18px;
  font-weight: 900;
}
.logo span.accent { color: var(--accent); }

.main-nav ul {
  display: flex;
  align-items: center;
  gap: 26px;
  list-style: none;
}
.main-nav a {
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 600;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}
.main-nav a:hover,
.main-nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.nav-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  padding: 8px 12px;
  cursor: pointer;
}
/* --------------------------------------------------------------------------
   Hero + Search
   -------------------------------------------------------------------------- */
.hero {
  padding: 62px 0 46px;
  text-align: center;
  background:
    radial-gradient(900px 340px at 50% -10%, rgba(0, 229, 138, 0.16), transparent 70%),
    var(--bg);
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 14px;
}
.hero h1 .accent { color: var(--accent); }
.hero p {
  max-width: 660px;
  margin: 0 auto 28px;
  color: var(--text-muted);
  font-size: 17px;
}

.search-box {
  display: flex;
  gap: 8px;
  max-width: 580px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 6px 6px 6px 18px;
}
.search-box input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 15px;
  font-family: var(--font);
}
.search-box input::placeholder { color: var(--text-muted); }
.search-box button {
  border: none;
  border-radius: 50px;
  padding: 10px 24px;
  background: var(--accent);
  color: #04120c;
  font-weight: 700;
  font-size: 15px;
  font-family: var(--font);
  cursor: pointer;
  transition: background .18s ease;
}
.search-box button:hover { background: var(--accent-dark); }

.hero-stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 34px;
  margin-top: 32px;
  color: var(--text-muted);
  font-size: 14px;
}
.hero-stats strong { display: block; color: var(--text); font-size: 20px; }

/* --------------------------------------------------------------------------
   Layout with sidebar
   -------------------------------------------------------------------------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  padding: 40px 0 60px;
}
.sidebar { display: flex; flex-direction: column; gap: 22px; }

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.section-title h2 {
  font-size: 22px;
  font-weight: 700;
  border-left: 4px solid var(--accent);
  padding-left: 12px;
}
.section-title span { color: var(--text-muted); font-size: 14px; }
/* --------------------------------------------------------------------------
   Game grid / cards
   -------------------------------------------------------------------------- */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}

.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.game-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  font-size: 42px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.92);
  background: linear-gradient(135deg, #1f2a38, #101722);
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
}
.game-thumb .badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent);
  color: #04120c;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: .5px;
}

.game-thumb .cat-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(4, 18, 12, 0.62);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: .3px;
  white-space: nowrap;
}

.game-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.game-body h3 { font-size: 16px; font-weight: 700; }
.game-body h3 a { color: var(--text); }
.game-body h3 a:hover { color: var(--accent); }
.game-body .btn { margin-top: auto; }

.game-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.tag {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 9px;
}
.tag.mod {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  text-align: center;
  transition: background .18s ease, transform .12s ease, border-color .18s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: #04120c; }
.btn-primary:hover { background: var(--accent-dark); color: #04120c; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 30px; font-size: 17px; }
/* --------------------------------------------------------------------------
   Game detail page
   -------------------------------------------------------------------------- */
.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  padding: 18px 0 0;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }

.game-hero {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 26px;
}
.game-hero .icon {
  width: 132px;
  height: 132px;
  border-radius: 26px;
  display: grid;
  place-items: center;
  font-size: 52px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #00a2ff, #00e58a);
  flex-shrink: 0;
}
.game-hero .info { flex: 1; min-width: 240px; }
.game-hero h1 {
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 800;
  margin-bottom: 8px;
}
.game-hero .subtitle { color: var(--text-muted); margin-bottom: 14px; }

.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.spec {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.spec small {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.spec b { font-size: 15px; }

.content-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 26px;
}
.content-block h2 { font-size: 20px; margin-bottom: 14px; }
.content-block h3 { font-size: 17px; margin: 18px 0 10px; }
.content-block p { color: var(--text-muted); margin-bottom: 12px; }
.content-block ul,
.content-block ol {
  color: var(--text-muted);
  padding-left: 22px;
  margin-bottom: 12px;
}
.content-block li { margin-bottom: 7px; }
.content-block li strong { color: var(--text); }

.feature-list { list-style: none; padding-left: 0 !important; }
.feature-list li { position: relative; padding-left: 26px; }
.feature-list li::before {
  content: "\2714";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.screenshots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.shot {
  aspect-ratio: 9 / 16;
  max-height: 300px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: linear-gradient(160deg, var(--surface-2), var(--bg-alt));
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  overflow: hidden;
}

/* Phone screenshots are taller than the 9/16 tile, so let the image fill the
   tile and crop the bottom instead of overflowing into the next block. */
.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: inherit;
}

.notice {
  border-left: 4px solid var(--warn);
  background: rgba(255, 194, 71, 0.08);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.download-cta {
  text-align: center;
  background: linear-gradient(135deg, rgba(0, 229, 138, .12), rgba(0, 162, 255, .08));
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 28px 20px;
  margin-bottom: 26px;
}
.download-cta h2 { font-size: 21px; margin-bottom: 8px; }
.download-cta p { color: var(--text-muted); margin-bottom: 16px; }
.download-cta small {
  display: block;
  color: var(--text-muted);
  margin-top: 12px;
  font-size: 12px;
}
/* --------------------------------------------------------------------------
   Download page
   -------------------------------------------------------------------------- */
.download-wrap { max-width: 720px; margin: 0 auto; }

.timer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px 22px;
  margin-bottom: 24px;
  text-align: center;
}
.timer-circle {
  width: 132px;
  height: 132px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 44px;
  font-weight: 900;
  color: var(--accent);
  background: var(--bg-alt);
  border: 6px solid var(--accent);
  box-shadow: 0 0 0 6px var(--accent-soft);
}
.timer-circle.done {
  color: var(--text);
  border-color: var(--border);
  box-shadow: none;
  font-size: 40px;
}

.progress {
  height: 8px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  background: var(--surface-2);
  border-radius: 20px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #00a2ff);
  transition: width .4s linear;
}

.mirror-list { display: flex; flex-direction: column; gap: 14px; }
.mirror {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-align: left;
  transition: border-color .18s ease;
}
.mirror:hover { border-color: var(--accent); }
.mirror .m-name { font-weight: 700; }
.mirror .m-desc { color: var(--text-muted); font-size: 13px; }

.steps { counter-reset: step; list-style: none; padding-left: 0 !important; }
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 38px;
  margin-bottom: 12px;
  color: var(--text-muted);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.hidden { display: none !important; }

.fade-in { animation: fadeIn .45s ease both; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
/* --------------------------------------------------------------------------
   Legal / static pages
   -------------------------------------------------------------------------- */
.page-head {
  padding: 46px 0 30px;
  border-bottom: 1px solid var(--border);
  background: radial-gradient(700px 260px at 50% 0%, rgba(0, 229, 138, .1), transparent 70%);
}
.page-head h1 { font-size: clamp(26px, 4.5vw, 38px); font-weight: 800; }
.page-head p { color: var(--text-muted); margin-top: 8px; }
.page-head .updated { font-size: 13px; }

.legal h2 { margin-top: 26px; }
.legal h2:first-child { margin-top: 0; }
.legal a { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 46px 0 22px;
  margin-top: 20px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 30px;
}
.footer-grid h4 { font-size: 15px; margin-bottom: 12px; }
.footer-grid p { color: var(--text-muted); font-size: 14px; }
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid li a { color: var(--text-muted); font-size: 14px; }
.footer-grid li a:hover { color: var(--accent); }
.footer-bottom {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .sidebar .ad-slot { flex: 1 1 300px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .ad-desktop { display: none; }
  .ad-mobile  { display: flex; }

  .nav-toggle { display: block; }
  .main-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 66px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    display: none;
  }
  .main-nav.open { display: block; }
  .main-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 16px 16px;
  }
  .main-nav a {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
  }

  .hero { padding: 42px 0 34px; }
  .hero p { font-size: 15px; }
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .game-thumb { font-size: 30px; }
  .game-body { padding: 12px; }
  .game-body h3 { font-size: 15px; }
  .game-hero { padding: 18px; }
  .game-hero .icon { width: 92px; height: 92px; font-size: 38px; border-radius: 20px; }
  .content-block { padding: 18px; }
  .mirror { flex-direction: column; align-items: stretch; text-align: center; }
  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
}

@media (max-width: 480px) {
  .search-box { flex-direction: column; border-radius: var(--radius); padding: 10px; }
  .search-box button { width: 100%; }
  .hero-stats { gap: 20px; }
  .timer-circle { width: 110px; height: 110px; font-size: 36px; }
}