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

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1452 50%, #2d1b69 100%);
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
    position: relative;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

/* 星空背景动画 */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.stars::before,
.stars::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    background: #fff;
    box-shadow: 
        100px 200px #fff, 300px 100px #fff, 500px 300px #fff,
        700px 150px #fff, 200px 400px #fff, 600px 500px #fff,
        150px 50px #fff, 450px 250px #fff, 800px 400px #fff,
        250px 150px #fff, 550px 50px #fff, 350px 450px #fff,
        650px 200px #fff, 50px 350px #fff, 750px 100px #fff,
        400px 350px #fff, 100px 500px #fff, 500px 150px #fff,
        200px 250px #fff, 600px 350px #fff, 300px 500px #fff,
        700px 250px #fff, 150px 150px #fff, 450px 450px #fff,
        550px 400px #fff, 250px 50px #fff, 350px 200px #fff,
        50px 100px #fff, 650px 450px #fff, 750px 300px #fff;
    animation: sparkle 3s infinite ease-in-out alternate;
}

.stars::after {
    width: 1px;
    height: 1px;
    box-shadow: 
        120px 180px #fff, 320px 120px #fff, 520px 320px #fff,
        720px 170px #fff, 220px 420px #fff, 620px 520px #fff,
        170px 70px #fff, 470px 270px #fff, 770px 420px #fff,
        270px 170px #fff, 570px 70px #fff, 370px 470px #fff,
        670px 220px #fff, 70px 370px #fff, 770px 120px #fff;
    animation: sparkle 4s infinite ease-in-out alternate;
}

@keyframes sparkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

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

/* 头部样式 */
.game-header {
    text-align: center;
    margin-bottom: 20px;
    animation: fadeInDown 1s ease-out;
}

.game-header h1 {
    font-size: 2.5em;
    font-weight: 700;
    background: linear-gradient(45deg, #ffd700, #ffed4e, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    margin-bottom: 10px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5)); }
    to { filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8)); }
}

.subtitle {
    font-size: 1em;
    color: #b8c5ff;
    font-weight: 400;
}

.game-features {
    font-size: 0.9em;
    color: #9fd3ff;
    margin: 10px 0;
    font-weight: 500;
}

/* 游戏信息卡片 */
.game-info {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    animation: fadeIn 1s ease-out 0.3s both;
    flex-wrap: wrap;
}

.info-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    padding: 12px 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, border-color 0.3s ease;
    min-width: 100px;
}

.info-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 215, 0, 0.6);
}

.info-card .label {
    font-size: 0.85em;
    color: #b8c5ff;
    font-weight: 400;
}

.info-card .value {
    font-size: 1.8em;
    font-weight: 700;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.combo-value {
    transition: all 0.3s ease;
}

.combo-value.combo-active {
    color: #ff00ff;
    text-shadow: 0 0 15px rgba(255, 0, 255, 0.8);
    transform: scale(1.2);
}

/* 游戏容器 */
.game-container {
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 215, 0, 0.2);
    margin-bottom: 20px;
    animation: fadeIn 1s ease-out 0.6s both;
}

#gameCanvas {
    display: block;
    margin: 0 auto;
    background: rgba(10, 14, 39, 0.8);
    border-radius: 10px;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
    max-width: 100%;
    height: auto;
}

/* 技能栏 */
.skills-bar {
    display: none;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.skills-bar.mobile {
    gap: 10px;
}

.skill-item {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(100, 181, 246, 0.5);
    border-radius: 12px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 80px;
    overflow: hidden;
}

.skill-item:hover {
    transform: translateY(-3px);
    border-color: rgba(100, 181, 246, 0.9);
    box-shadow: 0 5px 20px rgba(100, 181, 246, 0.5);
}

.skill-item i {
    font-size: 1.8em;
    color: #64b5f6;
}

.skill-name {
    font-size: 0.85em;
    color: #b8c5ff;
    font-weight: 500;
}

.skill-key {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 215, 0, 0.3);
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 0.7em;
    color: #ffd700;
    font-weight: 700;
}

.cooldown-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0%;
    background: rgba(0, 0, 0, 0.7);
    transition: height 0.1s linear;
    pointer-events: none;
}

/* 移动端控制 */
.mobile-controls {
    display: none;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    gap: 20px;
}

.joystick-container {
    position: relative;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid rgba(255, 215, 0, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.joystick {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #64b5f6, #2196f3);
    border-radius: 50%;
    box-shadow: 0 3px 10px rgba(33, 150, 243, 0.5);
    transition: transform 0.1s ease;
    pointer-events: none;
}

.mobile-skills {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-skill-btn {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(100, 181, 246, 0.5);
    border-radius: 12px;
    color: #64b5f6;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-skill-btn:active {
    transform: scale(0.95);
    background: rgba(100, 181, 246, 0.3);
}

/* 游戏遮罩层 */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    z-index: 10;
}

.game-overlay.hidden {
    display: none;
}

.game-over-overlay {
    background: rgba(26, 20, 82, 0.98);
}

.overlay-content {
    text-align: center;
    padding: 30px;
    animation: bounceIn 0.8s ease-out;
    max-width: 90%;
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

.overlay-content h2 {
    font-size: 2em;
    margin-bottom: 15px;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

.overlay-content p {
    font-size: 1em;
    margin-bottom: 12px;
    color: #b8c5ff;
    line-height: 1.6;
}

.tip {
    font-size: 0.9em !important;
    color: #8a9bdc !important;
    font-style: italic;
}

.final-score {
    font-size: 1.4em !important;
    font-weight: 700;
    color: #ffd700 !important;
    margin: 15px 0 !important;
}

.message {
    font-size: 1em !important;
    color: #9fd3ff !important;
    margin-bottom: 20px !important;
    white-space: pre-line;
}

/* 按钮样式 */
.start-btn {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #0a0e27;
    border: none;
    padding: 15px 45px;
    font-size: 1.2em;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 25px rgba(255, 215, 0, 0.4);
    font-family: 'Noto Sans SC', sans-serif;
}

.start-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 35px rgba(255, 215, 0, 0.6);
}

.start-btn:active {
    transform: translateY(-1px) scale(1.02);
}

/* 功能展示区 */
.game-features-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    animation: fadeIn 1s ease-out 0.9s both;
}

.feature-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    border: 2px solid rgba(255, 215, 0, 0.2);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 215, 0, 0.4);
}

.feature-card h3 {
    color: #ffd700;
    font-size: 1.3em;
    margin-bottom: 15px;
    text-align: center;
}

.feature-card ul {
    list-style: none;
    color: #b8c5ff;
    font-size: 0.95em;
    line-height: 2;
}

.feature-card li {
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.feature-card li:last-child {
    border-bottom: none;
}

.star-type {
    display: inline-block;
    margin-right: 8px;
}

.star-type.gold { color: #FFD700; }
.star-type.rainbow { 
    background: linear-gradient(90deg, #FF0000, #FF7F00, #FFFF00, #00FF00, #0000FF, #4B0082, #9400D3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.star-type.speed { color: #00FFFF; }
.star-type.bomb { color: #FF0000; }

/* 页脚 */
.game-footer {
    text-align: center;
    padding: 20px;
    color: #8a9bdc;
    animation: fadeIn 1s ease-out 1.2s both;
}

.game-footer p {
    margin: 5px 0;
    font-size: 0.95em;
}

.author {
    font-size: 0.85em;
    color: #6a7bbc;
    font-style: italic;
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .game-header h1 {
        font-size: 1.8em;
    }

    .subtitle {
        font-size: 0.9em;
    }

    .game-features {
        font-size: 0.8em;
    }

    .game-info {
        gap: 10px;
    }

    .info-card {
        padding: 10px 18px;
        min-width: 85px;
    }

    .info-card .label {
        font-size: 0.75em;
    }

    .info-card .value {
        font-size: 1.5em;
    }

    .game-container {
        padding: 15px;
    }

    .skills-bar {
        gap: 10px;
        margin-top: 15px;
    }

    .skill-item {
        padding: 12px 15px;
        min-width: 70px;
    }

    .skill-item i {
        font-size: 1.5em;
    }

    .skill-name {
        font-size: 0.75em;
    }

    .skill-key {
        display: none;
    }

    .overlay-content {
        padding: 20px;
    }

    .overlay-content h2 {
        font-size: 1.6em;
    }

    .overlay-content p {
        font-size: 0.9em;
    }

    .start-btn {
        padding: 12px 35px;
        font-size: 1.1em;
    }

    .game-features-section {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .feature-card {
        padding: 15px;
    }

    .feature-card h3 {
        font-size: 1.1em;
    }

    .feature-card ul {
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    .game-header h1 {
        font-size: 1.5em;
    }

    .subtitle {
        font-size: 0.85em;
    }

    .game-info {
        flex-wrap: wrap;
    }

    .info-card {
        flex: 1 1 calc(50% - 10px);
        min-width: 0;
    }

    .info-card .value {
        font-size: 1.3em;
    }

    .skills-bar {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .skill-item {
        min-width: 60px;
        padding: 10px 12px;
        flex-shrink: 0;
    }

    .skill-item i {
        font-size: 1.3em;
    }

    .skill-name {
        font-size: 0.7em;
    }

    .joystick-container {
        width: 100px;
        height: 100px;
    }

    .joystick {
        width: 40px;
        height: 40px;
    }

    .mobile-skill-btn {
        width: 50px;
        height: 50px;
        font-size: 1.3em;
    }

    .overlay-content h2 {
        font-size: 1.4em;
    }

    .start-btn {
        padding: 10px 30px;
        font-size: 1em;
    }
}

/* 横屏优化 */
@media (max-height: 600px) and (orientation: landscape) {
    .container {
        max-width: 100%;
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .game-header {
        width: 100%;
        margin-bottom: 10px;
    }

    .game-header h1 {
        font-size: 1.5em;
    }

    .subtitle {
        display: none;
    }

    .game-info {
        order: 2;
        flex: 1;
        flex-direction: column;
        margin: 0 10px;
    }

    .game-container {
        order: 1;
        flex: 2;
        margin: 0;
    }

    .skills-bar {
        order: 3;
        flex: 1;
        flex-direction: column;
        margin: 0 10px;
    }

    .game-features-section,
    .game-footer {
        display: none;
    }
}

/* 触摸反馈 */
@media (hover: none) {
    .skill-item:active,
    .info-card:active,
    .feature-card:active {
        transform: scale(0.95);
    }
}

/* 减少动画（尊重用户偏好）*/
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
