* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    max-width: 100vw;
    height: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    background: linear-gradient(135deg, #1a3409 0%, #2d5016 50%, #1a3409 100%);
}

.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s;
}

.hidden {
    display: none !important;
}

/* Ana Menü */
.menu-container {
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    max-width: 500px;
    width: 90%;
}

.game-title {
    font-size: 64px;
    color: #fff;
    text-shadow: 0 0 20px #ff6b35, 0 0 40px #ff6b35;
    margin-bottom: 10px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.game-subtitle {
    color: #ffd700;
    font-size: 18px;
    margin-bottom: 30px;
}

.player-info {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.player-avatar {
    font-size: 80px;
    margin-bottom: 15px;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

#playerName {
    width: 100%;
    padding: 12px;
    font-size: 18px;
    border: 2px solid #ff6b35;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    text-align: center;
    margin-bottom: 15px;
    transition: all 0.3s;
}

#playerName:focus {
    outline: none;
    border-color: #ffd700;
    transform: scale(1.05);
}

.player-stats {
    display: flex;
    justify-content: space-around;
    color: #fff;
    font-size: 16px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.btn {
    padding: 15px 30px;
    font-size: 18px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: bold;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b35 0%, #ff8555 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #4a90e2 0%, #5aa3f0 100%);
    color: white;
}

.btn-shop {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
}

.btn-settings {
    background: linear-gradient(135deg, #666 0%, #888 100%);
    color: white;
}

.btn-icon {
    font-size: 24px;
}

.game-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.stat-box {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 25px;
    border-radius: 10px;
}

.stat-value {
    font-size: 28px;
    color: #ffd700;
    font-weight: bold;
}

.stat-label {
    color: #ccc;
    font-size: 14px;
    margin-top: 5px;
}

/* Market */
.shop-container, .settings-container, .gameover-container {
    background: rgba(0, 0, 0, 0.9);
    padding: 30px;
    border-radius: 20px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.shop-title, .settings-title {
    color: #fff;
    font-size: 36px;
    text-align: center;
    margin-bottom: 20px;
}

.shop-balance {
    text-align: center;
    font-size: 24px;
    color: #ffd700;
    margin-bottom: 20px;
}

.shop-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.shop-tab {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 10px;
    color: #ccc;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
}

.shop-tab:hover {
    background: rgba(255, 255, 255, 0.2);
}

.shop-tab.active {
    background: rgba(255, 107, 53, 0.3);
    border-color: #ff6b35;
    color: #fff;
}

.shop-section {
    display: none;
}

.shop-section.active {
    display: block;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.shop-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.shop-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
}

.shop-item.owned {
    border-color: #4ade80;
}

.shop-item.selected {
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.shop-item-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.shop-item-name {
    color: #fff;
    font-size: 16px;
    margin-bottom: 8px;
    font-weight: bold;
}

.shop-item-price {
    color: #ffd700;
    font-size: 14px;
}

.shop-item-owned {
    color: #4ade80;
    font-size: 14px;
}

/* Ayarlar */
.settings-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setting-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setting-item label {
    color: #fff;
    font-size: 18px;
}

.setting-item input[type="range"] {
    width: 200px;
}

.setting-item select {
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    font-size: 16px;
}

/* Oyun Ekranı */
#gameCanvas {
    display: block;
    background: #3a5f1f;
}

#gameUI {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.ui-panel {
    position: absolute;
    pointer-events: all;
}

.top-left {
    top: 20px;
    left: 20px;
}

.top-right {
    top: 20px;
    right: 20px;
    z-index: 150;
}

.bottom-left {
    bottom: 20px;
    left: 20px;
    z-index: 150;
}

.bottom-right {
    bottom: 20px;
    right: 20px;
}

.player-card {
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 10px;
    border-radius: 10px;
    display: flex;
    gap: 8px;
    align-items: center;
    backdrop-filter: blur(10px);
}

.player-avatar-small {
    font-size: 24px;
}

.player-info-game {
    flex: 1;
}

.player-name-game {
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 4px;
}

.player-size {
    display: flex;
    align-items: center;
    gap: 10px;
}

.size-bar {
    flex: 1;
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.size-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ade80 0%, #22c55e 100%);
    transition: width 0.3s;
}

#sizeText {
    color: #ffd700;
    font-weight: bold;
    font-size: 11px;
}

.level-badge {
    background: linear-gradient(135deg, #ff6b35 0%, #ff8555 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    margin-top: 10px;
    text-align: center;
    font-weight: bold;
}

.leaderboard {
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 12px;
    min-width: 250px;
    backdrop-filter: blur(10px);
}

.leaderboard h3 {
    color: #ffd700;
    margin-bottom: 10px;
    text-align: center;
}

.leader-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    margin-bottom: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.leader-rank {
    color: #ffd700;
    font-weight: bold;
    min-width: 25px;
}

.leader-avatar {
    font-size: 20px;
}

.leader-name {
    color: #fff;
    flex: 1;
}

.leader-score {
    color: #4ade80;
    font-weight: bold;
}

.minimap {
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

#minimapCanvas {
    display: block;
    border-radius: 8px;
}

.abilities {
    display: flex;
    gap: 10px;
}

.ability {
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.ability-icon {
    font-size: 24px;
}

.ability-key {
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    margin-top: 2px;
}

.ability-cooldown {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
}

.notifications {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    z-index: 500;
}

.notification {
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    animation: slideIn 0.3s, slideOut 0.3s 2.7s;
    white-space: nowrap;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(-50px); opacity: 0; }
}

.fps-counter {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #4ade80;
    padding: 8px 16px;
    border-radius: 8px;
    font-family: monospace;
}

.pause-menu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
}

.pause-menu h2 {
    color: #fff;
    margin-bottom: 30px;
}

.pause-menu .btn {
    margin: 10px;
}

/* Oyun Sonu */

.gameover-title {
    color: #fff;
    font-size: 48px;
    text-align: center;
    margin-bottom: 30px;
}

.gameover-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-large {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    font-size: 48px;
}

.stat-info {
    flex: 1;
}

.stat-label {
    color: #ccc;
    font-size: 14px;
    margin-bottom: 5px;
}

.stat-value-large {
    color: #ffd700;
    font-size: 32px;
    font-weight: bold;
}

.gameover-achievements {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    min-height: 100px;
}

.gameover-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 107, 53, 0.5);
    border-radius: 5px;
}

/* ===== MOBİL OYUN BİTTİ EKRANI ===== */
@media (max-width: 768px) {
    .gameover-container {
        padding: 14px 12px !important;
        width: 96vw !important;
        max-width: 96vw !important;
        max-height: 96vh !important;
        overflow-y: auto !important;
        border-radius: 14px !important;
    }

    .gameover-title {
        font-size: 22px !important;
        margin-bottom: 10px !important;
    }

    /* 4 stat kutusu: 2x2 grid, kompakt */
    .gameover-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        margin-bottom: 10px !important;
    }

    .stat-large {
        padding: 8px 10px !important;
        gap: 8px !important;
        border-radius: 8px !important;
    }

    .stat-icon {
        font-size: 24px !important;
    }

    .stat-label {
        font-size: 10px !important;
        margin-bottom: 2px !important;
    }

    .stat-value-large {
        font-size: 18px !important;
    }

    .gameover-achievements {
        padding: 8px 10px !important;
        margin-bottom: 10px !important;
        min-height: unset !important;
        font-size: 12px !important;
    }

    .gameover-buttons {
        gap: 8px !important;
    }

    .gameover-buttons .btn {
        padding: 10px 14px !important;
        font-size: 13px !important;
        flex: 1 !important;
    }
}

/* Yatay modda oyun bitti: sol stats, sağ achievements+butonlar */
@media (max-width: 900px) and (orientation: landscape) {
    .gameover-container {
        padding: 10px 14px !important;
        width: 98vw !important;
        max-width: 98vw !important;
        max-height: 94vh !important;
        overflow-y: auto !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: auto !important;
        gap: 10px !important;
        align-items: start !important;
    }

    .gameover-title {
        grid-column: 1 / -1 !important;
        font-size: 18px !important;
        margin-bottom: 4px !important;
    }

    .gameover-stats {
        grid-column: 1 !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
        margin-bottom: 0 !important;
    }

    .stat-large {
        padding: 6px 8px !important;
        gap: 6px !important;
    }

    .stat-icon {
        font-size: 20px !important;
    }

    .stat-label {
        font-size: 9px !important;
    }

    .stat-value-large {
        font-size: 15px !important;
    }

    .gameover-achievements {
        grid-column: 2 !important;
        padding: 8px !important;
        margin-bottom: 6px !important;
        min-height: unset !important;
        font-size: 11px !important;
    }

    .gameover-buttons {
        grid-column: 2 !important;
        gap: 6px !important;
    }

    .gameover-buttons .btn {
        padding: 8px 10px !important;
        font-size: 12px !important;
        flex: 1 !important;
    }
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 107, 53, 0.7);
}

/* ===== LOBİ SOHBETİ ===== */
#lobbyChat {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10;
    width: 300px;
    background: rgba(0,0,0,0.78);
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#lobbyChatHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255,107,53,0.25);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    flex-shrink: 0;
}
#lobbyChatMessages {
    height: 200px;
    overflow-y: auto;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
#lobbyChatMessages::-webkit-scrollbar { width: 3px; }
#lobbyChatMessages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }
.chat-msg { font-size: 12px; line-height: 1.4; word-break: break-word; color: #ddd; animation: fadeInMsg 0.2s ease; }
.chat-msg .chat-name { font-weight: bold; margin-right: 3px; }
.chat-msg.system { color: #999; font-style: italic; text-align: center; font-size: 11px; }
@keyframes fadeInMsg {
    from { opacity: 0; transform: translateY(3px); }
    to   { opacity: 1; transform: translateY(0); }
}
#lobbyChatInput {
    display: flex;
    gap: 6px;
    padding: 8px 10px;
    border-top: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}
#lobbyChatText {
    flex: 1;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    color: #fff;
    padding: 6px 10px;
    font-size: 12px;
    outline: none;
}
#lobbyChatText:focus { border-color: #ff6b35; }
#lobbyChatText::placeholder { color: rgba(255,255,255,0.35); }
#lobbyChatSend {
    background: #ff6b35;
    border: none;
    border-radius: 8px;
    color: white;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 14px;
}
#lobbyChatSend:hover { background: #ff8555; }

/* ===== LOBBY WRAPPER ===== */
#mainMenu {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

#lobbyWrapper {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    z-index: 10;
    padding: 20px;
    min-height: calc(100vh - 40px);
}

/* Sohbet - Varsayılan olarak gizli */
#lobbyChat {
    display: none !important;
    width: 420px !important;
    position: relative !important;
    bottom: auto !important;
    right: auto !important;
    border-radius: 20px 0 0 20px !important;
    border-right: none !important;
    flex-direction: column;
}

#lobbyChatMessages {
    flex: 1 !important;
    height: auto !important;
}

/* Menü - Ortada */
#lobbyMenu {
    width: 420px !important;
    max-width: 420px !important;
    border-radius: 20px !important;
    margin: 0 !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
}


/* ===== STATİSTİK EKRANI ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(255,107,53,0.2) 0%, rgba(255,215,0,0.1) 100%);
    border: 1px solid rgba(255,215,0,0.3);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    color: #fff;
}

.stat-card-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.stat-card-value {
    font-size: 28px;
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 5px;
}

.stat-card-label {
    font-size: 12px;
    color: #ccc;
}

.history-list {
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: #ddd;
    font-size: 14px;
}

.history-item:last-child {
    border-bottom: none;
}

.history-date {
    color: #999;
    min-width: 80px;
}

.history-score, .history-kills, .history-time {
    flex: 1;
    text-align: center;
}

.history-rank {
    min-width: 40px;
    text-align: right;
    font-weight: bold;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.achievement-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    border: 1px solid rgba(255,215,0,0.2);
    transition: all 0.3s;
}

.achievement-item.locked {
    opacity: 0.5;
    border-color: rgba(255,255,255,0.1);
}

.achievement-item.unlocked {
    border-color: rgba(255,215,0,0.5);
    background: rgba(255,215,0,0.1);
}

.achievement-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,215,0,0.2);
}

.ach-icon {
    font-size: 24px;
    min-width: 30px;
}

.ach-info {
    flex: 1;
}

.ach-name {
    color: #fff;
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 3px;
}

.ach-desc {
    color: #999;
    font-size: 11px;
}

.ach-reward {
    color: #ffd700;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

/* ===== BAŞARIM BİLDİRİMİ ===== */
.achievement-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    border: 1px solid rgba(255,215,0,0.5);
    padding: 10px 16px;
    border-radius: 12px;
    display: flex;
    gap: 10px;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    transform: translateX(300px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.3);
    max-width: 260px;
}

.achievement-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.achievement-icon {
    font-size: 24px;
}

.achievement-info {
    color: #fff;
}

.achievement-title {
    font-size: 10px;
    color: #ffd700;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.achievement-name {
    font-size: 13px;
    font-weight: bold;
    margin: 2px 0;
}

.achievement-reward {
    font-size: 12px;
    color: #ffd700;
}

/* ===== GLOBAL LEADERBOARD ===== */
.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    margin-bottom: 10px;
    border-left: 4px solid transparent;
}

.leaderboard-item:nth-child(1) {
    border-left-color: #ffd700;
    background: rgba(255,215,0,0.1);
}

.leaderboard-item:nth-child(2) {
    border-left-color: #c0c0c0;
    background: rgba(192,192,192,0.05);
}

.leaderboard-item:nth-child(3) {
    border-left-color: #cd7f32;
    background: rgba(205,127,50,0.05);
}

.leaderboard-rank {
    font-size: 24px;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
}

.leaderboard-rank.first { color: #ffd700; }
.leaderboard-rank.second { color: #c0c0c0; }
.leaderboard-rank.third { color: #cd7f32; }

.leaderboard-info {
    flex: 1;
}

.leaderboard-name {
    color: #fff;
    font-weight: bold;
    font-size: 16px;
}

.leaderboard-stats {
    color: #999;
    font-size: 12px;
    margin-top: 3px;
}

.leaderboard-score {
    text-align: right;
    color: #4ade80;
    font-weight: bold;
    font-size: 18px;
}

/* ===== AUTH MODAL ===== */
#authModal input:focus {
    border-color: #ff6b35 !important;
    background: rgba(255,255,255,0.15) !important;
}

#authError {
    animation: shake 0.3s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ===== LATENCY GÖSTERGESI ===== */
#latencyDisplay {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* ===== MOBİL VIEWPORT DÜZELTMESİ - MOBILE-FIRST YAKLAŞIMI ===== */

/* TEMEL MOBİL AYARLAR (Tüm cihazlar için) */
* {
    -webkit-tap-highlight-color: transparent;
    max-width: 100vw; /* Taşmayı engelle */
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    max-width: 100vw;
    max-height: 100vh;
}

.screen {
    max-width: 100vw;
    max-height: 100vh;
}

#gameUI {
    max-width: 100vw;
    max-height: 100vh;
}

/* Küçük telefonlar (0-480px) */
@media (max-width: 480px) {
    .ui-panel {
        font-size: clamp(10px, 2.5vw, 12px);
        padding: clamp(4px, 1vw, 8px);
    }
    
    .menu-container {
        width: 95vw !important;
        max-width: 95vw;
        padding: clamp(10px, 3vw, 15px);
    }
    
    .btn {
        font-size: clamp(12px, 3vw, 14px);
        padding: clamp(8px, 2vw, 10px);
    }
}

/* Orta boy telefonlar (481-640px) */
@media (min-width: 481px) and (max-width: 640px) {
    .ui-panel {
        font-size: clamp(12px, 2.5vw, 14px);
        padding: clamp(6px, 1.5vw, 10px);
    }
    
    .menu-container {
        width: 90vw !important;
        max-width: 90vw;
    }
    
    .btn {
        font-size: clamp(13px, 3vw, 15px);
    }
}

/* Büyük telefonlar (641-768px) */
@media (min-width: 641px) and (max-width: 768px) {
    .ui-panel {
        font-size: clamp(13px, 2.5vw, 15px);
    }
    
    .menu-container {
        width: 85vw !important;
        max-width: 85vw;
    }
}

/* ===== MOBİL MENU (0-768px) - PC'ye dokunmaz ===== */
@media (max-width: 768px) {
    /* Lobby wrapper: yan yana → tek sütun, sadece menü */
    #lobbyWrapper {
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
        padding: 0 12px !important;
        box-sizing: border-box !important;
    }

    /* Sohbet panelini mobilde gizle */
    #lobbyChat {
        display: none !important;
    }

    /* Menü tam genişlik, köşeleri düzelt */
    #lobbyMenu {
        width: 100% !important;
        max-width: 340px !important;
        border-radius: 20px !important;
        border-left: none !important;
        margin: 0 auto !important;
        padding: 14px 12px !important;
    }

    /* Başlık küçült */
    .game-title {
        font-size: 28px !important;
        margin-bottom: 4px !important;
    }

    .game-subtitle {
        font-size: 11px !important;
        margin-bottom: 12px !important;
    }

    /* Avatar küçült */
    .player-avatar {
        font-size: 40px !important;
        margin-bottom: 6px !important;
    }

    /* Player info daha kompakt */
    .player-info {
        padding: 8px !important;
        margin-bottom: 10px !important;
    }

    #playerName {
        font-size: 13px !important;
        padding: 7px !important;
        margin-bottom: 8px !important;
    }

    .player-stats {
        font-size: 11px !important;
    }

    /* Butonlar daha küçük */
    .menu-buttons {
        gap: 6px !important;
        margin-bottom: 10px !important;
    }

    .btn {
        padding: 9px 12px !important;
        font-size: 13px !important;
        border-radius: 8px !important;
    }

    .btn-icon {
        font-size: 15px !important;
    }

    /* İstatistik kutuları */
    .game-stats {
        gap: 8px !important;
    }

    .stat-box {
        padding: 7px 12px !important;
    }

    .stat-value {
        font-size: 16px !important;
    }

    .stat-label {
        font-size: 10px !important;
    }

    /* Ana menü ekranı scroll edilebilir */
    #mainMenu {
        align-items: flex-start !important;
        padding: max(20px, env(safe-area-inset-top)) 0 max(20px, env(safe-area-inset-bottom)) !important;
        overflow-y: auto !important;
    }
}

/* ===== MOBİL LANDSCAPE (yatay mod) ===== */
@media (max-width: 900px) and (orientation: landscape) {
    #mainMenu {
        align-items: center !important;
        padding: 8px !important;
        overflow-y: auto !important;
    }

    #lobbyWrapper {
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
        padding: 0 8px !important;
    }

    #lobbyChat {
        display: none !important;
    }

    #lobbyMenu {
        width: 100% !important;
        max-width: 700px !important;
        border-radius: 16px !important;
        border-left: none !important;
        margin: 0 auto !important;
        padding: 12px 16px !important;
    }

    /* Başlık + subtitle yan yana küçük */
    .game-title {
        font-size: 22px !important;
        margin-bottom: 2px !important;
        display: inline !important;
    }

    .game-subtitle {
        font-size: 10px !important;
        margin-bottom: 8px !important;
    }

    /* İçeriği 2 sütuna böl */
    .menu-content {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        align-items: start !important;
    }

    /* Sol sütun: player-info */
    .player-info {
        padding: 8px !important;
        margin-bottom: 0 !important;
    }

    .player-avatar {
        font-size: 36px !important;
        margin-bottom: 4px !important;
    }

    #playerName {
        font-size: 12px !important;
        padding: 6px !important;
        margin-bottom: 6px !important;
    }

    .player-stats {
        font-size: 10px !important;
        flex-direction: column !important;
        gap: 2px !important;
    }

    /* Sağ sütun: butonlar */
    .menu-buttons {
        gap: 5px !important;
        margin-bottom: 0 !important;
    }

    .btn {
        padding: 7px 10px !important;
        font-size: 12px !important;
        border-radius: 8px !important;
    }

    .btn-icon {
        font-size: 13px !important;
    }

    /* Stats kutusu: 2 sütunun altına tam genişlik */
    .game-stats {
        grid-column: 1 / -1 !important;
        gap: 8px !important;
        justify-content: center !important;
    }

    .stat-box {
        padding: 5px 12px !important;
    }

    .stat-value {
        font-size: 14px !important;
    }

    .stat-label {
        font-size: 9px !important;
    }
}
    .ui-panel {
        font-size: 16px;
    }
    
    .menu-container {
        width: 70vw !important;
        max-width: 600px;
    }
}

/* Tablet landscape ve küçük laptop (1025-1280px) */
@media (min-width: 1025px) and (max-width: 1280px) {
    .ui-panel {
        font-size: 16px;
    }
    
    .menu-container {
        width: 450px;
    }
}

/* Masaüstü (1281px+) */
@media (min-width: 1281px) {
    .ui-panel {
        font-size: 18px;
    }
    
    .menu-container {
        width: 450px;
    }
}




/* Auth modal landscape mobil */
@media (max-width: 900px) and (orientation: landscape) {
    #authModal {
        align-items: flex-start !important;
        padding: 10px 0 !important;
        overflow-y: auto !important;
    }
    
    #authModal > div {
        padding: 16px !important;
        margin: auto !important;
    }
    
    #authModal h2 {
        font-size: 18px !important;
        margin-bottom: 12px !important;
    }
    
    #authModal input {
        padding: 8px !important;
        font-size: 14px !important;
    }
    
    #authModal .btn {
        padding: 9px !important;
        font-size: 14px !important;
    }
    
    #authModal > div > div {
        gap: 8px !important;
    }
}

/* ===== MOBİL PERFORMANS OPTİMİZASYONU ===== */
@media (max-width: 768px) {
    /* backdrop-filter kaldır - iOS'ta çok ağır */
    .ui-panel,
    .player-card,
    .leaderboard,
    .minimap,
    #mobileJoystick,
    #fullscreenToggle,
    #minimapToggle,
    #leaderboardToggle,
    #mergeButton {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /* Masaüstü toggle butonlarını mobilde gizle */
    #leaderboardToggleDesktop,
    #minimapToggleDesktop {
        display: none !important;
    }
    
    /* Canvas rendering optimizasyonu */
    #gameCanvas {
        image-rendering: auto !important;
    }
}



/* ===== ANİMASYONLU AYI KAFASI İKONLARI ===== */
.animated-bear-icon {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.bear-head {
    animation: bearBounce 1.2s ease-in-out infinite;
    transform-origin: center;
}

.bear-ear {
    animation: earWiggle 1.5s ease-in-out infinite;
    transform-origin: center;
}

.bear-eye-group {
    animation: eyeBlink 3s ease-in-out infinite;
}

.bear-eye-group.left-eye {
    animation: eyeBlink 3s ease-in-out infinite, eyeLookLeft 2s ease-in-out infinite;
}

.bear-eye-group.right-eye {
    animation: eyeBlink 3s ease-in-out infinite, eyeLookRight 2s ease-in-out infinite;
}

.bear-mouth {
    animation: mouthSmile 1.5s ease-in-out infinite;
}

/* Zıplama animasyonu - hafif ve doğal */
@keyframes bearBounce {
    0%, 100% {
        transform: translateY(0px);
    }
    25% {
        transform: translateY(-2px);
    }
    50% {
        transform: translateY(0px);
    }
    75% {
        transform: translateY(-1px);
    }
}

/* Kulak sallanması */
@keyframes earWiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-3deg);
    }
    50% {
        transform: rotate(0deg);
    }
    75% {
        transform: rotate(3deg);
    }
}

/* Göz kırpma */
@keyframes eyeBlink {
    0%, 10%, 100% {
        transform: scaleY(1);
    }
    5% {
        transform: scaleY(0.1);
    }
}

/* Sol göz sağa bakma */
@keyframes eyeLookLeft {
    0%, 100% {
        transform: translateX(-1px);
    }
    50% {
        transform: translateX(2px);
    }
}

/* Sağ göz sola bakma */
@keyframes eyeLookRight {
    0%, 100% {
        transform: translateX(1px);
    }
    50% {
        transform: translateX(-2px);
    }
}

/* Ağız gülüş animasyonu */
@keyframes mouthSmile {
    0%, 100% {
        stroke-width: 0.5px;
        opacity: 0.8;
    }
    50% {
        stroke-width: 1px;
        opacity: 1;
    }
}

/* Bildirimler (Notifications) */
.notifications {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.notification {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    min-width: 300px;
    animation: slideInDown 0.3s ease, fadeOut 0.3s ease 2.7s;
    pointer-events: auto;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}
