/* Huta Game: "cuốn sổ phác thảo". Một theme sáng duy nhất (giấy + chì), mọi màu đặt rõ ràng. */
@font-face { font-family: "Patrick Hand"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/patrickhand-vietnamese.woff2) format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Patrick Hand"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/patrickhand-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Patrick Hand"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/patrickhand-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(../fonts/baloo2-vietnamese.woff2) format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(../fonts/baloo2-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(../fonts/baloo2-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --paper: #f8f4e9;
  --paper-deep: #efe8d6;
  --ink: #2b2b2e;
  --ink-soft: #6d6d74;
  --rule: rgba(47, 120, 200, 0.13);
  --hand: "Patrick Hand", "Comic Sans MS", "Segoe Print", cursive, sans-serif;
  --body: "Baloo 2", "Segoe UI", system-ui, sans-serif;
  --accent: var(--ink);
  --gutter: 16px;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  font-family: var(--body); font-size: 17px; line-height: 1.55; font-weight: 450;
  color: var(--ink);
  background-color: var(--paper);
  /* dòng kẻ vở xanh mờ + vân giấy rất nhẹ */
  background-image:
    repeating-linear-gradient(to bottom, transparent 0 31px, var(--rule) 31px 32px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .47 0 0 0 0 .41 0 0 0 0 .31 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; font-family: var(--hand); font-size: 20px; text-decoration: none; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }
h1, h2, h3 { font-family: var(--hand); font-weight: 400; line-height: 1.05; margin: 0; text-wrap: balance; }

/* ---------- đầu trang ---------- */
.top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  padding-top: max(12px, env(safe-area-inset-top, 0px));
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { font-family: var(--hand); font-size: 26px; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.logo svg { width: 30px; height: 30px; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a { font-family: var(--hand); font-size: 20px; text-decoration: none; padding: 6px 10px; min-height: 44px; display: inline-flex; align-items: center; }
.nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.nav .lang { border: 2px solid var(--ink); border-radius: 12px 8px 14px 9px / 9px 14px 8px 12px; padding: 2px 12px; min-height: 40px; background: var(--paper); }
@media (max-width: 520px) { .nav .hide-sm { display: none; } }

/* ---------- hero chạy theo thanh cuộn ---------- */
.hero { position: relative; height: 400vh; height: 400svh; background: var(--paper); }
.hero__stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.hero__stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero__title {
  position: absolute; left: 0; right: 0; top: 0; z-index: 2;
  padding-top: calc(max(12px, env(safe-area-inset-top, 0px)) + 64px);
  text-align: center; pointer-events: none; will-change: opacity, transform;
}
.hero__title h1 { font-size: clamp(64px, 15vw, 148px); letter-spacing: -0.01em; position: relative; display: inline-block; }
.hero__title h1 svg { position: absolute; left: 4%; right: 4%; bottom: -0.06em; width: 92%; height: 0.22em; overflow: visible; }
.hero__title p { font-family: var(--hand); font-size: clamp(22px, 3.6vw, 32px); line-height: 1.2; margin: 14px auto 0; max-width: 30ch; padding: 0 16px; color: var(--ink); text-wrap: balance; }
.hero__title p span { display: block; color: var(--ink-soft); }
.hero__hint {
  position: absolute; left: 50%; bottom: max(18px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 2;
  font-family: var(--hand); font-size: 19px; color: var(--ink-soft); display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none;
}
.hero__hint svg { width: 22px; height: 30px; }
.hero__cap {
  position: absolute; z-index: 2; left: 0; right: 0; top: calc(max(12px, env(safe-area-inset-top, 0px)) + 70px);
  opacity: 0; visibility: hidden; pointer-events: none; will-change: opacity, transform;
}
.hero__cap .wrap { display: grid; gap: 6px; justify-items: start; }
.hero__cap .num { font-family: var(--hand); font-size: 20px; color: var(--accent); border: 2px solid var(--accent); border-radius: 50% 46% 52% 48% / 48% 52% 46% 50%; width: 42px; height: 42px; display: grid; place-items: center; }
.hero__cap .name { font-family: var(--hand); font-size: clamp(40px, 8vw, 76px); line-height: 1; color: var(--accent); margin: 0; }
.hero__cap .desc { margin: 0; max-width: 34ch; font-size: clamp(16px, 2.1vw, 20px); line-height: 1.4; color: var(--ink); background: rgba(248, 244, 233, 0.82); border-radius: 6px; }
@media (min-width: 900px) { .hero__cap .wrap { padding-left: max(var(--gutter), calc((100vw - 1120px) / 2 + 16px)); } }

/* chế độ tĩnh: bật giảm chuyển động hoặc máy yếu */
.hero-static .hero { height: auto; }
.hero-static .hero__stage { position: relative; }
@media (prefers-reduced-motion: reduce) {
  .hero { height: auto; }
  .hero__stage { position: relative; }
}
html:not(.js) .hero { height: auto; }
html:not(.js) .hero__stage { position: relative; }

/* ---------- khu chung ---------- */
.section { padding: 72px 0; }
.section__head { display: grid; gap: 6px; margin-bottom: 28px; }
.section__head h2 { font-size: clamp(40px, 6vw, 60px); }
.section__head p { margin: 0; color: var(--ink-soft); max-width: 52ch; }
.scribble { display: block; width: 150px; height: 14px; color: var(--ink); }

/* nét vẽ tay: viền lệch góc + bóng chì cứng (không bóng mềm) */
.sketch {
  border: 2.5px solid var(--ink);
  border-radius: 18px 9px 22px 12px / 12px 22px 9px 18px;
  background: var(--paper);
}

/* ---------- thẻ game ---------- */
.games { display: grid; gap: 34px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .games { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .games { grid-template-columns: repeat(3, 1fr); gap: 28px; } }
.card {
  position: relative; padding: 26px 20px 20px; display: grid; gap: 14px; align-content: start;
  box-shadow: 4px 5px 0 var(--accent);
  transform: rotate(var(--tilt, -0.5deg));
}
.card:nth-child(2) { --tilt: 0.6deg; }
.card:nth-child(3) { --tilt: -0.3deg; }
.card::before { /* mẩu băng dính màu nhấn */
  content: ""; position: absolute; top: -12px; left: 50%; width: 96px; height: 24px; transform: translateX(-50%) rotate(-2.5deg);
  background: var(--accent); opacity: 0.28; border-radius: 2px;
}
.card__head { display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: center; }
.card__icon { width: 84px; height: 84px; border: 2.5px solid var(--ink); border-radius: 22px 16px 24px 15px / 16px 24px 15px 22px; overflow: hidden; background: var(--paper-deep); }
.card__icon img { width: 100%; height: 100%; object-fit: cover; }
.card h3 { font-size: 32px; color: var(--accent); }
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.card p { margin: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-family: var(--hand); font-size: 18px; line-height: 1; padding: 5px 10px 4px; border: 2px dashed var(--ink-soft); border-radius: 999px; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.tag svg { width: 12px; height: 18px; }
.tag.landscape svg { width: 18px; height: 12px; }
.actions { display: grid; gap: 10px; margin-top: 4px; }
@media (min-width: 420px) and (max-width: 759px) { .actions { grid-template-columns: 1fr 1fr; } }

.btn {
  font-family: var(--hand); font-size: 23px; line-height: 1; text-decoration: none; text-align: center;
  min-height: 52px; padding: 12px 16px 10px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  color: #fff; background: var(--btn, var(--ink));
  border: 2.5px solid var(--ink); border-radius: 14px 8px 16px 9px / 9px 16px 8px 14px;
  box-shadow: 3px 3px 0 var(--ink); cursor: pointer; transition: transform .08s, box-shadow .08s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn--ghost { color: var(--ink); background: var(--paper); }
.btn--soon { color: var(--ink-soft); background: transparent; border-style: dashed; border-color: var(--ink-soft); box-shadow: none; cursor: not-allowed; }
.btn--soon:hover, .btn--soon:active { transform: none; box-shadow: none; }

/* ---------- về Huta Game ---------- */
.about { display: grid; gap: 28px; align-items: center; }
@media (min-width: 860px) { .about { grid-template-columns: 1.2fr 1fr; } }
.about__text { display: grid; gap: 14px; }
.about__text p { margin: 0; font-size: 19px; max-width: 54ch; }
.about__doodle { padding: 18px; transform: rotate(1deg); }
.about__doodle svg { width: 100%; height: auto; display: block; }

/* ---------- chân trang ---------- */
.foot { padding: 48px 0 calc(40px + env(safe-area-inset-bottom, 0px)); border-top: 2.5px solid var(--ink); position: relative; }
.foot__grid { display: grid; gap: 28px; }
@media (min-width: 760px) { .foot__grid { grid-template-columns: 1.3fr 1fr; } }
.foot h2 { font-size: 30px; margin-bottom: 10px; }
.mailbox { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.mail { font-size: 20px; font-weight: 600; user-select: all; -webkit-user-select: all; padding: 6px 12px; word-break: break-all; }
.copy { font-size: 20px; min-height: 46px; padding: 8px 14px 6px; }
.copy-msg { font-family: var(--hand); font-size: 19px; color: var(--ink); min-height: 24px; margin: 6px 0 0; }
.links { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.links a { display: inline-flex; min-height: 40px; align-items: center; text-underline-offset: 4px; }
.copyright { margin: 34px 0 0; color: var(--ink-soft); font-size: 15px; }
@media (max-width: 520px) { .hero__hint span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }

/* ---------- trang con (game, quyền riêng tư, 404) ---------- */
.page__main { padding-top: calc(max(12px, env(safe-area-inset-top, 0px)) + 76px); }
.back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-family: var(--hand); font-size: 21px; text-decoration: none; }
.back svg { width: 22px; height: 16px; }
.back:hover span { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

.game-hero { display: grid; gap: 28px; align-items: center; padding: 18px 0 8px; }
@media (min-width: 900px) { .game-hero { grid-template-columns: 1fr 1.05fr; gap: 44px; } }
.game-hero__text { display: grid; gap: 14px; justify-items: start; }
.game-hero__icon { width: 96px; height: 96px; }
.game-hero h1 { font-size: clamp(46px, 7vw, 76px); color: var(--accent); }
.lead { margin: 0; font-size: 20px; max-width: 40ch; }
.actions--row { display: flex; flex-wrap: wrap; gap: 12px; width: 100%; }
.actions--row .btn { flex: 1 1 220px; }
@media (min-width: 900px) { .actions--row .btn { flex: 0 1 auto; } }
.feature { margin: 0; padding: 10px; transform: rotate(0.8deg); box-shadow: 4px 5px 0 var(--accent); }
.feature img { width: 100%; border-radius: 10px 6px 12px 7px / 7px 12px 6px 10px; }

.game-body { display: grid; gap: 40px; }
@media (min-width: 860px) { .game-body { grid-template-columns: 1.1fr 1fr; gap: 56px; } }
.game-body h2 { font-size: clamp(36px, 5vw, 48px); }
.game-body__col { display: grid; gap: 14px; align-content: start; }
.game-body__col p { margin: 0; font-size: 18px; max-width: 58ch; }
.game-body__col a { text-underline-offset: 4px; }
.howto { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: step; }
.howto li { position: relative; padding-left: 52px; font-size: 18px; min-height: 38px; counter-increment: step; }
.howto li::before {
  content: counter(step); position: absolute; left: 0; top: -2px; width: 38px; height: 38px; display: grid; place-items: center;
  font-family: var(--hand); font-size: 22px; color: var(--accent); border: 2.5px solid var(--accent);
  border-radius: 50% 46% 52% 48% / 48% 52% 46% 50%;
}
.shot { margin: 0 0 8px; padding: 10px; transform: rotate(-0.5deg); }
.shot img { width: 100%; border-radius: 8px; }
.games--two { grid-template-columns: 1fr; }
@media (min-width: 760px) { .games--two { grid-template-columns: repeat(2, 1fr); } }

/* chính sách quyền riêng tư: chỉ đổi kiểu chữ, giữ nguyên nội dung */
.policy { margin: 18px 0 72px; padding: 28px clamp(18px, 4vw, 48px) 36px; display: grid; gap: 28px; max-width: 860px; }
.policy header { display: grid; gap: 8px; }
.policy h1 { font-size: clamp(34px, 5.5vw, 52px); color: var(--accent); }
.policy h2 { font-size: 27px; margin: 0 0 6px; color: var(--accent); }
.policy p, .policy ul { margin: 0; }
.policy ul { padding-left: 22px; display: grid; gap: 6px; }
.policy section { display: grid; gap: 10px; padding-top: 18px; border-top: 2px dashed rgba(43, 43, 46, 0.25); }
.policy .meta { color: var(--ink-soft); font-size: 15px; }
.policy .lang { display: flex; gap: 10px; flex-wrap: wrap; }
.policy .lang a { font-family: var(--hand); font-size: 20px; text-decoration: none; border: 2px solid var(--ink); border-radius: 12px 8px 14px 9px / 9px 14px 8px 12px; padding: 4px 14px; min-height: 40px; display: inline-flex; align-items: center; }
.policy .mail { font-size: inherit; padding: 0; user-select: all; -webkit-user-select: all; }
.policy .part { display: grid; gap: 24px; }
.policy .part + .part, .policy section#en { margin-top: 12px; padding-top: 28px; border-top: 2.5px solid var(--ink); }
.policy a { text-underline-offset: 3px; }

/* 404 */
.nf { min-height: 70vh; display: grid; align-items: center; }
.nf__box { max-width: 620px; margin: 24px auto 72px; padding: 30px clamp(18px, 4vw, 40px); display: grid; gap: 14px; text-align: center; justify-items: center; transform: rotate(-0.6deg); }
.nf__code { font-family: var(--hand); font-size: clamp(90px, 22vw, 150px); line-height: 0.9; margin: 0; }
.nf h1 { font-size: clamp(36px, 6vw, 52px); }
.nf__box p { margin: 0; max-width: 46ch; }
.nf__en { color: var(--ink-soft); }
.nf .actions--row { justify-content: center; }

/* ---------- con trỏ bút chì (chỉ khi dùng chuột) ---------- */
@media (hover: hover) and (pointer: fine) {
  html { cursor: url(../cursors/pencil.svg?v=f3cea2d7) 2 2, auto; }
  a, button, .btn, label, summary, [role="button"] { cursor: url(../cursors/pencil-tap.svg?v=c67cb32f) 7 7, pointer; }
  .btn--soon { cursor: not-allowed; }
  .mail { cursor: text; }
}
.orig { margin: -6px 0 0; font-size: 15px; color: var(--ink-soft); }
