/* 浅色街机展台：首页用明亮底色衬托游戏画面，保留像素标志。 */
:root {
  color-scheme: light;
  --pd-bg: #f4f6fb;
  --pd-panel: #fff;
  --pd-line: #d4dceb;
  --pd-ink: #1b2c49;
  --pd-muted: #53657e;
  --pd-accent: #176f83;
  --pd-body: var(--pd-font-ui);
  --pd-mono: var(--pd-font-ui);
  --gb-font-head: var(--pd-body);
  --gb-font-body: var(--pd-body);
  --gb-surface: #141e30;
  --gb-surface-2: #10192a;
  --gb-border: #314058;
  --gb-border-hover: #7ce2d5;
  --gb-cyan: #7ce2d5;
  --gb-cyan-dim: #a2eee4;
  --gb-magenta: #f0a5bf;
  --gb-text: #edf2fa;
  --gb-text-dim: #a4b1c7;
  --gb-text-faint: #92a1ba;
}

body {
  background:
    radial-gradient(ellipse 55% 34% at 1% 0%, #eadfff 0%, transparent 100%),
    radial-gradient(ellipse 48% 38% at 100% 42%, #d5f2ed 0%, transparent 100%),
    linear-gradient(180deg, #f8f8ff 0%, var(--pd-bg) 64%, #edf2fb 100%);
  color: var(--pd-ink);
  font-family: var(--pd-body);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
body::after, #stars { display: none; }
button, input, textarea { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--pd-accent); outline-offset: 4px; }
::selection { background: #9de5dd; color: #1b2c49; }
::-webkit-scrollbar-track { background: var(--pd-bg); }
::-webkit-scrollbar-thumb { background: #aebbd1; }
.container { max-width: 1224px; padding-inline: 32px; }

.hero { padding: 22px 0 10px; text-align: left; }
.hero-title {
  font-family: "Press Start 2P", var(--pd-mono);
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.45;
  letter-spacing: .08em;
  margin-bottom: 10px;
  color: #26345e;
  text-shadow: none;
  animation: none;
}
.hero-desc { display: inline-block; font-size: 12px; line-height: 1.8; color: var(--pd-muted); letter-spacing: .04em; }
.hero::after { display: none; }

.lang-toggle { top: 16px; right: max(24px, calc((100vw - 1160px) / 2)); }
.lang-trigger { min-height: 42px; padding: 9px 14px; border-radius: 10px; background: #fff; border-color: var(--pd-line); color: var(--pd-ink); font: 500 12px/1.5 var(--pd-body); letter-spacing: .02em; box-shadow: 0 4px 15px #21365912; }
.lang-trigger:hover, .lang-trigger.open { background: #ebf6f6; border-color: #89c8cb; color: var(--pd-ink); }
.lang-dropdown { background: #fff; border-color: var(--pd-line); border-radius: 12px; padding: 6px; box-shadow: 0 16px 40px #21365925; }
.lang-option { min-height: 44px; font: 500 14px/1.5 var(--pd-body); color: var(--pd-muted); }
.lang-option:hover { background: #eef3f9; color: var(--pd-ink); }
.lang-option.active { color: var(--pd-accent); background: #dff3f2; }
.lang-option.active .flag { text-shadow: none; }

.articles-bar { max-width: none; margin: 0 0 10px; min-height: 44px; padding: 6px 12px; gap: 10px; border-color: #c9c1e5; border-radius: 10px; background: linear-gradient(100deg, #ebe4ff, #fff0df); }
.articles-bar::before { display: none; }
.articles-bar:hover { border-color: #8f77c8; box-shadow: 0 10px 28px #6b589033; }
.articles-bar__icon { width: 26px; height: 26px; justify-content: center; border-radius: 10px; background: #d3eef0; filter: none; }
.articles-bar__icon svg { opacity: .8; }
.articles-bar__icon svg [stroke] { stroke: #176f83; }
.articles-bar__icon svg rect { fill: #d3eef0; }
.articles-bar__text { flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; }
.articles-bar [data-i18n="articles-bar-title"] { font: 600 14px/1.65 var(--pd-body); color: #302b59; letter-spacing: .025em; text-shadow: none; }
.articles-bar__sub { font: 400 12px/1.5 var(--pd-body); color: var(--pd-muted); text-shadow: none; }
.articles-bar__arrow { color: #5e448d; font-size: 18px; text-shadow: none; }
.section-title { margin-bottom: 12px; text-align: left; font: 700 14px/1.6 var(--pd-body); letter-spacing: .08em; color: #314669; }

.game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding-bottom: 20px; }
.game-card { --card-accent: #86d8cb; display: flex; flex-direction: column; background: var(--pd-panel); border-color: var(--pd-line); border-radius: 16px; box-shadow: 0 10px 24px #263c6419; transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease; }
.game-card[data-game="rift-runner"] { --card-accent: #f7b47c; }
.game-card[data-game="micro-commander"] { --card-accent: #83d9cf; }
.game-card[data-game="beat-maze"] { --card-accent: #f2a2db; }
.game-card[data-game="echoes-of-ruins"] { --card-accent: #bca6f2; }
.game-card[data-game="elemental-chain"] { --card-accent: #9fbaf5; }
.game-card[data-game="neon-match"] { --card-accent: #f5a6bb; }
.game-card[data-game="prism-siege"] { --card-accent: #c4b4f3; }
.game-card[data-game="prism-siege"] .card-thumb img { object-fit: contain !important; }
.game-card:not(.coming-soon)::before { content: ''; position: absolute; top: 0; inset-inline: 0; height: 4px; z-index: 1; background: var(--card-accent); }
.game-card:hover, .game-card:focus-within { border-color: #849ec4; box-shadow: 0 14px 34px #263c6430; transform: translateY(-4px); }
.card-thumb { height: clamp(96px, 15vh, 132px); aspect-ratio: auto; border-bottom: 1px solid var(--pd-line); }
.card-thumb img { object-fit: cover !important; filter: brightness(1.18) contrast(.84) saturate(1.15); }
.game-card[data-game="rift-runner"] .card-thumb img { object-position: center 65%; }
.game-card[data-game="beat-maze"] .card-thumb img { object-fit: contain !important; }
.game-card[data-game="echoes-of-ruins"] .card-thumb img { object-fit: contain !important; }
.game-card[data-game="elemental-chain"] .card-thumb img { object-fit: contain !important; }
.card-thumb::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 0% 0%, #84dbf02e, transparent 70%), radial-gradient(ellipse at 100% 100%, #b18ae926, transparent 70%); mix-blend-mode: screen; }
.game-card:nth-child(3n + 2) .card-thumb::after { background: radial-gradient(ellipse at 0% 0%, #88ddc930, transparent 70%), radial-gradient(ellipse at 100% 100%, #89b6fa24, transparent 70%); }
.game-card:nth-child(3n) .card-thumb::after { background: radial-gradient(ellipse at 0% 0%, #d79ff029, transparent 70%), radial-gradient(ellipse at 100% 100%, #86daf026, transparent 70%); }
.game-card:not(.coming-soon):hover .card-thumb img { transform: scale(1.035); }
.card-badge { top: 12px; right: 12px; padding: 5px 9px; font: 500 11px/1.4 var(--pd-body); letter-spacing: .02em; border-radius: 6px; backdrop-filter: blur(8px); }
.card-badge.ready { background: #0c1d24e8; color: #9ee9dd; border-color: #416862; }
.game-card:not(.coming-soon) .card-badge.ready { display: none; }
.card-info { flex: 1; display: flex; flex-direction: column; padding: 10px 12px; gap: 5px; }
.card-title { margin: 0; font: 650 17px/1.4 var(--pd-body); color: #203450; letter-spacing: .02em; }
.card-title .sub { display: inline; margin: 0 0 0 8px; font: 400 10px/1.5 var(--pd-mono); color: #617491; letter-spacing: .08em; }
html[lang="en"] .card-title .sub { display: none; }
.card-meta { margin: 0; gap: 7px; }
.card-tag { padding: 3px 8px; font: 500 11px/1.4 var(--pd-body); letter-spacing: .02em; border-radius: 5px; }
.card-tag.platformer { color: #176f83; background: #dff4f0; border-color: #a5dbd4; }
.card-tag.towerdef { color: #765522; background: #fff0d1; border-color: #ead19c; }
.card-tag.rhythm { color: #256b51; background: #ddf4e6; border-color: #a7d9bc; }
.card-tag.dungeon { color: #88466e; background: #fbe4f1; border-color: #e8b9d5; }
.card-tag.cardgame { color: #584c9e; background: #eae6ff; border-color: #c6bbed; }
.card-tag.casual { color: #944e65; background: #ffe5ec; border-color: #efb7c9; }
.card-desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden; flex: none; font: 400 13px/1.65 var(--pd-body); color: #53657e; letter-spacing: .015em; }
.card-play { width: 100%; min-height: 44px; margin-top: auto; padding: 10px 14px; font: 700 12px/1.5 var(--pd-body); letter-spacing: .04em; color: #172945; background: var(--card-accent); border: 1px solid #17294524; border-radius: 8px; transition: color .18s ease, background .18s ease, border-color .18s ease; }
.card-play:hover { background: #24385d; border-color: #24385d; color: #fff; box-shadow: none; transform: none; }
.card-play:active { transform: translateY(1px); }

.footer { padding: 42px 0 36px; font: 400 11px/1.8 var(--pd-mono); color: #6f7f97; letter-spacing: .08em; }
.footer span { color: #176f83; }

/* 留言板与首页共用色彩及正文排版，面板使用实色以保证可读性。 */
#gb-fab { right: 24px; bottom: max(24px, env(safe-area-inset-bottom)); width: 54px; height: 54px; border-radius: 17px; color: #fff; background: #293d6b; border: 1px solid #526a9a; box-shadow: 0 8px 26px #21365945; }
#gb-fab:hover { transform: translateY(-3px); background: #3c5790; box-shadow: 0 12px 28px #21365955; }
#gb-fab .gb-fab-icon { font-size: inherit; filter: none; }
#gb-fab .gb-fab-badge { color: #182436; background: #c4b6fa; font: 700 10px/20px var(--pd-body); box-shadow: 0 0 0 3px var(--pd-bg); }
#gb-fab .gb-fab-badge[hidden] { display: none; }
#gb-modal.open { padding: 24px; }
#gb-modal { z-index: 200; }
#gb-modal .gb-backdrop { background: #050b16ba; backdrop-filter: blur(8px); }
#gb-modal .gb-dialog { width: min(600px, 100%); min-width: 0; }
#guestbook { width: 100%; max-height: calc(100dvh - 48px); padding: 30px; color: var(--gb-text); color-scheme: dark; background: var(--gb-surface); border-color: #36465e; border-radius: 20px; box-shadow: 0 28px 90px #0008; }
#guestbook::before { width: 34px; margin: 0 0 20px; background: var(--pd-accent); box-shadow: none; }
#guestbook h2 { padding-right: 110px; font: 650 21px/1.5 var(--pd-body); letter-spacing: .015em; margin-bottom: 8px; text-shadow: none; }
#guestbook .gb-desc { font-size: 14px; line-height: 1.8; letter-spacing: .02em; margin-bottom: 12px; }
#guestbook .gb-count { font-size: 12px; letter-spacing: .02em; margin-bottom: 18px; }
#gb-modal .gb-close { width: 40px; height: 40px; top: 16px; right: 16px; background: #1e2c41; border-radius: 10px; font-size: 15px; }
#gb-modal .gb-close:hover { box-shadow: none; background: #293c54; }
.gb-manage-btn { min-height: 40px; top: 16px; right: 66px; padding: 7px 12px; font-size: 12px; letter-spacing: .02em; border-radius: 9px; }
.gb-manage-btn:hover { box-shadow: none; }
.gb-list { max-height: min(26dvh, 240px); overscroll-behavior: contain; }
.gb-empty, .gb-loading, .gb-unavailable { padding: 28px 18px; font-size: 14px; line-height: 1.7; letter-spacing: .025em; }
.gb-empty { background: #101a2c; border: 1px dashed #33455e; border-radius: 12px; }
.gb-empty::before { content: '✦'; display: block; margin-bottom: 8px; font-size: 21px; color: var(--pd-accent); }
.gb-item { padding: 15px 17px; margin-bottom: 10px; border-color: #2a3b53; border-radius: 12px; }
.gb-item .gb-meta { flex-wrap: wrap; gap: 6px 12px; }
.gb-item .gb-nick { font-size: 13px; font-weight: 600; letter-spacing: .01em; text-shadow: none; }
.gb-item .gb-time { font-size: 11px; }
.gb-item .gb-msg { font-size: 14px; line-height: 1.85; }
.gb-form { margin-top: 24px; gap: 9px; }
.gb-form label, .gb-owner label { font-size: 12px; font-weight: 500; letter-spacing: .02em; }
.gb-form input, .gb-form textarea, .gb-owner input { padding: 12px 14px; font-size: 16px; line-height: 1.6; border-radius: 10px; background: #0e1828; }
.gb-form input { min-height: 46px; }
.gb-form textarea { min-height: 112px; resize: vertical; }
.gb-form input::placeholder, .gb-form textarea::placeholder { color: #92a0b6; opacity: 1; }
.gb-form input:focus, .gb-form textarea:focus, .gb-owner input:focus { box-shadow: 0 0 0 3px #7ce2d512; }
.gb-counter { font: 400 11px/1.5 var(--pd-mono); color: var(--gb-text-faint); letter-spacing: 0; }
.gb-submit { min-height: 44px; padding: 11px 25px; font: 650 14px/1.5 var(--pd-body); letter-spacing: .08em; border-radius: 9px; box-shadow: none; }
.gb-submit:hover { box-shadow: none; }
.gb-submit:disabled { opacity: .45; cursor: not-allowed; }
.gb-owner { padding: 15px; margin: 0 0 18px; border: 1px solid #354960; border-radius: 12px; background: #101a2c; }
.gb-owner .gb-owner-ok { min-height: 40px; font-size: 13px; letter-spacing: .02em; }
.gb-del { min-height: 36px; font-size: 12px; letter-spacing: .02em; border-color: #f0a5bf55; }
.gb-del:hover { box-shadow: none; background: #f0a5bf0b; }
.gb-pager-btn { min-height: 40px; font-family: var(--pd-body); font-size: 12px; }
.gb-pager-page { font: 400 12px/1.5 var(--pd-mono); }
.gb-toast { z-index: 210; bottom: max(24px, env(safe-area-inset-bottom)); padding: 13px 20px; font: 500 13px/1.65 var(--pd-body); letter-spacing: .02em; background: #1d2c41; border-radius: 11px; box-shadow: 0 8px 30px #0005; }

@media (min-width: 769px) and (max-width: 1024px) {
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .container { padding-inline: 20px; }
  .hero { padding: 60px 0 10px; }
  .hero-title { font-size: clamp(16px, 4.4vw, 28px); letter-spacing: .04em; margin-bottom: 8px; }
    .hero-desc { font-size: 12px; letter-spacing: .04em; }
  .hero::after { margin-top: 14px; }
  .lang-toggle { top: 12px; right: 16px; }
  .lang-trigger { min-height: 40px; font-size: 12px; padding: 8px 12px; }
  .articles-bar { margin-bottom: 14px; padding: 8px 12px; gap: 10px; border-radius: 10px; }
  .articles-bar__icon { width: 24px; height: 24px; }
  .articles-bar [data-i18n="articles-bar-title"] { font-size: 12px; line-height: 1.8; }
  .articles-bar__sub { display: none; }
  .section-title { margin-bottom: 10px; font-size: 13px; }
  .game-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .card-thumb { height: 110px; }
  .card-info { padding: 12px 14px; gap: 7px; }
  .game-card:not(.coming-soon) .card-meta { display: none; }
  .card-title { font-size: 17px; }
  .card-desc { font-size: 13px; }
  .footer { padding: 30px 45px 100px; font-size: 10px; }
  #gb-fab { width: 50px; height: 50px; right: 18px; bottom: max(18px, env(safe-area-inset-bottom)); border-radius: 15px; }
  #gb-modal.open { padding: 12px; }
  #guestbook { padding: 24px 20px; max-height: calc(100dvh - 24px); border-radius: 16px; }
  #guestbook h2 { font-size: 20px; }
  #guestbook .gb-desc { font-size: 13px; }
  #gb-modal .gb-close { top: 12px; right: 12px; }
  .gb-manage-btn { top: 12px; right: 62px; }
  .gb-list { max-height: 26dvh; }
  .gb-form { margin-top: 20px; }
  .gb-submit { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  #stars { display: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .game-card:hover, #gb-fab:hover { transform: none; }
}

/* Game cards are native links, including when JavaScript is unavailable. */
a.game-card { color: inherit; text-decoration: none; }
span.card-play { display: block; text-align: center; }

/* Chinese uses the local CJK font; English keeps the pixel wordmark. */
html:lang(zh) .hero-title { font-family: var(--pd-body); font-size: clamp(26px, 2.6vw, 34px); font-weight: 750; letter-spacing: .1em; }

/* Keep both rows of real PLAY links visible, including short laptop windows. */
@media (min-width: 1024px) {
  .container { padding-inline: 48px; }
  #gb-fab { right: 12px; width: 44px; height: 44px; }
  .hero { padding: 16px 0 12px; }
  .hero-title { line-height: 1.2; margin-bottom: 6px; }
  html:lang(zh) .hero-title { font-size: 30px; }
  .hero::after { display: none; }
  .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .game-card:not(.coming-soon) .card-meta { display: none; }
}
