.mode-selector {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 10px 0;
    width: 100%;
}

.mode-btn {
    background: #ffffff;
    color: #555;
    border: 1px solid #e0e0e0;
    padding: 9px 18px;
    border-radius: 50px;
    font-size: clamp(0.82rem, 2.4vw, 0.92rem);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 80px;
    max-width: 130px;
    text-align: center;
}

.mode-btn.active {
    background: #4a9;
    color: white;
    border-color: #4a9;
}

.mode-btn:hover {
    border-color: #4a9;
    color: #4a9;
}

.mode-btn.active:hover {
    color: white;
    background: #3a8a6a;
}

.mode-btn:active {
    transform: translateY(1px);
}

.mode-btn-online {
    background: #ffffff;
    color: #4a9;
    border: 1px solid #4a9;
}

.mode-btn-online.active {
    background: #4a9;
    color: white;
}

.info-panel {
    background: #fafafa;
    border: 1px solid #ececec;
    border-radius: 12px;
    padding: 14px;
}

.score-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.score, .high-score, .level, .p2-score {
    font-size: clamp(0.78rem, 2.3vw, 0.9rem);
    color: #555;
    background: #ffffff;
    padding: 9px 12px;
    border-radius: 50px;
    text-align: center;
    font-weight: 500;
    border: 1px solid #ececec;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.score span, .high-score span, .level span, .p2-score span {
    color: #4a9;
    font-weight: 700;
}

.special-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 10px 0;
}

.feature-toggle {
    background: #ffffff;
    color: #666;
    border: 1px solid #e0e0e0;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: clamp(0.8rem, 2.4vw, 0.88rem);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.feature-toggle.active {
    background: #4a9;
    color: white;
    border-color: #4a9;
}

.feature-toggle:hover { border-color: #4a9; color: #4a9; }
.feature-toggle.active:hover { color: white; background: #3a8a6a; }

.player-speed-control,
.game-area-control,
.target-score-control {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    padding: 10px 14px;
    border-radius: 50px;
    margin: 8px 0;
    border: 1px solid #ececec;
}

.target-score-control { display: none; }

.player-speed-control label,
.game-area-control label,
.target-score-control label {
    font-size: 0.85rem;
    color: #555;
    white-space: nowrap;
    font-weight: 600;
}

.player-speed-control input {
    flex: 1;
    min-width: 0;
    accent-color: #4a9;
    height: 4px;
}

.player-speed-control span {
    background: #4a9;
    color: #fff;
    padding: 2px 10px;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
    min-width: 44px;
    text-align: center;
}

.game-area-control select,
.target-score-control input {
    flex: 1;
    min-width: 80px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #333;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.game-area-control select:focus,
.target-score-control input:focus {
    border-color: #4a9;
}

.target-score-control input { text-align: center; }

.ai-settings {
    display: none;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    padding: 10px 14px;
    border-radius: 50px;
    margin: 8px 0;
    border: 1px solid #ececec;
}

.ai-settings label {
    font-size: 0.85rem;
    color: #555;
    font-weight: 600;
    white-space: nowrap;
}

.ai-settings select {
    flex: 1;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #333;
    font-size: 0.85rem;
    outline: none;
}

.theme-selector {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 10px 0;
    padding: 10px;
    background: #ffffff;
    border-radius: 50px;
    border: 1px solid #ececec;
}

.theme-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

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

.theme-btn.active {
    border-color: #4a9;
    transform: scale(1.15);
}

.theme-cute { background: #ffb6c1; }
.theme-pixel { background: #9d7af5; }
.theme-forest { background: #4caf50; }
.theme-ocean { background: #29b6f6; }
.theme-space { background: #8e24aa; }
.theme-candy { background: #ff9a9e; }
.theme-gold { background: #ffd700; }
.theme-neon { background: #00d4ff; }

.shape-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
    padding: 12px 16px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #ececec;
}

.shape-label {
    font-size: 0.86rem;
    font-weight: 600;
    color: #4a9;
    flex-shrink: 0;
}

.shape-selector .shape-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 50px;
    border: 1px solid #e0e0e0;
    background: #ffffff;
    color: #666;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 80px;
    max-width: 130px;
}

.shape-btn:hover {
    border-color: #4a9;
    color: #4a9;
}

.shape-btn.active {
    background: #4a9;
    color: #fff;
    border-color: #4a9;
}

.score-prompt-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.score-prompt-modal.show { display: flex; }

.score-prompt-box {
    background: #ffffff;
    border: 1px solid #ececec;
    border-radius: 16px;
    padding: 26px 30px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    max-width: 360px;
    width: 90%;
    text-align: center;
}

.score-prompt-box h3 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 8px;
    font-weight: 600;
}

.score-prompt-box .score-prompt-num {
    font-size: 2rem;
    font-weight: 700;
    color: #4a9;
    margin: 10px 0;
}

.score-prompt-box .score-prompt-tip {
    font-size: 0.84rem;
    color: #888;
    margin-bottom: 18px;
    line-height: 1.5;
}

.score-prompt-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.score-prompt-actions button {
    flex: 1;
    padding: 10px 16px;
    border-radius: 50px;
    border: none;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.score-prompt-yes {
    background: #4a9;
    color: #fff;
}

.score-prompt-yes:hover { background: #3a8a6a; }

.score-prompt-no {
    background: #ffffff;
    color: #666;
    border: 1px solid #e0e0e0;
}

.score-prompt-no:hover { background: #f7f7f7; }

.controls {
    display: flex;
    gap: 6px;
    margin: 12px 0 8px;
    padding: 8px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #ececec;
}

.controls button {
    background: #4a9;
    color: white;
    border: none;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 70px;
    max-width: 120px;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.controls button#pauseBtn {
    background: #f59e0b;
}

.controls button#restartBtn {
    background: #94a3b8;
}

.controls button:hover {
    background: #3a8a6a;
}

.controls button#pauseBtn:hover {
    background: #d97706;
}

.controls button#restartBtn:hover {
    background: #64748b;
}

.controls button:active {
    transform: translateY(1px);
}

.instructions {
    text-align: center;
    color: #888;
    margin-top: 10px;
    font-size: clamp(0.75rem, 2vw, 0.84rem);
    line-height: 1.6;
    background: #ffffff;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #ececec;
}

.lb-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e0e0e0;
    background: #ffffff;
    cursor: pointer;
    margin: 8px auto;
    transition: all 0.2s;
    color: #666;
}

.lb-toggle:hover {
    border-color: #4a9;
    color: #4a9;
}

.lb-toggle.active {
    background: #4a9;
    color: #fff;
    border-color: #4a9;
}

.leaderboard-panel {
    width: 100%;
    background: #fafafa;
    border: 1px solid #ececec;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.lb-head {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    justify-content: center;
}

.lb-pick {
    padding: 6px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 50px;
    background: #ffffff;
    color: #666;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.lb-pick:hover { border-color: #4a9; color: #4a9; }

.lb-pick.active {
    background: #4a9;
    color: white;
    border-color: #4a9;
}

.lb-body {
    max-height: 180px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.lb-row {
    display: flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 50px;
    font-size: 0.82rem;
    gap: 10px;
    margin-bottom: 3px;
    transition: background 0.2s;
}

.lb-row:hover { background: #f5f5f5; }
.lb-row:nth-child(odd) { background: #ffffff; }
.lb-row:first-child { background: #fff8e1; color: #b8860b; font-weight: 600; }
.lb-row:nth-child(2) { background: #f5f5f5; color: #6c7a89; font-weight: 500; }
.lb-row:nth-child(3) { background: #fdf2e9; color: #a0522d; font-weight: 500; }

.lb-rank { width: 24px; text-align: center; font-weight: 600; }
.lb-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #555; }
.lb-pts { font-weight: 700; color: #4a9; padding: 2px 10px; border-radius: 50px; font-size: 0.78rem; }
.lb-empty { text-align: center; padding: 20px; color: #aaa; font-size: 0.85rem; }
