/* ============================================
   XPuzzle Game - 基础样式（重置、背景、通用面板、响应式）
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ---------- 动画 ---------- */
@keyframes bgShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes floatUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

@keyframes titleGlow {
    0%, 100% { text-shadow: 0 2px 4px rgba(120, 60, 20, .35); }
    50%      { text-shadow: 0 2px 8px rgba(200, 100, 40, .6); }
}

@keyframes pulseBadge {
    0%, 100% { transform: scale(1);    opacity: 1;  }
    50%      { transform: scale(1.08); opacity: .85; }
}

@keyframes shine {
    0%   { transform: translateX(-120%) skewX(-20deg); }
    100% { transform: translateX(220%)  skewX(-20deg); }
}

@keyframes ringPulse {
    0%   { box-shadow: 0 0 0 0 rgba(161, 92, 26, .55); }
    100% { box-shadow: 0 0 0 14px rgba(161, 92, 26, 0); }
}

/* ---------- 页面背景 ---------- */
body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
    color: #3a2416;
    line-height: 1.6;
    min-height: 100vh;
    background: linear-gradient(-45deg, #fef3c7, #fde68a, #fcd9a5, #fbeacb);
    background-size: 400% 400%;
    animation: bgShift 18s ease infinite;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(2px 2px at 20% 30%, rgba(180, 120, 60, .35), transparent),
        radial-gradient(1px 1px at 60% 70%, rgba(180, 120, 60, .3), transparent),
        radial-gradient(1.5px 1.5px at 80% 20%, rgba(180, 120, 60, .25), transparent),
        radial-gradient(1px 1px at 35% 85%, rgba(180, 120, 60, .25), transparent),
        radial-gradient(1.5px 1.5px at 90% 60%, rgba(180, 120, 60, .2), transparent);
    background-size: 800px 800px;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* ---------- 顶部标题 ---------- */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 24px 0;
    background: linear-gradient(135deg, rgba(251, 191, 36, .95) 0%, rgba(234, 88, 12, .9) 100%);
    border: 1px solid rgba(120, 60, 20, .25);
    border-radius: 16px;
    box-shadow:
        0 8px 30px rgba(180, 100, 30, .35),
        inset 0 1px 0 rgba(255, 255, 255, .4);
    position: relative;
    overflow: hidden;
}

header::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 40%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,.35), transparent);
    animation: shine 5s ease-in-out infinite;
}

h1 {
    font-size: 2.8em;
    letter-spacing: 3px;
    font-weight: 900;
    color: #fff8ec;
    text-shadow: 0 2px 4px rgba(120, 60, 20, .5);
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ---------- 通用面板 ---------- */
.screen {
    width: 100%;
    max-width: 820px;
    background: linear-gradient(160deg, rgba(255, 249, 231, .95) 0%, rgba(250, 235, 200, .95) 100%);
    border: 1px solid rgba(180, 120, 60, .35);
    border-radius: 18px;
    padding: 32px;
    box-shadow:
        0 10px 40px rgba(180, 100, 30, .25),
        inset 0 1px 0 rgba(255, 255, 255, .6);
    margin-bottom: 30px;
    text-align: center;
    backdrop-filter: blur(6px);
    animation: floatUp .4s ease-out;
}

.hidden { display: none !important; }

.section-title {
    font-size: 1.5em;
    font-weight: 800;
    color: #a15c1a;
    letter-spacing: 4px;
    margin: 10px 0 22px;
    text-shadow: 0 1px 2px rgba(255, 220, 160, .8);
}

.section-title::before,
.section-title::after {
    content: "";
    display: inline-block;
    width: 40px;
    height: 2px;
    vertical-align: middle;
    margin: 0 14px;
    background: linear-gradient(90deg, transparent, #a15c1a, transparent);
}

/* ---------- 响应式（通用） ---------- */
@media (max-width: 640px) {
    h1 { font-size: 2em; letter-spacing: 2px; }
    .screen { padding: 20px; }
}