/* ========================================
   STYLES CSS - Pony
   ======================================== */

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #0a0a14;
    font-family: 'Arial', sans-serif;
}

/* ========================================
   LAYOUT PRINCIPAL FULLSCREEN
   ======================================== */

#gameWrapper {
    display: flex;
    width: 100%;
    height: 100%;
    background-color: #1a1a2e;
}

#gameArea {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
    position: relative;
}

#gameContainer {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
}

#gameCanvas {
    display: block;
    background-color: #87CEEB;
    max-width: 100%;
    max-height: 100%;
}

/* ========================================
   SIDEBAR IN-GAME
   ======================================== */

#gameSidebar {
    width: 280px;
    background: linear-gradient(180deg, #16213e 0%, #1a1a2e 100%);
    border-left: 3px solid #34495e;
    display: flex;
    flex-direction: column;
    padding: 15px;
    overflow-y: auto;
}

#gameSidebar.hidden {
    display: none;
}

.sidebar-section {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
}

.sidebar-section h3 {
    color: #f39c12;
    font-size: 14px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #34495e;
}

/* Player Stats */
.sidebar-player-stats {
    display: flex;
    justify-content: space-around;
}

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

.sidebar-stat .stat-icon {
    font-size: 20px;
}

.sidebar-stat span:last-child {
    color: #ecf0f1;
    font-weight: bold;
    font-size: 18px;
}

/* Equipped Items */
.sidebar-equipped {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.equipped-slot {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #34495e;
}

.equipped-slot .slot-icon {
    font-size: 18px;
}

.equipped-slot .slot-name {
    color: #bdc3c7;
    font-size: 12px;
}

.equipped-slot.active {
    border-color: #f39c12;
    background: rgba(243, 156, 18, 0.1);
}

.equipped-slot.active .slot-name {
    color: #f1c40f;
}

/* Powerups */
.sidebar-powerups {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.powerup-slot {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid #34495e;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
}

.powerup-slot.empty {
    color: #4a5568;
}

.powerup-slot.active {
    border-color: #2ecc71;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.5);
}

/* Combo */
.sidebar-combo {
    text-align: center;
}

.combo-count {
    font-size: 28px;
    font-weight: bold;
    color: #f39c12;
    text-shadow: 0 0 10px rgba(243, 156, 18, 0.5);
}

.combo-bar {
    height: 8px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    margin-top: 8px;
    overflow: hidden;
}

.combo-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #f39c12, #e74c3c);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Sidebar Actions */
.sidebar-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-btn {
    padding: 12px;
    font-size: 14px;
    font-weight: bold;
    background: rgba(52, 73, 94, 0.8);
    color: #ecf0f1;
    border: 2px solid #4a6278;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-btn:hover {
    background: #f39c12;
    border-color: #f39c12;
    color: #1a1a2e;
}

/* ========================================
   ÉCRAN D'INTRO (Branding)
   ======================================== */
#introOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#introOverlay.hidden {
    display: none;
}

#introText {
    color: #fff;
    font-size: 36px;
    font-family: 'Georgia', serif;
    letter-spacing: 3px;
    opacity: 0;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

#introText.fade-in {
    animation: fadeIn 1s ease-in forwards;
}

#introText.fade-out {
    animation: fadeOut 1s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(1.1); }
}

/* ========================================
   MENU PRINCIPAL
   ======================================== */
#menuOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 50;
}

#menuOverlay.hidden {
    display: none;
}

.menu-title {
    color: #f39c12;
    font-size: 56px;
    font-weight: bold;
    text-shadow: 3px 3px 0 #c0392b, 6px 6px 10px rgba(0,0,0,0.5);
    margin-bottom: 10px;
    letter-spacing: 4px;
}

.menu-subtitle {
    color: #bdc3c7;
    font-size: 18px;
    margin-bottom: 50px;
    font-style: italic;
}

.menu-instructions {
    color: #ecf0f1;
    font-size: 16px;
    margin-bottom: 10px;
    text-align: center;
}

.menu-instructions span {
    color: #f1c40f;
    font-weight: bold;
}

.menu-highscore {
    margin-top: 30px;
    color: #f39c12;
    font-size: 20px;
    font-weight: bold;
}

#startButton {
    margin-top: 40px;
    padding: 20px 50px;
    font-size: 24px;
    font-weight: bold;
    background: transparent;
    color: #fff;
    border: 3px solid #f39c12;
    cursor: pointer;
    letter-spacing: 3px;
    animation: blink 1s infinite;
    transition: all 0.3s ease;
}

#startButton:hover {
    background-color: #f39c12;
    color: #1a1a2e;
    transform: scale(1.05);
    animation: none;
}

@keyframes blink {
    0%, 100% { opacity: 1; border-color: #f39c12; }
    50% { opacity: 0.5; border-color: #e67e22; }
}

/* Décoration du menu */
.menu-decoration {
    position: absolute;
    bottom: 20px;
    color: #7f8c8d;
    font-size: 12px;
}

/* ========================================
   OVERLAY GAME OVER
   ======================================== */
#gameOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 40;
}

#gameOverlay.visible {
    opacity: 1;
    pointer-events: auto;
}

#gameOverlay h1 {
    color: #e74c3c;
    font-size: 52px;
    margin-bottom: 20px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    letter-spacing: 5px;
}

#gameOverlay .finalScore {
    color: #f1c40f;
    font-size: 28px;
    margin-bottom: 10px;
}

#gameOverlay .highScoreDisplay {
    color: #f39c12;
    font-size: 22px;
    margin-bottom: 5px;
}

#gameOverlay #newRecordText {
    color: #2ecc71;
    font-size: 18px;
    margin-bottom: 10px;
}

#gameOverlay .finalTime {
    color: #3498db;
    font-size: 18px;
    margin-bottom: 30px;
}

#restartBtn {
    padding: 15px 40px;
    font-size: 20px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 2px;
}

#restartBtn:hover {
    background-color: #2ecc71;
    transform: scale(1.05);
}

#backToMenuBtn {
    margin-top: 15px;
    padding: 10px 30px;
    font-size: 14px;
    background: transparent;
    color: #bdc3c7;
    border: 2px solid #7f8c8d;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#backToMenuBtn:hover {
    border-color: #ecf0f1;
    color: #ecf0f1;
}

/* ========================================
   USER INFO & MENU BUTTONS
   ======================================== */

#userInfo {
    margin-bottom: 20px;
    text-align: center;
}

#userInfo.hidden {
    display: none;
}

.user-welcome {
    color: #f39c12;
    font-size: 18px;
    margin-bottom: 8px;
}

.user-welcome span {
    color: #f1c40f;
    font-weight: bold;
}

.user-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    color: #ecf0f1;
    font-size: 14px;
}

.user-stats span {
    background: rgba(0,0,0,0.3);
    padding: 5px 12px;
    border-radius: 15px;
}

.menu-buttons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.menu-btn {
    padding: 12px 25px;
    font-size: 14px;
    background: rgba(52, 73, 94, 0.8);
    color: #ecf0f1;
    border: 2px solid #4a6278;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.menu-btn:hover {
    background: #f39c12;
    border-color: #f39c12;
    color: #1a1a2e;
    transform: translateY(-2px);
}

.game-over-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    color: #bdc3c7;
    font-size: 16px;
}

.game-over-stats span {
    background: rgba(0,0,0,0.3);
    padding: 8px 15px;
    border-radius: 8px;
}

/* ========================================
   MODALS
   ======================================== */

.modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    border: 3px solid #f39c12;
    border-radius: 12px;
    padding: 30px;
    position: relative;
    max-height: 90%;
    overflow-y: auto;
}

.modal-content h2 {
    color: #f39c12;
    text-align: center;
    margin-bottom: 20px;
    font-size: 28px;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    color: #7f8c8d;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #e74c3c;
}

/* ========================================
   AUTH MODAL
   ======================================== */

.auth-modal {
    width: 400px;
}

.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #34495e;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    color: #7f8c8d;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-tab.active {
    color: #f39c12;
    border-bottom: 2px solid #f39c12;
    margin-bottom: -2px;
}

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

.auth-form.hidden {
    display: none;
}

.auth-form input {
    padding: 12px 15px;
    font-size: 16px;
    background: #0f0f1a;
    border: 2px solid #34495e;
    border-radius: 8px;
    color: #ecf0f1;
    outline: none;
    transition: border-color 0.2s;
}

.auth-form input:focus {
    border-color: #f39c12;
}

.auth-form input::placeholder {
    color: #7f8c8d;
}

.auth-submit {
    padding: 14px;
    font-size: 16px;
    font-weight: bold;
    background: linear-gradient(180deg, #f39c12, #e67e22);
    color: #1a1a2e;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.4);
}

.auth-error {
    color: #e74c3c;
    text-align: center;
    font-size: 14px;
    padding: 10px;
    background: rgba(231, 76, 60, 0.2);
    border-radius: 6px;
}

.auth-error.hidden {
    display: none;
}

.auth-success {
    color: #2ecc71;
    text-align: center;
    font-size: 14px;
    padding: 10px;
    background: rgba(46, 204, 113, 0.2);
    border-radius: 6px;
}

.auth-success.hidden {
    display: none;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #7f8c8d;
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #34495e;
}

.auth-divider span {
    padding: 0 15px;
}

.social-login {
    display: flex;
    gap: 12px;
}

.social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.social-btn svg {
    flex-shrink: 0;
}

.social-btn.google {
    background: #4285f4;
    color: white;
}

.social-btn.google:hover {
    background: #357abd;
    transform: translateY(-2px);
}

.social-btn.discord {
    background: #5865f2;
    color: white;
}

.social-btn.discord:hover {
    background: #4752c4;
    transform: translateY(-2px);
}

/* ========================================
   SHOP MODAL
   ======================================== */

.shop-modal {
    width: 800px;
    max-width: 95%;
}

.shop-header {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
}

.shop-header span {
    font-size: 18px;
    color: #f1c40f;
    font-weight: bold;
}

.shop-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.shop-tab {
    padding: 10px 20px;
    background: rgba(52, 73, 94, 0.6);
    border: 2px solid transparent;
    border-radius: 8px;
    color: #bdc3c7;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.shop-tab:hover {
    background: rgba(52, 73, 94, 0.9);
    border-color: #4a6278;
}

.shop-tab.active {
    background: #f39c12;
    color: #1a1a2e;
    border-color: #f39c12;
}

.shop-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    max-height: 350px;
    overflow-y: auto;
    padding: 10px;
}

.shop-item {
    background: rgba(0,0,0,0.4);
    border: 2px solid #34495e;
    border-radius: 10px;
    padding: 15px;
    transition: all 0.2s;
}

.shop-item:hover {
    border-color: #f39c12;
    transform: translateY(-3px);
}

.shop-item.owned {
    border-color: #2ecc71;
    opacity: 0.8;
}

.shop-item.locked {
    opacity: 0.5;
    border-color: #7f8c8d;
}

.shop-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.shop-item-name {
    color: #ecf0f1;
    font-weight: bold;
    font-size: 14px;
}

.shop-item-rarity {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

.rarity-common { background: #7f8c8d; color: #fff; }
.rarity-rare { background: #3498db; color: #fff; }
.rarity-epic { background: #9b59b6; color: #fff; }
.rarity-legendary { background: linear-gradient(90deg, #f39c12, #e74c3c); color: #fff; }

.shop-item-desc {
    color: #95a5a6;
    font-size: 12px;
    margin-bottom: 10px;
    min-height: 32px;
}

.shop-item-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.shop-item-stat {
    font-size: 11px;
    background: rgba(52, 152, 219, 0.3);
    color: #3498db;
    padding: 3px 8px;
    border-radius: 4px;
}

.shop-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shop-item-price {
    color: #f1c40f;
    font-weight: bold;
    font-size: 14px;
}

.shop-item-level {
    color: #7f8c8d;
    font-size: 11px;
}

.shop-buy-btn {
    padding: 8px 16px;
    font-size: 12px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.shop-buy-btn:hover {
    background: #2ecc71;
    transform: scale(1.05);
}

.shop-buy-btn:disabled {
    background: #7f8c8d;
    cursor: not-allowed;
    transform: none;
}

.shop-buy-btn.owned {
    background: #2ecc71;
    cursor: default;
}

/* ========================================
   LEADERBOARD MODAL
   ======================================== */

.leaderboard-modal {
    width: 500px;
}

.player-rank {
    text-align: center;
    padding: 15px;
    background: rgba(243, 156, 18, 0.2);
    border: 2px solid #f39c12;
    border-radius: 10px;
    margin-bottom: 20px;
    color: #f39c12;
    font-size: 18px;
    font-weight: bold;
}

.player-rank.hidden {
    display: none;
}

.player-rank span {
    color: #f1c40f;
    font-size: 24px;
}

.leaderboard-list {
    max-height: 400px;
    overflow-y: auto;
}

.leaderboard-entry {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #34495e;
    transition: background 0.2s;
}

.leaderboard-entry:hover {
    background: rgba(52, 73, 94, 0.5);
}

.leaderboard-entry.top-1 { background: rgba(255, 215, 0, 0.2); }
.leaderboard-entry.top-2 { background: rgba(192, 192, 192, 0.15); }
.leaderboard-entry.top-3 { background: rgba(205, 127, 50, 0.15); }

.leaderboard-rank {
    width: 40px;
    font-size: 18px;
    font-weight: bold;
    color: #f39c12;
}

.leaderboard-entry.top-1 .leaderboard-rank { color: #ffd700; }
.leaderboard-entry.top-2 .leaderboard-rank { color: #c0c0c0; }
.leaderboard-entry.top-3 .leaderboard-rank { color: #cd7f32; }

.leaderboard-name {
    flex: 1;
    color: #ecf0f1;
    font-size: 16px;
}

.leaderboard-level {
    color: #7f8c8d;
    font-size: 12px;
    margin-right: 20px;
}

.leaderboard-score {
    color: #f1c40f;
    font-weight: bold;
    font-size: 16px;
}

/* ========================================
   INVENTORY MODAL
   ======================================== */

.inventory-modal {
    width: 600px;
}

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

.inventory-tab {
    width: 50px;
    height: 50px;
    font-size: 24px;
    background: rgba(52, 73, 94, 0.6);
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.inventory-tab:hover {
    background: rgba(52, 73, 94, 0.9);
}

.inventory-tab.active {
    background: #f39c12;
    border-color: #f39c12;
}

.inventory-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    max-height: 350px;
    overflow-y: auto;
    padding: 10px;
}

.inventory-item {
    background: rgba(0,0,0,0.4);
    border: 2px solid #34495e;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.inventory-item:hover {
    border-color: #f39c12;
}

.inventory-item.equipped {
    border-color: #2ecc71;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.5);
}

.inventory-item-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.inventory-item-name {
    color: #ecf0f1;
    font-size: 12px;
    font-weight: bold;
}

.inventory-item-equipped {
    color: #2ecc71;
    font-size: 10px;
    margin-top: 5px;
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */

.shop-items::-webkit-scrollbar,
.leaderboard-list::-webkit-scrollbar,
.inventory-items::-webkit-scrollbar {
    width: 8px;
}

.shop-items::-webkit-scrollbar-track,
.leaderboard-list::-webkit-scrollbar-track,
.inventory-items::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
}

.shop-items::-webkit-scrollbar-thumb,
.leaderboard-list::-webkit-scrollbar-thumb,
.inventory-items::-webkit-scrollbar-thumb {
    background: #f39c12;
    border-radius: 4px;
}

.shop-items::-webkit-scrollbar-thumb:hover,
.leaderboard-list::-webkit-scrollbar-thumb:hover,
.inventory-items::-webkit-scrollbar-thumb:hover {
    background: #e67e22;
}

/* ========================================
   SETTINGS MODAL
   ======================================== */

.settings-modal {
    width: 500px;
    max-width: 95%;
}

.settings-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid #34495e;
}

.settings-tab {
    flex: 1;
    padding: 12px 8px;
    background: none;
    border: none;
    color: #7f8c8d;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.settings-tab:hover {
    color: #bdc3c7;
}

.settings-tab.active {
    color: #f39c12;
    border-bottom-color: #f39c12;
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.settings-section.hidden {
    display: none;
}

.settings-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.settings-label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    color: #ecf0f1;
    font-size: 14px;
}

.settings-label span:first-child {
    font-weight: bold;
}

.settings-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-control input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    background: #34495e;
    border-radius: 3px;
    cursor: pointer;
}

.settings-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #f39c12;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

.settings-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.settings-control span {
    min-width: 40px;
    text-align: right;
    color: #f39c12;
    font-weight: bold;
}

.settings-toggle {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: bold;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 70px;
}

.settings-toggle:hover {
    opacity: 0.9;
}

.settings-toggle.off {
    background: #7f8c8d;
}

.settings-label input[type="text"],
.settings-label input[type="email"],
.settings-label input[type="password"],
.settings-label select {
    padding: 10px 12px;
    font-size: 14px;
    background: #0f0f1a;
    border: 2px solid #34495e;
    border-radius: 6px;
    color: #ecf0f1;
    outline: none;
    transition: border-color 0.2s;
}

.settings-label input:focus,
.settings-label select:focus {
    border-color: #f39c12;
}

.settings-label select {
    cursor: pointer;
}

.settings-action-btn {
    padding: 10px 20px;
    font-size: 12px;
    font-weight: bold;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.settings-action-btn:hover {
    background: #2980b9;
}

.settings-danger-btn {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: bold;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.settings-danger-btn:hover {
    background: #c0392b;
}

.settings-divider {
    height: 1px;
    background: #34495e;
    margin: 10px 0;
}

.settings-message {
    text-align: center;
    padding: 10px;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 14px;
}

.settings-message.hidden {
    display: none;
}

.settings-message.success {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.settings-message.error {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.account-not-connected {
    text-align: center;
    padding: 30px;
}

.account-not-connected p {
    color: #bdc3c7;
    margin-bottom: 20px;
}

.account-connected.hidden {
    display: none;
}

/* Resume Button */
.resume-btn {
    margin-top: 15px;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    animation: pulse-green 2s infinite;
    transition: all 0.2s;
}

.resume-btn:hover {
    background: #2ecc71;
    transform: scale(1.05);
    animation: none;
}

.resume-btn.hidden {
    display: none;
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.5); }
    50% { box-shadow: 0 0 20px 5px rgba(46, 204, 113, 0.3); }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Touch Controls pour Mobile */
#touchControls {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.5));
    padding: 10px 20px;
    z-index: 100;
}

#touchControls.active {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.touch-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    touch-action: manipulation;
}

.touch-btn:active {
    background: rgba(243, 156, 18, 0.6);
    border-color: #f39c12;
    transform: scale(0.95);
}

.touch-btn.jump {
    width: 90px;
    height: 90px;
    font-size: 32px;
}

.touch-area-left,
.touch-area-right {
    display: flex;
    gap: 15px;
}

/* ========================================
   TABLETTE (768px - 1024px)
   ======================================== */
@media screen and (max-width: 1024px) {
    #gameSidebar {
        width: 220px;
        padding: 10px;
    }

    .sidebar-section {
        padding: 10px;
        margin-bottom: 10px;
    }

    .sidebar-section h3 {
        font-size: 12px;
    }

    .sidebar-stat span:last-child {
        font-size: 16px;
    }

    .combo-count {
        font-size: 24px;
    }

    .powerup-slot {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .sidebar-btn {
        padding: 10px;
        font-size: 12px;
    }

    /* Modals */
    .modal-content {
        padding: 20px;
        max-width: 90%;
    }

    .shop-modal {
        width: 95%;
    }

    .shop-items {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    /* Menu */
    .menu-title {
        font-size: 42px;
    }

    .menu-subtitle {
        font-size: 16px;
        margin-bottom: 30px;
    }

    .menu-instructions {
        font-size: 14px;
    }

    #startButton {
        padding: 15px 35px;
        font-size: 20px;
    }

    .menu-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }

    .menu-btn {
        padding: 10px 18px;
        font-size: 12px;
    }
}

/* ========================================
   MOBILE LANDSCAPE (hauteur < 500px)
   ======================================== */
@media screen and (max-height: 500px) {
    #gameSidebar {
        display: none !important;
    }

    #touchControls.active {
        height: 80px;
    }

    .touch-btn {
        width: 55px;
        height: 55px;
        font-size: 22px;
    }

    .touch-btn.jump {
        width: 70px;
        height: 70px;
        font-size: 26px;
    }

    /* Menu compact */
    .menu-title {
        font-size: 32px;
        margin-bottom: 5px;
    }

    .menu-subtitle {
        font-size: 14px;
        margin-bottom: 15px;
    }

    .menu-instructions {
        display: none;
    }

    #startButton {
        padding: 12px 30px;
        font-size: 18px;
        margin-top: 15px;
    }

    .menu-buttons {
        margin-top: 15px;
        gap: 8px;
    }

    .menu-btn {
        padding: 8px 12px;
        font-size: 11px;
    }

    .resume-btn {
        padding: 10px 25px;
        font-size: 14px;
        margin-top: 10px;
    }

    /* Game over compact */
    #gameOverlay h1 {
        font-size: 36px;
        margin-bottom: 10px;
    }

    #gameOverlay .finalScore {
        font-size: 22px;
    }

    #gameOverlay .highScoreDisplay {
        font-size: 16px;
    }

    .game-over-stats {
        gap: 15px;
        margin-bottom: 15px;
    }

    #restartBtn {
        padding: 12px 30px;
        font-size: 16px;
    }
}

/* ========================================
   MOBILE PORTRAIT (< 768px)
   ======================================== */
@media screen and (max-width: 768px) {
    /* Layout - Sidebar en bas */
    #gameWrapper {
        flex-direction: column;
    }

    #gameSidebar {
        width: 100%;
        height: auto;
        max-height: 150px;
        flex-direction: row;
        flex-wrap: wrap;
        border-left: none;
        border-top: 3px solid #34495e;
        padding: 8px;
        gap: 8px;
        overflow-x: auto;
    }

    .sidebar-section {
        flex: 1;
        min-width: 100px;
        max-width: 200px;
        margin-bottom: 0;
        padding: 8px;
    }

    .sidebar-section h3 {
        font-size: 11px;
        margin-bottom: 6px;
        padding-bottom: 4px;
    }

    .sidebar-player-stats {
        gap: 8px;
    }

    .sidebar-stat .stat-icon {
        font-size: 16px;
    }

    .sidebar-stat span:last-child {
        font-size: 14px;
    }

    .sidebar-equipped {
        gap: 4px;
    }

    .equipped-slot {
        padding: 4px 8px;
    }

    .equipped-slot .slot-icon {
        font-size: 14px;
    }

    .equipped-slot .slot-name {
        font-size: 10px;
    }

    .sidebar-powerups {
        gap: 6px;
    }

    .powerup-slot {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }

    .combo-count {
        font-size: 20px;
    }

    .combo-bar {
        height: 6px;
        margin-top: 4px;
    }

    .sidebar-actions {
        flex-direction: row;
        margin-top: 0;
        gap: 6px;
    }

    .sidebar-btn {
        padding: 8px 12px;
        font-size: 11px;
        flex: 1;
    }

    /* Menu */
    #menuOverlay {
        padding: 20px;
    }

    .menu-title {
        font-size: 36px;
    }

    .menu-subtitle {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .menu-instructions {
        font-size: 12px;
        padding: 0 10px;
    }

    .menu-highscore {
        font-size: 16px;
        margin-top: 20px;
    }

    #startButton {
        padding: 15px 30px;
        font-size: 18px;
        margin-top: 25px;
    }

    .menu-buttons {
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 20px;
    }

    .menu-btn {
        padding: 10px 15px;
        font-size: 12px;
        flex: 1 1 45%;
        min-width: 120px;
    }

    .resume-btn {
        padding: 12px 30px;
        font-size: 16px;
    }

    /* User Info */
    .user-stats {
        gap: 10px;
        flex-wrap: wrap;
    }

    .user-stats span {
        padding: 4px 10px;
        font-size: 12px;
    }

    /* Game Over */
    #gameOverlay h1 {
        font-size: 38px;
    }

    #gameOverlay .finalScore {
        font-size: 22px;
    }

    .game-over-stats {
        flex-direction: column;
        gap: 10px;
    }

    #restartBtn {
        padding: 12px 35px;
        font-size: 18px;
    }

    #backToMenuBtn {
        padding: 8px 25px;
        font-size: 12px;
    }

    /* Modals */
    .modal-content {
        padding: 20px 15px;
        margin: 10px;
        max-height: 85vh;
    }

    .modal-content h2 {
        font-size: 22px;
    }

    .modal-close {
        top: 8px;
        right: 10px;
        font-size: 24px;
    }

    /* Auth Modal */
    .auth-modal {
        width: 95%;
    }

    .auth-tabs {
        margin-bottom: 15px;
    }

    .auth-tab {
        padding: 10px;
        font-size: 14px;
    }

    .auth-form input {
        padding: 12px;
        font-size: 16px;
    }

    .auth-submit {
        padding: 12px;
        font-size: 16px;
    }

    .social-login {
        flex-direction: column;
    }

    .social-btn {
        padding: 12px;
    }

    /* Shop Modal */
    .shop-modal {
        width: 100%;
        max-height: 90vh;
    }

    .shop-tabs {
        gap: 5px;
    }

    .shop-tab {
        padding: 8px 12px;
        font-size: 12px;
    }

    .shop-items {
        grid-template-columns: 1fr;
        max-height: 40vh;
    }

    .shop-item {
        padding: 12px;
    }

    .shop-header span {
        font-size: 16px;
    }

    /* Leaderboard Modal */
    .leaderboard-modal {
        width: 95%;
    }

    .leaderboard-entry {
        padding: 10px;
    }

    .leaderboard-rank {
        width: 30px;
        font-size: 14px;
    }

    .leaderboard-name {
        font-size: 14px;
    }

    .leaderboard-level {
        font-size: 10px;
        margin-right: 10px;
    }

    .leaderboard-score {
        font-size: 14px;
    }

    /* Settings Modal */
    .settings-modal {
        width: 95%;
    }

    .settings-tabs {
        gap: 3px;
    }

    .settings-tab {
        padding: 10px 5px;
        font-size: 12px;
    }

    .settings-group {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .settings-toggle,
    .settings-action-btn {
        width: 100%;
    }

    /* Inventory Modal */
    .inventory-modal {
        width: 95%;
    }

    .inventory-tab {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .inventory-items {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .inventory-item-icon {
        font-size: 24px;
    }

    .inventory-item-name {
        font-size: 10px;
    }

    /* Intro */
    #introText {
        font-size: 24px;
    }
}

/* ========================================
   PETIT MOBILE (< 480px)
   ======================================== */
@media screen and (max-width: 480px) {
    .menu-title {
        font-size: 28px;
        letter-spacing: 2px;
    }

    .menu-subtitle {
        font-size: 12px;
        margin-bottom: 15px;
    }

    .menu-instructions {
        font-size: 11px;
    }

    #startButton {
        padding: 12px 25px;
        font-size: 16px;
        letter-spacing: 2px;
    }

    .menu-buttons {
        gap: 8px;
    }

    .menu-btn {
        padding: 8px 12px;
        font-size: 11px;
        min-width: 100px;
    }

    .resume-btn {
        padding: 10px 25px;
        font-size: 14px;
    }

    /* Sidebar encore plus compacte */
    #gameSidebar {
        max-height: 120px;
        padding: 6px;
    }

    .sidebar-section {
        min-width: 80px;
        padding: 6px;
    }

    .sidebar-section h3 {
        font-size: 10px;
    }

    /* Modals */
    .modal-content h2 {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .shop-item-name {
        font-size: 12px;
    }

    .shop-item-desc {
        font-size: 10px;
    }

    .shop-buy-btn {
        padding: 6px 12px;
        font-size: 11px;
    }

    /* Touch controls plus grands sur petit écran */
    #touchControls.active {
        height: 100px;
        padding: 8px 15px;
    }

    .touch-btn {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    .touch-btn.jump {
        width: 75px;
        height: 75px;
        font-size: 28px;
    }
}

/* ========================================
   TRÈS PETIT MOBILE (< 360px)
   ======================================== */
@media screen and (max-width: 360px) {
    .menu-title {
        font-size: 24px;
    }

    .menu-btn {
        font-size: 10px;
        padding: 6px 10px;
    }

    #startButton {
        font-size: 14px;
        padding: 10px 20px;
    }

    #gameSidebar {
        max-height: 100px;
    }

    .sidebar-section {
        min-width: 70px;
    }
}

/* ========================================
   DESKTOP LARGE (> 1400px)
   ======================================== */
@media screen and (min-width: 1400px) {
    #gameSidebar {
        width: 320px;
    }

    .sidebar-section {
        padding: 15px;
    }

    .sidebar-stat span:last-child {
        font-size: 22px;
    }

    .combo-count {
        font-size: 32px;
    }

    .powerup-slot {
        width: 55px;
        height: 55px;
        font-size: 28px;
    }
}

/* ========================================
   PRÉFÉRENCE: MOUVEMENT RÉDUIT
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* ========================================
   MODE SOMBRE / CLAIR SYSTÈME
   ======================================== */
@media (prefers-color-scheme: light) {
    /* Le jeu reste sombre mais on peut ajouter des ajustements si besoin */
}

/* ========================================
   ORIENTATION LOCK MESSAGE
   ======================================== */
#orientationMessage {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #1a1a2e;
    color: white;
    z-index: 9999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

#orientationMessage .rotate-icon {
    font-size: 60px;
    margin-bottom: 20px;
    animation: rotate-hint 2s ease-in-out infinite;
}

#orientationMessage p {
    font-size: 18px;
    color: #bdc3c7;
}

@keyframes rotate-hint {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-20deg); }
    75% { transform: rotate(20deg); }
}

/* Afficher le message sur mobile portrait si l'écran est très petit en hauteur */
@media screen and (max-width: 600px) and (orientation: portrait) and (max-height: 400px) {
    #orientationMessage {
        display: flex;
    }
}
