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

:root {
    --bg: #06061a;
    --surface: #0e0e2a;
    --surface2: #161640;
    --border: #2a2a5e;
    --accent: #ff6b9d;
    --accent2: #7c4dff;
    --accent3: #00e5ff;
    --green: #00e676;
    --red: #ff3d71;
    --gold: #ffd740;
    --text: #e0e0ff;
    --text-dim: #6a6a9a;
    --glow-pink: 0 0 20px rgba(255, 107, 157, .35);
    --glow-blue: 0 0 20px rgba(0, 229, 255, .3);
    --glow-purple: 0 0 20px rgba(124, 77, 255, .3);
    --font-pixel: 'Press Start 2P', monospace;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    font-family: var(--font-pixel);
    color: var(--text);
    cursor: crosshair;
    user-select: none;
    -webkit-user-select: none;
}

input, textarea {
    user-select: auto;
    -webkit-user-select: auto;
}

/* â”€â”€ Scrollbar â”€â”€ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent2);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--surface);
}

/* â”€â”€ Scanlines â”€â”€ */
.scanlines {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: repeating-linear-gradient(0deg,
            rgba(0, 0, 0, .04) 0px, rgba(0, 0, 0, .04) 1px,
            transparent 1px, transparent 3px);
}

/* â”€â”€ Top Bar â”€â”€ */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(6, 6, 26, .92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    font-size: .65rem;
}

.topbar-logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.topbar-icon {
    font-size: 1.4rem;
    filter: drop-shadow(0 0 6px rgba(255, 107, 157, 0.6));
}

.topbar-title {
    font-size: .45rem;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 2px;
    white-space: nowrap;
}

.topbar-center {
    display: flex;
    gap: 20px;
}

.stat {
    color: var(--text-dim);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.coin-display {
    color: var(--gold);
    font-size: .75rem;
}

.username-input {
    font-family: var(--font-pixel);
    font-size: .6rem;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px 12px;
    width: 160px;
    outline: none;
}

.username-input:focus {
    border-color: var(--accent);
}

/* â”€â”€ Canvas â”€â”€ */
#gridCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}

/* â”€â”€ Minimap â”€â”€ */
.minimap-wrap {
    position: fixed;
    bottom: 85px;
    right: 16px;
    z-index: 90;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: 0 4px 24px rgba(0, 0, 0, .5);
}

#minimapCanvas {
    display: block;
}

.minimap-viewport {
    position: absolute;
    border: 1.5px solid var(--accent3);
    pointer-events: none;
    transition: all .1s;
}

/* â”€â”€ Link Popup â”€â”€ */
.link-popup {
    position: fixed;
    z-index: 250;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px;
    display: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .6);
}

.link-popup.visible {
    display: block;
}

/* â”€â”€ Tooltip â”€â”€ */
.tooltip {
    position: fixed;
    z-index: 200;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: .4rem;
    line-height: 1.7;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
    max-width: 220px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .6);
}

.tooltip.visible {
    opacity: 1;
}

.tooltip .tt-name {
    color: var(--accent);
    font-size: .5rem;
}

.tooltip .tt-dim {
    color: var(--text-dim);
}

/* â”€â”€ Pixel Shield Icon â”€â”€ */
.pixel-shield {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-left: 4px;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 3px rgba(0, 229, 255, 0.4));
}

.pixel-shield svg {
    width: 100%;
    height: 100%;
}

/* â”€â”€ Selection Info â”€â”€ */
.selection-info {
    position: fixed;
    bottom: 85px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 90;
    background: rgba(6, 6, 26, .9);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 18px;
    font-size: .45rem;
    color: var(--text-dim);
    display: none;
    backdrop-filter: blur(10px);
}

.selection-info.visible {
    display: block;
}

/* â”€â”€ Modal â”€â”€ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, .7);
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 540px;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 60px rgba(0, 0, 0, .6);
    animation: modalIn .25s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(.92) translateY(10px);
    }

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: .85rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer;
    transition: .2s;
}

.modal-close:hover {
    color: var(--red);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
}

/* Modal result */
.modal-result {
    text-align: center;
    padding: 50px 40px;
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.modal-result h2 {
    font-size: 1rem;
    margin-bottom: 16px;
}

.modal-result p {
    font-size: .6rem;
    color: var(--text-dim);
    margin-bottom: 24px;
    line-height: 1.8;
}

/* Claim info */
.claim-info,
.attack-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: .6rem;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg);
    border-radius: 8px;
    line-height: 1.6;
}

.claim-info strong,
.attack-info strong {
    color: var(--accent3);
}

/* Upload */
.claim-upload {
    margin-bottom: 18px;
}

.upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    border: 2px dashed var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: .2s;
    font-size: .6rem;
    color: var(--text-dim);
}

.upload-label:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.claim-preview {
    display: none;
    width: 100%;
    margin-top: 10px;
    border-radius: 6px;
    image-rendering: pixelated;
    border: 1px solid var(--border);
}

.claim-preview.show {
    display: block;
}

/* Input field */
.input-field {
    font-family: var(--font-pixel);
    font-size: .6rem;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px 18px;
    width: 100%;
    outline: none;
    margin-bottom: 14px;
}

.input-field:focus {
    border-color: var(--accent);
}

/* Attack slider */
.attack-slider-group {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.attack-slider-group .ctrl-label {
    font-size: .55rem;
    color: var(--text-dim);
    white-space: nowrap;
}

.attack-slider-group input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.attack-slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 10px rgba(255, 61, 113, .5);
    cursor: pointer;
}

.attack-power-val {
    font-size: .6rem;
    color: var(--red);
    min-width: 60px;
}

.attack-chance {
    font-size: .65rem;
    text-align: center;
    padding: 14px;
    background: var(--bg);
    border-radius: 6px;
    color: var(--gold);
}

/* â”€â”€ Buttons â”€â”€ */
.btn {
    font-family: var(--font-pixel);
    font-size: .6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px 24px;
    cursor: pointer;
    transition: .2s;
}

.btn-cancel {
    background: var(--bg);
    color: var(--text-dim);
}

.btn-cancel:hover {
    border-color: var(--text-dim);
    color: var(--text);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent2), var(--accent));
    color: #fff;
    border-color: transparent;
}

.btn-primary:hover {
    box-shadow: var(--glow-pink);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #ff1744, var(--red));
    color: #fff;
    border-color: transparent;
}

.btn-danger:hover {
    box-shadow: 0 0 20px rgba(255, 61, 113, .4);
    transform: translateY(-1px);
}

/* â”€â”€ Context Menu â”€â”€ */
.context-menu {
    position: fixed;
    z-index: 300;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 0;
    display: none;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .6);
    min-width: 160px;
}

.context-menu.open {
    display: block;
}

.ctx-item {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: var(--text);
    font-family: var(--font-pixel);
    font-size: .45rem;
    padding: 10px 16px;
    text-align: left;
    cursor: pointer;
    transition: .15s;
}

.ctx-item:hover {
    background: var(--surface2);
    color: var(--accent);
}

.ctx-item:disabled {
    color: var(--text-dim);
    cursor: default;
}

.ctx-item:disabled:hover {
    background: none;
    color: var(--text-dim);
}

/* â”€â”€ Market â”€â”€ */
.market-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.market-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.market-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.market-card.premium {
    border-color: var(--accent3);
    box-shadow: var(--glow-blue);
}

.market-card.god-mode {
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(255, 215, 64, 0.3);
}

.mc-icon {
    font-size: 2.2rem;
    margin-bottom: 16px;
}

.mc-amount {
    font-size: 0.65rem;
    color: var(--text);
    margin-bottom: 10px;
}

.mc-price {
    font-size: 0.8rem;
    color: var(--green);
    margin-bottom: 20px;
}

.market-card .buy-btn {
    width: 100%;
    font-size: 0.6rem;
    padding: 12px;
}

/* â”€â”€ My Areas List â”€â”€ */
.my-areas-list {
    max-height: 350px;
    overflow-y: auto;
    padding-right: 5px;
}

.my-area-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface2);
    border: 1px solid var(--border);
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.my-area-item:hover { border-color: var(--accent); background: rgba(255,255,255,0.08); }

/* Moderation Card Styles */
.moderation-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s ease;
}
.moderation-item:hover { border-color: var(--accent3); transform: translateY(-3px); }
.mod-preview-wrap {
    width: 100%;
    aspect-ratio: 1;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.05);
}
.mod-preview-img { max-width: 100%; max-height: 100%; image-rendering: pixelated; }
.mod-info { font-size: 0.55rem; color: var(--text-dim); }
.mod-info b { color: var(--accent3); }
.mod-issues { color: var(--red); margin-top: 4px; font-weight: bold; }
.mod-actions { display: flex; gap: 8px; margin-top: 8px; }
.mod-actions .btn { flex: 1; padding: 6px 0; font-size: 0.5rem; }
.btn-approve { background: linear-gradient(135deg, #00c853, #009624); }
.btn-reject { background: linear-gradient(135deg, #ff1744, #d50000); }

.ma-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ma-name {
    font-size: 0.55rem;
    color: var(--text);
}

.ma-coords {
    font-size: 0.45rem;
    color: var(--text-dim);
}

.ma-goto {
    font-size: 0.6rem;
    color: var(--accent3);
}

.floating-seasons-btn {
    position: fixed;
    bottom: 245px;
    right: 16px;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 150px;
    height: 35px;
    font-size: 0.55rem;
    font-family: var(--font-pixel);
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, var(--surface2), var(--surface));
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.floating-seasons-btn:hover {
    border-color: var(--accent3);
    box-shadow: var(--glow-blue);
    transform: translateY(-2px);
}

.my-areas-floating-btn {
    position: fixed;
    bottom: 105px;
    left: 16px;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 110px;
    height: 40px;
    padding: 0 10px;
    font-size: 0.5rem;
    background: linear-gradient(135deg, var(--surface2), var(--surface));
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.my-areas-floating-btn:hover {
    border-color: var(--accent3);
    box-shadow: var(--glow-blue);
    transform: translateY(-2px);
}

/* â”€â”€ Responsive â”€â”€ */
@media (max-width: 600px) {
    .topbar {
        flex-wrap: wrap;
        gap: 6px;
        justify-content: center;
        padding: 8px 10px;
    }

    .topbar-logo {
        font-size: .5rem;
    }

    .topbar-title {
        font-size: .35rem;
    }

    .stat, .coin-display {
        font-size: .5rem;
    }

    .topbar .btn {
        padding: 6px 12px;
        font-size: .5rem;
    }

    .minimap-wrap {
        width: 100px;
        height: 100px;
    }

    #minimapCanvas {
        width: 100px;
        height: 100px;
    }

    /* Pushed up to clear the tall mobile footer */
    .minimap-wrap {
        bottom: 120px;
    }

    .floating-seasons-btn {
        bottom: 230px;
        width: 100px;
    }
    
    .my-areas-floating-btn {
        bottom: 120px;
    }

    .selection-info {
        width: 240px;
        height: auto;
        bottom: 175px; /* Butonların üstünde durması için daha yukarı alındı */
    }

    .site-footer {
        padding: 8px 10px 10px;
        gap: 6px;
    }

    .footer-top {
        font-size: .3rem;
    }

    .footer-links {
        gap: 6px 14px;
    }

    .footer-link {
        font-size: .35rem;
    }

    .shopier-logo {
        width: 45px;
    }
}

/* â”€â”€ Tablet â”€â”€ */
@media (min-width: 601px) and (max-width: 1024px) {

    .minimap-wrap {
        bottom: 190px;
    }
    .floating-seasons-btn {
        bottom: 350px;
    }

    .my-areas-floating-btn {
        bottom: 140px;
    }

    .selection-info {
        width: 280px;
        height: 40px;
        bottom: 140px;
    }
}

/* â”€â”€ Site Footer â”€â”€ */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 95;
    background: rgba(6, 6, 26, .95);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(12px);
    padding: 12px 20px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
}

.footer-top {
    font-size: .35rem;
    color: var(--text-dim);
    letter-spacing: 1px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 28px;
    justify-content: center;
}

.footer-link {
    font-family: var(--font-pixel);
    font-size: .45rem;
    color: #8a8aaa;
    text-decoration: none;
    transition: color .2s;
    cursor: pointer;
}

.footer-link:hover {
    color: var(--accent);
    text-shadow: 0 0 5px var(--accent);
}

.footer-payment {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.payment-badge {
    font-size: .3rem;
    color: var(--text-dim);
    letter-spacing: 1px;
}

.shopier-logo {
    width: 60px;
    height: auto;
    opacity: .75;
    transition: opacity .2s;
}

.shopier-logo:hover {
    opacity: 1;
}

/* â”€â”€ Legal Modal â”€â”€ */
.legal-modal {
    width: 640px;
    max-width: 95vw;
    max-height: 82vh;
}

.legal-body {
    font-family: 'Segoe UI', sans-serif;
    font-size: .8rem;
    line-height: 1.8;
    color: #c0c0e0;
}

.legal-body h3 {
    font-family: var(--font-pixel);
    font-size: .5rem;
    color: var(--accent3);
    margin: 18px 0 8px;
}

.legal-body p {
    margin-bottom: 10px;
}

.legal-body ul {
    padding-left: 20px;
    margin-bottom: 10px;
}

.legal-body ul li {
    margin-bottom: 8px;
}

.legal-body strong {
    color: var(--text);
}
/* ¦¦ SAVAŞ BÜLTENİ (BATTLE FEED) ¦¦ */
.battle-feed {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column; /* Yeni bildirimler üstten eklenecek */
    gap: 10px;
    pointer-events: none; /* Tıklamaları engellememesi için */
}

.battle-toast {
    background: rgba(10, 15, 30, 0.9);
    border: 1px solid var(--accent);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5), 0 0 10px rgba(255, 51, 102, 0.3);
    animation: slideInRight 0.4s ease forwards, fadeOut 0.4s ease 4.6s forwards; /* 5sn kalır */
    display: flex;
    align-items: center;
    gap: 8px;
}

.battle-toast.shield-drop {
    border-color: #00e5ff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5), 0 0 10px rgba(0, 229, 255, 0.3);
}

.battle-toast.conquer {
    border-color: #ffcc00;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5), 0 0 10px rgba(255, 204, 0, 0.3);
}

.battle-toast strong {
    color: var(--accent3);
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

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

/* Bilgisayar görünümü menü yerleşimleri */
@media (min-width: 768px) {
    .topbar-left {
        margin-left: 60px;
    }
    .topbar-center {
        margin-right: auto;
        margin-left: 25vw; /* Ortadaki istatistikleri logoya daha yakýn tutmak için sola çekiyoruz */
    }
}
