:root {
    --primary-color: #00f3ff;
    --secondary-color: #ff0055;
    --bg-dark: #050505;
    --glass-bg: rgba(10, 15, 30, 0.65);
    --glass-border: rgba(0, 243, 255, 0.2);
    --text-main: #e0e0e0;
    --text-dim: #8899a6;
    --font-head: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    /* Oyun oynarken metin seçmeyi engelle */
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* Oyun Sahnesi */
#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: radial-gradient(circle at center, #0a1020 0%, #000000 100%);
}

/* UI Katmanları */
#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    /* Tıklamaların canvasa geçmesine izin ver */
}

/* UI Elemanlarına tıklanabilsin */
.glass-panel,
.top-bar,
button {
    pointer-events: auto;
}

/* Premium Cam Efekti (Glassmorphism) */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    padding: 15px;
    color: #fff;
    transition: all 0.3s ease;
}

.glass-panel:hover {
    border-color: rgba(0, 243, 255, 0.6);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.15);
}

/* Üst Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent);
    font-family: var(--font-head);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pulse-icon {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #00ff44;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ff44;
    margin-right: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.player-stats {
    display: flex;
    gap: 20px;
    font-size: 1.1rem;
    font-weight: 700;
}

.resource .icon {
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

#uridium {
    color: var(--primary-color);
}

#credits {
    color: #ffd700;
}

/* Kullanıcı Paneli (Sol Üst) */
.user-panel {
    position: absolute;
    top: 60px;
    left: 20px;
    width: 300px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.user-panel .avatar img {
    width: 64px;
    height: 64px;
    border-radius: 4px;
    border: 1px solid var(--primary-color);
}

.user-panel h2 {
    font-family: var(--font-head);
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: 2px;
}

.level-badge {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 5px;
}

/* Barlar */
.bar-container {
    width: 100%;
    height: 14px;
    background: rgba(0, 0, 0, 0.6);
    margin-bottom: 4px;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.bar-fill {
    height: 100%;
    transition: width 0.5s ease-out;
}

.hp-bar .bar-fill {
    background: linear-gradient(90deg, #008800, #00ff00);
    box-shadow: 0 0 10px #00ff00;
}

.shield-bar .bar-fill {
    background: linear-gradient(90deg, #004488, #0088ff);
    box-shadow: 0 0 10px #0088ff;
}

.bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 9px;
    font-weight: bold;
    text-shadow: 1px 1px 1px #000;
    z-index: 2;
    white-space: nowrap;
}

/* Mini Harita */
.minimap-container {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 200px;
    height: 200px;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.minimap-header {
    background: rgba(0, 243, 255, 0.1);
    padding: 5px;
    text-align: center;
    font-size: 0.9rem;
    font-family: var(--font-head);
    border-bottom: 1px solid var(--glass-border);
}

#minimapCanvas {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}

.coordinates {
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 0.8rem;
    color: var(--text-dim);
    pointer-events: none;
}

/* Aksiyon Barı */
.action-bar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    padding: 10px;
}

.action-btn {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #444;
    color: #fff;
    width: 60px;
    height: 60px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    font-family: var(--font-body);
}

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

.action-btn.active {
    background: rgba(0, 243, 255, 0.3);
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.4);
}

.action-btn .key {
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 0.7rem;
    color: var(--text-dim);
}

.action-btn .icon {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.action-btn .label {
    font-size: 0.7rem;
    color: #ccc;
}

/* Log Paneli */
.log-panel {
    position: absolute;
    top: 60px;
    left: 335px;
    /* User panel yanına */
    width: 300px;
    height: 150px;
    overflow: hidden;
    font-size: 0.9rem;
}

.log-content {
    height: 100%;
    display: flex;
    flex-direction: column-reverse;
    /* Yeni mesajlar alttan gelir */
}

.system-msg {
    color: var(--primary-color);
    margin-bottom: 4px;
    font-family: 'Courier New', monospace;
}

/* Target Panel */
.target-panel {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    text-align: center;
    border: 1px solid #ff3333;
    box-shadow: 0 0 15px rgba(255, 51, 51, 0.3);
}

.target-name {
    font-family: var(--font-head);
    font-size: 1.2rem;
    color: #ff3333;
    margin-bottom: 5px;
    letter-spacing: 2px;
}

.target-stats {
    font-size: 0.8rem;
    margin-top: 5px;
    color: #ccc;
}

/* Modal Overlay */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
    backdrop-filter: blur(5px);
}

.modal-box {
    width: 800px;
    background: var(--bg-dark);
    border: 2px solid var(--primary-color);
    padding: 20px;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 243, 255, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.close-btn {
    background: none;
    border: 1px solid #555;
    color: #fff;
    width: 30px;
    height: 30px;
    cursor: pointer;
}

.close-btn:hover {
    background: #f00;
    border-color: #f00;
}

.shop-grid {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.shop-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #333;
    padding: 20px;
    width: 200px;
    text-align: center;
    transition: all 0.3s;
}

.shop-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.shop-item h3 {
    margin: 10px 0 5px;
    color: var(--primary-color);
    font-size: 1rem;
}

.shop-item p {
    color: #888;
    font-size: 0.8rem;
    margin-bottom: 15px;
}

.shop-item .price {
    font-weight: bold;
    color: #00f3ff;
    margin-bottom: 15px;
}

.shop-item .price.cred {
    color: #ffd700;
}

.shop-item button {
    background: #004400;
    color: #fff;
    border: 1px solid #00aa00;
    padding: 5px 15px;
    cursor: pointer;
    width: 100%;
}

.shop-item button:hover {
    background: #006600;
}

/* --- Auth Styles --- */
#auth-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.auth-box {
    width: 400px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 0 50px rgba(0, 243, 255, 0.2);
    border: 1px solid rgba(0, 243, 255, 0.3);
}

.game-title {
    font-family: var(--font-head);
    font-size: 3rem;
    margin-bottom: 20px;
    letter-spacing: 5px;
    color: #fff;
    text-shadow: 0 0 10px var(--primary-color);
}

.game-title span {
    color: var(--primary-color);
}

.auth-tabs {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    font-family: var(--font-head);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px 15px;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #fff;
}

.tab-btn.active {
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

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

.auth-form.active {
    display: flex;
}

.input-group input {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 4px;
    font-size: 1rem;
    font-family: var(--font-body);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

.submit-btn {
    background: linear-gradient(135deg, var(--secondary-color), #cc0044);
    color: #fff;
    border: none;
    padding: 12px;
    font-size: 1.1rem;
    font-family: var(--font-head);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
    letter-spacing: 1px;
    margin-top: 10px;
}

.submit-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.5);
}

.msg {
    min-height: 20px;
    font-size: 0.9rem;
    margin-top: 5px;
}

.msg.error {
    color: #ff3333;
}

.msg.success {
    color: #33ff33;
}