:root {
    --bg: #1a1a2e;
    --bg-soft: #e8e4f0;
    --card-bg: rgba(255,255,255,0.92);
    --card-bg-hover: rgba(255,255,255,0.98);
    --text: #2d2d3f;
    --text-light: #5a5a72;
    --accent: #c44569;
    --accent-soft: #e77f8e;
    --gold: #d4a233;
    --gold-soft: #f0d078;
    --shadow: 0 8px 32px rgba(0,0,0,0.12);
    --shadow-hover: 0 16px 48px rgba(0,0,0,0.2);
    --border: rgba(0,0,0,0.06);
    --radius: 16px;
    --transition: 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: "Microsoft YaHei", "PingFang SC", sans-serif; }

body {
    background: linear-gradient(135deg, #f5f0eb 0%, #ede4f0 30%, #fce4ec 60%, #f5f0eb 100%);
    background-size: 400% 400%;
    animation: gradientShift 20s ease infinite;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    25% { background-position: 100% 0%; }
    50% { background-position: 100% 100%; }
    75% { background-position: 0% 100%; }
    100% { background-position: 0% 50%; }
}

/* ─── 浮动光球（增到8个） ─── */
.scene-overlay { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.fog { position: absolute; inset: 0; opacity: 0.3; pointer-events: none; }
.float-orb {
    position: absolute; border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(212,162,51,0.18), rgba(196,69,105,0.06));
    box-shadow: 0 0 60px rgba(212,162,51,0.1), inset 0 0 40px rgba(255,255,255,0.04);
    animation: floaty 7s ease-in-out infinite;
    mix-blend-mode: multiply;
}
.float-orb.small { width: 50px; height: 50px; }
.float-orb.medium { width: 90px; height: 90px; }
.float-orb.large { width: 140px; height: 140px; }
.float-orb.one   { left: 5%;  top: 15%; animation-delay: 0s; }
.float-orb.two   { left: 22%; top: 55%; animation-delay: 1.2s; }
.float-orb.three { left: 40%; top: 25%; animation-delay: 0.6s; }
.float-orb.four  { left: 60%; top: 65%; animation-delay: 2s; }
.float-orb.five  { left: 78%; top: 12%; animation-delay: 1.8s; }
.float-orb.six   { left: 15%; top: 80%; animation-delay: 3s; }
.float-orb.seven { left: 50%; top: 75%; animation-delay: 2.4s; }
.float-orb.eight { left: 88%; top: 45%; animation-delay: 0.9s; }

@keyframes floaty {
    0% { transform: translateY(0) scale(1) rotate(0deg); }
    33% { transform: translateY(-24px) scale(1.04) rotate(3deg); }
    66% { transform: translateY(8px) scale(0.96) rotate(-2deg); }
    100% { transform: translateY(0) scale(1) rotate(0deg); }
}

/* ─── 飘落粒子（保留作为背景微光） ─── */
.particles-container {
    position: fixed; inset: 0; pointer-events: none; z-index: 6; overflow: hidden;
}
.particle {
    position: absolute; width: 3px; height: 3px;
    background: var(--gold-soft); border-radius: 50%;
    animation: particleFall linear infinite;
    opacity: 0;
    box-shadow: 0 0 6px rgba(240,208,120,0.6);
}
@keyframes particleFall {
    0% { transform: translateY(-10vh) translateX(0); opacity: 0; }
    10% { opacity: 0.9; }
    90% { opacity: 0.4; }
    100% { transform: translateY(110vh) translateX(60px); opacity: 0; }
}

/* ─── emoji 流星雨 ─── */
@keyframes emojiRain {
    0%   { transform: translateY(0) translateX(0) rotate(0deg); opacity: 1; }
    80%  { opacity: 0.5; }
    100% { transform: translateY(120vh) translateX(var(--drift, 15vw)) rotate(360deg); opacity: 0; }
}
@keyframes emojiBurst {
    0%   { transform: translate(-50%,-50%) scale(0); opacity: 1; }
    50%  { opacity: 1; }
    100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.4); opacity: 0; }
}

/* ─── header ─── */
header {
    background: linear-gradient(135deg, rgba(26,26,46,0.85) 0%, rgba(55,25,50,0.8) 50%, rgba(26,26,46,0.85) 100%);
    padding: 2.5rem 2rem;
    text-align: center;
    position: relative; overflow: hidden;
    border-bottom: 2px solid rgba(212,162,51,0.3);
    box-shadow: 0 4px 40px rgba(0,0,0,0.3);
    z-index: 15;
    backdrop-filter: blur(10px);
}
header::before {
    content: ''; position: absolute; top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(ellipse, rgba(212,162,51,0.06) 0%, transparent 70%);
    animation: headerShine 8s linear infinite;
}
@keyframes headerShine { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.header-particles { position: absolute; inset: 0; pointer-events: none; opacity: 0.15; }

.title {
    font-size: 2.8rem; font-weight: 900; letter-spacing: 3px;
    color: var(--gold-soft);
    text-shadow: 0 0 20px rgba(212,162,51,0.5), 0 0 60px rgba(212,162,51,0.2), 0 2px 4px rgba(0,0,0,0.5);
    margin-bottom: 0.5rem;
    position: relative; z-index: 2;
    animation: titleGlow 3s ease-in-out infinite alternate;
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    -webkit-text-fill-color: initial !important;
}
@keyframes titleGlow {
    from { text-shadow: 0 0 20px rgba(212,162,51,0.5), 0 0 60px rgba(212,162,51,0.2), 0 2px 4px rgba(0,0,0,0.5); }
    to   { text-shadow: 0 0 35px rgba(240,208,120,0.7), 0 0 80px rgba(212,162,51,0.3), 0 2px 8px rgba(0,0,0,0.6); }
}

.subtitle {
    font-style: italic; font-size: 1.1rem;
    color: rgba(255,255,255,0.85);
    text-shadow: 0 0 12px rgba(255,255,255,0.3), 0 1px 3px rgba(0,0,0,0.6);
    position: relative; z-index: 2;
    animation: subGlow 4s ease-in-out infinite alternate;
    background: none !important;
    -webkit-background-clip: initial !important; background-clip: initial !important;
    -webkit-text-fill-color: initial !important;
}
@keyframes subGlow {
    from { text-shadow: 0 0 8px rgba(255,255,255,0.3), 0 1px 3px rgba(0,0,0,0.6); }
    to   { text-shadow: 0 0 20px rgba(255,255,255,0.5), 0 1px 5px rgba(0,0,0,0.7); }
}

.title .char, .subtitle .char {
    display: inline-block; position: relative;
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    -webkit-text-fill-color: initial !important;
}
.title .char { color: var(--gold-soft) !important; text-shadow: 0 0 10px rgba(212,162,51,0.6) !important; }
.subtitle .char { color: rgba(255,255,255,0.85) !important; text-shadow: 0 0 8px rgba(255,255,255,0.4) !important; }

@keyframes breath {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.06); opacity: 0.88; }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(1.5px); }
    75% { transform: translateX(-1.5px); }
}

/* ─── container & controls ─── */
.container { max-width: 1240px; margin: 0 auto; padding: 2rem; position: relative; z-index: 10; }

.controls {
    display: flex; justify-content: space-between; margin-bottom: 2.5rem;
    flex-wrap: wrap; gap: 1rem;
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(20px);
    padding: 1.5rem; border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: box-shadow var(--transition);
}
.controls:hover { box-shadow: var(--shadow-hover); }

.search-box { flex-grow: 1; max-width: 420px; position: relative; }
.search-box::after {
    content: '🔍'; position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    font-size: 1rem; pointer-events: none; opacity: 0.5;
}
.search-box input {
    width: 100%; padding: 0.85rem 2.5rem 0.85rem 1rem;
    border: 2px solid rgba(196,69,105,0.15);
    background: rgba(255,255,255,0.6);
    color: var(--text); border-radius: 12px;
    font-size: 1rem; outline: none;
    transition: all var(--transition);
}
.search-box input:focus {
    border-color: var(--accent);
    background: rgba(255,255,255,0.9);
    box-shadow: 0 0 0 4px rgba(196,69,105,0.08);
}

.filter-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.filter-btn {
    padding: 0.55rem 1.2rem;
    background: rgba(255,255,255,0.5);
    border: 1.5px solid rgba(196,69,105,0.12);
    color: var(--text-light); border-radius: 10px;
    cursor: pointer; font-size: 0.9rem; font-weight: 500;
    transition: all var(--transition);
    position: relative; overflow: hidden;
}
.filter-btn::after {
    content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, var(--accent), var(--accent-soft));
    opacity: 0; transition: opacity var(--transition); z-index: -1; border-radius: 10px;
}
.filter-btn.active, .filter-btn:hover {
    color: #fff; border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(196,69,105,0.2);
    transform: translateY(-2px);
}
.filter-btn.active::after, .filter-btn:hover::after { opacity: 1; }
.filter-btn.active { font-weight: 700; }

/* ─── game cards ─── */
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.75rem; }

.game-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all var(--transition);
    display: flex; flex-direction: column;
    border: 1px solid var(--border);
    position: relative;
    backdrop-filter: blur(10px);
}
.game-card::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(212,162,51,0.06), rgba(196,69,105,0.08), rgba(212,162,51,0.04));
    opacity: 0; transition: opacity 0.5s ease;
    pointer-events: none; z-index: 1; border-radius: var(--radius);
}
.game-card:hover { transform: translateY(-10px) scale(1.015); box-shadow: var(--shadow-hover); }
.game-card:hover::before { opacity: 1; }

.game-image {
    height: 190px; background: linear-gradient(135deg, #2d2d3f, #4a2545);
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
}
.game-image::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(26,26,46,0.7));
    z-index: 2;
}
.game-image img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.7s ease;
}
.game-card:hover .game-image img { transform: scale(1.08); }

.game-info {
    padding: 1.25rem 1.35rem;
    display: flex; flex-direction: column; gap: 0.6rem;
    flex-grow: 1; position: relative; z-index: 2;
}

.game-title {
    font-size: 1.15rem; font-weight: 700;
    color: var(--accent); letter-spacing: 0.5px;
}
.game-description { color: var(--text-light); font-size: 0.9rem; opacity: 0.85; }
.game-meta { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--text-light); opacity: 0.65; }

.play-btn {
    display: inline-block; text-align: center;
    padding: 0.75rem; margin-top: auto;
    background: linear-gradient(135deg, var(--accent), #a03555);
    color: #fff; text-decoration: none; border-radius: 10px;
    font-weight: 700; letter-spacing: 1px;
    transition: all var(--transition);
    position: relative; overflow: hidden;
}
.play-btn::after {
    content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}
.play-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(196,69,105,0.3); }
.play-btn:hover::after { left: 100%; }
.play-btn:active { transform: translateY(0); }

/* 卡片闪烁星点 */
.game-card .card-sparkle {
    position: absolute; width: 6px; height: 6px;
    background: var(--gold-soft); border-radius: 50%;
    pointer-events: none; z-index: 3;
    opacity: 0; animation: sparklePop 2s ease-out infinite;
}

@keyframes sparklePop {
    0% { transform: scale(0) translate(0, 0); opacity: 0; }
    30% { transform: scale(1) translate(0, 0); opacity: 1; }
    100% { transform: scale(0) translate(0, 30px); opacity: 0; }
}

.no-results {
    grid-column: 1 / -1; text-align: center; padding: 3rem;
    font-style: italic;
    background: rgba(255,255,255,0.5); border-radius: var(--radius);
    backdrop-filter: blur(10px);
}

/* ─── footer ─── */
footer {
    text-align: center; padding: 2rem;
    margin-top: 3rem;
    border-top: 1px solid rgba(0,0,0,0.06);
    color: var(--text-light); opacity: 0.7;
    font-size: 0.9rem;
    position: relative; z-index: 10;
}

/* ─── 路灯（保留原风格，提亮细节） ─── */
.street-light-left {
    position: fixed; left: 3%; bottom: 6%;
    width: 120px; height: 400px; z-index: 12; pointer-events: none;
}
.street-light-right {
    position: fixed; right: 3%; bottom: 6%;
    width: 120px; height: 400px; z-index: 12; pointer-events: none;
    transform: scaleX(-1);
}
.light-base {
    position: absolute; bottom: 0; width: 44px; height: 22px;
    background: linear-gradient(to right, #4a4a5a, #8a8a9a, #4a4a5a);
    border-radius: 6px; left: 38px;
}
.light-pole {
    position: absolute; bottom: 22px; left: 55px;
    width: 12px; height: 310px;
    background: linear-gradient(to right, #6a6a78, #a0a0b0, #6a6a78);
    border-radius: 6px;
    box-shadow: 0 0 16px rgba(212,162,51,0.25);
}
.light-arm {
    position: absolute; top: 50px; left: 55px;
    width: 65px; height: 12px;
    background: linear-gradient(to bottom, #5a5a6a, #8a8a9a);
    border-radius: 6px;
    transform-origin: left center; transform: rotate(-10deg);
}
.light-head {
    position: absolute; top: 40px; left: 115px;
    width: 34px; height: 44px;
    background: linear-gradient(to bottom, #5a5a6a, #8a8a9a);
    border-radius: 6px;
    display: flex; justify-content: center; align-items: flex-end;
    padding-bottom: 5px;
}
.light-glow {
    width: 28px; height: 28px;
    background: radial-gradient(circle, #ffffcc, #ffdd66, transparent 70%);
    border-radius: 50%; opacity: 0.75;
    animation: lightFlicker 3s infinite alternate;
    filter: blur(6px);
    box-shadow: 0 0 30px rgba(240,208,120,0.5), 0 0 60px rgba(212,162,51,0.3);
}
@keyframes lightFlicker {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 0.95; transform: scale(1.12); }
}
.rope {
    position: absolute; bottom: -62px; left: 50%; transform: translateX(-50%);
    width: 4px; height: 62px;
    background: linear-gradient(to bottom, #8B4513, #A0522D);
    border-radius: 2px;
}
.hanged-figure {
    position: absolute; bottom: -145px; left: 50%; transform: translateX(-50%);
    width: 64px; height: 85px;
    background: linear-gradient(135deg, #9b2d30, #c44569);
    border-radius: 32px 32px 10px 10px;
    display: flex; justify-content: center; align-items: center;
    color: #fff; font-size: 0.7rem; font-weight: bold; text-align: center;
    box-shadow: 0 6px 20px rgba(0,0,0,0.5), 0 0 20px rgba(196,69,105,0.2);
    animation: hanging 5s ease-in-out infinite; z-index: 10;
}
.hanged-figure::before {
    content: ''; position: absolute; top: -5px; left: 50%; transform: translateX(-50%);
    width: 22px; height: 12px; background: #8B4513; border-radius: 10px 10px 0 0;
}
.hanged-figure::after {
    content: ''; position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
    width: 33px; height: 33px; background: #9b2d30; border-radius: 50%; z-index: -1;
}
.street-light-right .hanged-figure {
    animation: hangingRight 5s ease-in-out infinite;
    transform: translateX(-50%) scaleX(-1);
}
@keyframes hanging {
    0%, 100% { transform: translateX(-50%) rotate(-6deg); }
    50% { transform: translateX(-50%) rotate(6deg); }
}
@keyframes hangingRight {
    0%, 100% { transform: translateX(-50%) scaleX(-1) rotate(-6deg); }
    50% { transform: translateX(-50%) scaleX(-1) rotate(6deg); }
}

/* ─── 响应式 ─── */
@media (max-width: 768px) {
    .controls { flex-direction: column; }
    .search-box { max-width: 100%; }
    .games-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
    .title { font-size: 2.2rem; }
    .street-light-left, .street-light-right { width: 80px; height: 300px; }
    .light-pole { height: 220px; }
    .hanged-figure { width: 50px; height: 70px; font-size: 0.6rem; bottom: -125px; }
}
@media (max-width: 480px) {
    .games-grid { grid-template-columns: 1fr; }
    .title { font-size: 1.7rem; line-height: 1.2; white-space: normal; }
    .container { padding: 1rem; }
}