/* hub.css — 首页（index.html）与游戏列表（gamelist.html）共用样式
 * 风格：纸张 × 墨色 × 单一讯号橘，「街机票根」式编号清单。
 * 动态：只用 transform / opacity；进场 ease-out、<300ms（标题与主题切换例外）；
 *      hover 动效只给精准指标装置；prefers-reduced-motion 时改为温和淡入。
 * 注意：.game-item 等 class 由 admin/api.php ssrRenderGameListMarkup() 与 /js/hub.js 共同产生，改名需三处同步。
 */

:root {
    --paper: #f3efe6;
    --paper-2: #fbf8f1;
    --paper-3: #e9e3d6;
    --ink: #17140f;
    --ink-2: #5d564b;
    --ink-3: #8b8375;
    --line: rgba(23, 20, 15, 0.13);
    --line-strong: rgba(23, 20, 15, 0.85);
    --accent: #ff5a1f;
    --accent-ink: #ffffff;
    --fresh: #c8f03c;
    --fresh-ink: #17140f;

    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

    --font: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, sans-serif;
    --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;

    --gutter: 16px;
    --max: 1120px;
    color-scheme: light;
}

html.dark-mode {
    --paper: #121110;
    --paper-2: #1b1a17;
    --paper-3: #26241f;
    --ink: #f2ede3;
    --ink-2: #b1a999;
    --ink-3: #7f786b;
    --line: rgba(242, 237, 227, 0.12);
    --line-strong: rgba(242, 237, 227, 0.8);
    --accent: #ff6a33;
    --accent-ink: #120f0b;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 16px; }

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
}

/* 纸张颗粒：静态 SVG 噪点，固定不动、不吃事件 */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.07;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
html.dark-mode body::before { opacity: 0.1; mix-blend-mode: screen; filter: invert(1); }

body > * { position: relative; z-index: 1; }

a { color: inherit; }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
svg { display: block; }

:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- 载入进度条（取代整页 spinner，不挡内容） ---------- */
.loader-container {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 3px;
    z-index: 100;
    overflow: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.loader-container.hidden { opacity: 0; }
.spinner {
    width: 40%;
    height: 100%;
    background: var(--accent);
    animation: loaderSlide 1.1s var(--ease-in-out) infinite;
}
@keyframes loaderSlide {
    from { transform: translateX(-100%); }
    to { transform: translateX(260%); }
}

/* ---------- 顶栏 ---------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: calc(14px + env(safe-area-inset-top));
    padding-bottom: 14px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.brand-mark {
    width: 22px; height: 22px;
    display: grid; place-items: center;
    background: var(--ink);
    color: var(--paper);
    border-radius: 6px;
    font-size: 12px;
    letter-spacing: 0;
}
.brand-mark svg { width: 14px; height: 14px; }

.topbar-right { display: flex; align-items: center; gap: 8px; }
.icon-btn {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    border-radius: 999px;
    border: 1.5px solid var(--line-strong);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    transition: background-color 0.16s ease, transform 0.12s var(--ease-out);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { background: var(--paper-3); } }
.tabs {
    display: inline-flex;
    padding: 3px;
    border: 1.5px solid var(--line-strong);
    border-radius: 999px;
    gap: 2px;
}
.tabs a {
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 999px;
    color: var(--ink-2);
    transition: color 0.16s ease, background-color 0.16s ease;
}
.tabs a[aria-current="page"] { background: var(--ink); color: var(--paper); }
@media (hover: hover) and (pointer: fine) {
    .tabs a:not([aria-current="page"]):hover { color: var(--ink); background: var(--paper-3); }
}

/* ---------- 标题区 ---------- */
.hero { padding: 18px 0 8px; }
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-2);
    margin: 0 0 12px;
}
.eyebrow .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
    animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.35; } }

.app-title {
    margin: 0;
    font-size: clamp(40px, 12vw, 84px);
    line-height: 0.98;
    font-weight: 900;
    letter-spacing: -0.035em;
}
.app-title .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.app-title .line > span { display: inline-block; animation: lineUp 0.62s var(--ease-out) both; }
.app-title .line:nth-child(2) > span { animation-delay: 0.07s; }
.app-title .hl { position: relative; white-space: nowrap; }
.app-title .hl svg {
    position: absolute;
    left: -2%; bottom: -0.1em;
    width: 104%; height: 0.32em;
    overflow: visible;
    z-index: -1;
}
.app-title .hl path {
    fill: none;
    stroke: var(--accent);
    stroke-width: 9;
    stroke-linecap: round;
    stroke-dasharray: 420;
    stroke-dashoffset: 420;
    animation: draw 0.7s var(--ease-out) 0.35s forwards;
}
@keyframes lineUp { from { transform: translateY(105%); } to { transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

.app-subtitle {
    margin: 14px 0 0;
    max-width: 34em;
    color: var(--ink-2);
    font-size: 15px;
    animation: fadeUp 0.5s var(--ease-out) 0.2s both;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 跑马灯 ---------- */
.ticker {
    margin: 22px calc(var(--gutter) * -1) 0;
    border-top: 1.5px solid var(--line-strong);
    border-bottom: 1.5px solid var(--line-strong);
    background: var(--ink);
    color: var(--paper);
    overflow: hidden;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.ticker-track { display: inline-flex; padding: 9px 0; animation: marquee 32s linear infinite; }
.ticker-track span { display: inline-flex; align-items: center; gap: 18px; padding-right: 18px; }
.ticker-track b { color: var(--fresh); font-weight: 800; font-family: var(--mono); padding: 0 2px; }
.ticker-track i { font-style: normal; color: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- 搜索 ---------- */
.container { padding-top: 22px; }
.search-bar { margin-bottom: 8px; }
.search-bar[hidden] { display: none; }
.search-field {
    position: relative;
    display: flex;
    align-items: center;
    border: 1.5px solid var(--line-strong);
    border-radius: 14px;
    background: var(--paper-2);
    transition: box-shadow 0.18s var(--ease-out);
}
.search-field:focus-within { box-shadow: 4px 4px 0 var(--ink); }
.search-icon { position: absolute; left: 14px; color: var(--ink-2); pointer-events: none; }
.search-icon svg { width: 18px; height: 18px; }
#searchInput {
    width: 100%;
    height: 50px;
    border: 0;
    background: transparent;
    padding: 0 48px 0 44px;
    font: inherit;
    font-size: 16px; /* iOS 不放大 */
    color: var(--ink);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
#searchInput::placeholder { color: var(--ink-3); }
#searchInput::-webkit-search-cancel-button { display: none; }
.search-clear {
    position: absolute;
    right: 8px;
    width: 34px; height: 34px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ink-2);
    cursor: pointer;
    display: grid; place-items: center;
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s var(--ease-out);
}
.search-clear svg { width: 16px; height: 16px; }
.search-clear.visible { opacity: 1; transform: none; pointer-events: auto; }
.search-clear:active { transform: scale(0.94); }
.search-kbd {
    position: absolute; right: 12px;
    font-family: var(--mono); font-size: 11px; color: var(--ink-3);
    border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px;
    pointer-events: none; transition: opacity 0.15s ease;
}
.search-field:focus-within .search-kbd, .search-clear.visible ~ .search-kbd { opacity: 0; }
@media (hover: none) { .search-kbd { display: none; } }

.search-count {
    display: flex; align-items: center; gap: 8px;
    font-size: 12.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ink-2);
    padding: 12px 2px 6px;
}
.search-count::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- 游戏清单（票根式编号列） ---------- */
.game-list { list-style: none; margin: 0; padding: 0; counter-reset: rank; }

.game-item {
    position: relative;
    display: grid;
    grid-template-columns: 30px 60px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0 12px;
    padding: 14px 6px 14px 0;
    border-bottom: 1.5px dashed var(--line);
    counter-increment: rank;
    transition: background-color 0.16s ease;
}
.game-item::before {
    content: counter(rank, decimal-leading-zero);
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 800;
    color: var(--ink-3);
    text-align: right;
    font-variant-numeric: tabular-nums;
    transition: color 0.16s ease;
}
.game-item:nth-child(-n+3)::before { color: var(--accent); }

.game-icon-wrapper {
    position: relative;
    width: 60px; height: 60px;
    border-radius: 16px;
    border: 1.5px solid var(--line-strong);
    background: var(--paper-3);
    transition: transform 0.2s var(--ease-out);
}
.game-icon { width: 100%; height: 100%; object-fit: cover; border-radius: 14.5px; }
.game-item.is-fresh .game-icon-wrapper::after {
    content: "NEW";
    position: absolute;
    top: -7px; right: -9px;
    background: var(--fresh);
    color: var(--fresh-ink);
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 900;
    letter-spacing: 0.06em;
    padding: 2px 5px;
    border-radius: 5px;
    border: 1.5px solid var(--ink);
    transform: rotate(8deg);
}

.game-info { min-width: 0; }
.game-title {
    margin: 0;
    font-size: 16.5px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.game-desc {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--ink-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.game-meta { margin-top: 5px; display: flex; }
.game-tag {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-3);
    letter-spacing: 0.02em;
}
.game-item.is-fresh .game-tag { color: var(--ink); }
.game-item.is-fresh .game-tag::before { content: "● "; color: var(--accent); }

.btn-play {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px 0 14px;
    border-radius: 10px;
    background: var(--ink);
    color: var(--paper);
    font-size: 13.5px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    /* 不可对 .btn-play 本身做 transform：它的 ::before 撑满整列当点击区，
       一旦 transform 会变成新的定位容器，按下时点击区缩回按钮大小，整列就点不到了 */
    transition: background-color 0.12s ease, color 0.12s ease;
}
.btn-play::after {
    content: "";
    width: 7px; height: 7px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
    margin-left: 1px;
    transition: transform 0.2s var(--ease-out);
}
/* 整列都可以点：把按钮的点击区扩到整列 */
.btn-play:not(.is-disabled)::before { content: ""; position: absolute; inset: 0; z-index: 1; }
.btn-play.is-disabled { background: var(--paper-3); color: var(--ink-3); }
.btn-play.is-disabled::after { display: none; }

.game-item:active .btn-play:not(.is-disabled) { background: var(--accent); color: var(--accent-ink); }
.game-item:has(.btn-play:not(.is-disabled)):active { background: var(--paper-2); }

@media (hover: hover) and (pointer: fine) {
    .game-item:has(.btn-play:not(.is-disabled)):hover { background: var(--paper-2); }
    .game-item:hover::before { color: var(--accent); }
    .game-item:hover .game-icon-wrapper { transform: rotate(-4deg) scale(1.04); }
    .game-item:hover .btn-play:not(.is-disabled) { background: var(--accent); color: var(--accent-ink); }
    .game-item:hover .btn-play::after { transform: translateX(3px) rotate(45deg); }
}

/* 进场：只在首次载入时（ul 带 .anim），搜索过滤时不重播 */
.game-list.anim > .game-item { animation: rowIn 0.32s var(--ease-out) both; }
.game-list.anim > .game-item:nth-child(1) { animation-delay: 0.18s; }
.game-list.anim > .game-item:nth-child(2) { animation-delay: 0.22s; }
.game-list.anim > .game-item:nth-child(3) { animation-delay: 0.26s; }
.game-list.anim > .game-item:nth-child(4) { animation-delay: 0.30s; }
.game-list.anim > .game-item:nth-child(5) { animation-delay: 0.34s; }
.game-list.anim > .game-item:nth-child(6) { animation-delay: 0.38s; }
.game-list.anim > .game-item:nth-child(7) { animation-delay: 0.42s; }
.game-list.anim > .game-item:nth-child(8) { animation-delay: 0.46s; }
.game-list.anim > .game-item:nth-child(n+9) { animation-delay: 0.5s; }
@keyframes rowIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- 状态框（载入失败 / 无结果） ---------- */
.state-box {
    list-style: none;
    text-align: center;
    padding: 44px 20px;
    border: 1.5px dashed var(--line-strong);
    border-radius: 18px;
    margin-top: 8px;
    animation: fadeUp 0.25s var(--ease-out) both;
}
.state-icon { width: 44px; height: 44px; margin: 0 auto 12px; color: var(--ink-2); }
.state-icon svg { width: 100%; height: 100%; }
.state-title { margin: 0 0 6px; font-weight: 800; font-size: 17px; }
.state-text { margin: 0; color: var(--ink-2); font-size: 14px; }
.state-text.is-error { color: var(--accent); }
.btn-retry {
    margin-top: 18px;
    height: 42px;
    padding: 0 20px;
    border: 0;
    border-radius: 12px;
    background: var(--ink);
    color: var(--paper);
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.12s var(--ease-out);
}
.btn-retry:active { transform: scale(0.97); }
.btn-retry:disabled { opacity: 0.6; cursor: default; }

/* ---------- 页尾 ---------- */
.site-footer { margin-top: 48px; padding-bottom: 24px; }
.footer-word {
    font-size: clamp(44px, 16vw, 150px);
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: -0.05em;
    color: transparent;
    -webkit-text-stroke: 1.5px var(--line-strong);
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
}
.footer-meta {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
    margin-top: 14px; padding-top: 14px;
    border-top: 1.5px solid var(--line-strong);
    font-family: var(--mono); font-size: 12px; color: var(--ink-2);
}
.footer-meta a { text-decoration: none; font-weight: 700; }
.footer-meta a:hover { color: var(--accent); }

/* ---------- 右下浮动按钮 ---------- */
.floating-dock-container {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 50;
}
.floating-dock { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.dock-divider { display: none; }
.dock-btn {
    width: 46px; height: 46px;
    display: grid; place-items: center;
    border-radius: 14px;
    border: 1.5px solid var(--ink);
    background: var(--paper-2);
    color: var(--ink);
    cursor: pointer;
    box-shadow: 3px 3px 0 var(--ink);
    transition: transform 0.14s var(--ease-out), box-shadow 0.14s var(--ease-out), opacity 0.2s ease;
}
.dock-btn svg { width: 20px; height: 20px; }
.dock-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
#scrollTopBtn { opacity: 0; transform: translateY(8px); pointer-events: none; }
#scrollTopBtn.show { opacity: 1; transform: none; pointer-events: auto; }
#scrollTopBtn.show:active { transform: translate(2px, 2px); }
#themeIcon .i-moon { display: none; }
html.dark-mode #themeIcon .i-sun { display: none; }
html.dark-mode #themeIcon .i-moon { display: block; }

/* 主题切换：从按钮位置圆形展开（View Transitions，不支援的浏览器直接切换） */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------- 桌面 ---------- */
@media (min-width: 760px) {
    :root { --gutter: 32px; }
    body { font-size: 16px; }
    .topbar { padding-top: 22px; }
    .hero { padding: 40px 0 12px; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 24px; }
    .hero-side { text-align: right; font-size: 13px; color: var(--ink-2); line-height: 1.7; }
    .hero-side strong { display: block; font-size: 64px; line-height: 1; color: var(--ink); letter-spacing: -0.04em; font-family: var(--font); font-weight: 900; }
    .ticker { margin: 32px 0 0; border-radius: 0; }
    .container { padding-top: 32px; }
    .search-bar { display: grid; grid-template-columns: minmax(0, 520px) 1fr; align-items: center; gap: 20px; }
    .search-count { padding: 0; }
    .game-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; margin-top: 16px; }
    .game-item { grid-template-columns: 32px 64px minmax(0, 1fr) auto; padding: 18px 10px 18px 0; border-radius: 0; }
    .game-icon-wrapper { width: 64px; height: 64px; }
    .state-box { grid-column: 1 / -1; }
    .floating-dock-container { right: 28px; bottom: 28px; }
}
@media (max-width: 759px) { .hero-side { display: none; } }
@media (max-width: 360px) {
    .game-item { grid-template-columns: 22px 52px minmax(0, 1fr) auto; gap: 0 10px; }
    .game-icon-wrapper { width: 52px; height: 52px; border-radius: 14px; }
    .btn-play { padding: 0 10px; font-size: 13px; }
    .tabs a { padding: 5px 9px; }
}

/* ---------- 减少动态 ---------- */
@media (prefers-reduced-motion: reduce) {
    .app-title .line > span, .app-subtitle { animation: fadeIn 0.3s ease both; }
    .app-title .hl path { animation: none; stroke-dashoffset: 0; }
    .game-list.anim > .game-item { animation: fadeIn 0.3s ease both; animation-delay: 0s !important; }
    .ticker-track { animation: none; }
    .eyebrow .dot { animation: none; }
    .spinner { animation: none; width: 100%; opacity: 0.5; }
    .game-icon-wrapper, .btn-play, .btn-play::after, .dock-btn, #scrollTopBtn { transition-property: opacity, background-color, color; }
    .game-item:hover .game-icon-wrapper { transform: none; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* 极窄萤幕：品牌只留图示 */
@media (max-width: 330px) {
    .brand-text { display: none; }
    .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
    .brand-mark svg { width: 18px; height: 18px; }
}
html.dark-mode .ticker-track b { color: var(--accent); }

/* ======================================================================
   动态 2.0：标题旁的游戏图示扇形 + 旋转徽章、捲动进场、NEW 晃动、按钮扫光
   ====================================================================== */
.hero { position: relative; }
.hero-art {
    position: absolute;
    top: 6px; right: 0;
    width: 132px; height: 132px;
    pointer-events: none;
}
.fan { position: absolute; inset: 0; }
.fan img {
    position: absolute;
    left: 50%; top: 50%;
    width: 64px; height: 64px;
    margin: -32px 0 0 -32px;
    border-radius: 18px;
    border: 2px solid var(--ink);
    background: var(--paper-3);
    object-fit: cover;
    box-shadow: 4px 4px 0 var(--ink);
    opacity: 0;
    transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(0.9);
    animation: fanIn 0.5s var(--ease-out) forwards, bob 5s ease-in-out infinite;
    animation-delay: var(--d), calc(var(--d) + 0.5s);
}
@keyframes fanIn { to { opacity: 1; transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(1); } }
@keyframes bob {
    0%, 100% { opacity: 1; transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(1); }
    50% { opacity: 1; transform: translate(var(--x), calc(var(--y) - 6px)) rotate(calc(var(--r) * -0.5)) scale(1); }
}
.spin-badge {
    position: absolute;
    right: -10px; bottom: -14px;
    width: 74px; height: 74px;
    animation: spin 16s linear infinite;
    z-index: 3;
}
.spin-badge circle { fill: var(--accent); stroke: var(--ink); stroke-width: 2; }
.spin-badge text { font: 800 9.6px var(--mono); fill: var(--accent-ink); }
html:not(.dark-mode) .spin-badge text { fill: #fff; }
.spin-badge .star { fill: var(--fresh); stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 760px) {
    .hero { grid-template-columns: 1fr auto auto; }
    .hero-art { position: relative; top: auto; right: auto; width: 220px; height: 170px; align-self: center; }
    .fan img { width: 96px; height: 96px; margin: -48px 0 0 -48px; border-radius: 24px; }
    .spin-badge { width: 96px; height: 96px; right: -6px; bottom: -18px; }
}
@media (max-width: 380px) { .hero-art { transform: scale(0.82); transform-origin: top right; } }

/* 捲动进场：首屏以外的列，进入视窗时滑入一次 */
.game-item.reveal { opacity: 0; transform: translateY(14px); }
.game-item.reveal.in { opacity: 1; transform: none; transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out); }

/* NEW 每隔几秒晃一下 */
.game-item.is-fresh .game-icon-wrapper::after { animation: wiggle 4s ease-in-out 1.2s infinite; transform-origin: 30% 80%; }
@keyframes wiggle {
    0%, 86%, 100% { transform: rotate(8deg); }
    89% { transform: rotate(-6deg) scale(1.08); }
    92% { transform: rotate(12deg) scale(1.08); }
    95% { transform: rotate(4deg); }
}

/* 立即游玩：间歇扫光（用 background-position，不动 transform，以免影响整列点击区） */
.btn-play:not(.is-disabled) {
    background-image: linear-gradient(105deg, transparent 38%, color-mix(in srgb, var(--paper) 30%, transparent) 50%, transparent 62%);
    background-size: 260% 100%;
    background-position: 130% 0;
    background-repeat: no-repeat;
    animation: shine 5.5s ease-in-out infinite;
}
.game-item:nth-child(2n) .btn-play { animation-delay: 0.6s; }
.game-item:nth-child(3n) .btn-play { animation-delay: 1.3s; }
@keyframes shine { 0%, 70% { background-position: 130% 0; } 85%, 100% { background-position: -30% 0; } }

/* 数字跳动时不让版面抖 */
.js-total, .js-fresh { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
    .fan img { animation: fadeIn 0.3s ease forwards; opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)); }
    .spin-badge { animation: none; }
    .game-item.reveal { transform: none; }
    .game-item.reveal.in { transition: opacity 0.3s ease; }
    .game-item.is-fresh .game-icon-wrapper::after { animation: none; }
    .btn-play:not(.is-disabled) { animation: none; background-image: none; }
}
.game-list.anim > .game-item.reveal { animation: none; }
