/* COREW — corew.app
   Màu: đêm phố, tàu đỏ, vàng sao, ghế nhựa xanh, tường vôi xanh bạc hà.
   Chữ: Kanit (SIL OFL 1.1, xem assets/fonts/OFL.txt), tự host. */

@font-face { font-family: "Kanit"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/kanit-regular.woff2") format("woff2"); }
@font-face { font-family: "Kanit"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/kanit-semibold.woff2") format("woff2"); }
@font-face { font-family: "Kanit"; font-style: italic; font-weight: 900; font-display: swap; src: url("../fonts/kanit-blackitalic.woff2") format("woff2"); }

:root {
  --dem: #1e1840;        /* đêm phố — nền tối */
  --dem-2: #2a2258;
  --tau: #d7261e;        /* đỏ đầu tàu */
  --tau-dark: #a8170f;
  --sao: #ffc928;        /* vàng ngôi sao */
  --ghe: #2450d6;        /* xanh ghế nhựa — link trên nền sáng */
  --voi: #eef6f1;        /* tường vôi xanh bạc hà — nền sáng */
  --reu: #0f6b57;        /* cửa sắt xanh rêu */
  --muc: #1e1840;        /* chữ trên nền sáng */
  --trang: #ffffff;
  --mo: #5b5677;         /* chữ phụ trên nền sáng */
  --mo-toi: #c9c4e6;     /* chữ phụ trên nền tối */
  --wrap: 72rem;
  --pad: clamp(1.1rem, 4vw, 2.5rem);
  --display: "Kanit", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Kanit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--muc);
  background: var(--voi);
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: var(--ghe); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { text-decoration-thickness: .14em; }
:focus-visible { outline: 3px solid var(--sao); outline-offset: 3px; border-radius: 4px; }
.on-light :focus-visible, .light :focus-visible { outline-color: var(--ghe); }
p { margin: 0 0 1em; max-width: 38em; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
strong { font-weight: 600; }

.skip { position: absolute; left: -999px; top: 0; background: var(--sao); color: var(--dem); padding: .6rem 1rem; z-index: 10; font-weight: 600; }
.skip:focus { left: .5rem; top: .5rem; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- tiêu đề kiểu chữ nghiêng đậm ---------- */
.display {
  font-family: var(--display);
  font-style: italic;
  font-weight: 900;
  letter-spacing: -.01em;
  line-height: 1.12;            /* đủ chỗ cho dấu chồng (Ồ, Ỗ, Ấ…) */
  text-wrap: balance;
}
.h-section { font-size: clamp(2rem, 6vw, 3.4rem); margin-bottom: .5em; }
.lede { font-size: clamp(1.1rem, 2.4vw, 1.3rem); }

/* ---------- đầu trang ---------- */
.site-header { background: var(--dem); color: var(--trang); }
.site-header .wrap { display: flex; align-items: center; gap: 1rem; min-height: 4.25rem; flex-wrap: wrap; padding-top: .5rem; padding-bottom: .5rem; }
.brand {
  display: inline-block; font-family: var(--display); font-style: italic; font-weight: 900;
  font-size: 1.45rem; line-height: 1; color: var(--trang); text-decoration: none;
  background: var(--tau); padding: .42rem .8rem .38rem .7rem; transform: skewX(-8deg); border-radius: 3px;
}
.brand span { display: inline-block; transform: skewX(8deg); }
.nav { margin-left: auto; display: flex; align-items: center; gap: .3rem 1.1rem; flex-wrap: wrap; }
.nav a { color: var(--trang); text-decoration: none; font-weight: 600; font-size: .98rem; padding: .25rem 0; }
.nav a:hover { text-decoration: underline; }
.lang { display: inline-flex; border: 2px solid var(--sao); border-radius: 999px; overflow: hidden; }
.lang a, .lang span { padding: .12rem .7rem; font-weight: 600; font-size: .9rem; line-height: 1.6; }
.lang span { background: var(--sao); color: var(--dem); }
.lang a { color: var(--sao) !important; }
@media (max-width: 560px) {
  .nav .hide-sm { display: none; }
}

/* ---------- hero ---------- */
.hero { background: var(--dem); color: var(--trang); padding: clamp(2rem, 6vw, 4.5rem) 0 clamp(2.5rem, 6vw, 4.5rem); overflow: hidden; }
.hero-grid { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.05fr 1fr; gap: 3rem; } }
.studio-line { font-family: var(--display); font-style: italic; font-weight: 900; font-size: clamp(1.25rem, 3.2vw, 1.6rem); color: var(--mo-toi); margin-bottom: 1.1rem; line-height: 1.3; }
.game-title, .hero .game-title {
  font-family: var(--display); font-style: italic; font-weight: 900; color: var(--sao);
  font-size: clamp(3.4rem, 15vw, 7.4rem); line-height: 1.06; letter-spacing: -.02em; margin: 0 0 .25em;
  text-transform: uppercase; padding-top: .12em;  /* chừa chỗ cho dấu trên chữ hoa */
  text-shadow: .045em .045em 0 var(--tau);
}
.game-title .line { display: block; }
.hero p { color: #ece9fb; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.2rem; padding: 0; list-style: none; }
.chip { display: inline-block; font-weight: 600; font-size: .9rem; padding: .15rem .75rem; border-radius: 999px; border: 2px solid currentColor; line-height: 1.6; }
.chip.solid { background: var(--sao); color: var(--dem); border-color: var(--sao); }
.hero .chip { color: var(--sao); }
.hero .chip.solid { color: var(--dem); }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.btn {
  display: inline-block; font-family: var(--display); font-style: italic; font-weight: 900; font-size: 1.15rem;
  text-decoration: none; padding: .62rem 1.3rem .58rem; border-radius: 6px; line-height: 1.3;
  background: var(--tau); color: var(--trang); box-shadow: 0 4px 0 var(--tau-dark);
}
.btn:hover { background: #e3342b; }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--tau-dark); }
.btn.ghost { background: transparent; color: var(--sao); box-shadow: inset 0 0 0 2px var(--sao); }
.btn.ghost:hover { background: rgba(255,201,40,.12); }

/* khung "cửa sổ toa tàu" cho video */
.window {
  position: relative; border-radius: 22px; padding: 10px; background: var(--tau);
  box-shadow: 0 0 0 4px var(--dem), 0 0 0 7px var(--sao);
  transform: rotate(-1.2deg);
}
.window video, .window img { border-radius: 14px; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #000; }
.window .toggle {
  position: absolute; right: 22px; bottom: 22px; font: 600 .9rem/1 "Kanit", sans-serif; color: var(--dem);
  background: var(--sao); border: 0; border-radius: 999px; padding: .5rem .9rem; cursor: pointer;
}
.window .toggle:focus-visible { outline-color: var(--trang); }
@media (prefers-reduced-motion: reduce) { .window { transform: none; } }

/* dải chắn tàu đỏ trắng */
.barrier { height: 22px; background: repeating-linear-gradient(-45deg, var(--tau) 0 26px, var(--trang) 26px 52px); border-top: 4px solid var(--dem); border-bottom: 4px solid var(--dem); }

/* ---------- section chung ---------- */
.section { padding: clamp(3rem, 8vw, 5.5rem) 0; }
.section.dark { background: var(--dem); color: var(--trang); }
.section.dark p { color: #ece9fb; }
.section.dark a { color: var(--sao); }
.section.yellow { background: var(--sao); color: var(--dem); }
.section.yellow a { color: var(--dem); }

/* ---------- lưới trò chơi ---------- */
.games { display: grid; gap: 1.25rem; grid-template-columns: 1fr; list-style: none; margin: 0; padding: 0; }
@media (min-width: 720px) { .games { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .games { grid-template-columns: repeat(3, 1fr); } .games .featured { grid-column: span 3; } }
@media (min-width: 720px) and (max-width: 1079px) { .games .featured { grid-column: span 2; } }
.game { position: relative; border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; min-height: 15rem; }
.game h3 { font-family: var(--display); font-style: italic; font-weight: 900; font-size: clamp(1.8rem, 5vw, 2.3rem); line-height: 1.15; margin: 0 0 .4rem; }
.game p { margin: 0 0 1rem; }
.game .status { margin-top: auto; align-self: flex-start; }
.game-body { padding: 1.4rem 1.4rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.featured { background: var(--dem); color: var(--trang); }
.featured .game-body p { color: #ece9fb; }
.featured h3 { color: var(--sao); font-size: clamp(2.2rem, 6vw, 3.4rem); text-transform: uppercase; padding-top: .1em; }
@media (min-width: 720px) { .featured { flex-direction: row; } .featured picture { flex: 1.25; } .featured .game-body { flex: 1; padding: 2rem; } }
.featured picture img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 10; }
.featured .status { color: var(--sao); }
.featured .more { margin-top: 1rem; }
/* thẻ chữ cho game chưa có ảnh */
.card-type { padding: 0; }
.card-type .game-body { padding-top: 1.6rem; }
.card-type .glyph { font-family: var(--display); font-style: italic; font-weight: 900; font-size: 6.5rem; line-height: .8; position: absolute; right: -.08em; bottom: -.12em; opacity: .16; pointer-events: none; }
.c-pet { background: var(--reu); color: var(--trang); }
.c-tower { background: var(--tau); color: var(--trang); }
.c-pickle { background: var(--ghe); color: var(--trang); }
.card-type .status { color: var(--trang); }

/* ---------- giới thiệu / liên hệ ---------- */
.about-grid { display: grid; gap: 2rem; }
@media (min-width: 900px) { .about-grid { grid-template-columns: 1fr 1fr; gap: 4rem; } }
.email-big { font-family: var(--display); font-style: italic; font-weight: 900; font-size: clamp(1.5rem, 6.5vw, 2.8rem); line-height: 1.25; word-break: break-word; }
.email-big a { color: inherit; }
.small { font-size: .95rem; }

/* ---------- trang game ---------- */
.game-hero .game-title { font-size: clamp(3.4rem, 14vw, 7rem); }
.subtitle { font-family: var(--display); font-style: italic; font-weight: 900; font-size: clamp(1.3rem, 3.6vw, 1.85rem); color: var(--trang); line-height: 1.3; margin: 0 0 1rem; }
.store-slot:empty { display: none; }

.how { display: grid; gap: 1.5rem; }
@media (min-width: 900px) { .how { grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: start; } }
.do-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.do-list li { background: var(--trang); border-radius: 12px; padding: 1rem 1.1rem; border-left: 8px solid var(--tau); }
.do-list b { display: block; font-family: var(--display); font-style: italic; font-weight: 900; font-size: 1.3rem; line-height: 1.3; }
.power { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; list-style: none; padding: 0; }
.power li { background: var(--sao); border-radius: 999px; padding: .1rem .8rem; font-weight: 600; border: 0; }
figure { margin: 0; }
figcaption { font-size: .92rem; color: var(--mo); margin-top: .5rem; }
.dark figcaption { color: var(--mo-toi); }
.shot { border-radius: 12px; overflow: hidden; }
.shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }

/* ---------- hành trình 22 ga ---------- */
.route-ends { display: flex; justify-content: space-between; gap: 1rem; font-family: var(--display); font-style: italic; font-weight: 900; font-size: clamp(1.2rem, 3.5vw, 1.6rem); margin: 0 0 1.4rem; }
.route {
  list-style: none; margin: 0; padding: 0; counter-reset: ga;
  display: grid; grid-template-columns: 1fr; column-gap: 2.5rem;
}
@media (min-width: 760px) { .route { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(11, auto); grid-auto-flow: column; } }
@media (min-width: 1140px) { .route { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(8, auto); } }
.stop { position: relative; padding: 0 0 1.05rem 3.6rem; min-height: 4.4rem; }
/* đường ray: hai thanh ray + tà vẹt */
.stop::before {
  content: ""; position: absolute; left: 1.02rem; top: 0; bottom: 0; width: 1.05rem;
  background:
    linear-gradient(var(--dem), var(--dem)) left / 3px 100% no-repeat,
    linear-gradient(var(--dem), var(--dem)) right / 3px 100% no-repeat,
    repeating-linear-gradient(to bottom, transparent 0 6px, rgba(30,24,64,.55) 6px 10px);
}
.stop:first-child::before { top: 1.2rem; }
.stop:last-child::before { bottom: auto; height: 1.2rem; }
.stop::after {
  counter-increment: ga; content: counter(ga);
  position: absolute; left: 0; top: .15rem; width: 3.1rem; height: 2.15rem;
  display: grid; place-items: center; background: var(--tau); color: var(--trang);
  font: italic 900 1.15rem/1 "Kanit", sans-serif; border-radius: 6px; border: 3px solid var(--dem);
}
.stop .ga { display: block; font-family: var(--display); font-style: italic; font-weight: 900; font-size: 1.45rem; line-height: 1.25; }
.stop .tinh { font-size: .92rem; font-weight: 600; opacity: .8; }
.stop .mon { display: inline-block; margin-top: .25rem; background: var(--dem); color: var(--sao); font-weight: 600; padding: .05rem .7rem .1rem; border-radius: 6px; line-height: 1.5; }
.stop .mon i { font-style: normal; color: #e8e4fb; font-weight: 400; }
.stop.end::after { background: var(--dem); color: var(--sao); }
@media (min-width: 760px) {
  .stop:nth-child(11)::before, .stop:nth-child(12)::before { top: 0; bottom: 0; height: auto; }
}
@media (min-width: 1140px) {
  .stop:nth-child(8)::before, .stop:nth-child(9)::before, .stop:nth-child(16)::before, .stop:nth-child(17)::before { top: 0; bottom: 0; height: auto; }
  .stop:nth-child(11)::before, .stop:nth-child(12)::before { top: 0; bottom: 0; height: auto; }
}

/* ---------- ảnh ---------- */
.gallery { display: grid; gap: 1rem; grid-template-columns: 1fr; list-style: none; margin: 0; padding: 0; }
@media (min-width: 640px) { .gallery { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1080px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
.video-wrap { max-width: 56rem; }

/* ---------- chính sách ---------- */
.doc { padding: clamp(2rem, 6vw, 4rem) 0 4rem; }
.doc h1 { font-size: clamp(2.2rem, 7vw, 3.6rem); margin-bottom: .4rem; }
.doc h2 { font-family: var(--display); font-style: italic; font-weight: 900; font-size: clamp(1.6rem, 4.5vw, 2.2rem); margin: 2.6rem 0 .8rem; }
.doc h3 { font-weight: 600; font-size: 1.15rem; margin: 1.6rem 0 .4rem; }
.doc ul { padding-left: 1.2rem; max-width: 38em; }
.doc li { margin-bottom: .4rem; }
.updated { display: inline-block; background: var(--sao); font-weight: 600; padding: .1rem .7rem; border-radius: 6px; }
.toc { display: flex; gap: .8rem; flex-wrap: wrap; margin: 1.2rem 0 0; }
.lang-part { border-top: 6px solid var(--dem); margin-top: 3rem; padding-top: .5rem; }

/* ---------- chân trang ---------- */
.site-footer { background: var(--dem); color: var(--mo-toi); padding: 2.5rem 0 3rem; font-size: .95rem; }
.site-footer a { color: var(--trang); }
.foot { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; }
.foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.3rem; }
.site-footer p { margin: 0; }
.featured a { color: var(--sao); }
.stop .tinh { display: block; line-height: 1.3; }
.stop .mon { display: table; }
@media (min-width: 640px) { .gallery li:first-child { grid-column: span 2; } }
@media (min-width: 1080px) {
  .gallery { grid-template-columns: repeat(4, 1fr); }
  .gallery li:first-child { grid-row: span 2; }
  .gallery li:first-child img { height: 100%; }
}
.stop .gloss { display: block; font-size: .92rem; line-height: 1.35; margin-top: .2rem; }
.card-type .status { position: relative; z-index: 1; background: rgba(30, 24, 64, .28); }
