* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    /* Remove blue tap highlight on mobile */
    touch-action: manipulation;
    /* Prevent zoom on double-tap */
}

:root {
    --primary-color: #ff0055;
    --secondary-color: #00ff88;
    --danger-color: #ff3333;
    --dark-bg: #0a0e27;
    --dark-surface: #151932;
    --text-primary: #ffffff;
    --text-secondary: #a0a0c0;
    --neon-glow: 0 0 20px rgba(255, 0, 85, 0.5);
    --neon-glow-green: 0 0 20px rgba(0, 255, 136, 0.5);
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* Prevent scrolling */
    position: fixed;
    /* Lock viewport on iOS */
    overscroll-behavior: none;
    /* Prevent bounce */
    font-family: 'Rajdhani', sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
    color: var(--text-primary);
}

/* ... existing styles ... */

/* Mobile Controls */
.mobile-only {
    display: none;
}

@media (pointer: coarse) {
    .mobile-only {
        display: block !important;
    }
}

.joystick-container {
    position: absolute;
    bottom: calc(20px + env(safe-area-inset-bottom));
    /* iOS Safe Area */
    width: 120px;
    /* Reduced to 120px */
    height: 120px;
    z-index: 20;
    pointer-events: auto;
    touch-action: none;
}

#joystick-move {
    left: 20px;
}

#joystick-aim {
    right: 20px;
}

/* Joystick Base & Hand (Shared) */
.joystick-base {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.1) 60%, rgba(255, 255, 255, 0.05) 100%);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    position: relative;
    backdrop-filter: blur(2px);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.joystick-hand {
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, rgba(0, 255, 136, 0.8) 0%, rgba(0, 255, 136, 0.4) 100%);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.6);
}

/* Distinct color for Aim Joystick Hand */
#joystick-aim .joystick-hand {
    background: radial-gradient(circle, #ff0055 0%, #cc0044 100%);
    /* Red for fire */
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.6);
}

/* Base style for mobile action buttons */
.mobile-switch-btn,
.mobile-reload-btn {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(10, 14, 39, 0.6);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 100;
    pointer-events: auto;
    user-select: none;
    cursor: pointer;
    touch-action: manipulation;
    text-align: center;
    transition: transform 0.1s;
}

.mobile-switch-btn:active,
.mobile-reload-btn:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.2);
}

#mobile-switch {
    right: 20px;
    bottom: 160px;
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

#mobile-reload {
    right: 140px;
    /* Adjusted to sit next to the new aim joystick */
    bottom: calc(30px + env(safe-area-inset-bottom));
    border-color: #00ccff;
    color: #00ccff;
    box-shadow: 0 0 10px rgba(0, 204, 255, 0.3);
}

/* Audio Controls */
.audio-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    align-items: center;
    pointer-events: auto;
    z-index: 2000;
    /* Ensure on top of everything */
}

.audio-btn {
    background: rgba(10, 14, 39, 0.6);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
    pointer-events: auto;
    z-index: 1000;
    position: relative;
}

.audio-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

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

.audio-btn.muted {
    opacity: 0.5;
    border-color: #ff0055;
}

/* Responsive */
@media (max-width: 1200px) {
    #game-canvas {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
    }
}

@media (max-width: 768px) {
    .game-title {
        font-size: 2rem;
    }

    .hud-top {
        padding: 5px;
        gap: 5px;
    }

    .level-number {
        font-size: 1.5rem;
    }

    .level-display {
        padding: 5px 15px;
    }

    .stats-row {
        gap: 10px;
        justify-content: center;
    }

    .stat-box {
        padding: 2px 8px;
        font-size: 0.7rem;
    }

    .hud-bottom {
        bottom: auto;
        top: 80px;
        left: 0;
        right: 0;
        flex-direction: row;
        justify-content: space-between;
        padding: 0 10px;
        pointer-events: none;
    }

    .weapon-info,
    .health-bar {
        min-width: auto;
        padding: 8px;
        background: rgba(10, 14, 39, 0.7);
    }

    .weapon-name {
        font-size: 0.9rem;
    }

    .ammo-count {
        font-size: 1.1rem;
    }

    .health-text {
        font-size: 1rem;
    }

    .weapon-hint {
        display: none;
    }
}

/* Screens */
/* Screens */
.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: none;
    overflow-y: auto;
    /* Enable scrolling */
    -webkit-overflow-scrolling: touch;
    padding: 20px 0;
    /* Add bottom padding for scroll space */
    z-index: 50;
    /* Ensure on top */
}

.screen.active {
    display: flex;
    /* Use margin: auto on child to center, allowing scroll when overflowing */
}

/* Lobby Screen */
.lobby-container {
    text-align: center;
    max-width: 500px;
    width: 90%;
    background: rgba(15, 20, 45, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 25px;
    padding: 30px;
    padding-bottom: 80px; /* Footer için boşluk */
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(255, 0, 85, 0.1);
    margin: auto;
    /* Centers perfectly in flex container */
    position: relative;
    /* Ensure minimal touch targets don't get cut off */
    min-height: min-content;
}

.game-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    /* Adjusted for mobile */
    font-weight: 900;
    margin-bottom: 20px;
    text-transform: uppercase;
    background: linear-gradient(180deg, #fff, #a0a0a0);
    /* Metallic text */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
}

/* Aktif Oyuncu Sayısı Badge */
.online-players-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.15), rgba(0, 200, 100, 0.1));
    border: 1px solid rgba(0, 255, 136, 0.4);
    border-radius: 20px;
    padding: 8px 18px;
    margin-bottom: 25px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
    animation: badge-glow 2s ease-in-out infinite;
}

@keyframes badge-glow {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(0, 255, 136, 0.2);
    }

    50% {
        box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
    }
}

.online-players-badge #online-count {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.8);
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background: #00ff88;
    border-radius: 50%;
    animation: pulse-dot 1.5s ease-in-out infinite;
    box-shadow: 0 0 8px #00ff88;
}

@keyframes pulse-dot {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

.lobby-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.player-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.player-info input[type="text"] {
    width: 100%;
    padding: 18px 25px;
    font-size: 1.1rem;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    transition: all 0.3s ease;
    text-align: center;
    /* Center text input */
}

.player-info input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 20px rgba(255, 0, 85, 0.2);
}

.room-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

.room-join {
    display: flex;
    gap: 10px;
}

.room-join input {
    flex: 1;
    padding: 15px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    text-align: center;
    letter-spacing: 2px;
}

/* Buttons */
.btn {
    padding: 18px 30px;
    font-size: 1rem;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    width: 100%;
    /* Full width buttons */
    box-shadow: 0 5px 0 #990033;
    /* 3D effect */
}

.btn-primary:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #990033;
}

.btn-secondary {
    background: var(--secondary-color);
    color: #000;
    flex: 1;
    box-shadow: 0 5px 0 #00aa55;
}

.btn-secondary:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #00aa55;
}

/* Mobile Specific Tweaks for Lobby */
@media (max-width: 600px) {
    .lobby-container {
        width: 95%;
        padding: 20px;
    }

    .game-title {
        font-size: 2rem;
        margin-bottom: 30px;
    }

    .room-join {
        flex-direction: column;
        /* Stack input and button on small screens */
    }

    .btn {
        padding: 15px;
        /* Taller touch targets */
    }
}

.btn-success {
    background: linear-gradient(135deg, #00ff88, #00cc66);
    color: var(--dark-bg);
    box-shadow: var(--neon-glow-green);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #cc0000);
    color: white;
}

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

/* Room Info */
.room-info {
    background: rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: 15px;
    border: 2px solid rgba(0, 255, 136, 0.3);
}

.room-info h2 {
    font-family: 'Orbitron', sans-serif;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.players-list {
    margin: 20px 0;
}

.players-list h3 {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.players-list ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.players-list li {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 20px;
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
    font-size: 1.1rem;
}

/* Game Screen */
#game-canvas {
    display: block;
    background: #2a2a3a;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    margin: auto;
    /* Center in flex container */
}

/* HUD */
.hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
    z-index: 10;
}

.hud-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    gap: 15px;
}

.level-display {
    background: rgba(0, 0, 0, 0.8);
    border: 3px solid #fff;
    padding: 10px 40px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.level-label {
    font-size: 0.8rem;
    color: #aaa;
    letter-spacing: 2px;
}

.level-number {
    font-size: 2.5rem;
    font-weight: 900;
    color: #fff;
    font-family: 'Orbitron', sans-serif;
}

.stats-row {
    display: flex;
    gap: 20px;
}

.stat-box {
    background: rgba(0, 0, 0, 0.6);
    padding: 5px 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-family: 'Orbitron', sans-serif;
}

.stat-box .label {
    color: #888;
    font-size: 0.9rem;
    margin-right: 5px;
}

.stat-box span:last-child {
    color: #00ff88;
    font-weight: 700;
}

.hud-bottom {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    gap: 20px;
}

.weapon-info {
    background: rgba(10, 14, 39, 0.9);
    backdrop-filter: blur(10px);
    padding: 20px 30px;
    border-radius: 10px;
    border: 2px solid rgba(255, 0, 85, 0.3);
    box-shadow: var(--neon-glow);
    min-width: 250px;
}

.weapon-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.ammo-count {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.weapon-hint {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.health-bar {
    background: rgba(10, 14, 39, 0.9);
    backdrop-filter: blur(10px);
    padding: 20px 30px;
    border-radius: 10px;
    border: 2px solid rgba(255, 0, 85, 0.3);
    box-shadow: var(--neon-glow);
    min-width: 300px;
    position: relative;
}

.health-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--danger-color), var(--primary-color));
    border-radius: 10px;
    transition: width 0.3s ease;
    opacity: 0.3;
}

.health-text {
    position: relative;
    z-index: 1;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Overlays */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 39, 0.95);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 100;
    overflow-y: auto !important;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y !important;
    padding: 20px 0;
}

/* Override global touch-action for overlay scrolling */
.overlay *,
.overlay-content,
.overlay-content * {
    touch-action: pan-y !important;
}

.overlay-content {
    text-align: center;
    background: rgba(21, 25, 50, 0.9);
    backdrop-filter: blur(10px);
    padding: 50px;
    border-radius: 20px;
    border: 2px solid rgba(255, 0, 85, 0.5);
    box-shadow: var(--neon-glow);
    margin: auto;
    max-width: 95%;
}

.overlay-content h1 {
    /* Keep legacy for other overlays if any */
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    margin-bottom: 30px;
    color: var(--primary-color);
    text-shadow: var(--neon-glow);
}

.game-over-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 3.5rem;
    color: var(--danger-color);
    /* Red for Game Over */
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.6);
    margin-bottom: 20px;
    margin-top: 0;
    animation: pulse 2s infinite;
}

.winner-section {
    margin-bottom: 30px;
    animation: slideDown 0.5s ease-out;
}

.trophy {
    font-size: 4rem;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 10px gold);
    animation: bounce 1s infinite alternate;
}

.winner-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    color: #ffcc00;
    /* Gold */
    font-weight: 900;
    text-transform: uppercase;
    text-shadow: 0 0 15px rgba(255, 204, 0, 0.6);
    margin: 5px 0;
}

.winner-label {
    font-size: 1rem;
    color: var(--text-secondary);
    letter-spacing: 5px;
    text-transform: uppercase;
}

/* Leaderboard Table */
.leaderboard-container {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    min-width: 300px;
}

.final-leaderboard {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 5px;
    text-align: left;
}

.final-leaderboard th {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    padding: 0 10px 5px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.final-leaderboard td {
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
}

.final-leaderboard tr:first-child td {
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
}

.final-leaderboard tr:last-child td {
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
}

.final-leaderboard tr.is-me td {
    background: rgba(0, 255, 136, 0.15);
    color: #fff;
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-left: 3px solid var(--secondary-color);
}

/* Ranks */
.rank-1 {
    color: #ffcc00;
    font-weight: 900;
    text-shadow: 0 0 10px gold;
}

.rank-2 {
    color: #c0c0c0;
    font-weight: 800;
}

.rank-3 {
    color: #cd7f32;
    font-weight: 700;
}

.player-score {
    text-align: right;
    color: var(--secondary-color);
}

.final-level-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-top: 10px;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

    to {
        transform: translateY(-5px);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.loading-bar {
    width: 300px;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    margin: 30px auto;
    overflow: hidden;
}

.loading-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    animation: loading 2s ease-in-out;
    border-radius: 5px;
}

@keyframes loading {
    0% {
        width: 0%;
    }

    100% {
        width: 100%;
    }
}

.next-level-text {
    font-size: 1.2rem;
    color: var(--text-secondary);
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.level-msg {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 255, 136, 0.9);
    color: #000;
    padding: 10px 30px;
    border-radius: 50px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 1.2rem;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
    z-index: 1000;
    animation: fadeInOut 2s ease-in-out forwards;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translate(-50%, -20px);
    }

    15% {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    85% {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
}

/* Utility */
.hidden {
    display: none !important;
}

/* Mobile Controls */
/* Mobile Controls */
.mobile-only {
    display: none;
}

@media (pointer: coarse) {
    .mobile-only {
        display: block !important;
    }
}

.joystick-container {
    position: absolute;
    bottom: 20px;
    /* Lowered from 50px */
    width: 160px;
    /* Reduced from 200px */
    height: 160px;
    /* Reduced from 200px */
    z-index: 20;
    pointer-events: auto;
    touch-action: none;
}

#joystick-move {
    left: 20px;
    /* Closer to edge */
}

/* Fire button replaces joystick-aim */
.mobile-fire-btn {
    position: absolute;
    right: 20px;
    /* Closer to edge */
    bottom: 20px;
    /* Lowered from 50px */
    width: 140px;
    /* Reduced from 180px */
    height: 140px;
    /* Reduced from 180px */
    background: radial-gradient(circle, #ff0055 0%, #cc0044 100%);
    border: 4px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    color: white;
    font-size: 2.5rem;
    /* Reduced font size */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(255, 0, 85, 0.6);
    z-index: 20;
    pointer-events: auto;
    touch-action: manipulation;
    user-select: none;
}

.mobile-fire-btn:active {
    transform: scale(0.95);
    background: radial-gradient(circle, #ff3377 0%, #ff0055 100%);
    box-shadow: 0 0 50px rgba(255, 0, 85, 1);
}

.joystick-base {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.1) 60%, rgba(255, 255, 255, 0.05) 100%);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    position: relative;
    backdrop-filter: blur(2px);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.joystick-hand {
    width: 60px;
    /* Reduced from 80px */
    height: 60px;
    /* Reduced from 80px */
    background: radial-gradient(circle, rgba(0, 255, 136, 0.8) 0%, rgba(0, 255, 136, 0.4) 100%);
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.6);
}

/* Base style for mobile action buttons */
.mobile-switch-btn {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(10, 14, 39, 0.6);
    backdrop-filter: blur(10px);
    border: 3px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    display: grid;
    /* Changed to grid for better centering */
    place-items: center;
    /* Helper for centering */
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    /* Larger for icon */
    font-weight: 700;
    z-index: 100;
    pointer-events: auto;
    user-select: none;
    cursor: pointer;
    touch-action: manipulation;
    text-align: center;
    margin: 0;
    padding: 0;
    /* Important: remove padding to let grid center it */
    padding-bottom: 5px;
    /* Slight optical adjustment for some fonts */
    transition: transform 0.1s;
}

.mobile-switch-btn:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.2);
}

#mobile-switch {
    right: 30px;
    /* Moved to right side */
    bottom: 200px;
    /* Positioned above the aim joystick */
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

/* Responsive */
@media (max-width: 1200px) {
    #game-canvas {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain;
    }
}

@media (max-width: 768px) {
    .game-title {
        font-size: 2rem;
    }

    .hud-top {
        padding: 5px;
        gap: 5px;
    }

    .level-number {
        font-size: 1.5rem;
    }

    .level-display {
        padding: 5px 15px;
    }

    .stats-row {
        gap: 10px;
        justify-content: center;
    }

    .stat-box {
        padding: 2px 8px;
        font-size: 0.7rem;
    }

    /* Move HUD bottom to top-right/left area or simplify */
    .hud-bottom {
        bottom: auto;
        top: 130px;
        /* Moved down to clear top HUD and Chat */
        left: 0;
        right: 0;
        flex-direction: row;
        justify-content: space-between;
        padding: 0 10px;
        pointer-events: none;
        z-index: 5;
        /* Lower z-index than controls */
    }

    .weapon-info,
    .health-bar {
        min-width: auto;
        padding: 8px;
        background: rgba(10, 14, 39, 0.7);
    }

    .weapon-name {
        font-size: 0.9rem;
    }

    .ammo-count {
        font-size: 1.1rem;
    }

    .health-text {
        font-size: 1rem;
    }

    .weapon-hint {
        display: none;
    }

    /* Hide hint on mobile */

    .joystick-container {
        width: 130px;
        /* Even smaller for small mobiles */
        height: 130px;
        bottom: 20px;
    }

    #joystick-move {
        left: 20px;
    }

    .mobile-fire-btn {
        width: 110px;
        /* Even smaller for small mobiles */
        height: 110px;
        right: 20px;
        bottom: 20px;
        font-size: 2rem;
    }

    .joystick-hand {
        width: 50px;
        height: 50px;
    }

    #mobile-switch {
        right: 45px;
        left: auto;
        bottom: 159px;
        width: 70px;
        height: 69px;
        font-size: 1.8rem;
        display: flex !important;
        justify-content: center;
        align-items: center;
    }
}



/* ===== UNIFIED CHAT SYSTEM ===== */
.chat-ui {
    position: absolute;
    top: 240px;

    /* Sağ tarafa taşındı */
    left: 50px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;

    /* Sağa hizala */
}

.chat-toggle-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(30, 40, 70, 0.95), rgba(10, 15, 30, 0.98));
    border: 2px solid var(--secondary-color);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), 0 0 10px rgba(0, 255, 136, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--secondary-color);
}

.chat-content {
    background: rgba(15, 20, 40, 0.96);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px;
    width: 280px;
    max-height: 350px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: top right;
    /* Sağ tarafa göre animasyon */
}

.chat-ui.collapsed .chat-content {
    transform: scale(0) translateY(-20px);
    opacity: 0;
    pointer-events: none;
    max-height: 0;
    padding: 0;
    border: none;
}

.chat-history {
    flex: 1;
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 5px;
    scrollbar-width: thin;
    scrollbar-color: var(--secondary-color) rgba(0, 0, 0, 0.2);
}

.chat-history::-webkit-scrollbar {
    width: 5px;
}

.chat-history::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.chat-history::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 10px;
}

.chat-message-item {
    font-size: 0.85rem;
    color: #ddd;
    line-height: 1.4;
    word-break: break-word;
    padding: 4px 0;
}

.chat-message-item .author {
    color: var(--secondary-color);
    font-weight: 700;
    margin-right: 4px;
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.3);
}

#chat-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 10px 12px;
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    transition: all 0.2s;
}

#chat-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

#chat-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    background: rgba(0, 0, 0, 0.7);
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.15);
}

.error-pulse {
    border-color: #ff3333 !important;
    animation: shake 0.4s;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* Mobile Optimizations */
@media (max-width: 600px) {
    .chat-ui {
        top: 213px;
        /* Aligned with scoreboard icon */
        left: 15px;
    }

    .chat-content {
        width: 240px;
        max-height: 280px;
    }

    .chat-history {
        max-height: 160px;
    }

    #chat-input {
        font-size: 0.85rem;
        padding: 8px 10px;
    }
}

/* Scoreboard Overlay (Tab Key) */
.scoreboard {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 20, 45, 0.95);
    padding: 30px;
    border-radius: 15px;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 200;
    width: 600px;
    max-width: 90%;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

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

.scoreboard-title {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(255, 0, 85, 0.5);
    letter-spacing: 2px;
}

.scoreboard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 5px;
}

.scoreboard-table th {
    font-family: 'Orbitron', sans-serif;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.scoreboard-table td {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
}

.scoreboard-table tr:hover td {
    background: rgba(255, 255, 255, 0.1);
}

.scoreboard-table tr td:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    color: var(--secondary-color);
    font-weight: 700;
}

.scoreboard-table tr td:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    text-align: right;
    color: #ffcc00;
    /* Gold for score */
}

/* Highlight current player row */
.scoreboard-table tr.is-me td {
    background: rgba(255, 0, 85, 0.15);
    border-top: 1px solid rgba(255, 0, 85, 0.3);
    border-bottom: 1px solid rgba(255, 0, 85, 0.3);
}

.scoreboard-table tr.is-me td:first-child {
    border-left: 3px solid var(--primary-color);
}

.scoreboard-table tr.is-me td:last-child {
    border-right: 1px solid rgba(255, 0, 85, 0.3);
}

/* Scoreboard Mobile Button */
#mobile-scoreboard-btn {
    position: absolute;
    top: 70px;
    /* Below level indicator area (approx) */
    right: 10px;
    width: 40px;
    height: 40px;
    background: rgba(10, 14, 39, 0.9);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 100;
    display: none;
    /* Hidden by default on desktop */
}

@media (max-width: 768px) {
    .scoreboard {
        width: 95%;
        padding: 15px;
    }

    .scoreboard-title {
        font-size: 1.5rem;
    }

    .scoreboard-table td {
        padding: 10px;
        font-size: 1rem;
    }

    #mobile-scoreboard-btn {
        display: flex;
        /* Visible on mobile */
    }
}

/* ================================================
   EL BOMBASI (GRENADE) STİLLERİ
   ================================================ */

/* HUD Bomba Göstergesi */
.grenade-info {
    background: rgba(10, 14, 39, 0.9);
    backdrop-filter: blur(10px);
    padding: 15px 25px;
    border-radius: 10px;
    border: 2px solid rgba(255, 165, 0, 0.4);
    box-shadow: 0 0 15px rgba(255, 165, 0, 0.3);
    min-width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.grenade-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 10px rgba(255, 100, 0, 0.5));
    animation: grenadePulse 2s infinite ease-in-out;
}

@keyframes grenadePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.grenade-count {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #ff6600;
    text-shadow: 0 0 10px rgba(255, 102, 0, 0.5);
}

.grenade-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

/* Mobil Bomba Butonu */
.mobile-grenade-btn {
    position: absolute;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 100, 0, 0.8), rgba(200, 50, 0, 0.9));
    backdrop-filter: blur(10px);
    border: 3px solid rgba(255, 165, 0, 0.6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 100;
    pointer-events: auto;
    user-select: none;
    cursor: pointer;
    touch-action: manipulation;
    text-align: center;
    transition: all 0.15s ease;
    box-shadow:
        0 0 20px rgba(255, 100, 0, 0.4),
        0 5px 0 rgba(150, 50, 0, 0.8),
        inset 0 2px 5px rgba(255, 255, 255, 0.2);
}

.mobile-grenade-btn:active {
    transform: translateY(3px) scale(0.95);
    box-shadow:
        0 0 15px rgba(255, 100, 0, 0.6),
        0 2px 0 rgba(150, 50, 0, 0.8);
}

#mobile-grenade {
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(160px + env(safe-area-inset-bottom));
}

/* Bomba sayısı 0 olduğunda */
.grenade-info.empty .grenade-count {
    color: #666;
}

.grenade-info.empty .grenade-icon {
    filter: grayscale(1) opacity(0.5);
    animation: none;
}

/* Bomba atma animasyonu */
@keyframes grenadeThrow {
    0% {
        transform: scale(1) translateY(0);
    }

    50% {
        transform: scale(1.2) translateY(-10px);
    }

    100% {
        transform: scale(1) translateY(0);
    }
}

.grenade-thrown {
    animation: grenadeThrow 0.3s ease-out;
}

/* Responsive - Mobil */
@media (max-width: 768px) {
    .grenade-info {
        padding: 8px 15px;
        min-width: 80px;
    }

    .grenade-icon {
        font-size: 1.3rem;
    }

    .grenade-count {
        font-size: 1.2rem;
    }

    .grenade-hint {
        display: none;
    }

    #mobile-grenade {
        bottom: calc(140px + env(safe-area-inset-bottom));
    }
}

/* Bomba Patlaması Flash Efekti */
@keyframes explosionFlash {
    0% {
        background: rgba(255, 200, 0, 0.8);
        transform: scale(1);
    }

    50% {
        background: rgba(255, 100, 0, 0.6);
        transform: scale(1.5);
    }

    100% {
        background: transparent;
        transform: scale(2);
    }
}

.explosion-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    animation: explosionFlash 0.3s ease-out forwards;
    z-index: 1000;
}

/* ========================================
   JOYSTICK SETTINGS & CUSTOMIZATION
   ======================================== */

/* Settings Button */
.joystick-settings-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(10, 14, 39, 0.8);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.joystick-settings-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--primary-color);
    transform: rotate(90deg) scale(1.1);
}

.joystick-settings-btn:active {
    transform: rotate(90deg) scale(0.95);
}

/* Settings Panel */
.joystick-settings-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(10, 14, 39, 0.98);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 0, 85, 0.5);
    border-radius: 20px;
    padding: 30px;
    z-index: 999;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), var(--neon-glow);
    min-width: 320px;
    animation: slideIn 0.3s ease-out;
}

.joystick-settings-panel.hidden {
    display: none;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.settings-panel-content h3 {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-color);
    margin: 0 0 15px 0;
    text-align: center;
    font-size: 1.5rem;
    text-shadow: var(--neon-glow);
}

.settings-hint {
    color: var(--text-secondary);
    text-align: center;
    margin: 0 0 20px 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.settings-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.settings-btn {
    padding: 12px 20px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    text-transform: uppercase;
}

.reset-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.reset-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--secondary-color);
}

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

.save-btn {
    background: linear-gradient(135deg, var(--primary-color), #cc0044);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 0, 85, 0.3);
}

.save-btn:hover {
    box-shadow: 0 6px 20px rgba(255, 0, 85, 0.5);
    transform: translateY(-2px);
}

.save-btn:active {
    transform: translateY(0) scale(0.95);
}

/* Joystick Labels (shown in edit mode) */
.joystick-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 1px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}


/* Edit Mode Styles */
body.joystick-edit-mode .joystick-container {
    cursor: move;
    border: 3px dashed var(--primary-color) !important;
    border-radius: 50%;
    animation: editPulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 30px rgba(255, 0, 85, 0.6) !important;
}

body.joystick-edit-mode .mobile-switch-btn {
    cursor: move;
    border: 3px dashed var(--primary-color) !important;
    animation: editPulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 30px rgba(255, 0, 85, 0.6) !important;
    pointer-events: auto !important;
    opacity: 1 !important;
}

body.joystick-edit-mode .joystick-label {
    opacity: 1;
}

@keyframes editPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 0, 85, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 0, 85, 0.8);
    }
}

/* Dragging State */
.joystick-container.dragging,
.mobile-switch-btn.dragging {
    opacity: 0.8;
    transform: scale(1.1);
    z-index: 2000 !important;
    transition: none;
}

/* Prevent text selection during drag */
body.joystick-edit-mode {
    user-select: none;
    -webkit-user-select: none;
}

/* ========================================
   LOBBY FOOTER - LEGAL LINKS
   ======================================== */

.lobby-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 0, 85, 0.2);
    text-align: center;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    color: var(--text-secondary);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
}

.lobby-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 5px 10px;
    border-radius: 5px;
    white-space: nowrap;
}

.lobby-footer a:hover {
    color: var(--primary-color);
    background: rgba(255, 0, 85, 0.1);
    text-shadow: 0 0 10px rgba(255, 0, 85, 0.5);
}

.lobby-footer .separator {
    margin: 0 5px;
    color: rgba(255, 255, 255, 0.3);
    user-select: none;
}

.lobby-footer .version {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
    font-style: italic;
    white-space: nowrap;
}

/* Responsive for small screens */
@media (max-width: 600px) {
    .lobby-footer {
        font-size: 0.75rem;
        bottom: 10px;
        gap: 3px;
    }

    .lobby-footer .separator {
        margin: 0 3px;
    }

    .lobby-footer a {
        padding: 3px 6px;
    }
}

/* ================================================
   LANDSCAPE MODE - YATAY EKRAN OPTİMİZASYONU
   ================================================ */

/* Landscape mode: width > height ve touch cihaz */
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
    
    /* === HUD TOP - Yatay düzenleme === */
    .hud-top {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        padding: 5px 10px;
        gap: 15px;
    }
    
    .level-display {
        padding: 2px 10px;
        border-width: 2px;
        order: 1;
    }
    
    .level-label {
        font-size: 0.5rem;
    }
    
    .level-number {
        font-size: 1rem;
    }
    
    .stats-row {
        gap: 6px;
        order: 2;
    }
    
    .stat-box {
        padding: 2px 5px;
        font-size: 0.6rem;
    }
    
    /* === SES KONTROLLERİ - Sağ üstte, ayarların sol tarafında === */
    .audio-controls {
        position: absolute;
        top: 8px;
        right: 55px;
        gap: 4px;
        z-index: 100;
    }
    
    .audio-btn {
        padding: 4px 6px;
        font-size: 0.85rem;
        border-radius: 5px;
    }
    
    /* === HUD BOTTOM - Üst ortaya taşındı (küçültülmüş) === */
    .hud-bottom {
        top: 5px;
        bottom: auto;
        left: auto;
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        flex-direction: row;
        gap: 8px;
        padding: 0;
        z-index: 15;
        pointer-events: none;
    }
    
    .weapon-info,
    .health-bar {
        padding: 3px 8px;
        min-width: auto;
        border-radius: 6px;
        border-width: 1px;
        background: rgba(10, 14, 39, 0.85);
    }
    
    .weapon-name {
        font-size: 0.6rem;
        margin-bottom: 1px;
    }
    
    .ammo-count {
        font-size: 0.7rem;
    }
    
    .health-text {
        font-size: 0.7rem;
    }
    
    .health-fill {
        border-radius: 6px;
    }
    
    /* === JOYSTICK'LER === */
    .joystick-container {
        width: 100px;
        height: 100px;
        bottom: 10px;
    }
    
    #joystick-move {
        left: 15px;
    }
    
    #joystick-aim {
        right: 15px;
    }
    
    .joystick-hand {
        width: 40px;
        height: 40px;
    }
    
    .joystick-label {
        font-size: 0.55rem;
        bottom: -18px;
    }
    
    /* === SİLAH DEĞİŞTİRME BUTONU === */
    #mobile-switch {
        width: 55px;
        height: 55px;
        font-size: 1.5rem;
        right: 130px;
        bottom: 10px;
    }
    
    /* === ATEŞ BUTONU (eğer varsa) === */
    .mobile-fire-btn {
        width: 90px;
        height: 90px;
        right: 15px;
        bottom: 10px;
        font-size: 1.8rem;
    }
    
    /* === BOMBA BUTONU === */
    .mobile-grenade-btn {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    #mobile-grenade {
        left: auto;
        right: 130px;
        bottom: 75px;
        transform: none;
    }
    
    /* === CHAT SİSTEMİ === */
    .chat-ui {
        top: 50px;
        left: 10px;
    }
    
    .chat-toggle-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .chat-content {
        width: 200px;
        max-height: 180px;
        padding: 8px;
    }
    
    .chat-history {
        max-height: 100px;
        font-size: 0.75rem;
    }
    
    #chat-input {
        padding: 6px 8px;
        font-size: 0.8rem;
    }
    
    /* === SCOREBOARD BUTONU - Sağ üst, ayarların altında === */
    #mobile-scoreboard-btn {
        top: 55px;
        right: 8px;
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    /* === AYARLAR BUTONU === */
    .joystick-settings-btn {
        top: 8px;
        right: 8px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    /* === AYARLAR PANELİ === */
    .joystick-settings-panel {
        min-width: 280px;
        padding: 20px;
    }
    
    .settings-panel-content h3 {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }
    
    .settings-hint {
        font-size: 0.75rem;
        margin-bottom: 15px;
    }
    
    .settings-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    /* === SEVİYE MESAJI === */
    .level-msg {
        top: 60px;
        font-size: 0.9rem;
        padding: 6px 20px;
    }
    
    /* === GAME OVER / OVERLAY === */
    .overlay {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 10px;
    }
    
    .overlay-content {
        padding: 15px 20px;
        border-radius: 12px;
        max-height: none;
        overflow-y: visible;
        margin: auto;
        max-width: 95%;
        pointer-events: auto;
    }
    
    .game-over-title {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }
    
    .winner-section {
        margin-bottom: 10px;
    }
    
    .trophy {
        font-size: 2.5rem;
    }
    
    .winner-name {
        font-size: 1.5rem;
    }
    
    .leaderboard-container {
        padding: 10px;
        margin-bottom: 15px;
    }
    
    .final-leaderboard td {
        padding: 6px 8px;
        font-size: 1rem;
    }
    
    .final-level-text {
        font-size: 0.9rem;
        margin-top: 5px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
    
    /* === SCOREBOARD OVERLAY === */
    .scoreboard {
        padding: 15px;
        max-height: 85vh;
        overflow-y: auto;
    }
    
    .scoreboard-title {
        font-size: 1.3rem;
        margin-bottom: 10px;
    }
    
    .scoreboard-table td {
        padding: 8px;
        font-size: 0.9rem;
    }
    
    /* === BOMBA BİLGİ KUTUSU === */
    .grenade-info {
        padding: 5px 10px;
        min-width: 60px;
    }
    
    .grenade-icon {
        font-size: 1.1rem;
    }
    
    .grenade-count {
        font-size: 1rem;
    }
}

/* Çok kısa ekranlar için ekstra optimizasyon (< 400px height) */
@media (orientation: landscape) and (max-height: 400px) and (pointer: coarse) {
    
    .hud-top {
        padding: 3px 8px;
    }
    
    .level-display {
        padding: 2px 8px;
    }
    
    .level-number {
        font-size: 1rem;
    }
    
    .stat-box {
        font-size: 0.55rem;
        padding: 1px 4px;
    }
    
    /* Ses kontrolleri - sağ üst, ayarların solunda */
    .audio-controls {
        right: 45px;
        top: 5px;
        left: auto;
    }
    
    .audio-btn {
        padding: 3px 5px;
        font-size: 0.8rem;
    }
    
    /* HUD Bottom - üst ortada, daha küçük */
    .hud-bottom {
        top: 3px;
    }
    
    .weapon-info,
    .health-bar {
        padding: 2px 6px;
    }
    
    .weapon-name {
        font-size: 0.55rem;
    }
    
    .ammo-count,
    .health-text {
        font-size: 0.6rem;
    }
    
    .joystick-container {
        width: 85px;
        height: 85px;
        bottom: 8px;
    }
    
    #joystick-move {
        left: 10px;
    }
    
    #joystick-aim {
        right: 10px;
    }
    
    .joystick-hand {
        width: 35px;
        height: 35px;
    }
    
    #mobile-switch {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
        right: 110px;
        bottom: 8px;
    }
    .mobile-fire-btn {
        width: 75px;
        height: 75px;
        font-size: 1.5rem;
    }
    
    .chat-ui {
        top: 40px;
    }
    
    .chat-toggle-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .chat-content {
        max-height: 140px;
    }
    
    #mobile-scoreboard-btn {
        top: 45px;
        right: 8px;
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    
    /* Ayarlar butonu - çok küçük ekran */
    .joystick-settings-btn {
        top: 5px;
        right: 5px;
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    /* Overlay scroll fix */
    .overlay {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 5px;
    }
    
    .overlay-content {
        padding: 10px 15px;
        max-height: none;
        overflow-y: visible;
    }
    
    .game-over-title {
        font-size: 1.2rem;
    }
    
    .trophy {
        font-size: 1.5rem;
    }
    
    .winner-name {
        font-size: 1rem;
    }
    
    .leaderboard-container {
        padding: 8px;
        margin-bottom: 10px;
    }
    
    .final-leaderboard td {
        padding: 4px 6px;
        font-size: 0.85rem;
    }
    
    .btn {
        padding: 8px 15px;
        font-size: 0.8rem;
    }
}

/* Geniş landscape ekranlar (tabletler vb.) */
@media (orientation: landscape) and (min-height: 500px) and (max-height: 700px) and (pointer: coarse) {
    
    .joystick-container {
        width: 120px;
        height: 120px;
        bottom: 15px;
    }
    
    #joystick-move {
        left: 20px;
    }
    
    #joystick-aim {
        right: 20px;
    }
    
    .joystick-hand {
        width: 50px;
        height: 50px;
    }
    
    #mobile-switch {
        width: 65px;
        height: 65px;
        font-size: 1.8rem;
        right: 155px;
        bottom: 25px;
    }
    
    .mobile-fire-btn {
        width: 110px;
        height: 110px;
        right: 20px;
        bottom: 15px;
    }
}

/* ================================================
   LANDSCAPE TIP OVERLAY - YATAY MOD ÖNERİSİ
   ================================================ */

.landscape-tip-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 39, 0.9);
    backdrop-filter: blur(5px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.landscape-tip-overlay.hidden {
    display: none !important;
}

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

.landscape-tip-content {
    background: rgba(21, 25, 50, 0.98);
    border: 2px solid rgba(0, 255, 136, 0.4);
    border-radius: 20px;
    padding: 30px 40px;
    text-align: center;
    max-width: 320px;
    box-shadow: 
        0 0 40px rgba(0, 255, 136, 0.2),
        0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s ease;
}

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

.tip-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    animation: pulse 2s ease-in-out infinite;
}

.tip-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin: 0 0 15px;
    text-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
}

.tip-text {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 20px;
}

.tip-text strong {
    color: var(--secondary-color);
}

.tip-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 25px;
}

.tip-phone {
    font-size: 2rem;
}

.tip-phone.rotated {
    transform: rotate(90deg);
    filter: drop-shadow(0 0 8px var(--secondary-color));
}

.tip-arrow {
    font-size: 1.5rem;
    color: var(--secondary-color);
    animation: arrowBounce 1s ease-in-out infinite;
}

@keyframes arrowBounce {
    0%, 100% {
        transform: translateX(0);
        opacity: 1;
    }
    50% {
        transform: translateX(5px);
        opacity: 0.6;
    }
}

.tip-dismiss-btn {
    background: linear-gradient(135deg, var(--secondary-color), #00cc66);
    color: #000;
    border: none;
    border-radius: 10px;
    padding: 12px 35px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    box-shadow: 0 4px 0 #00aa55;
}

.tip-dismiss-btn:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #00aa55;
}

.tip-dismiss-btn:hover {
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.4);
}

/* ================================================
   NEW LOBBY DESIGN - Premium Buttons
   ================================================ */
.lobby-menu-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.lobby-menu-section.hidden {
    display: none;
}

/* Lobby Buttons */
.lobby-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px 30px;
    border: 2px solid;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    text-align: center;
    background: linear-gradient(145deg, rgba(20, 25, 45, 0.9) 0%, rgba(12, 18, 35, 0.95) 100%);
}

.lobby-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.lobby-btn:hover::before {
    left: 100%;
}

.lobby-btn-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 10px currentColor);
}

.lobby-btn-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.lobby-btn-hint {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 5px;
}

/* Primary Button - BAŞLA */
.lobby-btn-primary {
    border-color: rgba(0, 255, 136, 0.5);
    color: #00ff88;
    box-shadow: 
        0 0 30px rgba(0, 255, 136, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: primaryPulse 3s ease-in-out infinite;
}

@keyframes primaryPulse {
    0%, 100% {
        box-shadow: 
            0 0 30px rgba(0, 255, 136, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }
    50% {
        box-shadow: 
            0 0 50px rgba(0, 255, 136, 0.35),
            inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }
}

.lobby-btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: rgba(0, 255, 136, 0.8);
    box-shadow: 
        0 10px 40px rgba(0, 255, 136, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Secondary Button - ÇOK OYUNCULU */
.lobby-btn-secondary {
    border-color: rgba(0, 170, 255, 0.4);
    color: #00aaff;
    box-shadow: 
        0 0 25px rgba(0, 170, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.lobby-btn-secondary:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: rgba(0, 170, 255, 0.7);
    box-shadow: 
        0 10px 35px rgba(0, 170, 255, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Create Room Button */
.lobby-btn-create {
    border-color: rgba(255, 170, 0, 0.4);
    color: #ffaa00;
    box-shadow: 
        0 0 25px rgba(255, 170, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.lobby-btn-create:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: rgba(255, 170, 0, 0.7);
    box-shadow: 
        0 10px 35px rgba(255, 170, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Join Room Button */
.lobby-btn-join {
    border-color: rgba(180, 100, 255, 0.4);
    color: #b464ff;
    box-shadow: 
        0 0 25px rgba(180, 100, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.lobby-btn-join:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: rgba(180, 100, 255, 0.7);
    box-shadow: 
        0 10px 35px rgba(180, 100, 255, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Confirm Button */
.lobby-btn-confirm {
    border-color: rgba(0, 255, 136, 0.5);
    color: #00ff88;
    padding: 18px 40px;
    flex-direction: row;
    gap: 10px;
}

.lobby-btn-confirm .lobby-btn-icon {
    font-size: 1.5rem;
    margin: 0;
}

.lobby-btn-confirm:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 255, 136, 0.8);
    box-shadow: 0 8px 30px rgba(0, 255, 136, 0.3);
}

/* Invite Friend Button */
.lobby-btn-invite {
    border-color: rgba(0, 170, 255, 0.4);
    color: #00aaff;
    padding: 15px 25px;
    flex-direction: row;
    gap: 10px;
}

.lobby-btn-invite .lobby-btn-icon {
    font-size: 1.3rem;
    margin: 0;
}

.lobby-btn-invite:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 170, 255, 0.7);
    box-shadow: 0 8px 25px rgba(0, 170, 255, 0.25);
}

/* Start Game Button */
.lobby-btn-start {
    border-color: rgba(0, 255, 136, 0.5);
    color: #00ff88;
    padding: 18px 30px;
    flex-direction: row;
    gap: 10px;
    animation: startPulse 2s ease-in-out infinite;
}

@keyframes startPulse {
    0%, 100% {
        box-shadow: 0 0 30px rgba(0, 255, 136, 0.2);
    }
    50% {
        box-shadow: 0 0 50px rgba(0, 255, 136, 0.4);
    }
}

.lobby-btn-start .lobby-btn-icon {
    font-size: 1.3rem;
    margin: 0;
}

.lobby-btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 35px rgba(0, 255, 136, 0.35);
}

/* Leave Room Button */
.lobby-btn-leave {
    border-color: rgba(255, 51, 102, 0.4);
    color: #ff3366;
    padding: 15px 25px;
    flex-direction: row;
    gap: 10px;
}

.lobby-btn-leave .lobby-btn-icon {
    font-size: 1.3rem;
    margin: 0;
}

.lobby-btn-leave:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 51, 102, 0.7);
    box-shadow: 0 8px 25px rgba(255, 51, 102, 0.25);
}

/* Back Button */
.lobby-back-btn {
    align-self: flex-start;
    background: transparent;
    border: none;
    color: rgba(200, 200, 220, 0.7);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    padding: 10px 0;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.lobby-back-btn:hover {
    color: #fff;
    transform: translateX(-5px);
}

/* Multiplayer Buttons Container */
.multiplayer-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Join Room Section */
.join-room-section {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    animation: slideDown 0.3s ease;
}

.join-room-section.hidden {
    display: none;
}

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

.room-code-input {
    flex: 1;
    padding: 18px 20px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: 8px;
    text-transform: uppercase;
    background: rgba(15, 20, 40, 0.8);
    border: 2px solid rgba(180, 100, 255, 0.4);
    border-radius: 12px;
    color: #fff;
    outline: none;
    transition: all 0.3s ease;
}

/* Compact Join Confirm Button */
.lobby-btn-join-confirm {
    width: 60px;
    height: 60px;
    min-width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    background: linear-gradient(145deg, rgba(20, 25, 45, 0.9) 0%, rgba(12, 18, 35, 0.95) 100%);
    border: 2px solid rgba(0, 255, 136, 0.5);
    border-radius: 12px;
    color: #00ff88;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.2);
}

.lobby-btn-join-confirm:hover {
    transform: scale(1.05);
    border-color: rgba(0, 255, 136, 0.8);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.4);
}

.room-code-input::placeholder {
    color: rgba(180, 100, 255, 0.5);
    letter-spacing: 4px;
}

.room-code-input:focus {
    border-color: rgba(180, 100, 255, 0.8);
    box-shadow: 0 0 25px rgba(180, 100, 255, 0.2);
}

/* Room Info Styling */
.room-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.room-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: #ffaa00;
    margin: 0;
}

.room-title span {
    color: #fff;
    letter-spacing: 3px;
}

.copy-code-btn {
    background: rgba(255, 170, 0, 0.2);
    border: 1px solid rgba(255, 170, 0, 0.4);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.copy-code-btn:hover {
    background: rgba(255, 170, 0, 0.3);
    transform: scale(1.1);
}

.room-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

/* Lobby Screen Scroll Support */
#lobby-screen {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

#lobby-screen .lobby-container {
    min-height: auto;
    padding-bottom: 100px;
}

#lobby-screen .lobby-content {
    padding: 20px 0;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .lobby-menu-section {
        gap: 12px;
        max-width: 100%;
        padding: 0 10px;
    }
    
    .lobby-btn {
        padding: 15px 20px;
    }
    
    .lobby-btn-icon {
        font-size: 1.5rem;
        margin-bottom: 5px;
    }
    
    .lobby-btn-text {
        font-size: 0.9rem;
        letter-spacing: 1px;
    }
    
    .lobby-btn-hint {
        font-size: 0.75rem;
    }
    
    .lobby-btn-confirm,
    .lobby-btn-invite,
    .lobby-btn-start,
    .lobby-btn-leave {
        padding: 12px 20px;
    }
    
    .lobby-btn-confirm .lobby-btn-icon,
    .lobby-btn-invite .lobby-btn-icon,
    .lobby-btn-start .lobby-btn-icon,
    .lobby-btn-leave .lobby-btn-icon {
        font-size: 1rem;
    }
    
    .lobby-btn-confirm .lobby-btn-text,
    .lobby-btn-invite .lobby-btn-text,
    .lobby-btn-start .lobby-btn-text,
    .lobby-btn-leave .lobby-btn-text {
        font-size: 0.8rem;
    }
    
    .room-code-input {
        padding: 12px 15px;
        font-size: 1rem;
        letter-spacing: 4px;
    }
    
    .join-room-section {
        flex-direction: column;
        gap: 10px;
    }
    
    .lobby-back-btn {
        font-size: 0.9rem;
    }
    
    .room-header {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .room-title {
        font-size: 1.2rem;
    }
    
    .room-actions {
        gap: 10px;
    }
    
    .multiplayer-buttons {
        gap: 12px;
    }
    
    .join-room-section {
        flex-direction: row;
    }
    
    .lobby-btn-join-confirm {
        width: 50px;
        height: 50px;
        min-width: 50px;
        font-size: 1.5rem;
    }
}