/* ZCOOL KuaiLe, SIL OFL 1.1. Local subset for current titles and labels. */
@font-face {
  font-family: "Gamehouse Handmade";
  src: url("../assets/fonts/zcool-kuaile-titles.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --font-body: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  --font-display: "Noto Sans SC", "Source Han Sans SC", "Source Han Sans CN", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-editorial: "Noto Serif SC", "Source Han Serif SC", "Source Han Serif CN", "Songti SC", "SimSun", serif;
  --cream: #f2e2b9;
  --paper: #fff9ec;
  --paper-strong: #fff9ec;
  --brown: #171713;
  --muted: #615b4e;
  --accent: #171713;
  --accent-dark: #171713;
  --sage: #9aa88c;
  --line: #171713;
  --shadow: 4px 4px 0 #171713;
  --shadow-hover: 7px 7px 0 #171713;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--cream);
  color: var(--brown);
  font-family: var(--font-body);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
.container { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.site-header {
  border-bottom: 2px solid var(--line);
  background: var(--cream);
  
}
.header-inner, .footer-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.025em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; color: #fffaf3; background: var(--accent); box-shadow: 0 6px 15px rgba(216, 121, 87, 0.24); }
.header-note, .back-link { color: var(--muted); font-size: 0.9rem; }
.back-link { font-weight: 700; }
.back-link:hover { color: var(--accent-dark); }

.hero { display: flex; align-items: center; justify-content: space-between; gap: 40px; padding: 44px 0 36px; }
.eyebrow { font-family: "Courier New", var(--font-body); margin: 0 0 12px; color: var(--accent-dark); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.18em; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 690px; margin-bottom: 18px; font-family: var(--font-display); font-size: clamp(2.4rem, 5vw, 4.2rem); line-height: 1.14; letter-spacing: -0.055em; font-weight: 900; }
.hero-description { max-width: 620px; margin-bottom: 0; color: var(--muted); font-size: 1.05rem; }
.hero-stats { flex: 0 0 auto; padding: 22px 24px; border: 2px solid var(--line); border-radius: 10px; background: var(--paper); text-align: center; }
.hero-stats strong { display: block; font-family: Georgia, var(--font-editorial); font-weight: 700; font-size: 2.8rem; line-height: 1; }
.hero-stats span { color: var(--muted); font-size: 0.85rem; }

.toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) 190px 170px; gap: 12px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.search-box, .select-box { display: flex; align-items: center; min-height: 48px; border: 2px solid var(--line); border-radius: 6px; background: var(--paper-strong); }
.search-box { gap: 10px; padding: 0 15px; color: var(--muted); }
.search-box:focus-within, .select-box:focus-within { border-color: var(--brown); outline: 3px solid #b06a25; outline-offset: 3px; }
.search-box input, .select-box select { width: 100%; border: 0; outline: 0; color: var(--brown); background: transparent; }
.search-box input::placeholder { color: #71695b; }
.select-box { padding: 0 14px; }
.select-box select { cursor: pointer; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 34px 0 22px; }
.section-heading h2 { margin-bottom: 0; font-family: var(--font-display); letter-spacing: -0.035em; font-size: 2rem; }
.result-summary { margin-bottom: 4px; color: var(--muted); font-size: 0.9rem; }
.game-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; padding-bottom: 84px; }
.game-card { overflow: hidden; border: 2px solid var(--line); border-radius: var(--radius); background: var(--paper-strong); box-shadow: var(--shadow); transition: transform 180ms ease, box-shadow 180ms ease; }
 .game-card:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-hover); }
.cover-wrap { border-bottom: 2px solid var(--line); position: relative; aspect-ratio: 8 / 5; overflow: hidden; background: #eaddbc; }
.cover-wrap img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 300ms ease; }
.game-card:hover .cover-wrap img { transform: scale(1.035); }
.demo-badge { position: absolute; top: 14px; left: 14px; padding: 4px 9px; border-radius: 999px; color: #fffaf3; background: rgba(63, 48, 41, 0.8); font-size: 0.72rem; font-weight: 700; }
.card-body { padding: 20px; }
.card-meta { font-family: "Courier New", var(--font-body); font-variant-numeric: tabular-nums; letter-spacing: 0.04em; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; color: var(--accent-dark); font-size: 0.78rem; font-weight: 700; }
.card-body h3 { margin: 0 0 12px; font-family: var(--font-editorial); font-size: 1.6rem; line-height: 1.35; letter-spacing: -0.035em; overflow-wrap: anywhere; }
.card-body p { display: -webkit-box; overflow: hidden; margin: 0; color: var(--muted); font-size: 0.92rem; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

.empty-state, .load-error { padding: 36px 24px; border: 1px dashed var(--line); border-radius: var(--radius); background: rgba(255, 250, 243, 0.45); text-align: center; }
.empty-icon { display: block; margin-bottom: 12px; font-size: 2rem; }
.empty-state h2, .load-error h1, .load-error h2 { margin-bottom: 8px; font-family: var(--font-body); }
.empty-state p, .load-error p { margin-bottom: 0; color: var(--muted); }

.game-page { padding: 48px 0 84px; }
.game-detail { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-strong); box-shadow: var(--shadow); }
.game-intro { display: grid; grid-template-columns: minmax(260px, 0.8fr) 1.2fr; gap: 40px; padding: 34px; }
.game-intro-cover { width: 100%; border-radius: 18px; aspect-ratio: 8 / 5; object-fit: cover; }
.game-intro h1 { margin-bottom: 14px; font-size: clamp(2.2rem, 5vw, 4rem); }
.game-intro-description { color: var(--muted); }
.game-info { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 24px 0 0; color: var(--muted); font-size: 0.9rem; }
.game-info strong { color: var(--brown); }
.game-shell { padding: 0 34px 34px; }
.game-shell iframe { display: block; width: 100%; min-height: 650px; border: 1px solid var(--line); border-radius: 16px; background: #1f1a17; }
.demo-notice { padding: 32px; border: 1px solid #ecd9b6; border-radius: 16px; background: #fff7e8; color: #70553a; }
.demo-notice h2 { margin-bottom: 8px; font-family: var(--font-body); }
.demo-notice p { margin-bottom: 0; }
.button-link { display: inline-flex; margin-top: 20px; padding: 11px 16px; border-radius: 11px; color: #fffaf3; background: var(--accent); font-weight: 700; }
.button-link:hover { background: var(--accent-dark); }

.site-footer { margin-top: 32px; border-top: 2px solid var(--line); color: var(--paper); background: var(--brown); font-size: 0.9rem; }
.footer-inner { min-height: 82px; }

@media (max-width: 820px) {
  .hero { align-items: start; flex-direction: row; padding: 32px 0 28px; }
  .hero-stats { align-self: center; text-align: center; }
  .hero-stats strong, .hero-stats span { display: block; }
  .hero-stats strong { margin-right: 7px; font-size: 2.1rem; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .search-box { grid-column: 1 / -1; }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-intro { grid-template-columns: 1fr; gap: 25px; }
}

@media (max-width: 560px) {
  .container { width: min(100% - 28px, 1120px); }
  .header-inner { min-height: 66px; }
  .header-note { display: none; }
  .brand { font-size: 0.92rem; }
  .hero { padding-top: 30px; }
  h1 { font-size: clamp(2rem, 8vw, 2.6rem); }
  .toolbar { grid-template-columns: 1fr 1fr; padding: 0; }
  .search-box { grid-column: 1 / -1; }
  .section-heading { align-items: start; flex-direction: column; padding-top: 26px; }
  .game-grid { grid-template-columns: 1fr; gap: 16px; padding-bottom: 56px; }
  .game-intro, .game-shell { padding: 20px; }
  .game-shell { padding-top: 0; }
  .game-shell iframe { min-height: 480px; }
  .footer-inner { align-items: start; flex-direction: column; justify-content: center; gap: 2px; }
}

.header-actions { display: flex; align-items: center; gap: 18px; }
.management-page { padding: 48px 0 84px; }
.management-heading { padding-top: 24px; }
.management-heading h1 { margin-bottom: 14px; }
.management-card { margin-bottom: 24px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-strong); box-shadow: var(--shadow); }
.file-drop { display: flex; min-height: 150px; align-items: center; justify-content: center; flex-direction: column; gap: 7px; border: 2px dashed var(--line); border-radius: 16px; background: #fffaf3; cursor: pointer; text-align: center; }
.file-drop:hover { border-color: var(--accent); }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop-title { color: var(--accent-dark); font-weight: 800; }
.field-help { margin: 12px 0 18px; color: var(--muted); font-size: .9rem; }
.button-submit { border: 0; cursor: pointer; }
.status-box { margin-top: 18px; padding: 14px 16px; border-radius: 12px; }
.status-box.pending { background: #fff7e8; color: #70553a; }
.status-box.success { background: #edf5e9; color: #45623c; }
.status-box.error { background: #fff0eb; color: #9d4937; }
.compact-heading { padding: 0 0 20px; }
.compact-heading h2 { font-size: 1.65rem; }
.edit-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.edit-form label { display: grid; gap: 7px; font-weight: 700; }
.edit-form label:nth-child(2) { grid-column: 1 / -1; }
.edit-form input, .edit-form textarea, .edit-form select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; color: var(--brown); background: #fffaf3; outline: 0; }
.edit-form input:focus, .edit-form textarea:focus, .edit-form select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(216, 121, 87, .12); }
.installed-games { display: grid; gap: 10px; }
.installed-game { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; }
.installed-game strong, .installed-game span { display: block; }
.installed-game span { color: var(--muted); font-size: .85rem; }
.installed-game button { border: 0; color: var(--accent-dark); background: transparent; cursor: pointer; font-weight: 700; }
@media (max-width: 560px) { .header-actions .header-note { display: none; } .management-card { padding: 20px; } .edit-form { grid-template-columns: 1fr; } .edit-form label:nth-child(2) { grid-column: auto; } }
.game-frame-wrap { position: relative; }
.game-load-status { margin: 0 0 10px; color: var(--muted); font-size: .86rem; }

/* Public collection layout; management selectors above remain compatible. */
[hidden] { display: none !important; }
.site-nav { letter-spacing: 0.035em; display: flex; flex-wrap: wrap; gap: 24px; font-size: .95rem; font-weight: 700; }
.site-nav a { padding: 8px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current="page"] { border-bottom-color: currentColor; }
.brand { white-space: nowrap; font-family: var(--font-editorial); font-weight: 900; font-size: 1.25rem; }
.brand-mark { font-family: var(--font-body); font-weight: 800; letter-spacing: 0.03em; border-radius: 6px; box-shadow: none; width: 38px; height: 38px; font-size: 1.1rem; }
.hero > div:first-child { min-width: 0; }
.hero-description { font-size: 1rem; max-width: 660px; }
.hero-stats span { display: block; margin-top: 8px; font-size: .8rem; }
.toolbar { scroll-margin-top: 20px; }
.section-heading h2 { font-weight: 900; }
.heading-dot { font-weight: 500; }
.game-grid { align-items: stretch; padding-bottom: 38px; }
.game-card { display: flex; flex-direction: column; }
.card-body { display: flex; flex: 1; flex-direction: column; }
.card-body h3 { font-weight: 900; }
.card-body p { line-height: 1.75; margin-bottom: 20px; }
.play-button { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding: 10px 14px; border: 2px solid var(--brown); border-radius: 5px; background: var(--brown); color: var(--paper); font-weight: 800; }
.game-card:hover .play-button { background: var(--cream); color: var(--brown); }
.footer-content { display: grid; grid-template-columns: 1fr 1fr; gap: 70px; padding-top: 42px; padding-bottom: 32px; }
.footer-about h2 { font-family: var(--font-editorial); font-weight: 900; letter-spacing: -0.025em; margin-bottom: 12px; font-size: 1.5rem; }
.footer-about p { max-width: 430px; color: #ddd3bd; }
.footer-about .footer-tagline { color: var(--paper); font-weight: 700; }
.footer-details details { border-bottom: 1px solid #5b574a; }
.footer-details summary { padding: 12px 0; cursor: pointer; font-weight: 700; }
.footer-details p { color: #ddd3bd; line-height: 1.8; }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; padding-top: 18px; padding-bottom: 22px; border-top: 1px solid #5b574a; color: #ddd3bd; font-size: .8rem; }
.game-intro-cover { border: 2px solid var(--line); border-radius: 8px; }
.game-detail { border-width: 2px; }
.game-intro { gap: 28px; }
.button-link { border: 2px solid var(--brown); border-radius: 5px; }
.button-link:hover { background: var(--cream); color: var(--brown); }
:focus-visible { outline: 3px solid #a35b18; outline-offset: 4px; }
@media (max-width: 820px) {
  .hero { gap: 20px; }
  .hero-stats { padding: 16px; }
  .footer-content { gap: 32px; }
}
@media (max-width: 560px) {
  .header-inner { flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px 0 12px; }
  .site-nav { width: 100%; justify-content: space-between; gap: 12px; font-size: .9rem; }
  .hero { flex-direction: column; gap: 20px; }
  .hero-stats { align-self: flex-start; padding: 8px 12px; }
  .hero-stats strong, .hero-stats span { display: inline; margin: 0; }
  .hero-stats strong { font-size: 1.5rem; margin-right: 8px; }
  .section-heading { gap: 8px; }
  .footer-content { grid-template-columns: 1fr; gap: 16px; padding-top: 30px; }
  .footer-bottom { flex-direction: column; }
  .game-intro h1 { font-size: 2rem; }
  .game-info { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* Handmade display type; body text and the square brand mark stay unchanged. */
#page-title, .game-intro h1, .card-body h3,
.brand > span:not(.brand-mark), .footer-about h2 {
  font-family: "Gamehouse Handmade", var(--font-display);
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: 0.01em;
}
#page-title { line-height: 1.2; }
.card-body h3 { font-size: 1.85rem; line-height: 1.3; }
.brand > span:not(.brand-mark) { font-size: 1.45rem; }
.site-nav, .play-button, .button-link, .select-box select {
  font-family: "Gamehouse Handmade", var(--font-body);
  font-weight: 400;
  letter-spacing: 0.025em;
}
.eyebrow { font-family: "Gamehouse Handmade", "Courier New", var(--font-body); font-weight: 400; letter-spacing: 0.14em; }
@media (max-width: 560px) {
  #page-title { font-size: clamp(2.1rem, 8.5vw, 2.8rem); }
  .brand > span:not(.brand-mark) { font-size: 1.3rem; }
}
/* Homepage title only: handmade editorial rhythm without changing other headings. */
#page-title {
  font-family: "Gamehouse Handmade", var(--font-display);
  font-size: clamp(2.45rem, 5.2vw, 4.35rem);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: 0.015em;
  text-shadow: 2px 2px 0 rgba(23, 23, 19, 0.14);
}
#page-title .title-line {
  display: inline-block;
  transform-origin: left center;
}
#page-title .title-line-one {
  transform: rotate(-1.2deg) translateX(-0.02em);
}
#page-title .title-line-two {
  margin-left: 0.32em;
  transform: rotate(1.4deg) translateY(0.08em);
  letter-spacing: 0.055em;
}
@media (max-width: 560px) {
  #page-title {
    font-size: clamp(2.05rem, 8.5vw, 2.85rem);
    line-height: 1.08;
  }
  #page-title .title-line-two { margin-left: 0.2em; }
}
