@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

:root {
    --primary: #00f0ff;
    --secondary: #ff00aa;
    --accent: #ffdd00;
    --bg-dark: #0a0a1a;
    --bg-card: rgba(20, 20, 40, 0.8);
    --text: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);
}

body {
    background: var(--bg-dark);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Orbitron', -apple-system, sans-serif;
    overflow: hidden;
    touch-action: manipulation;
    position: relative;
}

.bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0;
    animation: float 15s infinite ease-in-out;
    transform: translateY(100vh);
}

@keyframes float {
    0%, 100% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 0.3; }
    90% { opacity: 0.3; }
    100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}

.game-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 420px;
    height: 100vh;
    height: 100dvh;
    padding: env(safe-area-inset-top) 10px env(safe-area-inset-bottom);
}

.game-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 5px;
    flex-shrink: 0;
}

.header-stats {
    display: flex;
    gap: 16px;
}

.header-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.header-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    margin-top: 10px;
}

.next-preview-header {
    gap: 4px;
}

.next-preview-header #next-canvas {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-title {
    font-size: 14px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

.back-btn {
    background: linear-gradient(145deg, rgba(30, 30, 60, 0.9), rgba(20, 20, 40, 0.9));
    border: 1px solid rgba(0, 240, 255, 0.4);
    color: var(--primary);
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    cursor: pointer;
    box-shadow: 
        0 2px 10px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
}

.back-btn:active {
    transform: scale(0.95);
    border-color: var(--primary);
    box-shadow: 
        0 0 20px rgba(0, 240, 255, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.game-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
    padding: 5px 0;
}

.game-board-container {
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.game-board-frame {
    position: relative;
    padding: 3px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    box-shadow: 
        0 0 30px rgba(0, 240, 255, 0.3),
        0 0 60px rgba(255, 0, 170, 0.2),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
    max-width: 100%;
}

#game-canvas {
    display: block;
    background: var(--bg-dark);
    border-radius: 9px;
    max-width: 100%;
    height: auto;
}

.game-over-overlay {
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    background: rgba(10, 10, 26, 0.95);
    border-radius: 9px;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.game-over-title {
    font-size: 22px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--secondary), #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.final-stats {
    text-align: center;
    margin-bottom: 20px;
}

.final-score-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.final-score-value {
    font-size: 36px;
    font-weight: 900;
    color: var(--accent);
}

.restart-btn {
    background: linear-gradient(135deg, var(--primary), #00a8ff);
    border: none;
    color: var(--bg-dark);
    padding: 12px 35px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 2px;
    box-shadow: 0 5px 25px rgba(0, 240, 255, 0.4);
    transition: all 0.3s ease;
}

.restart-btn:active {
    transform: scale(0.95);
}

.controls {
    width: 100%;
    flex-shrink: 0;
    padding: 5px 0;
}

.control-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.control-btn {
    border: none;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    transition: all 0.15s ease;
    position: relative;
    overflow: hidden;
}

.control-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
    border-radius: inherit;
}

.control-btn:active {
    transform: scale(0.9);
}

.btn-direction {
    width: 58px;
    height: 58px;
    background: linear-gradient(145deg, #2a2a4a, #1a1a3a);
    color: var(--text);
    font-size: 20px;
    border-radius: 12px;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-direction:active {
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.4),
        inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.arrow-left {
    display: block;
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-right: 17px solid var(--text);
    margin-left: -5px;
}

.arrow-right {
    display: block;
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 17px solid var(--text);
    margin-left: 5px;
}

.arrow-down {
    display: block;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 17px solid var(--text);
    margin-top: 5px;
}

.btn-action {
    width: 62px;
    height: 62px;
    font-size: 22px;
    border-radius: 15px;
}

.btn-rotate {
    background: linear-gradient(145deg, #ff8800, #cc6600);
    color: var(--text);
    border-radius: 50%;
    box-shadow: 
        0 4px 20px rgba(255, 136, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-drop {
    background: linear-gradient(145deg, #ffdd00, #ccaa00);
    color: var(--bg-dark);
    font-size: 13px;
    font-weight: 700;
    box-shadow: 
        0 4px 20px rgba(255, 221, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-pause {
    display: none;
    width: 60px;
    height: 36px;
    border-radius: 18px;
    background: linear-gradient(145deg, #3a3a5a, #2a2a4a);
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.start-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 26, 0.98);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(20px);
}

.back-to-menu-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: linear-gradient(145deg, rgba(30, 30, 60, 0.9), rgba(20, 20, 40, 0.9));
    border: 1px solid rgba(0, 240, 255, 0.4);
    color: var(--primary);
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    cursor: pointer;
    box-shadow: 
        0 2px 10px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.back-to-menu-btn:active {
    transform: scale(0.95);
    border-color: var(--primary);
    box-shadow: 
        0 0 20px rgba(0, 240, 255, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.start-logo {
    margin-bottom: 12px;
}

.start-title {
    font-size: 35px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 5px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { filter: drop-shadow(0 0 12px rgba(0, 240, 255, 0.5)); }
    to { filter: drop-shadow(0 0 25px rgba(255, 0, 170, 0.5)); }
}

.start-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    letter-spacing: 4px;
    margin-bottom: 50px;
}

.start-btn {
    cursor: pointer;
    position: relative;
    overflow: visible;
    transform: none;
}

.btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 12rem;
    overflow: hidden;
    height: 3.5rem;
    background-size: 300% 300%;
    cursor: pointer;
    backdrop-filter: blur(1rem);
    border-radius: 5rem;
    transition: 0.5s;
    animation: gradient_301 5s ease infinite;
    border: double 4px transparent;
    background-image: linear-gradient(#212121, #212121),
        linear-gradient(
            137.48deg,
            #ffdb3b 10%,
            #fe53bb 45%,
            #8f51ea 67%,
            #0044ff 87%
        );
    background-origin: border-box;
    background-clip: content-box, border-box;
}

#container-stars {
    position: absolute;
    z-index: -1;
    width: 100%;
    height: 100%;
    overflow: hidden;
    transition: 0.5s;
    backdrop-filter: blur(1rem);
    border-radius: 5rem;
}

.btn strong {
    z-index: 2;
    font-family: 'Orbitron', -apple-system, sans-serif;
    font-size: 12px;
    letter-spacing: 5px;
    color: #ffffff;
    text-shadow: 0 0 4px white;
    font-weight: 700;
}

#glow {
    position: absolute;
    display: flex;
    width: 12rem;
}

.circle {
    width: 100%;
    height: 30px;
    filter: blur(2rem);
    animation: pulse_3011 4s infinite;
    z-index: -1;
}

.circle:nth-of-type(1) {
    background: rgba(254, 83, 186, 0.636);
}

.circle:nth-of-type(2) {
    background: rgba(142, 81, 234, 0.704);
}

.btn:hover #container-stars {
    z-index: 1;
    background-color: #212121;
}

.btn:hover {
    transform: scale(1.1);
}

.btn:active {
    border: double 4px #fe53bb;
    background-origin: border-box;
    background-clip: content-box, border-box;
    animation: none;
}

.btn:active .circle {
    background: #fe53bb;
}

#stars {
    position: relative;
    background: transparent;
    width: 200rem;
    height: 200rem;
}

#stars::after {
    content: "";
    position: absolute;
    top: -10rem;
    left: -100rem;
    width: 100%;
    height: 100%;
    animation: animStarRotate 90s linear infinite;
}

#stars::after {
    background-image: radial-gradient(#ffffff 1px, transparent 1%);
    background-size: 50px 50px;
}

#stars::before {
    content: "";
    position: absolute;
    top: 0;
    left: -50%;
    width: 170%;
    height: 500%;
    animation: animStar 60s linear infinite;
}

#stars::before {
    background-image: radial-gradient(#ffffff 1px, transparent 1%);
    background-size: 50px 50px;
    opacity: 0.5;
}

@keyframes animStar {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-135rem);
    }
}

@keyframes animStarRotate {
    from {
        transform: rotate(360deg);
    }

    to {
        transform: rotate(0);
    }
}

@keyframes gradient_301 {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes pulse_3011 {
    0% {
        transform: scale(0.75);
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(0, 0, 0, 0);
    }

    100% {
        transform: scale(0.75);
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
    }
}

.instructions {
    margin-top: 50px;
    text-align: center;
}

.instruction-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 12px 0;
    color: var(--text-muted);
    font-size: 15px;
}

.instruction-keys {
    display: flex;
    gap: 8px;
}

.instruction-btn {
    width: 44px !important;
    height: 44px !important;
    cursor: default !important;
    pointer-events: none;
}

.instruction-btn.btn-rotate {
    background: linear-gradient(145deg, #2a2a4a, #1a1a3a) !important;
    color: var(--text) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 15px !important;
    position: relative;
}

.instructions .instruction-btn::before {
    display: none !important;
}

.instruction-btn.btn-action {
    width: 48px !important;
    height: 48px !important;
    font-size: 18px !important;
}

.combo-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    font-weight: 900;
    pointer-events: none;
    z-index: 50;
    opacity: 0;
}

.combo-popup.show {
    animation: comboAnim 0.8s ease-out forwards;
}

@keyframes comboAnim {
    0% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(0.5);
    }
    50% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% { 
        opacity: 0; 
        transform: translate(-50%, -50%) scale(1) translateY(-50px);
    }
}

.line-clear-effect {
    position: absolute;
    left: 0;
    right: 0;
    height: 0;
    background: linear-gradient(90deg, transparent, var(--primary), var(--secondary), var(--primary), transparent);
    pointer-events: none;
    opacity: 0;
}

.line-clear-effect.animate {
    animation: lineClear 0.3s ease-out forwards;
}

@keyframes lineClear {
    0% { 
        opacity: 1;
        height: 100%;
    }
    100% { 
        opacity: 0;
        height: 0;
    }
}

/* ==================== 联机按钮样式 ==================== */
.online-btn {
    margin-top: 20px;
    background: linear-gradient(145deg, rgba(20, 20, 50, 0.9), rgba(30, 30, 70, 0.9));
    border: 2px solid rgba(0, 240, 255, 0.5);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.online-btn:hover {
    border-color: var(--primary);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.4);
    transform: scale(1.05);
}

.online-btn:active {
    transform: scale(0.98);
}

.online-btn strong {
    font-family: 'Orbitron', -apple-system, sans-serif;
    font-size: 12px;
    letter-spacing: 3px;
}

/* ==================== 模态框基础样式 ==================== */
.online-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.online-modal.active {
    display: flex;
    opacity: 1;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 20, 0.85);
    backdrop-filter: blur(10px);
}

.modal-container {
    position: relative;
    background: linear-gradient(180deg, rgba(25, 25, 55, 0.98), rgba(15, 15, 40, 0.98));
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    padding: 0;
    box-shadow: 
        0 0 50px rgba(0, 240, 255, 0.2),
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.online-modal.active .modal-container {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0, 240, 255, 0.2);
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

.modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 100, 100, 0.2);
    color: #ff6b6b;
}

.modal-content {
    padding: 24px;
}

/* ==================== 联机选项卡片 ==================== */
.online-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.online-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.online-option:hover {
    background: rgba(0, 240, 255, 0.1);
    border-color: rgba(0, 240, 255, 0.4);
    transform: translateX(5px);
}

.online-option:active {
    transform: translateX(2px) scale(0.98);
}

.option-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.create-icon {
    background: linear-gradient(135deg, #00f0ff33, #00f0ff11);
    color: var(--primary);
    border: 1px solid rgba(0, 240, 255, 0.3);
}

.join-icon {
    background: linear-gradient(135deg, #ff00aa33, #ff00aa11);
    color: var(--secondary);
    border: 1px solid rgba(255, 0, 170, 0.3);
}

.option-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.option-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 1px;
}

.option-desc {
    font-size: 13px;
    color: var(--text-muted);
}

/* ==================== 加入房间输入 ==================== */
.join-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.room-input-inline {
    width: 100%;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 0, 170, 0.3);
    border-radius: 12px;
    color: var(--text);
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    letter-spacing: 6px;
    text-align: center;
    text-transform: uppercase;
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box;
}

.room-input-inline::placeholder {
    font-size: 13px;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.3);
    text-transform: none;
}

.room-input-inline:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 20px rgba(255, 0, 170, 0.3);
}

.join-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--secondary), #cc0088);
    border: none;
    border-radius: 12px;
    color: var(--text);
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    width: 100%;
}

.join-btn:hover {
    box-shadow: 0 5px 30px rgba(255, 0, 170, 0.5);
    transform: translateY(-2px);
}

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

/* ==================== 房间等待界面 ==================== */
.room-waiting {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: rgba(10, 10, 26, 0.98);
    z-index: 500;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    padding-top: max(20px, env(safe-area-inset-top));
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
}

.room-waiting.active {
    display: flex;
}

.room-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 50px;
}

.back-to-online-btn {
    position: fixed;
    top: max(20px, env(safe-area-inset-top));
    left: max(20px, env(safe-area-inset-left));
    background: linear-gradient(145deg, rgba(30, 30, 60, 0.9), rgba(20, 20, 40, 0.9));
    border: 1px solid rgba(0, 240, 255, 0.4);
    color: var(--primary);
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 10;
}

.back-to-online-btn:hover {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

.room-header {
    text-align: center;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.room-header-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.room-title {
    font-size: 28px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 4px;
    margin-bottom: 20px;
    animation: glow 2s ease-in-out infinite alternate;
}

.room-code-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(0, 240, 255, 0.3);
    border-radius: 16px;
}

.room-code-label {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 2px;
}

.room-code-value {
    font-size: 28px;
    font-weight: 900;
    color: var(--accent);
    letter-spacing: 8px;
    text-shadow: 0 0 20px rgba(255, 221, 0, 0.5);
}

.copy-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: rgba(0, 240, 255, 0.2);
    color: var(--primary);
}

.time-select {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(0, 240, 255, 0.3);
    border-radius: 16px;
    position: relative;
}

.time-label {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 2px;
}

.time-dropdown {
    position: relative;
}

.time-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.time-dropdown-btn span {
    font-size: 13px;
    white-space: nowrap;
}

.time-dropdown-btn:hover {
    background: rgba(0, 240, 255, 0.2);
    border-color: var(--primary);
}

.time-dropdown-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.time-dropdown-value {
    flex: 1;
    text-align: center;
    white-space: nowrap;
}

.dropdown-arrow {
    transition: transform 0.2s ease;
}

.time-dropdown-btn.open .dropdown-arrow {
    transform: rotate(180deg);
}

.time-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(20, 20, 40, 0.98);
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 8px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 100;
    min-width: 90px;
}

.time-dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.time-option {
    padding: 10px 16px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-size: 13px;
}

.time-option:hover {
    background: rgba(0, 240, 255, 0.2);
    color: var(--text);
}

.time-option.active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #000;
    font-weight: 600;
}

.time-option:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== 玩家卡片区域 ==================== */
.players-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    width: 100%;
}

.player-card {
    flex: 1;
    max-width: 180px;
    background: rgba(20, 20, 50, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.player-card.host-card {
    border-color: rgba(0, 240, 255, 0.3);
}

.player-card.challenger-card {
    border-color: rgba(255, 0, 170, 0.3);
}

.player-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
}

.player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.avatar-placeholder.waiting {
    border: 2px dashed rgba(255, 255, 255, 0.3);
    animation: pulse-waiting 2s ease-in-out infinite;
}

@keyframes pulse-waiting {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.player-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.player-nickname {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-tag {
    font-size: 10px;
    padding: 4px 10px;
    border-radius: 10px;
    letter-spacing: 1px;
}

.host-tag {
    background: rgba(0, 240, 255, 0.2);
    color: var(--primary);
}

.challenger-tag {
    background: rgba(255, 0, 170, 0.2);
    color: var(--secondary);
}

.player-status {
    font-size: 11px;
    padding: 6px 14px;
    border-radius: 20px;
    letter-spacing: 1px;
}

.player-status.ready {
    background: rgba(0, 255, 100, 0.2);
    color: #00ff64;
}

.player-status.waiting {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    animation: pulse-waiting 2s ease-in-out infinite;
}

.vs-divider {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.3);
}

.vs-text {
    font-size: 16px;
    font-weight: 900;
    color: var(--bg-dark);
    letter-spacing: 2px;
}

/* ==================== 房间操作区域 ==================== */
.room-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.mode-select {
    width: 100%;
    text-align: center;
}

.mode-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.mode-options {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 90px;
}

.mode-btn span {
    font-size: 11px;
    letter-spacing: 1px;
}

.mode-icon {
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mode-icon svg {
    width: 24px;
    height: 24px;
}

.mode-btn:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--text);
}

.mode-btn[data-mode="speed"] {
    cursor: not-allowed;
    opacity: 0.5;
}

.mode-btn[data-mode="speed"]:hover {
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    opacity: 0.5;
}

.mode-btn.active {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

.ready-btn {
    padding: 16px 60px;
    background: linear-gradient(135deg, #00ff64, #00cc50);
    border: none;
    border-radius: 30px;
    color: var(--bg-dark);
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 30px rgba(0, 255, 100, 0.3);
}

.ready-btn:hover {
    box-shadow: 0 8px 40px rgba(0, 255, 100, 0.5);
    transform: translateY(-2px);
}

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

/* 开始游戏按钮 */
.start-game-btn {
    padding: 16px 60px;
    background: linear-gradient(135deg, #00f0ff, #0088ff);
    border: none;
    border-radius: 30px;
    color: var(--bg-dark);
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 30px rgba(0, 240, 255, 0.3);
}

.start-game-btn:hover:not(:disabled) {
    box-shadow: 0 8px 40px rgba(0, 240, 255, 0.5);
    transform: translateY(-2px);
}

.start-game-btn:active:not(:disabled) {
    transform: translateY(0);
}

.start-game-btn:disabled {
    background: linear-gradient(135deg, #666, #444);
    color: #999;
    cursor: not-allowed;
    box-shadow: none;
}

.ready-btn.cancel-ready {
    background: linear-gradient(135deg, #ff6666, #cc4444);
    box-shadow: 0 5px 30px rgba(255, 100, 100, 0.3);
}

.ready-btn.cancel-ready:hover {
    box-shadow: 0 8px 40px rgba(255, 100, 100, 0.5);
}

/* 按钮加载状态 */
.btn-loading {
    opacity: 0.7;
    pointer-events: none;
}

/* ==================== 双人对战模式 ==================== */
.dual-game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-dark);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dual-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    flex-shrink: 0;
}

.dual-title {
    font-size: 14px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 8px;
    margin: 0 auto 10px;
    width: fit-content;
}

.timer-label {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.timer-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Orbitron', monospace;
    min-width: 50px;
    text-align: center;
}

.timer-value.timer-warning {
    color: #ff4444;
    animation: timer-pulse 0.5s ease-in-out infinite;
}

@keyframes timer-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.dual-back-btn {
    padding: 6px 14px;
    background: rgba(255, 100, 100, 0.2);
    border: 1px solid rgba(255, 100, 100, 0.4);
    border-radius: 6px;
    color: #ff6b6b;
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dual-back-btn:hover {
    background: rgba(255, 100, 100, 0.3);
}

.dual-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 15px;
    overflow: hidden;
    min-height: 0;
}

.player-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-height: 0;
}

.player-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.player-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
}

.player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-avatar .avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.player-avatar .avatar-placeholder svg {
    width: 20px;
    height: 20px;
}

.my-side .player-avatar {
    border-color: rgba(0, 240, 255, 0.4);
}

.opponent-side .player-avatar {
    border-color: rgba(255, 0, 170, 0.4);
}

.player-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.my-side .player-name {
    color: var(--primary);
}

.opponent-side .player-name {
    color: var(--secondary);
}

.player-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.my-side .player-label {
    color: var(--primary);
}

.opponent-side .player-label {
    color: var(--secondary);
}

.player-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
}

.info-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
}

.info-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.info-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    min-width: 50px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.my-side .info-value {
    color: var(--primary);
}

.opponent-side .info-value {
    color: var(--secondary);
}

.next-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
}

.next-item canvas {
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-board-wrapper {
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.my-side .game-board-wrapper {
    border-color: rgba(0, 240, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
}

.opponent-side .game-board-wrapper {
    border-color: rgba(255, 0, 170, 0.3);
    box-shadow: 0 0 20px rgba(255, 0, 170, 0.2);
}

.game-board-wrapper canvas {
    display: block;
}

.dual-game-container .game-over-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.dual-game-container .game-over-overlay .game-over-title {
    font-size: 16px;
    font-weight: 700;
    color: #ff6b6b;
}

.dual-game-container .game-over-overlay .final-score {
    font-size: 11px;
    color: var(--text-muted);
}

.dual-content .vs-divider {
    display: none;
}

.dual-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    flex-shrink: 0;
}

.dual-controls .control-btn {
    width: 60px;
    height: 60px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--text);
    font-size: 22px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dual-controls .control-btn:active {
    background: rgba(0, 240, 255, 0.2);
    transform: scale(0.95);
}

.dual-controls .rotate-btn {
    font-size: 24px;
}

.attack-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 0, 170, 0.9);
    color: white;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 24px;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 2000;
}

.attack-indicator.show {
    opacity: 1;
}

/* ==================== 自定义弹窗 ==================== */
.dual-result-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    z-index: 3000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.dual-result-modal.active {
    display: flex;
}

.dual-result-modal .modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}

.dual-result-modal .modal-body {
    position: relative;
    background: linear-gradient(180deg, rgba(25, 25, 55, 0.98), rgba(15, 15, 40, 0.98));
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 20px;
    padding: 40px 48px;
    text-align: center;
    box-shadow: 0 0 60px rgba(0, 240, 255, 0.15);
    animation: modal-pop 0.3s ease-out;
    max-width: 340px;
    width: 100%;
}

@keyframes modal-pop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.dual-result-modal .result-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
}

.dual-result-modal .result-icon svg {
    width: 100%;
    height: 100%;
}

.dual-result-modal .result-text {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 3px;
    margin-bottom: 28px;
}

.dual-result-modal .result-text.win {
    background: linear-gradient(135deg, #ffdd00, #ffaa00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

.dual-result-modal .result-text.lose {
    color: #ff6b6b;
}

.dual-result-modal .result-text.draw {
    color: var(--primary);
}

.dual-result-modal .result-message {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.6;
}

.dual-result-modal .result-btn {
    padding: 12px 40px;
    background: linear-gradient(135deg, var(--primary), #0088ff);
    border: none;
    border-radius: 25px;
    color: var(--bg-dark);
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 25px rgba(0, 240, 255, 0.3);
}

.dual-result-modal .result-btn:hover {
    box-shadow: 0 8px 35px rgba(0, 240, 255, 0.5);
    transform: translateY(-2px);
}

.dual-result-modal .result-btn:active {
    transform: translateY(0);
}

/* ==================== Toast 提示 ==================== */
.tetris-toast {
    position: fixed;
    top: max(20px, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 12px;
    font-family: 'Orbitron', -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    max-width: 90vw;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.tetris-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.tetris-toast .toast-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.tetris-toast .toast-icon svg {
    width: 18px;
    height: 18px;
}

.tetris-toast .toast-text {
    line-height: 1.5;
}

.tetris-toast-info {
    background: rgba(0, 240, 255, 0.15);
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: #00f0ff;
}

.tetris-toast-info .toast-icon svg {
    stroke: #00f0ff;
}

.tetris-toast-error {
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
}

.tetris-toast-error .toast-icon svg {
    stroke: #ff6b6b;
}

.tetris-toast-warning {
    background: rgba(255, 221, 0, 0.15);
    border: 1px solid rgba(255, 221, 0, 0.3);
    color: #ffdd00;
}

.tetris-toast-warning .toast-icon svg {
    stroke: #ffdd00;
}

.tetris-toast-success {
    background: rgba(0, 255, 100, 0.15);
    border: 1px solid rgba(0, 255, 100, 0.3);
    color: #00ff64;
}

.tetris-toast-success .toast-icon svg {
    stroke: #00ff64;
}

/* ==================== 响应式适配 ==================== */
@media (max-width: 480px) {
    .players-area {
        gap: 10px;
    }
    
    .player-card {
        padding: 16px 10px;
    }
    
    .player-avatar {
        width: 60px;
        height: 60px;
    }
    
    .player-nickname {
        font-size: 12px;
    }
    
    .room-waiting .vs-divider {
        width: 40px;
        height: 40px;
    }
    
    .room-waiting .vs-text {
        font-size: 12px;
    }
    
    .room-header-row {
        gap: 10px;
    }
    
    .room-code-display {
        padding: 10px 14px;
        gap: 8px;
        border-radius: 12px;
    }
    
    .room-code-label {
        font-size: 10px;
    }
    
    .room-code-value {
        font-size: 20px;
        letter-spacing: 4px;
    }
    
    .copy-btn {
        width: 28px;
        height: 28px;
    }
    
    .time-select {
        padding: 8px 12px;
        gap: 8px;
        border-radius: 12px;
    }
    
    .time-label {
        font-size: 10px;
    }
    
    .time-dropdown-btn {
        padding: 6px 10px;
        min-width: 70px;
        font-size: 12px;
    }
    
    .time-dropdown-menu {
        min-width: 70px;
    }
    
    .time-option {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .mode-options {
        flex-wrap: wrap;
    }
    
    .mode-btn {
        padding: 12px 16px;
        min-width: 80px;
    }
    
    .dual-content {
        gap: 5px;
        padding: 5px;
    }
    
    .player-info {
        gap: 10px;
        padding: 6px 10px;
    }
    
    .info-item {
        gap: 4px;
    }
    
    .info-label {
        font-size: 10px;
    }
    
    .info-value {
        font-size: 14px;
        min-width: 40px;
    }
    
    .next-item canvas {
        width: 48px;
        height: 36px;
    }
    
    .dual-content .vs-divider {
        width: 30px;
        height: 30px;
        font-size: 10px;
    }
    
    .dual-controls .control-btn {
        width: 58px;
        height: 58px;
        font-size: 20px;
    }
}

/* ===== 邀请好友按钮 ===== */
.invite-friends-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 14px;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.15), rgba(0, 229, 255, 0.05));
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: 20px;
    color: #00e5ff;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.invite-friends-btn:hover {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.25), rgba(0, 229, 255, 0.1));
    border-color: rgba(0, 229, 255, 0.5);
}

.invite-friends-btn:active {
    transform: scale(0.95);
}

/* ===== 邀请好友弹窗 ===== */
.invite-friends-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.invite-friends-modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.invite-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.invite-modal-content {
    position: relative;
    width: 90%;
    max-width: 380px;
    max-height: 60vh;
    background: linear-gradient(145deg, #1e1e3a, #141428);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.invite-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.invite-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.invite-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.invite-modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.invite-friends-list {
    overflow-y: auto;
    padding: 8px 0;
    flex: 1;
}

.invite-friends-loading,
.invite-friends-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    padding: 30px 20px;
    font-size: 14px;
}

.invite-friend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    transition: background 0.15s;
}

.invite-friend-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.invite-friend-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.invite-friend-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.invite-friend-avatar svg {
    color: rgba(255, 255, 255, 0.3);
}

.invite-friend-info {
    flex: 1;
    min-width: 0;
}

.invite-friend-name {
    font-size: 14px;
    color: var(--text);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.invite-send-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    background: linear-gradient(135deg, #00e5ff, #00b8d4);
    border: none;
    border-radius: 16px;
    color: #0a0a1a;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.invite-send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 229, 255, 0.3);
}

.invite-send-btn:active {
    transform: scale(0.95);
}

.invite-send-btn.invited {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    cursor: default;
    pointer-events: none;
}

/* ===== 接收游戏邀请弹窗 ===== */
.game-invite-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
}

.game-invite-overlay.show {
    display: flex;
}

.game-invite-card {
    width: 90%;
    max-width: 340px;
    background: linear-gradient(145deg, #1e1e3a, #141428);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 16px;
    padding: 28px 24px 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 229, 255, 0.1);
    animation: inviteSlideIn 0.3s ease;
}

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

.game-invite-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.game-invite-body {
    margin-bottom: 24px;
}

.invite-from-label {
    display: block;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 4px;
}

.invite-from-name {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #00e5ff;
}

.game-invite-actions {
    display: flex;
    gap: 12px;
}

.game-invite-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.game-invite-btn.accept {
    background: linear-gradient(135deg, #00e5ff, #00b8d4);
    color: #0a0a1a;
}

.game-invite-btn.accept:hover {
    box-shadow: 0 4px 16px rgba(0, 229, 255, 0.4);
    transform: translateY(-1px);
}

.game-invite-btn.decline {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-invite-btn.decline:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text);
}

.game-invite-btn:active {
    transform: scale(0.96);
}
