@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700;900&family=MedievalSharp&display=swap');

:root {
    --bg-dark: #0f0a0a;
    --paper: #d4c5a3;
    --paper-dark: #a89f81;
    --gold: #c5a059;
    --gold-bright: #ffd700;
    --blood: #8a0303;
    --wood: #3e2723;
    --text-main: #2c1810;
    --text-light: #e0e0e0;
}

body {
    background-color: var(--bg-dark);
    /* Subtle texture overlay could be added here if available */
    background-image: repeating-linear-gradient(45deg, #1a1005 0, #1a1005 2px, #0f0a0a 0, #0f0a0a 50%);
    background-size: 20px 20px;
    color: var(--text-light);
    font-family: 'MedievalSharp', cursive;
    min-height: 100vh;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

/* Allow selection in text areas and inputs */
input, textarea {
    user-select: text;
    -webkit-user-select: text;
    -ms-user-select: text;
}

h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand {
    font-family: 'Cinzel', serif;
    color: var(--gold);
    text-shadow: 2px 2px 0px #000;
    letter-spacing: 1px;
}

/* Medieval Cards - Parchment Style */
.card {
    background-color: #1e1310;
    border: 2px solid var(--gold);
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    position: relative;
    overflow: visible;
    /* For ornamental borders if added */
}

/* Ornate corners using pseudo-elements? Simplified for now: Gold Border */

.card-header {
    background-color: #2b1d19 !important;
    border-bottom: 2px solid var(--gold);
    color: var(--gold);
    font-family: 'Cinzel', serif;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Inputs - Old Paper Style */
.form-control,
.form-select {
    background-color: #2b1d19 !important;
    border: 1px solid var(--gold);
    color: var(--gold-bright) !important;
    font-family: 'MedievalSharp', cursive;
    border-radius: 2px;
}

.form-control::placeholder {
    color: rgba(197, 160, 89, 0.5);
}

.form-control:focus,
.form-select:focus {
    background-color: #3e2b25 !important;
    border-color: var(--gold-bright);
    box-shadow: 0 0 10px rgba(197, 160, 89, 0.3);
}

/* Buttons - Wax Seal / Banner Style */
.btn {
    font-family: 'Cinzel', serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 2px;
    border: 1px solid var(--gold);
    transition: all 0.3s ease;
    position: relative;
}

.btn-warning {
    background: linear-gradient(to bottom, #cfac6b, #8c6a2e);
    color: #2e1c05;
    border-color: #5c4315;
}

.btn-warning:hover {
    background: linear-gradient(to bottom, #eec780, #a8823e);
    color: #000;
    box-shadow: 0 0 15px rgba(197, 160, 89, 0.4);
}

.btn-danger {
    background: linear-gradient(to bottom, #8a0303, #520000);
    color: #ffbaba;
    border-color: #380000;
}

.btn-danger:hover {
    background: linear-gradient(to bottom, #a30e0e, #6e0000);
    box-shadow: 0 0 15px rgba(138, 3, 3, 0.4);
}

.btn-outline-light {
    border-color: var(--gold);
    color: var(--gold);
}

.btn-outline-light:hover {
    background-color: var(--gold);
    color: #000;
}

/* Nav Tabs */
.nav-tabs {
    border-bottom: 2px solid var(--gold);
}

.nav-tabs .nav-link {
    color: var(--gold-dark);
    font-family: 'Cinzel', serif;
    border: 1px solid transparent;
}

.nav-tabs .nav-link.active {
    background-color: #2b1d19;
    color: var(--gold-bright);
    border: 2px solid var(--gold);
    border-bottom-color: #2b1d19;
    /* Blend with content */
}

/* Marquee */
.marquee-content {
    font-family: 'MedievalSharp', cursive;
    color: #ffaaaa;
    text-shadow: 1px 1px 0 #000;
}

/* Map specific */
#map-container {
    border: 4px ridge var(--gold);
    border: 4px ridge var(--gold);
    box-shadow: 0 0 20px #000;
}

.map-hotspot {
    position: absolute;
    width: 60px;
    height: 60px;
    /* border: 1px solid red; /* Debug */
    transform: translate(-50%, -50%);
    /* Center on coordinate */
    cursor: pointer;
    z-index: 5;
}

/* General Layout */
.container {
    max-width: 1200px;
}

.modal-content {
    background-color: #1e1310;
    border: 2px solid var(--gold);
    color: var(--gold-bright);
}

.modal-header,
.modal-footer {
    border-color: var(--gold);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #0f0a0a;
}

::-webkit-scrollbar-thumb {
    background: #5c4315;
    border: 1px solid #000;
}

::-webkit-scrollbar-thumb:hover {
    background: #8c6a2e;
}

/* Utility to center with style */
.center-medieval {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* List Groups */
.list-group-item {
    background-color: rgba(43, 29, 25, 0.8);
    border: 1px solid var(--gold);
    color: var(--gold-bright);
    margin-bottom: 5px;
}

/* Tables */
.table {
    border-color: var(--gold);
    color: var(--text-light);
}

.table-dark {
    --bs-table-bg: #1e1310;
    --bs-table-striped-bg: #2b1d19;
    --bs-table-striped-color: var(--gold-bright);
    --bs-table-active-bg: #3e2723;
    --bs-table-hover-bg: #3e2723;
    color: var(--gold);
    border-color: var(--gold);
}

.table> :not(caption)>*>* {
    border-bottom-color: rgba(197, 160, 89, 0.3);
}

.table-striped>tbody>tr:nth-of-type(odd)>* {
    color: var(--gold-bright);
}

/* Login Page Medieval Background */
.game-bg {
    background: url('assets/login_background.png') no-repeat center center fixed;
    background-size: cover;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Optional overlay to ensure text readability if image is bright */
.game-bg::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    /* 50% dark overlay */
    z-index: 0;
}

.game-bg>* {
    position: relative;
    z-index: 1;
}

/* Map Population Counter */
.pop-counter {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--danger);
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
    padding: 4px 8px;
    border-radius: 50%;
    border: 2px solid var(--dark);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    z-index: 10;
    pointer-events: none;
    min-width: 24px;
    text-align: center;
}