/* Aurev Studio · trang tĩnh phong cách pixel (khung gỗ / giấy lấy từ bộ khung màn chờ của Ngõ 1930s, hình PixelLab).
   Hình pixel chỉ phóng nguyên lần (1x, 2x, 3x) với image-rendering: pixelated. */
@font-face { font-family: "VT323"; src: url("/assets/fonts/vt323.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Ark Pixel"; src: url("/assets/fonts/ark-pixel-12.woff2") format("woff2"); font-display: swap; }

:root {
  --bg: #d9c7a1;
  --bg-deep: #c4ad83;
  --ink: #2a1a14;
  --ink-soft: #5a4334;
  --paper: #e6d8b9;
  --seal: #9e2f22;
  --seal-ink: #fff4dc;
  --wood: #4a2f22;
  --wood-ink: #f3e3c0;
  --link: #8a2a1c;
  --focus: #e0901c;
  --head: #3b2519;
  --head-ink: #f3e3c0;
  --head-line: #1a0f0a;
  --shadow: rgba(40, 20, 10, .35);
  --page-ink: #2a1a14;
  --page-soft: #5a4334;
  --gutter: 16px;
  --wrap: 1180px;
  --board: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1d1826;
    --bg-deep: #141019;
    --head: #120e18;
    --head-ink: #f0dcb4;
    --head-line: #000;
    --shadow: rgba(0, 0, 0, .6);
    --page-ink: #eadcbc;
    --page-soft: #bfae8c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1d1826;
  --bg-deep: #141019;
  --head: #120e18;
  --head-ink: #f0dcb4;
  --head-line: #000;
  --shadow: rgba(0, 0, 0, .6);
  --page-ink: #eadcbc;
  --page-soft: #bfae8c;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--page-ink);
  font-family: "Ark Pixel", ui-monospace, Menlo, monospace;
  font-size: 18px;
  line-height: 1.6;
  overflow-x: hidden;
}
img, video { max-width: 100%; display: block; }
.px { image-rendering: pixelated; image-rendering: crisp-edges; }
@supports (image-rendering: pixelated) { .px { image-rendering: pixelated; } }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--wood); color: var(--wood-ink); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }

h1, h2, h3, .title { font-family: "VT323", ui-monospace, monospace; font-weight: normal; line-height: 1.05; letter-spacing: .5px; }
h1 { font-size: 60px; margin: 0 0 12px; }
h2 { font-size: 42px; margin: 32px 0 12px; }
h3 { font-size: 32px; margin: 22px 0 6px; }
p { margin: 0 0 14px; }
strong { font-weight: normal; background: rgba(158, 47, 34, .14); box-shadow: 0 2px 0 rgba(158, 47, 34, .45); padding: 0 3px; }

/* ---------- Thanh điều hướng (dính đầu trang) ---------- */
.top { position: sticky; top: 0; z-index: 30; background: var(--head); color: var(--head-ink); border-bottom: 4px solid var(--head-line); }
.top-in {
  position: relative; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter);
  min-height: 72px; display: flex; align-items: center; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.brand img { width: 48px; height: 48px; }
.brand span { font-family: "VT323", monospace; font-size: 32px; letter-spacing: 3px; white-space: nowrap; line-height: 1; }
.nav { flex: 1; display: flex; justify-content: center; gap: 4px; font-family: "VT323", monospace; font-size: 26px; }
.nav a, .menu-list a {
  position: relative; display: flex; align-items: center; min-height: 48px; padding: 0 14px;
  text-decoration: none; white-space: nowrap; line-height: 1;
}
.nav a::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 8px; height: 3px; background: currentColor; transform: scaleX(0); transition: transform .15s steps(4); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: #ffd98a; }
.tools { display: flex; align-items: center; gap: 8px; flex: none; margin-left: auto; font-family: "VT323", monospace; font-size: 24px; }

/* Ô thả xuống (ngôn ngữ, menu điện thoại): <details> chạy không cần JS */
.dd { position: relative; }
.dd > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  min-height: 44px; min-width: 44px; padding: 0 12px; border: 2px solid rgba(243, 227, 192, .45); line-height: 1;
  user-select: none;
}
.dd > summary::-webkit-details-marker { display: none; }
.dd > summary:hover, .dd[open] > summary { border-color: currentColor; background: rgba(255, 255, 255, .06); }
.caret { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid currentColor; transition: transform .15s; }
.dd[open] .caret { transform: rotate(180deg); }
.lang-code { display: none; }
.dd-list {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; margin: 0; padding: 6px; list-style: none;
  background: var(--head); border: 3px solid var(--head-line); box-shadow: 4px 4px 0 var(--head-line);
}
.dd-list a { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 12px; text-decoration: none; }
.dd-list a:hover { background: rgba(255, 255, 255, .08); }
.dd-list a[aria-current="true"] { color: #ffd98a; }
.dd-list a[aria-current="true"]::after { content: ""; width: 8px; height: 8px; background: currentColor; }

.theme {
  display: none; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; cursor: pointer;
  background: none; border: 2px solid rgba(243, 227, 192, .45); color: inherit;
}
.js .theme { display: inline-flex; }
.theme:hover { border-color: currentColor; background: rgba(255, 255, 255, .06); }
.theme i { width: 18px; height: 18px; border: 3px solid currentColor; background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.menu { display: none; }
.bars, .bars::before, .bars::after { display: block; width: 22px; height: 3px; background: currentColor; }
.bars { position: relative; }
.bars::before, .bars::after { content: ""; position: absolute; left: 0; }
.bars::before { top: -7px; }
.bars::after { top: 7px; }
.menu[open] .bars { background: transparent; }
.menu[open] .bars::before { top: 0; transform: rotate(45deg); }
.menu[open] .bars::after { top: 0; transform: rotate(-45deg); }
.menu-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); display: grid; padding: 8px var(--gutter) 16px;
  background: var(--head); border-bottom: 4px solid var(--head-line); font-size: 28px;
}
.menu-list a { min-height: 52px; padding: 0 4px; border-bottom: 2px solid rgba(243, 227, 192, .15); }
.menu-list a[aria-current="page"] { color: #ffd98a; }

/* Khổ vừa: thanh điều hướng xuống hàng thứ hai, giãn đều */
@media (max-width: 1199px) {
  .top-in { flex-wrap: wrap; row-gap: 0; }
  .nav { order: 3; flex-basis: 100%; justify-content: space-between; border-top: 2px solid rgba(243, 227, 192, .12); margin: 0 -14px; }
}
/* Khổ hẹp: menu gọn */
@media (max-width: 819px) {
  .top-in { min-height: 60px; gap: 8px; flex-wrap: nowrap; }
  .brand { gap: 8px; }
  .brand img { width: 36px; height: 36px; }
  .brand span { font-size: 24px; letter-spacing: 2px; }
  .nav { display: none; }
  .menu { display: block; position: static; }
  .lang-full { display: none; }
  .lang-code { display: inline; }
  .dd > summary { padding: 0 10px; }
  html { scroll-padding-top: 72px; }
}
@media (max-width: 359px) { .brand span { display: none; } }

/* ---------- Tranh đầu trang (phóng nguyên lần) ---------- */
.hero { position: relative; background: #0d0a14; border-bottom: 4px solid #000; }
.hero-art { position: relative; height: 340px; overflow: hidden; }
.hero-art picture { display: contents; }
.hero-art img {
  position: absolute; left: 50%; top: 50%; width: 768px; height: 340px; max-width: none;
  transform: translate(-50%, -50%) scale(var(--s, 1));
}
@media (min-width: 768px) { .hero-art { height: 560px; } .hero-art picture { display: contents; }
.hero-art img { --s: 2; } }
@media (min-width: 1536px) { .hero-art { height: 680px; } .hero-art picture { display: contents; }
.hero-art img { --s: 3; } }
@media (max-width: 767px) { .hero-art { height: 320px; } }
.hero-in { position: absolute; inset: auto 0 0 0; padding: 48px var(--gutter) 24px; background: linear-gradient(rgba(8, 6, 14, 0), rgba(8, 6, 14, .9) 55%); color: #f6e7c6; }
.hero-box { max-width: var(--wrap); margin: 0 auto; display: flex; align-items: flex-end; gap: 20px; }
.hero-logo { width: 96px; height: 96px; flex: none; image-rendering: pixelated; }
.hero h1 { font-size: 76px; margin: 0; text-shadow: 4px 4px 0 #000; }
.hero-box p { margin: 6px 0 0; font-size: 20px; text-shadow: 2px 2px 0 #000; }
.hero .seal { margin: 0 0 8px; }

main { max-width: var(--wrap); margin: 0 auto; padding: 24px var(--gutter) 8px; }

/* ---------- Tờ giấy trong khung gỗ ---------- */
.paper {
  background: var(--paper);
  color: var(--ink);
  border: calc(var(--board) * 2) solid transparent;
  border-image: url("/assets/img/frame-board.png") 18 / calc(var(--board) * 2) / 0 round;
  image-rendering: pixelated;
  padding: 8px 16px;
  margin: 20px 0;
  box-shadow: 0 8px 0 -2px var(--shadow);
}
.paper > :first-child { margin-top: 0; }
.paper > :last-child { margin-bottom: 0; }
.paper a { color: var(--link); }
.muted { color: var(--page-soft); }
.paper .muted { color: var(--ink-soft); }
.page-title { color: var(--page-ink); margin: 36px 0 4px; }
main > .page-title:first-child { margin-top: 12px; }

/* Dấu son "Sắp ra mắt" */
.seal {
  display: inline-block; padding: 4px 12px 2px; background: var(--seal); color: var(--seal-ink);
  font-family: "VT323", monospace; font-size: 24px; line-height: 1; letter-spacing: 2px; text-transform: uppercase;
  box-shadow: 3px 3px 0 #000; border: 2px solid #5e160e;
}

/* ---------- Nút gỗ (btn-plank 92 x 24, phóng 3x) ---------- */
.plank {
  display: inline-flex; align-items: flex-start; justify-content: center;
  width: 276px; height: 72px; padding: 12px 24px 0;
  background: url("/assets/img/btn-plank.png") 0 0 / 100% 100% no-repeat;
  image-rendering: pixelated;
  color: var(--wood-ink); text-decoration: none; text-align: center;
  font-family: "VT323", monospace; font-size: 30px; line-height: 1; text-shadow: 2px 2px 0 #1a0d0a;
  transition: transform .08s steps(2), filter .1s;
}
.paper .plank, .plank:visited { color: var(--wood-ink); }
.plank:hover { filter: brightness(1.12); transform: translateY(-2px); }
.plank:active { transform: translateY(1px); }

/* ---------- Trang chủ studio ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.about-art { height: 340px; overflow: hidden; border: 4px solid var(--wood); background: #241a14; position: relative; }
.about-art picture, .card-art picture { display: contents; }
.about-art img { position: absolute; left: 50%; top: 50%; width: 768px; height: 340px; max-width: none; transform: translate(-50%, -50%); }
.facts { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.facts li { padding: 6px 12px 4px; border: 2px solid var(--wood); font-size: 16px; line-height: 1.2; }
.facts li:first-child { background: var(--wood); color: var(--wood-ink); }

.games-row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.games-row > * { margin: 8px 0 0; }
.ngo-card { padding: 0; display: grid; grid-template-rows: auto 1fr; }
.card-art { display: block; height: 300px; overflow: hidden; position: relative; background: #0d0a14; border-bottom: 4px solid var(--wood); }
.card-art img { position: absolute; left: 50%; top: 50%; width: 768px; height: 340px; max-width: none; transform: translate(-50%, -50%); transition: transform .3s steps(6); }
.card-art:hover img { transform: translate(-50%, -52%); }
.card-body { padding: 20px 16px 8px; }
.card-body h3 { font-size: 52px; margin: 12px 0 8px; }
.card-body h3 a { text-decoration: none; color: var(--ink); }
.card-body h3 a:hover { text-decoration: underline; text-decoration-thickness: 3px; }
.mini-games { list-style: none; padding: 0; margin: 16px 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.mini-games li { display: grid; justify-items: center; gap: 4px; text-align: center; font-size: 14px; line-height: 1.2; color: var(--ink-soft); }
.mini-games img { width: 64px; height: 64px; }
.cta { margin: 18px 0 8px; }
.next-card {
  display: grid; align-content: center; justify-items: center; text-align: center; gap: 4px; padding: 32px 24px;
  border: 4px dashed color-mix(in srgb, var(--page-ink) 40%, transparent); color: var(--page-soft);
}
.next-card img { width: 96px; height: 96px; filter: grayscale(1) opacity(.5); image-rendering: pixelated; }
.next-card h3 { margin: 12px 0 0; color: var(--page-ink); }
.next-card p { margin: 0; }
.contact { text-align: center; }
.contact h2 { margin-top: 0; }
.mail { font-family: "VT323", monospace; font-size: 40px; line-height: 1.1; word-break: break-word; margin: 8px 0 14px; }

/* ---------- Trang game ---------- */
.badges { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; margin: 16px 0 0; font-size: 16px; }
.badges li { padding: 6px 12px 4px; border: 2px solid var(--wood); line-height: 1.2; }
.soon-band {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px;
  margin: 28px 0; padding: 24px 28px; background: var(--wood); color: var(--wood-ink);
  border: 4px solid #000; box-shadow: 0 8px 0 -2px var(--shadow);
}
.soon-band h2 { margin: 0 0 12px; font-size: 40px; }
.platforms { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; font-family: "VT323", monospace; font-size: 24px; }
.platforms li { padding: 4px 12px 2px; border: 2px solid rgba(243, 227, 192, .5); line-height: 1.1; }
.notify { display: grid; justify-items: center; gap: 8px; }
.notify p { margin: 0; font-size: 14px; opacity: .85; max-width: 280px; text-align: center; }
.games { display: grid; grid-template-columns: 1fr; gap: 4px; }
.game { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 28px; align-items: center; }
.game .head { display: flex; gap: 16px; align-items: center; }
.game .head img { width: 128px; height: 128px; flex: none; }
.game h3 { margin: 0; font-size: 40px; }
.game .vn { font-family: "VT323", monospace; font-size: 24px; color: var(--ink-soft); margin: 2px 0 0; }
.game .head + p { margin: 14px 0 0; }
figure { margin: 0; }
figure .media { width: 100%; height: auto; aspect-ratio: 1280 / 668; object-fit: cover; background: #000; border: 4px solid var(--wood); }
figcaption { font-size: 14px; color: var(--ink-soft); margin-top: 6px; }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.by { text-align: center; color: var(--page-soft); margin: 28px 0 8px; }
.by a { color: var(--page-ink); }

/* ---------- Văn bản dài ---------- */
.doc { max-width: 880px; margin: 0 auto; }
.doc h2 { font-size: 36px; }
.doc ul, .doc ol { padding-left: 24px; }
.doc li { margin: 4px 0; }
.note { border-left: 6px solid var(--seal); padding: 8px 14px; background: rgba(158, 47, 34, .08); }
.note.pending { background: var(--paper); color: var(--ink); }
.other a { color: var(--page-ink); }
.steps { counter-reset: s; list-style: none; padding-left: 0 !important; }
.steps li { counter-increment: s; position: relative; padding-left: 48px; margin: 12px 0; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 34px; height: 34px; background: var(--seal); color: var(--seal-ink); font-family: "VT323", monospace; font-size: 28px; text-align: center; line-height: 34px; }
dl.faq dt { font-family: "VT323", monospace; font-size: 30px; margin-top: 22px; line-height: 1.1; }
dl.faq dt:first-child { margin-top: 0; }
dl.faq dd { margin: 6px 0 0; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 16px; }
th, td { text-align: left; vertical-align: top; padding: 8px; border-bottom: 2px solid rgba(74, 47, 34, .3); }

/* 404 */
.nf .paper { text-align: center; padding-top: 24px; padding-bottom: 24px; }
.nf-art { width: 192px; height: 192px; margin: 0 auto 8px; }
.nf-code { font-family: "VT323", monospace; font-size: 96px; line-height: .9; color: var(--seal); margin: 0; }
.nf h1 { font-size: 48px; }
.nf-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 20px; }

/* ---------- Chân trang ---------- */
.foot { background: var(--head); color: var(--head-ink); border-top: 4px solid var(--head-line); margin-top: 48px; }
.foot-in {
  max-width: var(--wrap); margin: 0 auto; padding: 32px var(--gutter) 28px;
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px 48px; font-size: 15px;
}
.foot-brand { display: flex; gap: 14px; align-items: flex-start; }
.foot-brand img { width: 48px; height: 48px; flex: none; }
.foot-name { display: block; }
.foot-brand .foot-name { font-family: "VT323", monospace; font-weight: normal; font-size: 28px; letter-spacing: 3px; line-height: 1; }
.foot-brand p { margin: 6px 0 0; }
.foot-nav { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 0 32px; align-content: start; }
.foot-nav a { display: flex; align-items: center; min-height: 36px; text-decoration: none; }
.foot-nav a:hover { text-decoration: underline; }
.foot-legal { grid-column: 1 / -1; border-top: 2px solid rgba(243, 227, 192, .15); padding-top: 16px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; font-size: 13px; opacity: .85; }
.foot-legal p { margin: 0; }

/* ---------- Khổ vừa / hẹp ---------- */
@media (max-width: 1023px) {
  .about { grid-template-columns: minmax(0, 1fr); }
  .games-row { grid-template-columns: minmax(0, 1fr); }
  .next-card { padding: 24px; }
}
@media (max-width: 819px) {
  :root { --board: 9px; }
  body { font-size: 16px; }
  h1 { font-size: 46px; }
  h2 { font-size: 34px; }
  h3 { font-size: 28px; }
  main { padding-top: 16px; }
  .paper { padding: 6px 6px; margin: 16px 0; }
  .hero-in { padding: 40px var(--gutter) 16px; }
  .hero-box { gap: 12px; }
  .hero-logo { display: none; }
  .hero h1 { font-size: 52px; }
  .hero-box p { font-size: 15px; }
  .seal { font-size: 20px; }
  .badges, .facts { gap: 6px; }
  .badges li, .facts li { font-size: 13px; padding: 5px 8px 3px; }
  .about-art { height: 220px; }
  .card-art { height: 200px; }
  .card-body { padding: 14px 8px 4px; }
  .card-body h3 { font-size: 44px; }
  .mini-games { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .mini-games img { width: 48px; height: 48px; image-rendering: auto; }
  .mini-games li { font-size: 11px; }
  .mail { font-size: 30px; }
  .soon-band { padding: 18px 16px; }
  .soon-band h2 { font-size: 32px; }
  .soon-band > div:first-child { flex-basis: 100%; }
  .notify { width: 100%; }
  .game { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .game .head img { width: 64px; height: 64px; }
  .game h3 { font-size: 34px; }
  .gallery { grid-template-columns: minmax(0, 1fr); }
  .foot-in { grid-template-columns: minmax(0, 1fr); padding-top: 24px; }
  .foot-legal { flex-direction: column; }
  .nf-art { width: 96px; height: 96px; }
  .nf-code { font-size: 72px; }
  .nf h1 { font-size: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
