/* ==========================================================================
   AIAvenue.app - Main Stylesheet (Vanilla CSS Parchment Theme)
   ========================================================================== */

/* Global Variables & Reset */
:root {
    --bg-parchment-light: #f4ebd0;
    --bg-parchment-dark: #ebdcb9;
    --bg-ledger: #f0ebd8;
    --ink-dark: #2c251e;
    --ink-sepia: #4e3629;
    --ink-red: #8b0000;
    --ink-blue: #1c3d5a;
    --gold: #d4af37;
    --border-style: 2px double #4e3629;
    --font-heading: 'Cinzel', serif;
    --font-body: 'Playfair Display', serif;
    --font-mono: 'Special Elite', monospace;
    --font-cursive: 'Spectral', serif;
}

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

body {
    background-color: #12100e;
    background-image: radial-gradient(circle, #241d17 0%, #0d0a08 100%);
    color: var(--ink-dark);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    padding-bottom: 20px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(44, 37, 30, 0.1);
}
::-webkit-scrollbar-thumb {
    background: var(--ink-sepia);
    border-radius: 4px;
}

/* ==========================================================================
   Header / Top Bar
   ========================================================================== */
.top-bar {
    background-color: var(--bg-parchment-dark);
    background-image: linear-gradient(to bottom, var(--bg-parchment-dark), #dfceaa);
    border-bottom: 3px double var(--ink-sepia);
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    z-index: 100;
    position: relative;
}

.logo-container {
    display: flex;
    flex-direction: column;
}

.app-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--ink-red);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.tagline {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--ink-sepia);
    letter-spacing: 1px;
}

.simulation-time {
    display: flex;
    align-items: center;
    gap: 15px;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--ink-sepia);
    font-size: 1.1rem;
}

.season-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-heading);
    border: 1px solid currentColor;
}

.season-badge.winter { color: var(--ink-blue); background: rgba(28, 61, 90, 0.1); }
.season-badge.spring { color: #2e7d32; background: rgba(46, 125, 50, 0.1); }
.season-badge.summer { color: #d84315; background: rgba(216, 67, 21, 0.1); }
.season-badge.autumn { color: #e65100; background: rgba(230, 81, 0, 0.1); }

.terminated-indicator {
    font-size: 0.75rem;
    color: var(--ink-red);
    background: rgba(139, 0, 0, 0.1);
    border: 1px solid var(--ink-red);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--font-body);
    font-style: italic;
    white-space: nowrap;
}

.header-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Wax Seal Buttons */
.wax-seal-btn {
    background: #8b1c1c;
    color: #fff;
    border: 2px solid #5a1010;
    border-radius: 30px;
    padding: 8px 18px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.2), 0 3px 6px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

.wax-seal-btn:hover {
    background: #a12323;
    transform: translateY(-2px);
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.3), 0 5px 12px rgba(0,0,0,0.4);
}

.wax-seal-btn:active {
    transform: translateY(1px);
}

/* Developer Mode Advance Day Button */
.dev-btn {
    background: #333;
    color: #ffd700;
    border: 1px solid #ffd700;
    border-radius: 4px;
    padding: 8px 15px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: bold;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.dev-btn:hover {
    background: #ffd700;
    color: #000;
}

/* ==========================================================================
   Map Viewport Section (Parchment Map)
   ========================================================================== */
.map-section {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.map-viewport {
    position: relative;
    width: 100%;
    height: 520px;
    background-color: #241d17;
    border: 6px double var(--ink-sepia);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7);
    cursor: grab;
    transition: border 0.3s ease, border-image 0.3s ease;
}

.map-viewport.season-winter {
    border: 16px solid transparent;
    border-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48' fill='none'><rect width='48' height='48' fill='%23111622'/><text x='3' y='13' font-size='11' fill='%23ffffff'>❄</text><text x='19' y='13' font-size='10' fill='%23a5d8ff'>❅</text><text x='35' y='13' font-size='11' fill='%23ffffff'>❆</text><text x='3' y='29' font-size='10' fill='%23a5d8ff'>❅</text><text x='35' y='29' font-size='11' fill='%23ffffff'>❄</text><text x='3' y='45' font-size='11' fill='%23ffffff'>❆</text><text x='19' y='45' font-size='10' fill='%23a5d8ff'>❄</text><text x='35' y='45' font-size='11' fill='%23ffffff'>❅</text></svg>") 16 repeat;
}

.map-viewport.season-spring {
    border: 16px solid transparent;
    border-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48' fill='none'><rect width='48' height='48' fill='%231c2618'/><circle cx='8' cy='8' r='3.5' fill='%23ffb7c5'/><circle cx='8' cy='8' r='1.2' fill='%23ffe17d'/><circle cx='24' cy='8' r='3.5' fill='%23ffb7c5'/><circle cx='24' cy='8' r='1.2' fill='%23ffe17d'/><circle cx='40' cy='8' r='3.5' fill='%23ffb7c5'/><circle cx='40' cy='8' r='1.2' fill='%23ffe17d'/><circle cx='8' cy='24' r='3.5' fill='%23ffb7c5'/><circle cx='8' cy='24' r='1.2' fill='%23ffe17d'/><circle cx='40' cy='24' r='3.5' fill='%23ffb7c5'/><circle cx='40' cy='24' r='1.2' fill='%23ffe17d'/><circle cx='8' cy='40' r='3.5' fill='%23ffb7c5'/><circle cx='8' cy='40' r='1.2' fill='%23ffe17d'/><circle cx='24' cy='40' r='3.5' fill='%23ffb7c5'/><circle cx='24' cy='40' r='1.2' fill='%23ffe17d'/><circle cx='40' cy='40' r='3.5' fill='%23ffb7c5'/><circle cx='40' cy='40' r='1.2' fill='%23ffe17d'/></svg>") 16 repeat;
}

.map-viewport.season-summer {
    border: 16px solid transparent;
    border-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48' fill='none'><rect width='48' height='48' fill='%231b2611'/><circle cx='8' cy='8' r='2' fill='%23c62828'/><path d='M4 12c2-2 5-2 6 0' stroke='%232e7d32' stroke-width='1.5'/><circle cx='24' cy='8' r='2' fill='%23c62828'/><path d='M20 12c2-2 5-2 6 0' stroke='%232e7d32' stroke-width='1.5'/><circle cx='40' cy='8' r='2' fill='%23c62828'/><path d='M36 12c2-2 5-2 6 0' stroke='%232e7d32' stroke-width='1.5'/><circle cx='8' cy='24' r='2' fill='%23c62828'/><path d='M4 28c2-2 5-2 6 0' stroke='%232e7d32' stroke-width='1.5'/><circle cx='40' cy='24' r='2' fill='%23c62828'/><path d='M36 28c2-2 5-2 6 0' stroke='%232e7d32' stroke-width='1.5'/><circle cx='8' cy='40' r='2' fill='%23c62828'/><path d='M4 44c2-2 5-2 6 0' stroke='%232e7d32' stroke-width='1.5'/><circle cx='24' cy='40' r='2' fill='%23c62828'/><path d='M20 44c2-2 5-2 6 0' stroke='%232e7d32' stroke-width='1.5'/><circle cx='40' cy='40' r='2' fill='%23c62828'/><path d='M36 44c2-2 5-2 6 0' stroke='%232e7d32' stroke-width='1.5'/></svg>") 16 repeat;
}

.map-viewport.season-autumn {
    border: 16px solid transparent;
    border-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48' fill='none'><rect width='48' height='48' fill='%2326160c'/><ellipse cx='8' cy='8' rx='3' ry='2' fill='%23d84315'/><rect x='7' y='5' width='1' height='1.5' fill='%235d4037'/><ellipse cx='24' cy='8' rx='3' ry='2' fill='%23d84315'/><rect x='23' y='5' width='1' height='1.5' fill='%235d4037'/><ellipse cx='40' cy='8' rx='3' ry='2' fill='%23d84315'/><rect x='39' y='5' width='1' height='1.5' fill='%235d4037'/><ellipse cx='8' cy='24' rx='3' ry='2' fill='%23d84315'/><rect x='7' y='21' width='1' height='1.5' fill='%235d4037'/><ellipse cx='40' cy='24' rx='3' ry='2' fill='%23d84315'/><rect x='39' y='21' width='1' height='1.5' fill='%235d4037'/><ellipse cx='8' cy='40' rx='3' ry='2' fill='%23d84315'/><rect x='7' y='37' width='1' height='1.5' fill='%235d4037'/><ellipse cx='24' cy='40' rx='3' ry='2' fill='%23d84315'/><rect x='23' y='37' width='1' height='1.5' fill='%235d4037'/><ellipse cx='40' cy='40' rx='3' ry='2' fill='%23d84315'/><rect x='39' y='37' width='1' height='1.5' fill='%235d4037'/></svg>") 16 repeat;
}

.map-viewport:active {
    cursor: grabbing;
}

.map-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 1400px; /* Oversized map for panning */
    height: 1400px; /* Square aspect ratio matching the map file */
}

.parchment-map-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none; /* Prevent browser drag */
    filter: sepia(20%) contrast(105%);
}

.map-instructions {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(0,0,0,0.7);
    color: #e5d1ae;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    pointer-events: none;
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
    border: 1px solid var(--ink-sepia);
}

.map-recenter-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: var(--bg-parchment-dark);
    color: var(--ink-dark);
    border: 1px solid var(--ink-sepia);
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    z-index: 10;
}

.map-recenter-btn:hover {
    background: var(--bg-parchment-light);
}

/* ==========================================================================
   Map Locations & Wax Stamp Avatars
   ========================================================================== */
.location-zone {
    position: absolute;
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    /* transform coordinates dynamically */
    transform: translate(-50%, -50%);
}

/* CSS Wax Seal representation of Character */
.character-wax-seal {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    position: absolute;
    box-shadow: 
        inset 0 2px 4px rgba(255,255,255,0.4),
        inset 0 -2px 4px rgba(0,0,0,0.4),
        0 4px 8px rgba(0,0,0,0.4);
    border: 2px dashed rgba(255, 255, 255, 0.25);
    transition: all 0.2s ease-in-out;
    user-select: none;
}

/* Distinctive inner wax circle effect */
.character-wax-seal::after {
    content: '';
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    pointer-events: none;
}

.character-wax-seal:hover {
    transform: scale(1.18) rotate(8deg);
    box-shadow: 
        inset 0 2px 4px rgba(255,255,255,0.5),
        inset 0 -2px 4px rgba(0,0,0,0.5),
        0 8px 16px rgba(0,0,0,0.6);
    z-index: 10;
}

/* Overlapping offset logic for multiple characters at same zone */
/* Overlapping offset logic for multiple characters at same zone */
.location-zone .character-wax-seal:nth-child(1) { transform: translate(0px, 0px); }
.location-zone .character-wax-seal:nth-child(2) { transform: translate(32px, 0px); }
.location-zone .character-wax-seal:nth-child(3) { transform: translate(16px, 28px); }
.location-zone .character-wax-seal:nth-child(4) { transform: translate(-16px, 28px); }
.location-zone .character-wax-seal:nth-child(5) { transform: translate(-32px, 0px); }
.location-zone .character-wax-seal:nth-child(6) { transform: translate(-16px, -28px); }
.location-zone .character-wax-seal:nth-child(7) { transform: translate(16px, -28px); }
.location-zone .character-wax-seal:nth-child(8) { transform: translate(56px, 0px); }
.location-zone .character-wax-seal:nth-child(9) { transform: translate(40px, 40px); }
.location-zone .character-wax-seal:nth-child(10) { transform: translate(0px, 56px); }
.location-zone .character-wax-seal:nth-child(11) { transform: translate(-40px, 40px); }
.location-zone .character-wax-seal:nth-child(12) { transform: translate(-56px, 0px); }
.location-zone .character-wax-seal:nth-child(13) { transform: translate(-40px, -40px); }
.location-zone .character-wax-seal:nth-child(14) { transform: translate(0px, -56px); }
.location-zone .character-wax-seal:nth-child(15) { transform: translate(40px, -40px); }
.location-zone .character-wax-seal:nth-child(16) { transform: translate(78px, 0px); }
.location-zone .character-wax-seal:nth-child(17) { transform: translate(-78px, 0px); }
.location-zone .character-wax-seal:nth-child(18) { transform: translate(0px, -78px); }

.location-zone .character-wax-seal:nth-child(1):hover { transform: translate(0px, 0px) scale(1.15) rotate(5deg); }
.location-zone .character-wax-seal:nth-child(2):hover { transform: translate(32px, 0px) scale(1.15) rotate(-5deg); }
.location-zone .character-wax-seal:nth-child(3):hover { transform: translate(16px, 28px) scale(1.15) rotate(5deg); }
.location-zone .character-wax-seal:nth-child(4):hover { transform: translate(-16px, 28px) scale(1.15) rotate(-5deg); }
.location-zone .character-wax-seal:nth-child(5):hover { transform: translate(-32px, 0px) scale(1.15) rotate(5deg); }
.location-zone .character-wax-seal:nth-child(6):hover { transform: translate(-16px, -28px) scale(1.15) rotate(-5deg); }
.location-zone .character-wax-seal:nth-child(7):hover { transform: translate(16px, -28px) scale(1.15) rotate(5deg); }
.location-zone .character-wax-seal:nth-child(8):hover { transform: translate(56px, 0px) scale(1.15) rotate(-5deg); }
.location-zone .character-wax-seal:nth-child(9):hover { transform: translate(40px, 40px) scale(1.15) rotate(5deg); }
.location-zone .character-wax-seal:nth-child(10):hover { transform: translate(0px, 56px) scale(1.15) rotate(-5deg); }
.location-zone .character-wax-seal:nth-child(11):hover { transform: translate(-40px, 40px) scale(1.15) rotate(5deg); }
.location-zone .character-wax-seal:nth-child(12):hover { transform: translate(-56px, 0px) scale(1.15) rotate(-5deg); }
.location-zone .character-wax-seal:nth-child(13):hover { transform: translate(-40px, -40px) scale(1.15) rotate(5deg); }
.location-zone .character-wax-seal:nth-child(14):hover { transform: translate(0px, -56px) scale(1.15) rotate(-5deg); }
.location-zone .character-wax-seal:nth-child(15):hover { transform: translate(40px, -40px) scale(1.15) rotate(5deg); }
.location-zone .character-wax-seal:nth-child(16):hover { transform: translate(78px, 0px) scale(1.15) rotate(-5deg); }
.location-zone .character-wax-seal:nth-child(17):hover { transform: translate(-78px, 0px) scale(1.15) rotate(5deg); }
.location-zone .character-wax-seal:nth-child(18):hover { transform: translate(0px, -78px) scale(1.15) rotate(-5deg); }

/* Zone title labels visible on map hover */
.zone-tag {
    position: absolute;
    bottom: -15px;
    background: rgba(44, 37, 30, 0.85);
    color: #f4ebd0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-family: var(--font-heading);
    white-space: nowrap;
    pointer-events: none;
    border: 1px solid var(--ink-sepia);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.location-zone:hover .zone-tag {
    opacity: 1;
}

/* ==========================================================================
   Bottom Grid Section (Newspaper + Voting)
   ========================================================================== */
.bottom-grid {
    display: grid;
    grid-template-columns: 7fr 3fr;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   Oakhaven Observer (Newspaper) Card
   ========================================================================== */
.newspaper-card {
    background-color: var(--bg-parchment-light);
    background-image: radial-gradient(circle, var(--bg-parchment-light) 60%, var(--bg-parchment-dark) 100%);
    border: 3px double var(--ink-sepia);
    padding: 30px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.5);
    border-radius: 4px;
    color: var(--ink-dark);
}

.newspaper-header {
    text-align: center;
    border-bottom: 2px solid var(--ink-sepia);
    padding-bottom: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.newspaper-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 1px;
    color: var(--ink-dark);
    margin: 0 auto;
    text-align: center;
}

.newspaper-meta-left, .newspaper-meta-right {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--ink-sepia);
}

.newspaper-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--ink-sepia);
    padding: 10px 0;
    margin-bottom: 20px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.paper-btn, .paper-btn-small {
    background: transparent;
    border: 1px solid var(--ink-sepia);
    color: var(--ink-sepia);
    font-family: var(--font-heading);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.15s ease;
    border-radius: 2px;
}

.paper-btn {
    padding: 5px 12px;
    font-size: 0.8rem;
}

.paper-btn-small {
    padding: 3px 8px;
    font-size: 0.75rem;
}

.paper-btn:hover, .paper-btn-small:hover {
    background: var(--ink-sepia);
    color: var(--bg-parchment-light);
}

.page-indicator {
    font-family: var(--font-heading);
    font-weight: 700;
    padding: 0 10px;
    font-size: 0.9rem;
}

.calendar-picker-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 0.8rem;
}

.paper-input, .paper-input-small {
    background: transparent;
    border: 1px solid var(--ink-sepia);
    color: var(--ink-dark);
    font-family: var(--font-mono);
    padding: 4px 6px;
    border-radius: 2px;
}

.paper-input { width: 60px; }
.paper-input-small { width: 50px; }

.newspaper-content {
    margin-top: 10px;
}

.newspaper-headline {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--ink-red);
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 1px dashed rgba(78, 54, 41, 0.4);
    padding-bottom: 10px;
    letter-spacing: 0.5px;
}

.newspaper-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.newspaper-gossip {
    font-size: 1.05rem;
    text-align: justify;
    text-justify: inter-word;
    font-family: var(--font-body);
}

.newspaper-gossip p {
    margin-bottom: 15px;
    text-indent: 20px;
}

.newspaper-divider {
    height: 1px;
    border-bottom: 1px solid var(--ink-sepia);
    margin: 10px 0;
}

.newspaper-notices {
    background: rgba(44, 37, 30, 0.04);
    border: 1px dashed var(--ink-sepia);
    padding: 15px;
    border-radius: 2px;
}

.newspaper-notices h4 {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: var(--ink-sepia);
    letter-spacing: 1px;
}

.newspaper-notices p {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #444;
}

/* ==========================================================================
   Town Hall Voting Card
   ========================================================================== */
.voting-card {
    background-color: var(--bg-parchment-dark);
    background-image: radial-gradient(circle, var(--bg-parchment-dark) 50%, #dfceaa 100%);
    border: 3px double var(--ink-sepia);
    padding: 25px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.5);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
}

.widget-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--ink-dark);
    text-align: center;
    border-bottom: 2px solid var(--ink-sepia);
    padding-bottom: 10px;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.poll-question {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--ink-sepia);
    line-height: 1.5;
}

.poll-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vote-choice-btn {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid var(--ink-sepia);
    border-radius: 4px;
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    text-align: left;
    color: var(--ink-dark);
}

.vote-choice-btn:hover {
    background: rgba(139, 0, 0, 0.1);
    border-color: var(--ink-red);
}

.choice-letter {
    background: var(--ink-sepia);
    color: var(--bg-parchment-light);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-family: var(--font-heading);
    font-size: 0.8rem;
}

.choice-text {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
}

/* Poll Results Panel */
.poll-results {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.results-header {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ink-sepia);
}

.result-bar-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.result-label {
    font-size: 0.85rem;
    font-weight: 600;
}

.result-bar {
    width: 100%;
    height: 14px;
    background: rgba(44, 37, 30, 0.1);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(78, 54, 41, 0.2);
}

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

.result-bar-fill.fill-a { background: var(--ink-red); }
.result-bar-fill.fill-b { background: var(--ink-blue); }

.voted-confirmation-message {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #555;
    text-align: center;
    margin-top: 10px;
    background: rgba(255,255,255,0.3);
    padding: 6px;
    border-radius: 4px;
}

/* ==========================================================================
   Modals (General Styles)
   ========================================================================== */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-backdrop.active {
    display: flex;
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--ink-sepia);
    transition: color 0.15s ease;
    z-index: 10;
}

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

/* ==========================================================================
   Modal 1: Paper Journal (Diary Modal)
   ========================================================================== */
.paper-journal-modal {
    background-color: var(--bg-parchment-light);
    background-image: linear-gradient(to right, var(--bg-parchment-dark) 0%, var(--bg-parchment-light) 3%, var(--bg-parchment-light) 97%, var(--bg-parchment-dark) 100%);
    border: 4px double var(--ink-sepia);
    border-radius: 4px;
    width: 100%;
    max-width: 900px;
    height: 580px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.8);
    position: relative;
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.journal-header {
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 2px solid var(--ink-sepia);
    padding-bottom: 12px;
    margin-bottom: 10px;
}

.avatar-wax-seal {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-heading);
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 
        inset 0 2px 4px rgba(255,255,255,0.4),
        inset 0 -2px 4px rgba(0,0,0,0.4),
        0 3px 6px rgba(0,0,0,0.3);
}

.diary-title-container {
    display: flex;
    flex-direction: column;
}

.diary-char-name {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--ink-dark);
}

.diary-char-role {
    font-size: 0.8rem;
    font-style: italic;
    color: var(--ink-sepia);
}

.journal-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed rgba(78, 54, 41, 0.4);
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.journal-pages {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    flex-grow: 1;
    overflow: hidden;
}

.journal-page {
    overflow-y: auto;
    padding-right: 10px;
}

.left-page {
    border-right: 1px solid rgba(78, 54, 41, 0.15);
    padding-right: 25px;
}

.journal-date {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    color: var(--ink-sepia);
    margin-bottom: 15px;
    font-weight: 700;
}

.journal-text {
    font-family: var(--font-cursive);
    font-size: 1.1rem;
    line-height: 1.7;
    text-align: justify;
    color: #1e1a15;
}

.journal-page h3 {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--ink-sepia);
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.profile-field {
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.profile-field strong {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: var(--ink-sepia);
    display: block;
    margin-bottom: 4px;
}

.profile-field p {
    font-style: italic;
}

/* Speculation Specimen Secrets Blurry Text */
.blur-text {
    filter: blur(4px);
    transition: filter 0.3s ease;
    cursor: pointer;
    user-select: none;
    background: rgba(0,0,0,0.05);
    padding: 6px;
    border-radius: 4px;
}

.blur-text:hover {
    filter: blur(2.5px);
}

.blur-text.revealed {
    filter: blur(0);
    cursor: default;
    background: transparent;
    user-select: text;
}

/* ==========================================================================
   Modal 2 & 3: Paper Ledger Modals (Census & Archives)
   ========================================================================== */
.paper-ledger-modal {
    background-color: var(--bg-ledger);
    background-image: linear-gradient(to bottom, var(--bg-ledger) 90%, #d8cfb4 100%);
    border: 4px double var(--ink-sepia);
    border-radius: 4px;
    width: 100%;
    max-width: 1100px;
    height: 600px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.8);
    position: relative;
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.ledger-header {
    text-align: center;
    border-bottom: 2px solid var(--ink-sepia);
    padding-bottom: 12px;
    margin-bottom: 15px;
}

.ledger-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    letter-spacing: 1.5px;
    color: var(--ink-dark);
}

.ledger-subtitle {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--ink-sepia);
}

.ledger-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--ink-sepia);
    color: var(--ink-sepia);
    padding: 4px 14px;
    border-radius: 20px;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn.active, .filter-btn:hover {
    background: var(--ink-sepia);
    color: var(--bg-ledger);
}

.ledger-grid-container {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 5px;
}

.ledger-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* Census Cards */
.census-card {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(78, 54, 41, 0.3);
    border-radius: 4px;
    padding: 15px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    transition: background 0.2s ease;
}

.census-card:hover {
    background: rgba(255, 255, 255, 0.7);
}

.census-card.deceased {
    opacity: 0.65;
    background: rgba(0,0,0,0.05);
}

.census-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-heading);
    font-weight: bold;
    font-size: 0.8rem;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.3), 0 2px 4px rgba(0,0,0,0.2);
    position: relative; /* Position context for unread badges */
}

.census-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.census-name {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--ink-dark);
}

.census-role {
    font-size: 0.75rem;
    font-style: italic;
    color: var(--ink-sepia);
    margin-bottom: 6px;
}

.census-bio {
    font-size: 0.8rem;
    line-height: 1.4;
    color: #333;
    margin-bottom: 8px;
}

.census-status {
    align-self: flex-start;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-family: var(--font-heading);
    font-weight: bold;
    text-transform: uppercase;
}

.census-status.alive { color: #2e7d32; background: rgba(46, 125, 50, 0.1); }
.census-status.deceased { color: var(--ink-red); background: rgba(139, 0, 0, 0.1); }
.census-status.exiled { color: #37474f; background: rgba(55, 71, 79, 0.1); }

/* ==========================================================================
   Vote Archives Table
   ========================================================================== */
.archive-list-container {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.archive-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 700px;
}

.archive-table th, .archive-table td {
    border-bottom: 1px solid rgba(78, 54, 41, 0.2);
    padding: 12px 10px;
    text-align: left;
    word-break: break-word;
}

.archive-table th {
    font-family: var(--font-heading);
    color: var(--ink-sepia);
    font-weight: bold;
    border-bottom: 2px solid var(--ink-sepia);
    white-space: nowrap;
}

.archive-table tr:hover td {
    background: rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.app-footer {
    text-align: center;
    color: rgba(244, 235, 208, 0.4);
    font-size: 0.8rem;
    margin-top: 30px;
    padding: 15px;
    border-top: 1px solid rgba(244, 235, 208, 0.1);
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
}

/* ==========================================================================
   Mobile / Responsive Layout (Stacking)
   ========================================================================== */
@media (max-width: 768px) {
    .top-bar {
        padding: 10px 15px;
        flex-direction: column;
        gap: 10px;
        align-items: center;
        text-align: center;
    }

    .terminated-indicator {
        white-space: normal;
        word-break: break-word;
        text-align: center;
    }

    .header-buttons {
        width: 100%;
        justify-content: center;
    }

    .btn-text {
        display: none; /* Hide button text on mobile to fit icons */
    }

    .wax-seal-btn {
        padding: 8px 12px;
    }

    .map-viewport {
        height: 320px; /* Smaller viewport height on mobile */
    }

    .bottom-grid {
        grid-template-columns: 1fr; /* Stack columns vertically */
        padding: 0 10px;
    }

    .voting-card {
        order: 1; /* Stack decrees above newspaper on mobile */
    }

    .newspaper-card {
        order: 2;
    }

    .newspaper-card, .voting-card {
        padding: 15px;
    }

    .newspaper-title {
        font-size: 1.5rem;
    }

    .newspaper-meta-left, .newspaper-meta-right {
        font-size: 0.7rem;
    }

    .newspaper-nav {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    /* Modal page splitting behaves like stacked layout on mobile */
    .paper-journal-modal {
        height: auto;
        max-height: 90vh;
        overflow-y: auto;
    }

    .journal-pages {
        grid-template-columns: 1fr;
        gap: 20px;
        overflow-y: visible;
    }

    .left-page {
        border-right: none;
        border-bottom: 1px dashed rgba(78, 54, 41, 0.3);
        padding-right: 0;
        padding-bottom: 20px;
    }

    /* Paper Ledger Modal (Census & Archives) mobile */
    .paper-ledger-modal {
        max-width: 95vw;
        height: 85vh;
        padding: 15px;
    }

    .ledger-title {
        font-size: 1.2rem;
    }

    .archive-table {
        font-size: 0.75rem;
        min-width: 600px;
    }

    .archive-table th, .archive-table td {
        padding: 8px 6px;
    }
}

/* Developer Mode Danger Button */
.dev-btn.danger {
    color: #ff4d4d;
    border-color: #ff4d4d;
}

.dev-btn.danger:hover {
    background: #ff4d4d;
    color: #fff;
}

/* Journal Conversation Link Container */
.journal-conversation-link-container {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed rgba(78, 54, 41, 0.2);
    text-align: center;
}

.today-conv-link {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--ink-red);
    text-decoration: none;
    border: 1px solid var(--ink-red);
    border-radius: 4px;
    padding: 6px 12px;
    transition: all 0.2s ease;
    display: inline-block;
}

.today-conv-link:hover {
    background-color: var(--ink-red);
    color: #fff;
    text-decoration: none;
}

/* Modal 4: Paper Script Modal (Play Dialogue Script) */
.paper-script-modal {
    background-color: var(--bg-parchment-light);
    border: 4px double var(--ink-sepia);
    border-radius: 4px;
    width: 100%;
    max-width: 650px;
    height: 520px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.8);
    position: relative;
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.script-header {
    text-align: center;
    border-bottom: 2px solid var(--ink-sepia);
    padding-bottom: 12px;
    margin-bottom: 15px;
}

.script-meta {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--ink-red);
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.script-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--ink-dark);
}

.script-subtitle {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--ink-sepia);
}

.script-divider {
    border-bottom: 1px dashed rgba(78, 54, 41, 0.4);
    margin-bottom: 15px;
}

.script-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    font-family: var(--font-mono); /* special elite gothic type-writer font */
    font-size: 0.95rem;
    line-height: 1.6;
    color: #1a1a1a;
}

.script-line {
    margin-bottom: 18px;
    text-align: left;
}

.script-character {
    display: block;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
    margin-bottom: 4px;
    color: #333;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.script-dialogue {
    display: block;
    margin-left: 15%;
    margin-right: 15%;
    text-align: left;
}

.stage-direction {
    font-style: italic;
    color: #555;
    text-align: center;
    margin: 12px 10%;
}

@media (max-width: 768px) {
    .paper-script-modal {
        max-width: 95vw;
        height: 85vh;
        padding: 15px;
    }
    
    .script-dialogue {
        margin-left: 5%;
        margin-right: 5%;
    }
    
    .script-footer {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
}

.script-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed rgba(78, 54, 41, 0.3);
    display: flex;
    justify-content: space-around;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: bold;
}

.script-footer a {
    color: var(--ink-red);
    text-decoration: none;
    border: 1px solid var(--ink-red);
    border-radius: 4px;
    padding: 6px 12px;
    transition: all 0.2s ease;
}

.script-footer a:hover {
    background-color: var(--ink-red);
    color: #fff;
    text-decoration: none;
}

.paper-auth-modal {
    background-color: var(--bg-ledger);
    background-image: linear-gradient(to bottom, var(--bg-ledger) 90%, #d8cfb4 100%);
    border: 4px double var(--ink-sepia);
    border-radius: 4px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.8);
    position: relative;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Terminated Simulation Cards */
.terminated-sim-card {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(78, 54, 41, 0.3);
    border-radius: 4px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.terminated-sim-card:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.terminated-sim-card-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: var(--ink-red);
    border-bottom: 1px dashed var(--ink-sepia);
    padding-bottom: 5px;
    margin-bottom: 10px;
    font-weight: 700;
}

.terminated-sim-card-detail {
    font-size: 0.85rem;
    margin-bottom: 5px;
    color: var(--ink-dark);
}

.terminated-sim-card-detail strong {
    color: var(--ink-sepia);
}

/* ==========================================================================
   Unread Badges for Character Avatars (LocalStorage Checked)
   ========================================================================== */
.unread-badge {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    z-index: 8; /* Stack above standard overlapping seals */
    pointer-events: none; /* Make sure they don't block clicks on the seal */
}

/* White outline border so they stand out against any avatar background */
.unread-badge.journal-badge {
    background-color: #4cd964; /* Vibrant green */
    box-shadow: 0 0 0 1.5px #ffffff, 0 1px 3px rgba(0, 0, 0, 0.4);
    top: -2px;
    left: -2px;
}

.unread-badge.conv-badge {
    background-color: #ff3b30; /* Vibrant red */
    box-shadow: 0 0 0 1.5px #ffffff, 0 1px 3px rgba(0, 0, 0, 0.4);
    top: -2px;
    right: -2px;
}

