:root {
  --gold: #D4AF37;
  --gold-light: #F6E3A6;
  --gold-dark: #9C7A24;
  --bg-0: #060403;
  --bg-1: #0A0805;
  --bg-2: #0C0905;
  --ink: #F3E7CC;
  --ink-muted: #C9B38A;
  --ink-dim: #7A6A48;
  --border-gold: rgba(212, 175, 55, 0.3);
  --red-accent: #7A1F1F;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--ink);
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold-light); text-decoration: none; }
a:hover { color: #FFE9AF; }

img { max-width: 100%; display: block; }

.display-font { font-family: 'Playfair Display', serif; }

button { font-family: inherit; cursor: pointer; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Launcher ---------- */

.launcher {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: radial-gradient(120% 90% at 50% 30%, #241a0c 0%, #0c0905 55%, #060403 100%);
}

.launcher__video,
.launcher__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.launcher__overlay {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 220px 60px rgba(0, 0, 0, 0.85);
  background:
    radial-gradient(60% 50% at 20% 15%, rgba(212, 175, 55, 0.14), transparent 60%),
    radial-gradient(50% 45% at 85% 80%, rgba(122, 31, 31, 0.22), transparent 60%);
}

.launcher__frame {
  position: absolute;
  inset: 22px;
  border: 1px solid var(--border-gold);
  overflow: hidden;
  pointer-events: none;
}
.launcher__frame::before {
  content: "";
  position: absolute;
  top: -60%;
  left: -25%;
  width: 16%;
  height: 220%;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 241, 189, 0) 35%,
    rgba(255, 241, 189, 0.5) 50%,
    rgba(255, 241, 189, 0) 65%,
    transparent 100%
  );
  transform: rotate(8deg);
  animation: frame-shimmer 5s ease-in-out infinite;
}

@keyframes frame-shimmer {
  0%   { left: -25%; }
  22%  { left: 115%; }
  100% { left: 115%; }
}

.launcher__corner {
  position: absolute;
  width: 34px;
  height: 34px;
  border-color: var(--gold);
  border-style: solid;
  border-width: 0;
}
.launcher__corner--tl { left: 22px; top: 22px; border-left-width: 2px; border-top-width: 2px; }
.launcher__corner--tr { right: 22px; top: 22px; border-right-width: 2px; border-top-width: 2px; }
.launcher__corner--bl { left: 22px; bottom: 22px; border-left-width: 2px; border-bottom-width: 2px; }
.launcher__corner--br { right: 22px; bottom: 22px; border-right-width: 2px; border-bottom-width: 2px; }

.launcher__topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 40px 0;
}

.launcher__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 2px;
}

.launcher__topnav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 13px;
  color: var(--ink-muted);
}

.launcher__main {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.launcher__eyebrow {
  font-size: 13px;
  letter-spacing: 6px;
  color: var(--gold);
  text-transform: uppercase;
}

.launcher__title {
  margin: 14px 0 0;
  font-weight: 800;
  font-size: clamp(38px, 7vw, 72px);
  line-height: 1.05;
  background-image: linear-gradient(
    100deg,
    #9C7A24 0%,
    #D4AF37 20%,
    #F6E3A6 38%,
    #FFFBEF 50%,
    #F6E3A6 62%,
    #D4AF37 80%,
    #9C7A24 100%
  );
  background-size: 300% 100%;
  background-position: 200% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: title-shimmer 5s ease-in-out infinite;
}

@keyframes title-shimmer {
  0%   { background-position: 220% 0; }
  22%  { background-position: -120% 0; }
  100% { background-position: -120% 0; }
}

.launcher__tagline {
  margin: 20px 0 0;
  font-size: 16px;
  color: #D8C9A3;
  max-width: 480px;
}

.btn-play {
  position: relative;
  margin-top: 44px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 18px 56px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #F6E3A6 0%, var(--gold) 50%, #9C7A24 100%);
  box-shadow: 0 10px 40px rgba(212, 175, 55, 0.35), 0 0 0 0 rgba(246, 227, 166, 0), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  color: #241A0C;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 3px;
  transition: filter 0.2s, box-shadow 0.25s, transform 0.15s;
}
.btn-play:hover,
.btn-play:focus-visible {
  filter: brightness(1.1);
  color: #241A0C;
  transform: translateY(-2px);
  box-shadow: 0 14px 44px rgba(212, 175, 55, 0.5), 0 0 0 4px rgba(246, 227, 166, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.btn-play:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 6px 22px rgba(212, 175, 55, 0.55), 0 0 0 6px rgba(246, 227, 166, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.btn-play svg { flex-shrink: 0; }

.launcher__stats {
  margin-top: 20px;
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 1px;
}

.launcher__bottombar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 40px;
  border-top: 1px solid rgba(212, 175, 55, 0.18);
  font-size: 12px;
  color: var(--ink-dim);
}

.social-row { display: flex; gap: 14px; }
.social-dot {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--ink-muted);
}

/* ---------- Trang chủ ---------- */

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 76px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.18);
  background: linear-gradient(180deg, rgba(20, 15, 7, 0.95), rgba(10, 8, 5, 0.95));
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
  gap: 12px;
}

.site-nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 1.5px;
  color: var(--ink);
}

.site-nav__links {
  display: flex;
  gap: 32px;
  font-size: 14px;
  color: var(--ink-muted);
  flex-wrap: wrap;
}
.site-nav__links a.active {
  color: var(--ink);
  border-bottom: 1px solid var(--gold);
  padding-bottom: 4px;
}

.site-nav__account {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 999px;
  font-size: 12px;
  color: var(--gold-light);
}
.site-nav__avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(180deg, #F6E3A6, #9C7A24);
}

.page-heading {
  text-align: center;
  padding: 44px 20px 10px;
}
.page-heading h1 {
  margin: 0;
  font-weight: 700;
  font-size: clamp(22px, 4vw, 30px);
  letter-spacing: 1px;
  color: var(--gold-light);
}
.page-heading__rule {
  width: 64px; height: 2px; background: var(--gold);
  margin: 12px auto;
}
.page-heading p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-dim);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 460px));
  justify-content: center;
  gap: 32px;
  padding: 40px 56px 90px;
  max-width: 1760px;
  margin: 0 auto;
}

@media (max-width: 1100px) {
  .game-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; padding: 32px 32px 70px; }
}
@media (max-width: 680px) {
  .game-grid { grid-template-columns: 1fr; gap: 20px; padding: 24px 20px 60px; }
  .site-nav__links { display: none; }
}

.game-card {
  position: relative;
  display: block;
  height: 460px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-gold);
  background-color: #141009;
  transition: border-color 0.2s, transform 0.2s;
}
.game-card:hover,
.game-card:focus-visible { border-color: var(--gold-light); transform: translateY(-3px); }

@media (max-width: 1100px) {
  .game-card { height: 320px; }
}
@media (max-width: 680px) {
  .game-card { height: 280px; border-radius: 10px; }
}

/* ánh sáng kim lướt qua từng ô — mỗi ô lệch giờ riêng qua biến --shimmer-delay/--shimmer-duration */
.game-card::before {
  content: "";
  position: absolute;
  top: -60%;
  left: -30%;
  width: 20%;
  height: 220%;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 241, 189, 0) 35%,
    rgba(255, 241, 189, 0.6) 50%,
    rgba(255, 241, 189, 0) 65%,
    transparent 100%
  );
  transform: rotate(8deg);
  animation: card-shimmer var(--shimmer-duration, 4s) ease-in-out infinite;
  animation-delay: var(--shimmer-delay, 0s);
  pointer-events: none;
  z-index: 1;
}

@keyframes card-shimmer {
  0%   { left: -30%; }
  20%  { left: 120%; }
  100% { left: 120%; }
}

.game-card__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.85; z-index: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.game-card:hover .game-card__img { transform: scale(1.04); opacity: 1; }

.game-card__ring {
  position: absolute;
  inset: 0;
  border: 2px solid var(--gold-light);
  border-radius: 14px;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
  z-index: 2;
}
.game-card:hover .game-card__ring { opacity: 1; }

.game-card__body {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 24px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.92) 55%);
  z-index: 3;
}

.game-card__name {
  display: block;
  font-weight: 800;
  font-size: 30px;
  line-height: 1.2;
  color: var(--gold-light);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

.game-card__play {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  width: fit-content;
  padding: 13px 26px;
  border-radius: 999px;
  background: var(--gold);
  color: #241A0C;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1.5px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  transition: filter 0.15s, transform 0.15s;
}
.game-card:hover .game-card__play,
.game-card:focus-visible .game-card__play {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

@media (max-width: 680px) {
  .game-card__body { padding: 18px; }
  .game-card__name { font-size: 22px; }
  .game-card__play {
    margin-top: 12px;
    font-size: 14px;
    padding: 11px 20px;
  }
}

.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--ink-muted);
}
.empty-state h2 { margin: 0 0 10px; font-size: 22px; color: var(--gold-light); }
.empty-state p { margin: 0; font-size: 14px; }

.site-footer {
  text-align: center;
  padding: 18px;
  font-size: 11px;
  color: var(--ink-dim);
  border-top: 1px solid rgba(212, 175, 55, 0.12);
}

/* ---------- Trang "sắp ra mắt" khi chưa gắn link game ---------- */

.coming-soon {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
  gap: 16px;
}
.coming-soon h1 { font-size: 26px; color: var(--gold-light); margin: 0; }
.coming-soon p { color: var(--ink-muted); margin: 0; max-width: 420px; }

/* ---------- Admin ---------- */

.admin-body { background: var(--bg-1); min-height: 100vh; }

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 68px;
  border-bottom: 1px solid var(--border-gold);
  background: var(--bg-2);
}
.admin-topbar__brand { font-weight: 700; letter-spacing: 1px; color: var(--gold-light); }
.admin-topbar__user { font-size: 13px; color: var(--ink-muted); display: flex; align-items: center; gap: 16px; }

.admin-shell { max-width: 1200px; margin: 0 auto; padding: 36px 24px 80px; }

.admin-heading { margin-bottom: 24px; }
.admin-heading h1 { margin: 0 0 6px; font-size: 24px; color: var(--gold-light); }
.admin-heading p { margin: 0; color: var(--ink-dim); font-size: 13px; }

.flash {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
}
.flash--ok { background: rgba(80, 160, 90, 0.15); border: 1px solid rgba(80, 160, 90, 0.4); color: #9FE0A8; }
.flash--err { background: rgba(160, 60, 60, 0.15); border: 1px solid rgba(160, 60, 60, 0.4); color: #F0A3A3; }

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.admin-card {
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  background: var(--bg-2);
  overflow: hidden;
}

.admin-card__preview {
  height: 140px;
  background-size: cover;
  background-position: center;
  background-color: #141009;
  position: relative;
}
.admin-card__order {
  position: absolute; top: 8px; left: 8px;
  background: rgba(0,0,0,0.6); color: var(--gold-light);
  font-size: 11px; padding: 3px 8px; border-radius: 999px;
}

.admin-card__status {
  position: absolute; top: 8px; right: 8px;
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
}
.admin-card__status--on { background: rgba(80, 160, 90, 0.85); color: #0A0805; }
.admin-card__status--off { background: rgba(0, 0, 0, 0.6); color: var(--ink-dim); }

.admin-card__form { padding: 16px; display: flex; flex-direction: column; gap: 10px; }

.field-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-muted);
}
.field-checkbox input { accent-color: var(--gold); width: 16px; height: 16px; }

.field label {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.field input[type="text"],
.field input[type="url"],
.field input[type="password"],
.field input[type="file"] {
  width: 100%;
  padding: 9px 11px;
  border-radius: 6px;
  border: 1px solid var(--border-gold);
  background: var(--bg-1);
  color: var(--ink);
  font-size: 13px;
}
.field input:focus { outline: none; border-color: var(--gold); }

.btn-admin {
  padding: 9px 16px;
  border-radius: 6px;
  border: 1px solid var(--gold);
  background: var(--gold);
  color: #241A0C;
  font-weight: 700;
  font-size: 13px;
}
.btn-admin:hover { filter: brightness(1.08); }

.btn-admin--ghost {
  background: transparent;
  color: var(--gold-light);
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 90% at 50% 30%, #241a0c 0%, #0c0905 55%, #060403 100%);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 360px;
  border: 1px solid var(--border-gold);
  border-radius: 14px;
  background: rgba(12, 9, 5, 0.9);
  padding: 36px 32px;
  text-align: center;
}
.login-card h1 { font-size: 20px; margin: 0 0 24px; color: var(--gold-light); }
.login-card .field { text-align: left; margin-bottom: 14px; }
.login-card .btn-admin { width: 100%; margin-top: 8px; padding: 11px; }
