* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html, body {
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
    touch-action: manipulation;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
}

.starry-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
    z-index: -1;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 2s infinite alternate;
}

@keyframes twinkle {
    0% {
        opacity: 0.3;
    }
    100% {
        opacity: 1;
    }
}

.game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    border: none;
    overflow: hidden;
}

.game-header {
    background: linear-gradient(to right, #4facfe, #00f2fe);
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #00d4ff;
    flex-shrink: 0;
}

.game-title {
    font-size: clamp(18px, 4vw, 28px);
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.game-title a{
    color: firebrick;
    text-shadow: 2px 2px 4px rgba(255, 223, 65, 0.3);
}

.stats {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.stat-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: clamp(12px, 3vw, 16px);
    font-weight: bold;
    white-space: nowrap;
}

.current-letter {
    background: #ff416c;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: clamp(14px, 3.5vw, 22px);
    font-weight: bold;
    min-width: 50px;
    text-align: center;
}

.game-canvas-container {
    position: relative;
    flex: 1;
    background: #87CEEB;
    overflow: hidden;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.ground {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background: linear-gradient(to bottom, #8B4513, #5D2906);
    z-index: 10;
    border-top: 2px solid #704214;
}

.controls {
    background: rgba(0, 0, 0, 0.85);
    padding: 8px 10px;
    color: #00f2fe;
    text-align: center;
    font-size: clamp(11px, 2.5vw, 15px);
    border-top: 2px solid #00d4ff;
    flex-shrink: 0;
}

.start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.97);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 200;
    color: white;
    gap: 30px;
}

.start-title {
    font-size: clamp(32px, 10vw, 60px);
    color: #4facfe;
    text-shadow: 0 0 30px rgba(79, 172, 254, 0.9);
}

.game-rules {
    background: rgba(255, 255, 255, 0.08);
    padding: 15px 20px;
    border-radius: 12px;
    width: 85%;
    max-width: 400px;
    text-align: center;
}

.game-rules p {
    margin: 6px 0;
    font-size: clamp(14px, 4vw, 16px);
}

.start-btn {
    background: linear-gradient(to right, #4facfe, #00f2fe);
    border: none;
    padding: 15px 40px;
    font-size: clamp(20px, 6vw, 28px);
    font-weight: bold;
    border-radius: 50px;
    color: white;
    cursor: pointer;
}

.game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    color: white;
    gap: 20px;
}

.game-over h2 {
    font-size: clamp(36px, 10vw, 60px);
    color: #ff416c;
}

.final-score {
    font-size: clamp(24px, 6vw, 36px);
}

.accuracy {
    font-size: clamp(18px, 4vw, 24px);
    color: #4facfe;
}

.game-over-buttons {
    display: flex;
    高度: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.restart-btn, .more-games-btn {
    background: linear-gradient(to right, #4facfe, #00f2fe);
    border: none;
    padding: 12px 25px;
    font-size: clamp(16px, 4vw, 20px);
    font-weight: bold;
    border-radius: 40px;
    color: white;
    cursor: pointer;
    text-decoration: none;
}

.more-games-btn {
    background: linear-gradient(to right, #ff416c, #ff6b6b);
}

.pause-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: clamp(36px, 10vw, 60px);
    font-weight: bold;
    text-shadow: 0 0 10px #000;
    display: none;
    z-index: 150;
}