* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

#app {
    width: 100%;
    height: 100%;
    position: relative;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
}

#canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: pointer;
}

/* 开始界面 */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.5s ease;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.content {
    text-align: center;
    color: white;
    padding: 2rem;
}

.content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 3s ease infinite;
}

.content p {
    font-size: 1rem;
    margin-bottom: 2rem;
    opacity: 0.8;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* 按钮样式 */
.btn-primary {
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
    border: none;
    border-radius: 50px;
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:active {
    transform: scale(0.95);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* 控制面板 */
#controls {
    position: absolute;
    top: 1rem;
    left: 0;
    right: 0;
    padding: 0 1rem;
    z-index: 50;
    transition: opacity 0.3s ease;
}

#controls.hidden {
    opacity: 0;
    pointer-events: none;
}

.control-row {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.control-row:last-child {
    margin-bottom: 0;
}

.btn-control {
    padding: 0.5rem 0.8rem;
    font-size: 0.75rem;
    min-width: 70px;
    border: none;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    text-align: center;
    line-height: 1.2;
}

.btn-control:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.25);
}

/* Responsive adjustments for small screens */
@media (max-width: 400px) {
    .btn-control {
        font-size: 0.7rem;
        padding: 0.4rem 0.6rem;
        min-width: 60px;
    }
    
    .control-row {
        gap: 0.3rem;
    }
}

/* Score Display */
#score-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 2rem;
    z-index: 40;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#score-display.hidden {
    opacity: 0;
}

.score-item {
    text-align: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    border-radius: 15px;
    color: white;
}

#score-value {
    font-size: 3rem;
    font-weight: bold;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.score-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 0.5rem;
}

#combo-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffd93d;
    text-shadow: 0 0 10px rgba(255, 217, 61, 0.5);
}

/* 提示信息 */
#hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.8rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    color: white;
    font-size: 0.9rem;
    z-index: 50;
    transition: opacity 0.3s ease;
    animation: float 2s ease-in-out infinite;
}

#hint.hidden {
    opacity: 0;
    pointer-events: none;
}

@keyframes float {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

/* Footer */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 1rem;
    z-index: 40;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.footer-links span {
    color: rgba(255, 255, 255, 0.4);
}

.footer-copyright {
    line-height: 1.6;
}

.footer-copyright p {
    margin: 0.25rem 0;
    color: rgba(255, 255, 255, 0.6);
}

.footer-email a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}

.footer-email a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Adjust hint position to avoid footer overlap */
#hint {
    bottom: 7rem;
}
