/* ============================================================
   游戏铺 · 门户首页
   和手绘本同一套纸墨配色
   ============================================================ */

@import url("fonts/fonts.css");

:root {
  --paper: #f7f0de;
  --paper-2: #efe5cc;
  --paper-edge: #cbb78d;
  --ink: #241f1a;
  --ink-soft: #574e45;
  --ink-faint: #8a7e70;
  --gold: #d9a441;
  --gold-deep: #b3812a;
  --green: #4f8a5b;
  --red: #b4453a;
  --blue: #3f6f9e;

  --font-brush: "Ma Shan Zheng", "Kaiti SC", "STKaiti", cursive;
  --font-hand: "ZCOOL KuaiLe", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --font-latin: "Gaegu", "Comic Sans MS", cursive;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink);
  background:
    radial-gradient(120% 70% at 50% 0%, #fdf8ea 0%, #f4ecd8 45%, #e9dcbe 100%);
  -webkit-font-smoothing: antialiased;
}

/* 纸纹 + 暗角 */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}
body::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='320' height='320' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.2;
  mix-blend-mode: multiply;
}
body::after {
  background: radial-gradient(100% 100% at 50% 40%, transparent 52%, rgba(120, 96, 56, 0.14) 100%);
}

.paper-fiber {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.12;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9 0.012' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='600' height='600' filter='url(%23f)'/%3E%3C/svg%3E");
}

.wrap {
  width: min(1080px, calc(100% - 40px));
  margin-inline: auto;
}

/* ---------- 头 ---------- */
.masthead {
  position: relative;
  padding: clamp(40px, 8vw, 84px) 0 clamp(18px, 3vw, 30px);
}

.masthead .wrap {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.eyebrow {
  font-family: var(--font-latin);
  font-size: 12px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 2px;
}

.masthead h1 {
  font-family: var(--font-brush);
  font-size: clamp(48px, 10vw, 96px);
  line-height: 1.05;
  letter-spacing: 0.06em;
  margin: 0;
}

.tagline {
  font-family: var(--font-hand);
  font-size: clamp(14px, 1.8vw, 17px);
  color: var(--ink-soft);
  margin: 8px 0 0;
}

.counter {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 20px;
  border: 2px solid rgba(87, 78, 69, 0.45);
  border-radius: 14px 10px 16px 9px / 10px 15px 9px 14px;
  transform: rotate(-1.6deg);
  background: rgba(255, 253, 246, 0.6);
}
/* 数字用中文手写体，笔画够粗；用 Gaegu 的话 "1" 会细成一根线 */
.counter b {
  font-family: var(--font-hand);
  font-size: 30px;
  line-height: 1;
  color: var(--gold-deep);
}
.counter-label {
  font-family: var(--font-hand);
  font-size: 14px;
  color: var(--ink-faint);
}

.sign-board {
  display: block;
  width: 100%;
  height: 40px;
  margin-top: 12px;
  opacity: 0.9;
}

/* ---------- 货架 ---------- */
.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: clamp(20px, 3vw, 34px);
  padding-bottom: clamp(40px, 8vw, 90px);
}

@media (max-width: 760px) {
  .shelf { grid-template-columns: 1fr; }
}

.game {
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(170deg, rgba(255, 253, 246, 0.95), rgba(244, 235, 214, 0.82));
  border: 2px solid rgba(87, 78, 69, 0.42);
  border-radius: 18px 13px 20px 12px / 13px 19px 12px 18px;
  overflow: hidden;
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.5) inset, 0 16px 32px -24px rgba(90, 70, 40, 0.8);
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s ease;
}

.game:hover {
  transform: rotate(0deg) translateY(-8px);
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.6) inset, 0 30px 46px -28px rgba(90, 70, 40, 0.75);
}

/* 封面 */
.cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e6d9bb;
  border-bottom: 2px solid rgba(87, 78, 69, 0.35);
}

.cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.game:hover .cover img { transform: scale(1.045) rotate(0.4deg); }

.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: var(--font-hand);
  font-size: 13px;
  padding: 3px 12px;
  border-radius: 10px 8px 11px 7px / 8px 10px 7px 9px;
  border: 1.6px solid rgba(87, 78, 69, 0.5);
  background: rgba(247, 240, 222, 0.92);
  color: var(--ink);
  transform: rotate(-2deg);
}
.badge--live { background: rgba(217, 164, 65, 0.85); border-color: var(--gold-deep); }

.cover-hint {
  position: absolute;
  inset: auto 0 0 0;
  padding: 8px 14px;
  font-family: var(--font-hand);
  font-size: 14px;
  color: var(--ink);
  background: linear-gradient(to top, rgba(247, 240, 222, 0.94), rgba(247, 240, 222, 0));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.game:hover .cover-hint { opacity: 1; transform: none; }

/* 正文 */
.game .body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: clamp(16px, 2.4vw, 24px);
}

.game h2 {
  font-family: var(--font-hand);
  font-weight: 400;
  font-size: 23px;
  margin: 0;
  line-height: 1.3;
}
.game h2 .sub {
  font-size: 16px;
  color: var(--ink-soft);
  margin-left: 6px;
}

.game .latin {
  font-family: var(--font-latin);
  font-size: 12.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 2px 0 10px;
}

.game .desc {
  margin: 0 0 14px;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--ink-soft);
}

.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 18px;
  padding: 0;
}
.tags li {
  font-family: var(--font-hand);
  font-size: 12.5px;
  color: var(--ink-soft);
  border: 1.4px dashed rgba(87, 78, 69, 0.45);
  border-radius: 8px 6px 9px 5px / 6px 8px 5px 7px;
  padding: 1px 9px;
}

.acts {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
}

.btn {
  font-family: var(--font-hand);
  font-size: 15px;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 9px 18px;
  border: 1.8px solid rgba(87, 78, 69, 0.5);
  border-radius: 12px 9px 13px 8px / 9px 12px 8px 11px;
  background: linear-gradient(170deg, rgba(255, 253, 246, 0.95), rgba(240, 230, 208, 0.85));
  transition: transform 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover {
  transform: translateY(-2px) rotate(-0.6deg);
  color: var(--ink);
  box-shadow: 0 12px 20px -16px rgba(90, 70, 40, 0.9);
}
.btn--primary {
  color: var(--ink);
  background: linear-gradient(170deg, rgba(232, 197, 104, 0.75), rgba(217, 164, 65, 0.5));
  border-color: var(--gold-deep);
}

/* 每张卡片歪一点，像随手贴上去的 */
.game:nth-child(3n + 1) { --tilt: -0.55deg; }
.game:nth-child(3n + 2) { --tilt: 0.6deg; }
.game:nth-child(3n) { --tilt: -0.3deg; }

/* 空位 */
.game--empty {
  background: none;
  border-style: dashed;
  border-color: rgba(87, 78, 69, 0.32);
  box-shadow: none;
  opacity: 0.72;
}
.game--empty:hover { transform: none; box-shadow: none; }
.cover--empty {
  display: grid;
  place-items: center;
  background: repeating-linear-gradient(-45deg, rgba(87, 78, 69, 0.05) 0 8px, transparent 8px 16px);
}
.cover--empty .plus {
  font-family: var(--font-latin);
  font-size: 54px;
  color: rgba(87, 78, 69, 0.35);
}

/* ---------- 脚 ---------- */
.foot {
  text-align: center;
  padding: 0 0 54px;
  color: var(--ink-faint);
  font-size: 13px;
}
.foot .note { font-family: var(--font-hand); margin: 0 0 4px; }
.foot .tiny {
  font-family: var(--font-latin);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-size: 11px;
  opacity: 0.7;
  margin: 0;
}

/* 减少动效 */
@media (prefers-reduced-motion: reduce) {
  .game, .cover img, .btn { transition: none; }
  .game:hover { transform: rotate(var(--tilt, 0deg)); }
}
