@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

:root {
    --bg-overlay: rgba(20, 10, 5, 0.85);
    --text-color: #eec900;
    /* Hordes-like yellow/orange */
    --text-muted: #a89f91;
    --alert-color: #ff3333;
    --panel-bg: rgba(40, 20, 10, 0.9);
    --border-color: #5c2b2b;
    --header-bg: #3c1b1b;
}

body {
    background-image: url('/static/bg.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-color: #0a0500;
    color: var(--text-color);
    font-family: 'VT323', monospace;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

#blackout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(20, 0, 0, 0.98);
    color: var(--alert-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: pulse 4s infinite;
}

#blackout-overlay h1 {
    font-size: 6rem;
    margin: 0;
    text-shadow: 0 0 20px var(--alert-color);
    font-family: 'Courier New', Courier, monospace;
    /* Grittier font for blackout */
    text-transform: uppercase;
    border: 5px solid var(--alert-color);
    padding: 20px;
    background: #000;
}

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

    50% {
        opacity: 1;
        text-shadow: 0 0 50px red;
    }

    100% {
        opacity: 0.95;
    }
}

.container {
    max-width: 1450px;
    margin: 40px auto;
    padding: 20px;
    background-color: var(--bg-overlay);
    border: 2px solid #5c2b2b;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    position: relative;
}

/* Corner decorations */
.container::before {
    content: "";
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 2px solid #3c1b1b;
    z-index: -1;
    pointer-events: none;
}

header {
    border-bottom: 4px double var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 30px;
    text-align: center;
    background: linear-gradient(to bottom, #2a1510, #1a0d0a);
    padding-top: 10px;
    border-radius: 5px;
}

h1 {
    text-transform: uppercase;
    letter-spacing: 4px;
    font-size: 3rem;
    color: #ffcc00;
    text-shadow: 2px 2px 0px #3c1b1b;
    margin: 10px 0;
}

h2 {
    color: #d4c0a1;
    border-bottom: 1px solid #5c2b2b;
    padding-bottom: 5px;
    margin-top: 0;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.stat-box {
    border: 2px solid #5c2b2b;
    padding: 10px 20px;
    text-align: center;
    min-width: 140px;
    background: #22110a;
    box-shadow: inset 0 0 10px #000;
    position: relative;
}

.stat-box .label {
    display: block;
    font-size: 1.1rem;
    color: #a89f91;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.stat-box .value {
    display: block;
    font-size: 2.2rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 2px #000;
}

main {
    display: grid;
    grid-template-columns: 1fr 180px 250px auto;
    gap: 20px;
}

/* ... */

.building-card {
    text-align: left;
    margin-bottom: 5px;
    padding: 2px 0;
    /* No border or background */
    border: none;
    background: transparent;
}

.building-card h3 {
    margin: 0 0 2px 0;
    font-size: 1.1rem;
    /* Slightly larger than 1.0 but standard */
    display: block;
    /* No flex needed if simple text */
}

.b-name {
    font-weight: bold;
    color: #eec900;
}

.b-votes {
    font-weight: normal;
    font-size: 1.0em;
    color: #a89f91;
}

@media (max-width: 800px) {
    main {
        grid-template-columns: 1fr;
    }
}

.logs-section,
.players-section,
.bank-section,
.buildings-section {
    border: 1px solid var(--border-color);
    padding: 15px;
    background: rgba(10, 5, 2, 0.6);
    height: 500px;
    overflow-y: auto;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.vote-banner {
    background-color: #a00;
    color: white;
    text-align: center;
    padding: 10px;
    font-weight: bold;
    animation: blink 2s infinite;
    margin-bottom: 10px;
    border: 1px solid red;
}

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

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.building-item {
    cursor: help;
}

/* Tooltip styling */
#global-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid #5c4b35;
    padding: 10px;
    color: #d4c5a3;
    font-size: 0.9em;
    z-index: 1000;
    pointer-events: none;
    /* Let mouse events pass through */
    display: none;
    /* Hidden by default */
    max-width: 300px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

#global-tooltip h4 {
    margin: 0 0 5px 0;
    color: #e8d0a9;
    border-bottom: 1px solid #5c4b35;
    padding-bottom: 3px;
}

#global-tooltip p {
    margin: 5px 0;
}

#global-tooltip .cost {
    color: #a0a0a0;
    font-style: italic;
    font-size: 0.85em;
}

/* Built building style */
.building-item.built h3 {
    color: #2ecc71 !important;
    /* Green for built */
    text-shadow: 0 0 5px #27ae60;
}

/* Attack Overlay */
#attack-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: red;
    font-family: 'Courier New', Courier, monospace;
    text-align: center;
    display: none;
    /* Hidden by default */
}

#attack-overlay h1 {
    font-size: 4em;
    text-transform: uppercase;
    animation: flash 1s infinite;
    text-shadow: 0 0 20px red;
    margin-bottom: 20px;
    z-index: 2;
    position: relative;
    /* Ensure z-index works */
}

#attack-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 0.5;
    /* Adjust opacity to make text readable */
}

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

    50% {
        opacity: 0.2;
    }

    100% {
        opacity: 1;
    }
}

#unmute-btn {
    position: relative;
    z-index: 10;
    background: #c0392b;
    color: white;
    border: 2px solid #e74c3c;
    padding: 15px 30px;
    font-size: 1.5em;
    font-family: 'Courier New', Courier, monospace;
    cursor: pointer;
    margin-top: 20px;
    text-transform: uppercase;
    box-shadow: 0 0 15px red;
}

#unmute-btn:hover {
    background: #e74c3c;
    transform: scale(1.1);
}

#global-tooltip hr {
    border: 0;
    border-top: 1px solid #555;
    margin: 5px 0;
}

#brand-corner {
    position: fixed;
    bottom: 10px;
    right: 10px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.2em;
    color: rgba(255, 255, 255, 0.3);
    pointer-events: none;
    z-index: 1000;
    font-weight: bold;
}

#logs-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.log-entry {
    padding: 8px;
    font-size: 1.1rem;
    border-bottom: 1px solid #332211;
    background: rgba(60, 30, 15, 0.1);
}

.log-entry:nth-child(odd) {
    background: rgba(60, 30, 15, 0.2);
}

.log-entry.attack {
    border-left: 4px solid var(--alert-color);
    background: rgba(100, 0, 0, 0.2);
    color: #ffaaaa;
}

.log-entry.command {
    color: #aaddff;
}

.log-entry.error {
    color: #ff3333;
    border-left: 4px solid #ff3333;
    background: rgba(100, 0, 0, 0.1);
}

.log-entry.warning {
    color: #ffcc00;
    border-left: 4px solid #ffcc00;
    background: rgba(100, 80, 0, 0.1);
}

.log-entry.success {
    color: #44ff44;
    border-left: 3px solid #44ff44;
}

.log-entry.pvp {
    color: #ff0000;
    /* Rouge vif */
    border-left: 3px solid #ff0000;
    font-weight: bold;
    background: rgba(255, 0, 0, 0.1);
}

.log-entry .time {
    color: #776655;
    font-size: 0.9rem;
    margin-right: 10px;
}

#players-list {
    list-style: none;
    padding: 0;
}

#players-list li {
    padding: 4px 10px;
    /* Reduced padding */
    border-bottom: 1px solid #332211;
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    background: rgba(30, 15, 5, 0.3);
    margin-bottom: 1px;
    /* Reduced margin */
}

#players-list li:hover {
    background: rgba(60, 30, 10, 0.5);
}

#bank-list {
    list-style: none;
    padding: 0;
}

#bank-list li {
    padding: 8px 10px;
    border-bottom: 1px solid #332211;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    background: rgba(30, 15, 5, 0.3);
    margin-bottom: 2px;
}

#bank-list li:hover {
    background: rgba(60, 30, 10, 0.5);
}

#buildings-list {
    list-style: none;
    padding: 0;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #1a0d0a;
    border-left: 1px solid #3c1b1b;
}

::-webkit-scrollbar-thumb {
    background: #5c2b2b;
    border: 1px solid #1a0d0a;
}

::-webkit-scrollbar-thumb:hover {
    background: #7c3b3b;
}

.item-icon {
    width: 16px;
    height: 16px;
    image-rendering: pixelated;
    vertical-align: middle;
}

.status-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin: 0 2px;
    image-rendering: pixelated;
}



.b-name {
    font-weight: bold;
    color: #eec900;
}

.b-votes {
    font-weight: normal;
    font-size: 0.9em;
    color: #a89f91;
}

.building-card .progress-bar {
    height: 4px;
    background: #1a0d0a;
    border: 1px solid #3c1b1b;
    margin-top: 2px;
}

.building-card .progress-fill {
    height: 100%;
    background: #d35400;
}

.building-card.built .progress-fill {
    background: #2ecc71;
}

#game-over-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    background-image: url('/static/items/gameover.jpg');
    background-size: cover;
    background-position: center;
    color: red;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

#game-over-overlay h1 {
    font-size: 5rem;
    text-shadow: 0 0 20px red;
    margin-bottom: 10px;
    text-align: center;
}

#game-over-overlay p {
    font-size: 2rem;
    color: #a89f91;
    text-align: center;
    text-shadow:
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000,
        0 0 10px #000;
    /* Strong outline + glow */
    font-weight: bold;
}

#game-over-overlay .subtext {
    font-size: 1.5rem;
    color: #bbb;
    /* Lighter for better contrast */
    margin-top: 20px;
    text-shadow:
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000,
        0 0 10px #000;
}

/* Players Section Split */
.players-section {
    display: flex;
    gap: 20px;
}

.players-column {
    flex: 0 0 190px;
    /* Fixed width 190px */
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 5px;
    min-width: 190px;
}

.players-column h2 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    border-bottom: 1px solid #444;
    padding-bottom: 5px;
}

#dead-players-list .player-name {
    color: #ff4444;
    /* Red for dead */
    text-decoration: line-through;
    /* Optional: strike-through */
}

#dead-players-list li {
    padding: 4px 10px;
    border-bottom: 1px solid #332211;
    display: flex;
    justify-content: flex-start;
    /* Force left alignment */
    align-items: center;
    font-size: 1.1rem;
    background: rgba(30, 15, 5, 0.3);
    margin-bottom: 1px;
    opacity: 0.7;
}

/* Stats Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: #1a1a1a;
    border: 1px solid #444;
    padding: 20px;
    width: 80%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 8px;
    position: relative;
    color: #e0e0e0;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: #fff;
}

/* Tabs */
.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #444;
}

.tab-btn {
    background: none;
    border: none;
    color: #aaa;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 16px;
    transition: color 0.3s;
}

.tab-btn.active {
    color: #ff4444;
    border-bottom: 2px solid #ff4444;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Top 10 Table */
#top10-table {
    width: 100%;
    border-collapse: collapse;
}

#top10-table th,
#top10-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #333;
}

#top10-table th {
    color: #ff4444;
}

#top10-table .pseudo {
    font-weight: bold;
    color: #fff;
}

/* Chart Container */
#activity {
    height: 400px;
}

/* Floating Button */
.floating-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 30px;
    /* Reduced from 50px */
    height: 30px;
    /* Reduced from 50px */
    border-radius: 50%;
    background-color: #ff4444;
    color: white;
    border: none;
    font-size: 14px;
    /* Reduced from 24px */
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 900;
    transition: transform 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.floating-btn:hover {
    transform: scale(1.1);
    background-color: #ff6666;
}

#visitor-counter {
    position: fixed;
    top: 20px;
    /* Top */
    left: 20px;
    /* Left */
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #5c2b2b;
    color: #a89f91;
    padding: 5px 10px;
    /* Smaller padding */
    text-align: center;
    font-family: 'Courier New', Courier, monospace;
    z-index: 2000;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    font-size: 0.8rem;
    /* Smaller font */
    pointer-events: none;
}

#visitor-counter span {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
}

#visitor-counter strong {
    color: #eec900;
    font-size: 1.0rem;
    display: block;
}
/* Accordion Mobile Styles */
.building-details {
    display: none;
    padding: 8px;
    background: rgba(30, 15, 5, 0.4);
    margin-top: 5px;
    font-size: 0.95em;
    color: #d4c5a3;
    border-left: 2px solid #5c4b35;
}

.building-card.expanded .building-details {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

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

@media (max-width: 800px) {
    .building-card {
        cursor: pointer;
        padding-bottom: 5px;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    
    .building-card:active {
        background-color: rgba(255,255,255,0.05);
    }
}
