:root {
  --background: #e6f7ff;
  --foreground: #17233b;
  --card: #ffffff;
  --card-foreground: #17233b;
  --popover: #ffffff;
  --popover-foreground: #17233b;
  --primary: #f09b13;
  --primary-foreground: #231507;
  --secondary: #edf7ff;
  --secondary-foreground: #19304d;
  --muted: #eaf3fa;
  --muted-foreground: #607086;
  --accent: #fff1c9;
  --accent-foreground: #563506;
  --destructive: #db3d32;
  --border: #c9ddeb;
  --input: #c9ddeb;
  --ring: #e89a16;
  --radius: .85rem;
}

.dark {
  --background: #071422;
  --foreground: #edf7ff;
  --card: #101f31;
  --card-foreground: #edf7ff;
  --popover: #101f31;
  --popover-foreground: #edf7ff;
  --primary: #ffb126;
  --primary-foreground: #241503;
  --secondary: #172a40;
  --secondary-foreground: #edf7ff;
  --muted: #18283a;
  --muted-foreground: #a9b7c8;
  --accent: #493615;
  --accent-foreground: #ffe4a2;
  --destructive: #ef655a;
  --border: #2d4156;
  --input: #32495f;
  --ring: #ffb126;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--background); }
body {
  margin: 0;
  min-height: 100%;
  background: var(--background);
  color: var(--foreground);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
button, a, input { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; height: auto; display: block; }

.site-shell {
  width: 100%;
  min-height: 100svh;
  padding: 18px 10px;
  background: radial-gradient(circle at 16% 8%, rgb(86 214 255 / 30%), transparent 30%), radial-gradient(circle at 82% 86%, rgb(255 186 47 / 20%), transparent 32%), var(--background);
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-site {
  width: 100%;
  max-width: 430px;
  min-width: 0;
  min-height: calc(100svh - 36px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--card);
  box-shadow: 0 24px 70px rgb(12 36 55 / 22%);
  display: flex;
  flex-direction: column;
}

.topbar {
  position: relative;
  z-index: 20;
  min-height: 84px;
  padding: 14px 16px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.topbar img.web-logo {
  flex: 0 1 240px;
  max-width: calc(100% - 110px);
  min-width: 0;
  height: auto;
  object-fit: contain;
}
.desktop-nav { display: none; }
.theme-toggle, .mobile-menu-toggle {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--foreground);
  background: var(--secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease;
}
.theme-toggle { margin-left: auto; }
.theme-toggle:hover, .mobile-menu-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
}
.mobile-dropdown {
  position: absolute;
  top: 100%;
  right: 12px;
  left: 12px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--popover);
  box-shadow: 0 16px 35px rgb(12 36 55 / 24%);
  display: grid;
  gap: 4px;
  z-index: 50;
}
.mobile-dropdown a, .mobile-dropdown button {
  min-height: 46px;
  padding: 0 14px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--foreground);
  font-family: inherit;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: .01em;
  text-align: left;
  text-decoration: none;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.mobile-dropdown a:hover, .mobile-dropdown button:hover, .mobile-dropdown .active {
  background: var(--secondary);
  color: var(--primary);
}

.intro-section { padding: 20px 16px 28px; }
.section-heading span {
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.section-heading h2 {
  margin: 5px 0 16px;
  font-size: 28px;
  line-height: 1.15;
  color: var(--foreground);
}
.intro-copy {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--secondary);
}
.intro-copy p { margin: 0; font-size: 16px; line-height: 1.7; color: var(--foreground); }
.intro-copy p + p { margin-top: 14px; }
.game-gallery { margin-top: 16px; display: grid; gap: 12px; }
.game-shot {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--secondary);
}
.game-shot-image {
  position: relative;
  aspect-ratio: 16/9;
  background: #081422;
  overflow: hidden;
}
.game-shot-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.game-shot figcaption {
  padding: 10px 12px;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 700;
}

.download-page { padding: 24px 16px 34px; }
.download-lead { margin: -5px 0 22px; color: var(--muted-foreground); font-size: 16px; line-height: 1.5; }
.platform-grid { display: grid; gap: 14px; }
.platform-card {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--secondary);
  color: var(--foreground);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.platform-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 12px 26px rgb(32 74 105 / 14%);
}
.platform-icon {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 18px;
  color: #fff;
  display: grid;
  place-items: center;
}
.platform-icon svg { width: 36px; height: 36px; fill: currentColor; }
.platform-card strong, .platform-card small { display: block; }
.platform-card strong { font-size: 18px; color: var(--foreground); }
.platform-card small { margin-top: 5px; color: var(--muted-foreground); font-size: 14px; }
.platform-card.windows .platform-icon { background: linear-gradient(145deg, #20a6ed, #0878d1); }
.platform-card.android .platform-icon { background: linear-gradient(145deg, #72d34e, #3c9d2d); }
.platform-card.ios .platform-icon { background: linear-gradient(145deg, #4d5968, #121820); }

.forum-page { padding: 24px 16px 40px; }
.forum-list { display: grid; gap: 12px; }
.forum-card {
  max-width: 520px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--secondary);
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 8px 20px rgb(32 74 105 / 8%);
}
.forum-avatar {
  position: relative;
  width: 70px;
  height: 70px;
  flex: 0 0 70px;
  overflow: hidden;
  border: 2px solid #f0a11d;
  border-radius: 16px;
  background: linear-gradient(145deg, #fff0bb, #ffd15c);
  display: flex;
  align-items: center;
  justify-content: center;
}
.forum-avatar img { width: 85%; height: 85%; object-fit: contain; }
.forum-card-copy { display: grid; gap: 4px; }
.forum-card-copy strong { color: var(--primary); font-size: 14px; letter-spacing: .06em; }
.forum-card-copy span { font-size: 17px; font-weight: 750; color: var(--foreground); }

footer {
  margin-top: auto;
  padding: 20px 18px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted-foreground);
  font-size: 12px;
}
footer strong { color: var(--foreground); font-size: 14px; }

/* Modals */
.web-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(3, 25, 44, 0.65);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.web-modal-box {
  position: relative;
  max-width: 100%;
  animation: modalFadeIn 0.2s ease-out;
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.web-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--secondary);
  color: var(--foreground);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  transition: transform 0.15s;
}
.web-modal-close:hover {
  transform: scale(1.1);
  border-color: var(--primary);
}

.welcome-card, .account-card {
  width: min(calc(100% - 24px), 390px);
  border: 1px solid var(--border);
  background: var(--popover);
  padding: 28px 22px 22px;
  border-radius: 22px;
  box-shadow: 0 24px 80px rgb(3 25 44 / 34%);
}
.welcome-orb {
  width: 60px;
  height: 60px;
  margin: 0 auto 4px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #593204;
  background: radial-gradient(circle at 36% 28%, #fff1a7, #ffb21f 55%, #db7604);
  box-shadow: 0 9px 26px rgb(233 138 10 / 38%);
}
.zalo-button {
  width: 100%;
  height: 52px;
  margin-top: 12px;
  border-radius: 15px;
  color: #fff !important;
  background: #0878f5;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 9px 22px rgb(8 120 245 / 24%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background .16s ease;
}
.zalo-button:hover { background: #006ce3; }
.zalo-button img { border-radius: 7px; }

.auth-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.auth-tab-btn {
  flex: 1;
  padding: 10px;
  font-weight: 700;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--secondary);
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.15s;
}
.auth-tab-btn.active {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(240, 155, 19, 0.25);
}

.account-form { display: grid; gap: 15px; margin-top: 14px; }
.account-form label { display: grid; gap: 7px; font-size: 14px; font-weight: 700; color: var(--foreground); }
.account-form input {
  height: 46px;
  background: var(--secondary);
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 14px;
  color: var(--foreground);
}
.account-form input:focus {
  outline: 2px solid var(--primary);
  border-color: var(--primary);
}
.submit-button {
  height: 48px;
  margin-top: 6px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 800;
  background: var(--primary);
  color: var(--primary-foreground);
  border: 0;
  cursor: pointer;
  transition: filter .16s ease;
}
.submit-button:hover { filter: brightness(1.06); }
.submit-button:disabled { cursor: wait; opacity: .7; }
.form-message { margin: 6px 0 0; font-size: 14px; font-weight: 700; line-height: 1.4; text-align: center; }
.form-message.success { color: #169447; }
.form-message.error { color: var(--destructive); }

.web-admin-pill {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: #1a0f00 !important;
  font-weight: 800 !important;
  border-radius: 12px !important;
  border: 1px solid #fbbf24 !important;
  padding: 0 14px !important;
  height: 42px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35) !important;
  font-size: 14px;
}

/* Desktop Layout (> 760px) */
@media(min-width: 760px) {
  .site-shell {
    padding: 34px 24px;
    display: grid;
    place-items: center;
  }
  .phone-site {
    width: min(100%, 1200px);
    max-width: 1200px;
    min-height: auto;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    grid-template-areas: "header" "intro" "footer";
    border-radius: 32px;
  }
  .topbar {
    grid-area: header;
    min-height: 116px;
    padding: 18px 32px 10px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
  }
  .topbar img.web-logo {
    flex: 0 0 330px;
    width: 330px;
    max-width: 330px;
    height: auto;
    object-fit: contain;
  }
  .desktop-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .desktop-nav a, .desktop-nav button {
    height: 42px;
    padding: 0 14px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--foreground);
    font-family: inherit;
    font-size: 15px;
    font-weight: 650;
    letter-spacing: .01em;
    text-decoration: none;
    display: flex;
    align-items: center;
    cursor: pointer;
    white-space: nowrap;
    transition: background .16s ease, color .16s ease;
  }
  .desktop-nav a:hover, .desktop-nav button:hover, .desktop-nav .active {
    background: var(--secondary);
    color: var(--primary);
  }
  .desktop-nav .download-nav {
    background: linear-gradient(145deg, #f7bd35, #e9820c);
    color: #251505 !important;
    box-shadow: 0 5px 14px rgb(224 124 4 / 20%);
  }
  .desktop-nav .download-nav:hover {
    background: linear-gradient(145deg, #ffc94f, #f19313);
    color: #251505 !important;
  }
  .theme-toggle { margin-left: 6px; flex: 0 0 42px; }
  .mobile-menu-toggle, .mobile-dropdown { display: none !important; }
  .intro-section { grid-area: intro; padding: 18px 28px 34px; }
  .section-heading h2 { font-size: 34px; }
  .intro-copy { padding: 24px; }
  .intro-copy p { font-size: 17px; }
  .game-gallery { grid-template-columns: 1fr 1fr; gap: 16px; }
  .download-page { grid-area: intro; padding: 46px 42px 60px; }
  .download-page .section-heading { text-align: center; }
  .download-lead { text-align: center; }
  .platform-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; max-width: 920px; margin: 30px auto 0; }
  .platform-card { min-height: 220px; padding: 28px 18px; flex-direction: column; justify-content: center; text-align: center; }
  .platform-icon { width: 82px; height: 82px; flex-basis: 82px; border-radius: 24px; }
  .platform-icon svg { width: 47px; height: 47px; }
  .platform-card strong { font-size: 20px; }
  .platform-card small { font-size: 14px; }
  .forum-page { grid-area: intro; padding: 42px 42px 70px; }
  .forum-card { padding: 18px; }
  .forum-avatar { width: 82px; height: 82px; flex-basis: 82px; }
  .forum-card-copy span { font-size: 19px; }
  footer { grid-area: footer; padding: 18px 32px 24px; }
}

@media(max-width: 520px) {
  .site-shell { padding: 0; }
  .phone-site { min-height: 100svh; border: 0; border-radius: 0; box-shadow: none; }
  .topbar { padding: 12px 14px 8px; }
}

/* Dragon Ball Guide Board & Cards (NROZ) */
.guide-board {
  margin-top: 18px;
  background: linear-gradient(180deg, #341e10, #221208);
  border: 3px solid #8e4e1d;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45), inset 0 0 20px rgba(0, 0, 0, 0.6);
}
.guide-board-header {
  background: linear-gradient(180deg, #dd8629 0%, #873700 100%);
  border: 2px solid #ffd46f;
  border-radius: 8px;
  color: #fff8d6;
  text-align: center;
  font-weight: 900;
  font-size: 19px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 8px 16px;
  margin-bottom: 16px;
  text-shadow: 1px 2px 4px #000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.guide-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  justify-content: center;
}
.guide-filter-btn {
  background: rgba(30, 16, 8, 0.85);
  border: 1px solid #d4821a;
  border-radius: 8px;
  color: #ffdba4;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
  transition: all .15s ease;
}
.guide-filter-btn:hover, .guide-filter-btn.active {
  background: linear-gradient(180deg, #e8932c, #9c4302);
  color: #fff;
  border-color: #ffd679;
  box-shadow: 0 3px 8px rgba(232, 147, 44, 0.35);
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.guide-card-box {
  background: rgba(18, 9, 3, 0.92);
  border: 2px solid #d4821a;
  border-radius: 9px;
  padding: 14px;
  box-shadow: inset 0 0 10px rgba(212, 130, 26, 0.22);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.guide-card-box:hover {
  transform: translateY(-2px);
  border-color: #ffbc42;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5), inset 0 0 12px rgba(255, 188, 66, 0.35);
}
.guide-card-title {
  color: #ffb834;
  font-size: 16px;
  font-weight: 800;
  border-bottom: 1px dashed rgba(212, 130, 26, 0.65);
  padding-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .03em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.guide-card-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  background: #5e2a04;
  color: #ffd885;
  border: 1px solid #c97914;
}
.guide-card-body {
  color: #ffeed1;
  font-size: 13.5px;
  line-height: 1.6;
}
.guide-card-body strong { color: #ffc55a; }
.guide-card-body ul { margin: 4px 0; padding-left: 18px; }
.guide-card-body li { margin-bottom: 3px; }
.guide-footer-note {
  text-align: center;
  color: #d89f66;
  font-size: 12.5px;
  margin-top: 16px;
  border-top: 1px dashed #743e16;
  padding-top: 10px;
  font-style: italic;
}
@media(max-width: 470px) {
  .guide-grid { grid-template-columns: 1fr; }
}
