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

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    overflow: hidden;
    color: #fff;
}

/* 主菜单界面 */
#menu-screen, #help-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    z-index: 100;
}

.menu-container, .help-container {
    text-align: center;
    padding: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.5s ease;
}

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

.game-title {
    font-size: 4rem;
    margin-bottom: 15px;
    background: linear-gradient(45deg, #ffd700, #ff6b6b, #4ecdc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    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 30px rgba(255, 107, 107, 0.8)); }
}

.game-subtitle {
    font-size: 1.5rem;
    color: #aaa;
    margin-bottom: 40px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.menu-btn {
    padding: 18px 60px;
    font-size: 1.3rem;
    font-weight: bold;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.menu-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6);
}

.menu-btn:active {
    transform: translateY(0) scale(0.98);
}

.game-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.feature {
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.feature:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* 帮助界面 */
.help-container {
    max-width: 600px;
}

.help-container h2 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: #ffd700;
}

.help-content {
    text-align: left;
    margin-bottom: 30px;
}

.help-content h3 {
    font-size: 1.4rem;
    color: #4ecdc4;
    margin: 25px 0 15px;
}

.help-content p {
    font-size: 1.1rem;
    color: #ccc;
    margin: 10px 0;
    padding-left: 20px;
}

/* 游戏界面 */
#game-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #1a1a2e;
}

#game {
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    border-radius: 10px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

/* 暂停界面 */
#pause-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.pause-menu {
    text-align: center;
    padding: 50px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.pause-menu h2 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: #ffd700;
}

.pause-menu .menu-btn {
    display: block;
    width: 100%;
    margin: 15px 0;
}

/* 登录/注册界面 */
#auth-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    z-index: 100;
}

.auth-container {
    text-align: center;
    padding: 50px 60px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.5s ease;
    min-width: 400px;
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
}

.auth-tab {
    padding: 12px 40px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
}

.auth-tab:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.auth-tab.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.95rem;
    color: #aaa;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 14px 18px;
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    outline: none;
    transition: all 0.3s ease;
}

.form-group input:focus {
    border-color: #667eea;
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.3);
}

.form-group input::placeholder {
    color: #666;
}

.auth-btn {
    padding: 16px 40px;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: white;
    box-shadow: 0 8px 25px rgba(78, 205, 196, 0.4);
    margin-top: 10px;
}

.auth-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(78, 205, 196, 0.5);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-btn:disabled {
    background: #555;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.auth-error {
    color: #ff6b6b;
    font-size: 0.95rem;
    min-height: 24px;
    margin-top: 5px;
}

.auth-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    color: #aaa;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 用户信息栏 */
.user-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

#welcome-user {
    font-size: 1.1rem;
    color: #4ecdc4;
}

.logout-btn {
    padding: 8px 20px;
    font-size: 0.9rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.5);
}

.logout-btn:hover {
    background: rgba(255, 107, 107, 0.5);
    color: #fff;
}

/* 账号操作按钮 */
.account-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.danger-btn {
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.4);
}

.danger-btn:hover {
    background: rgba(255, 107, 107, 0.4);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 107, 107, 0.3);
}

.danger-btn.small {
    padding: 10px 18px;
    font-size: 0.85rem;
}

/* 确认对话框 */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 300;
    animation: fadeIn 0.2s ease;
}

.confirm-dialog {
    text-align: center;
    padding: 40px 50px;
    background: rgba(30, 30, 50, 0.98);
    border-radius: 20px;
    border: 2px solid rgba(255, 107, 107, 0.5);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 450px;
}

.confirm-dialog h3 {
    font-size: 1.6rem;
    color: #ff6b6b;
    margin-bottom: 15px;
}

.confirm-dialog p {
    font-size: 1rem;
    color: #ccc;
    margin-bottom: 25px;
    line-height: 1.6;
}

.confirm-dialog .warning {
    color: #f39c12;
    font-size: 0.9rem;
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(243, 156, 18, 0.1);
    border-radius: 8px;
}

.confirm-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.confirm-btn {
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.confirm-btn.cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.confirm-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.confirm-btn.danger {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
    box-shadow: 0 5px 20px rgba(231, 76, 60, 0.4);
}

.confirm-btn.danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(231, 76, 60, 0.5);
}
