﻿:root {
    --bg-dark: #020305;
    --panel-bg: #080c13;
    --text-main: #e2e8f0;
    --neon-green: #10b981;
    --neon-purple: #8b5cf6;
    --neon-blue: #3b82f6;
    --danger-red: #ef4444;
    --gold: #fbbf24;
    --dark-matter: #d946ef;
    --anti-matter: #f43f5e;
    --border-glow: 0 0 15px rgba(16, 185, 129, 0.10);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Courier New', monospace;
    transition: background-color 0.3s, border-color 0.3s;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    padding: 20px;
    background-image: linear-gradient(rgba(2, 3, 5, 0.88), rgba(2, 3, 5, 0.92)), url('lab.png');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
}

/* MERKEZE DÖN BUTONU */
.btn-home {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
    padding: 10px 15px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    z-index: 1000;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
    transition: 0.3s;
}

    .btn-home:hover {
        background: var(--neon-green);
        color: #000;
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
    }

.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--neon-purple);
    border-radius: 4px;
}

.dashboard {
    max-width: 1550px;
    margin: 0 auto;
    padding-top: 40px;
}

.game-header {
    text-align: center;
    margin-bottom: 20px;
}

    .game-header h1 {
        color: var(--neon-green);
        text-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
        font-size: 2.2rem;
    }

.game-grid {
    display: grid;
    grid-template-columns: 280px 1fr 400px;
    gap: 20px;
}

.panel {
    background-color: var(--panel-bg);
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--border-glow);
    backdrop-filter: blur(8px);
}

    .panel h2 {
        color: var(--neon-purple);
        border-bottom: 1px solid #374151;
        padding-bottom: 10px;
        margin-bottom: 15px;
    }

.resource {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

    .resource strong {
        color: var(--neon-green);
        font-size: 1.3rem;
    }

.dark-matter-text {
    color: var(--dark-matter) !important;
    text-shadow: 0 0 10px rgba(217, 70, 239, 0.5);
    font-weight: bold;
}

.anti-matter-text {
    color: var(--anti-matter) !important;
    text-shadow: 0 0 10px rgba(244, 63, 94, 0.5);
    font-weight: bold;
}

.neon-blue-text {
    color: var(--neon-blue) !important;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.neon-purple-text {
    color: var(--neon-purple) !important;
}

.danger-red-text {
    color: var(--danger-red) !important;
    text-shadow: 0 0 10px var(--danger-red);
}

hr {
    border-top: 1px dashed #374151;
    border-bottom: none;
    margin: 20px 0;
}

.action-buttons-row {
    display: flex;
    gap: 10px;
}

.reactor-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.reactor-container {
    position: relative;
    height: 140px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #1f2937;
    border-radius: 10px;
    overflow: hidden;
    background: radial-gradient(circle at center, #0a192f 0%, #02060d 100%);
    box-shadow: inset 0 0 60px rgba(0,0,0,1);
}

.reactor-ring {
    position: absolute;
    width: 100px;
    height: 100px;
    border: 2px dashed rgba(16, 185, 129, 0.3);
    border-radius: 50%;
    animation: spin 15s linear infinite;
}

.inner-ring {
    width: 75px;
    height: 75px;
    border: 2px solid rgba(59, 130, 246, 0.2);
    border-top: 2px solid var(--neon-blue);
    border-bottom: 2px solid var(--neon-blue);
    animation: spin-reverse 8s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes spin-reverse {
    100% {
        transform: rotate(-360deg);
    }
}

.reactor {
    position: relative;
    z-index: 10;
    width: 55px;
    height: 55px;
    background: radial-gradient(circle, var(--neon-green), #000);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 0 30px var(--neon-green), inset 0 0 15px #fff;
    animation: pulse 1.5s infinite;
    transition: transform 0.05s;
}

    .reactor:active {
        transform: scale(0.85);
        box-shadow: 0 0 50px #fff;
    }

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
    }

    50% {
        box-shadow: 0 0 50px var(--neon-green);
    }
}

.mutant-cell {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: floatUp 2s ease-in forwards;
    z-index: 5;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.8;
    }

    100% {
        transform: translateY(-150px) scale(2);
        opacity: 0;
    }
}

button {
    padding: 12px;
    background: #1f2937;
    color: var(--text-main);
    border: 1px solid #374151;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

    button:disabled {
        opacity: 0.4;
        cursor: not-allowed;
        filter: grayscale(100%);
    }

.upgrade-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    align-items: stretch;
}

.upgrade-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.btn-upgrade {
    width: 100%;
    text-align: left;
    height: 100%;
}

    .btn-upgrade:hover:not(:disabled) {
        border-color: var(--neon-green);
        background: rgba(16, 185, 129, 0.1);
    }

.auto-toggle {
    font-size: 0.8rem;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(251, 191, 36, 0.1);
    padding: 4px;
    border-radius: 4px;
}

    .auto-toggle.hidden {
        display: none;
    }

.btn-max {
    width: 110px;
    background: rgba(139, 92, 246, 0.2);
    color: white;
    border: 1px solid var(--neon-purple);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

    .btn-max:hover:not(:disabled) {
        background: var(--neon-purple);
        box-shadow: 0 0 15px var(--neon-purple);
    }

    .btn-max small {
        font-size: 0.7rem;
        color: #cbd5e1;
        margin-top: 3px;
        font-weight: normal;
    }

.dm-border {
    border-color: rgba(217, 70, 239, 0.4);
}

    .dm-border:hover:not(:disabled) {
        border-color: var(--dark-matter);
    }

.dm-bg {
    background: rgba(217, 70, 239, 0.2);
    border-color: var(--dark-matter);
}

    .dm-bg:hover:not(:disabled) {
        background: var(--dark-matter);
        box-shadow: 0 0 15px var(--dark-matter);
    }

.am-border {
    border-color: rgba(244, 63, 94, 0.4);
}

    .am-border:hover:not(:disabled) {
        border-color: var(--anti-matter);
    }

.am-bg {
    background: rgba(244, 63, 94, 0.2);
    border-color: var(--anti-matter);
}

    .am-bg:hover:not(:disabled) {
        background: var(--anti-matter);
        box-shadow: 0 0 15px var(--anti-matter);
    }

.btn-action {
    width: 100%;
    margin-bottom: 10px;
}

    .btn-action:hover:not(:disabled) {
        background: rgba(16, 185, 129, 0.2);
        border-color: var(--neon-green);
    }

.neon-border {
    border-color: var(--neon-blue);
    color: var(--neon-blue);
}

.danger-bg {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger-red);
    color: var(--danger-red);
}

    .danger-bg:hover:not(:disabled) {
        background: var(--danger-red);
        color: #fff;
        box-shadow: 0 0 15px var(--danger-red);
    }

.btn-danger {
    width: 100%;
    color: var(--danger-red);
}

    .btn-danger:hover:not(:disabled) {
        background: var(--danger-red);
        color: white;
    }

.golden-text {
    color: var(--gold) !important;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}

.golden-border {
    border-color: var(--gold);
    color: var(--gold);
}

.prestige-zone {
    background: rgba(251, 191, 36, 0.05);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.btn-prestige {
    width: 100%;
    background: rgba(251, 191, 36, 0.1);
    border-color: var(--gold);
    color: var(--gold);
}

.research-list, .upgrades-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding-right: 10px;
}

.research-item {
    flex-shrink: 0;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--neon-blue);
    padding: 10px;
    border-radius: 8px;
    text-align: left;
}

    .research-item.bought {
        border-color: var(--neon-green);
        background: rgba(16, 185, 129, 0.2);
        color: #ccc;
        opacity: 0.6;
        pointer-events: none;
    }

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

    .modal.hidden {
        display: none !important;
    }

.modal-content {
    background: var(--panel-bg);
    padding: 30px;
    border-radius: 15px;
    border: 2px solid var(--neon-green);
    text-align: center;
    position: relative;
    max-width: 600px;
    width: 90%;
}

.modal-large {
    width: 95%;
    max-width: 1400px;
    max-height: 90vh;
    overflow-y: auto;
    display: block;
    padding: 20px;
}

.war-modal-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
    z-index: 100;
}

.admin-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.admin-input {
    flex-grow: 1;
    padding: 10px;
    background: #111;
    color: #fff;
    border: 1px solid #444;
    border-radius: 5px;
    font-size: 1rem;
}

.lore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 20px;
    padding-right: 10px;
}

.lore-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--neon-blue);
    padding: 25px;
    border-radius: 8px;
    text-align: left;
}

    .lore-card.locked {
        filter: grayscale(100%);
        opacity: 0.5;
        border-color: #555;
    }

    .lore-card h4 {
        color: var(--neon-blue);
        margin-bottom: 10px;
        font-size: 1.2rem;
        border-bottom: 1px solid #333;
        padding-bottom: 10px;
    }

    .lore-card.locked h4 {
        color: #888;
    }

.lore-desc {
    font-size: 0.95rem;
    color: var(--text-main);
    line-height: 1.6;
}

.lore-req {
    font-size: 0.85rem;
    color: var(--danger-red);
    margin-top: 15px;
    font-weight: bold;
}

.war-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 10px;
    text-align: left;
}

.heroes-panel {
    margin-bottom: 20px;
    text-align: center;
}

.heroes-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.hero-btn {
    width: 200px;
    height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #0a0a0a;
    border: 2px solid var(--gold);
    border-radius: 10px;
    position: relative;
}

    .hero-btn:hover:not(:disabled) {
        box-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
        transform: translateY(-5px);
    }

.hero-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.cooldown-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: rgba(0,0,0,0.8);
    transition: height 1s linear;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
}

.boss-visual {
    font-size: 6rem;
    text-align: center;
    margin: 20px 0;
    animation: pulse 2s infinite;
    text-shadow: 0 0 20px var(--danger-red);
}

.hp-bar-container {
    width: 100%;
    height: 25px;
    background: #333;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #555;
    position: relative;
    margin-bottom: 10px;
}

.hp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #b91c1c);
    width: 100%;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hp-text {
    text-align: center;
    margin-top: 5px;
    font-weight: bold;
    font-size: 1.2rem;
}

.tree-container {
    width: 100%;
    height: 60vh;
    background: linear-gradient(rgba(5, 5, 5, 0.85), rgba(5, 5, 5, 0.95)), url('lab.png');
    background-size: cover;
    background-position: center;
    border: 2px solid var(--neon-purple);
    border-radius: 10px;
    position: relative;
    overflow: auto;
    display: flex;
    justify-content: center;
    padding: 50px;
}

.tree-canvas {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 50px;
    min-width: 800px;
}

.tree-row {
    display: flex;
    justify-content: center;
    gap: 60px;
    position: relative;
}

.tree-node {
    width: 150px;
    height: 150px;
    padding: 10px;
    background: #111;
    border: 2px solid #333;
    border-radius: 50%;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    color: #aaa;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 15px #000;
    overflow: visible;
    box-sizing: border-box;
    line-height: 1.3;
}

    .tree-node.available {
        border-color: var(--neon-blue);
        color: var(--text-main);
    }

        .tree-node.available:hover {
            transform: scale(1.1);
            box-shadow: 0 0 20px var(--neon-blue);
            z-index: 10;
        }

    .tree-node.unlocked {
        border-color: var(--neon-green);
        background: rgba(16, 185, 129, 0.15);
        color: var(--neon-green);
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
    }

    .tree-node strong {
        font-size: 0.95rem;
        margin-bottom: 5px;
        color: inherit;
        display: block;
    }

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 20px;
    text-align: left;
    padding-right: 10px;
}

.ach-card {
    background: rgba(30, 30, 30, 0.5);
    border: 1px solid #333;
    padding: 15px;
    border-radius: 8px;
    opacity: 0.4;
}

    .ach-card.unlocked {
        opacity: 1;
        border-color: var(--gold);
        background: rgba(251, 191, 36, 0.1);
        box-shadow: 0 0 10px rgba(251, 191, 36, 0.2);
    }

    .ach-card h4 {
        color: #fff;
        margin-bottom: 5px;
        font-size: 1.1rem;
    }

    .ach-card.unlocked h4 {
        color: var(--gold);
    }

.ach-desc {
    font-size: 0.85rem;
    color: #aaa;
    margin-bottom: 10px;
}

.progress-container {
    width: 100%;
    background: #333;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-bar {
    height: 100%;
    background: var(--neon-blue);
    width: 0%;
    transition: width 0.3s;
}

.progress-text {
    font-size: 0.75rem;
    color: #888;
    text-align: right;
    margin-top: 3px;
}

.logs {
    overflow-y: auto;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-right: 10px;
}

.log-entry {
    padding: 5px;
    border-left: 3px solid var(--neon-green);
    background: rgba(15, 23, 42, 0.5);
}

.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gold);
    color: #000;
    padding: 15px 30px;
    border-radius: 30px;
    font-weight: bold;
    z-index: 3000;
    transition: all 0.5s;
}

    .toast.hidden {
        top: -100px;
        opacity: 0;
    }

/* ========================================================
   MOBİL OPTİMİZASYONU (RESPONSIVE)
   ======================================================== */
@media (max-width: 1300px) {
    .game-grid {
        grid-template-columns: 1fr 1fr;
    }

    .research-panel {
        grid-column: span 2;
    }
}

@media (max-width: 850px) {
    .game-grid {
        grid-template-columns: 1fr;
    }

    .research-panel {
        grid-column: span 1;
    }

    .war-grid {
        grid-template-columns: 1fr;
    }

    .btn-home {
        font-size: 0.8rem;
        padding: 8px 10px;
    }

    .game-header h1 {
        font-size: 1.8rem;
        margin-top: 15px;
    }

    .action-buttons-row {
        flex-direction: column;
    }

    .upgrade-row {
        flex-direction: column;
    }

    .btn-max {
        width: 100%;
        padding: 8px;
    }

    .tree-canvas {
        transform: scale(0.8);
        transform-origin: top center;
    }
}
