/* ==========================================================================
   ECI EVM SIMULATOR DESIGN SYSTEM (MODEL M3)
   ========================================================================== */

:root {
    /* Industrial Polling Booth Palette */
    --desk-wood: radial-gradient(circle, #3d2516 0%, #1a0f08 100%);
    --plastic-beige: #d7d1bf;
    --plastic-beige-light: #e3decb;
    --plastic-beige-dark: #b8b09b;
    --plastic-border: #a39b85;
    
    /* Component Specific Colors */
    --lcd-green: #9cbd27;
    --lcd-green-glow: #b1d43a;
    --lcd-text: #1d2b07;
    --ballot-pink: #fecdd3; /* ECI Pink Ballot Paper Tint */
    
    /* Tactile Colors */
    --led-off: #471212;
    --led-red: #ff0000;
    --led-green: #00ff22;
    --button-blue: #094eb8;
    --button-blue-dark: #042e73;
    --button-blue-light: #2c72e6;
    
    --cardboard-color: #cda270;
    --cardboard-border: #a47d51;
}

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

body {
    background: var(--desk-wood);
    color: #334155;
    font-family: 'Public Sans', sans-serif;
    min-height: 100vh;
    padding: 20px;
    padding-top: 65px; /* space for fixed disclaimer */
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden;
}

.disclaimer-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(90deg, #b91c1c, #dc2626, #b91c1c);
    color: #ffffff;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    font-weight: 800;
    text-align: center;
    padding: 10px;
    letter-spacing: 2px;
    border-bottom: 3px solid #f87171;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6);
    z-index: 1001; /* float over modal backdrops */
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

/* Polling Station Layout */
.polling-station {
    width: 100%;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Station Header */
.station-header {
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(8px);
}
.header-logo {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #f8fafc;
}
.logo-emblem {
    font-size: 2.2rem;
}
.header-logo h1 {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 1px;
}
.subtitle {
    font-size: 0.75rem;
    color: #94a3b8;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.station-info {
    display: flex;
    align-items: center;
    gap: 20px;
}
.booth-badge {
    background-color: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.booth-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 700;
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.status-dot.green {
    background-color: var(--led-green);
    box-shadow: 0 0 8px var(--led-green);
}

/* The Wooden Table Workspace */
.polling-desk {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 40px;
    align-items: start;
}

@media (max-width: 1150px) {
    .polling-desk {
        grid-template-columns: 1fr;
    }
}

.desk-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.section-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    color: #d17a22;
    letter-spacing: 1.5px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    border-left: 3px solid #d17a22;
    padding-left: 8px;
}

/* ==========================================================================
   1. CONTROL UNIT (CU)
   ========================================================================== */
.cu-device {
    position: relative;
    width: 320px;
    margin: 0 auto;
}
.device-body {
    background: linear-gradient(135deg, var(--plastic-beige-light) 0%, var(--plastic-beige) 50%, var(--plastic-beige-dark) 100%);
    border: 4px solid var(--plastic-border);
    border-radius: 12px 12px 20px 20px;
    box-shadow: 0 25px 40px rgba(0,0,0,0.6), inset 0 2px 5px rgba(255,255,255,0.7);
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.cu-header-logo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px dashed var(--plastic-border);
    padding-bottom: 8px;
}
.mfr-label {
    font-size: 0.65rem;
    font-weight: 800;
    color: #645f50;
    letter-spacing: 0.5px;
}
.cu-model {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    background-color: #4b5563;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
}

/* Retro character LCD Display */
.cu-lcd-frame {
    background-color: #3f3c35;
    border: 3px solid var(--plastic-border);
    border-radius: 6px;
    padding: 10px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}
.cu-lcd-bezel {
    position: relative;
    background-color: var(--lcd-green);
    border: 2px solid #555f2c;
    height: 60px;
    border-radius: 3px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 3px 6px rgba(0,0,0,0.4);
}
.lcd-backlight {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--lcd-green-glow);
    opacity: 0.15;
    pointer-events: none;
    transition: opacity 0.3s;
}
.lcd-backlight.active {
    opacity: 0.45;
}
.lcd-lines {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--lcd-text);
    letter-spacing: 2px;
    text-shadow: 1px 1px 0px rgba(255,255,255,0.3);
    text-align: center;
    text-transform: uppercase;
    z-index: 2;
}

/* LCD indicators panel */
.cu-led-panel {
    display: flex;
    justify-content: space-around;
    background-color: #272520;
    padding: 12px;
    border-radius: 6px;
    border: 2px solid var(--plastic-border);
}
.led-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.led {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #1e1d1a;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.8), 0 1px 1px rgba(255,255,255,0.1);
    transition: background-color 0.15s, box-shadow 0.15s;
}
.led-green.active {
    background-color: var(--led-green);
    box-shadow: 0 0 14px 4px rgba(0, 255, 34, 0.75), inset 0 0 4px #00ff22;
}
.led-red.active {
    background-color: var(--led-red);
    box-shadow: 0 0 14px 4px rgba(255, 0, 0, 0.75), inset 0 0 4px #ff0000;
}
.led-tag {
    font-size: 0.65rem;
    font-weight: 800;
    color: #948f7f;
    letter-spacing: 0.5px;
}

/* Control buttons keyboard */
.cu-keyboard {
    background-color: #33302a;
    padding: 16px;
    border-radius: 8px;
    border: 3px solid var(--plastic-border);
    box-shadow: inset 0 3px 6px rgba(0,0,0,0.5);
}
.kb-row {
    display: flex;
    justify-content: space-around;
}
.cu-btn {
    background-color: #222;
    border: 2px solid #555;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 90px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: transform 0.05s;
}
.cu-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.btn-top {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.4), 0 3px 0 rgba(0,0,0,0.4);
}
.reset-red {
    background-color: #dc2626;
    border: 2px solid #ef4444;
}
.result-yellow {
    background-color: #eab308;
    border: 2px solid #facc15;
}
.btn-lbl {
    font-size: 0.65rem;
    font-weight: 800;
    color: #e2e8f0;
    letter-spacing: 0.5px;
}

/* Exploit Board taped on side of CU */
.hacker-board {
    background-color: #1b4d22; /* green circuit board */
    border: 2px solid #0f3014;
    border-radius: 4px;
    padding: 10px;
    margin-top: 10px;
    position: relative;
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}
.hacker-board-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    color: #a3e635;
    border-bottom: 1px dashed rgba(163,230,53,0.3);
    padding-bottom: 4px;
    margin-bottom: 8px;
}
.wires {
    display: flex;
    gap: 8px;
    position: absolute;
    top: -24px;
    right: 30px;
    height: 24px;
}
.wire {
    width: 4px;
    height: 100%;
    border-radius: 2px 2px 0 0;
}
.red-w { background-color: #ef4444; }
.blue-w { background-color: #3b82f6; }
.yellow-w { background-color: #fbbf24; }

.hack-trigger-btn {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    color: white;
    border: 1px solid #34d399;
    border-radius: 4px;
    width: 100%;
    padding: 8px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    animation: hackGlowPulse 1.5s infinite alternate;
}
.hack-trigger-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #065f46 100%);
}
@keyframes hackGlowPulse {
    0% { box-shadow: 0 0 4px rgba(16, 185, 129, 0.4); }
    100% { box-shadow: 0 0 12px rgba(16, 185, 129, 0.8); }
}

/* Thicker wire between devices */
.cable {
    position: absolute;
    background-color: #1e293b;
    z-index: -1;
    border: 1px solid #0f172a;
}
.cable-to-vvpat {
    top: 50%;
    right: -42px;
    width: 45px;
    height: 14px;
    border-radius: 0 10px 10px 0;
    box-shadow: 0 8px 16px rgba(0,0,0,0.5);
}

/* ==========================================================================
   2. SECRET COMPARTMENT (VVPAT & BU)
   ========================================================================== */
.cardboard-compartment {
    background-color: var(--cardboard-color);
    border: 10px solid var(--cardboard-border);
    border-bottom: 20px solid var(--cardboard-border);
    border-radius: 8px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.7), inset 0 0 50px rgba(0,0,0,0.35);
    position: relative;
    padding: 30px 20px;
}
.security-seal {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ef4444;
    color: white;
    font-weight: 800;
    font-size: 0.55rem;
    padding: 4px 12px;
    border-radius: 2px;
    border: 2px dashed white;
    letter-spacing: 1px;
}

.compartment-devices {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    align-items: flex-start;
}

/* VVPAT UNIT */
.vvpat-device {
    width: 250px;
    display: flex;
    flex-direction: column;
}
.vvpat-label-bar {
    background-color: #475569;
    color: white;
    padding: 6px 12px;
    border-radius: 6px 6px 0 0;
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    font-weight: 800;
}
.vvpat-casing {
    background: linear-gradient(135deg, var(--plastic-beige-light) 0%, var(--plastic-beige) 60%, var(--plastic-beige-dark) 100%);
    border: 4px solid var(--plastic-border);
    border-top: none;
    border-radius: 0 0 10px 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

/* Mechanical viewing slot */
.vvpat-viewing-window {
    width: 100%;
    height: 190px;
    background-color: #0b0f19;
    border: 6px solid #334155;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 10px 20px rgba(0,0,0,0.8);
}
.vvpat-glass-shine {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 60%);
    z-index: 5;
    pointer-events: none;
}
.vvpat-internal-light {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(254, 240, 138, 0); /* starts off */
    z-index: 2;
    pointer-events: none;
    transition: background-color 0.4s, box-shadow 0.4s;
}
.vvpat-internal-light.active {
    background-color: rgba(254, 240, 138, 0.25);
    box-shadow: inset 0 0 35px rgba(254, 240, 138, 0.4);
}

.vvpat-printer-slot {
    position: absolute;
    top: -10px;
    left: 12px;
    right: 12px;
    height: 160px;
    background: transparent;
    display: flex;
    justify-content: center;
}

/* Virtual printed paper */
.vvpat-slip {
    width: 165px;
    height: 160px;
    background-color: #fcfcf9;
    background-image: repeating-linear-gradient(rgba(0,0,0,0.015) 0px, rgba(0,0,0,0.015) 2px, transparent 2px, transparent 4px);
    border: 1px solid #dcdad5;
    border-bottom: 2px dashed #999;
    color: #222;
    font-family: 'Share Tech Mono', monospace;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 3px 6px rgba(0,0,0,0.25);
    transform: translateY(-165px);
    opacity: 0;
}

/* Animations */
.vvpat-slip.printing {
    animation: printSlip 1.3s forwards cubic-bezier(0.2, 0.5, 0.3, 1.0);
}
.vvpat-slip.dropping {
    animation: dropSlip 1.0s forwards ease-in;
}

@keyframes printSlip {
    0% { transform: translateY(-165px); opacity: 0; }
    20% { opacity: 1; }
    100% { transform: translateY(12px); opacity: 1; }
}
@keyframes dropSlip {
    0% { transform: translateY(12px); opacity: 1; }
    20% { transform: translateY(18px) rotate(-1deg); opacity: 1; }
    100% { transform: translateY(220px) rotate(3deg); opacity: 0; }
}

.slip-header {
    font-size: 0.45rem;
    font-weight: 800;
    text-align: center;
    border-bottom: 1px solid #ccc;
    padding-bottom: 3px;
    color: #444;
}
.slip-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
}
.slip-col-sno {
    font-size: 1.1rem;
    font-weight: 800;
}
.slip-col-name {
    font-size: 0.65rem;
    font-weight: 700;
    flex: 1;
    padding: 0 6px;
    text-transform: uppercase;
    line-height: 1.2;
}
.slip-col-symbol {
    width: 28px;
    height: 28px;
}
.slip-col-symbol svg {
    width: 100%;
    height: 100%;
}
.slip-footer {
    font-size: 0.45rem;
    text-align: center;
    border-top: 1px solid #ccc;
    padding-top: 3px;
    color: #666;
}

.vvpat-bottom-box {
    width: 100%;
    background-color: #272520;
    border-radius: 4px;
    padding: 8px;
    border: 2px solid var(--plastic-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.paper-drop-slot {
    width: 120px;
    height: 8px;
    background-color: #0b0c10;
    border-radius: 4px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.8);
}
.drop-box-label {
    font-size: 0.55rem;
    font-weight: 800;
    color: #948f7f;
}


/* BALLOT UNIT (BU) */
.bu-device {
    width: 450px;
    background: linear-gradient(135deg, var(--plastic-beige-light) 0%, var(--plastic-beige) 50%, var(--plastic-beige-dark) 100%);
    border: 5px solid var(--plastic-border);
    border-radius: 12px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.4), inset 0 2px 4px rgba(255,255,255,0.6);
    overflow: hidden;
}
.bu-top-header {
    background-color: #3f5545; /* Dark forest green header */
    border-bottom: 3px solid var(--plastic-border);
    color: white;
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.bu-title {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 1px;
}
.bu-serial {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: #a3e635;
}

/* Pink ballot sheet */
.ballot-paper-container {
    background-color: #e2e8f0;
    padding: 12px;
}
.ballot-paper {
    background-color: var(--ballot-pink);
    border: 2px solid #000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.ballot-row {
    display: grid;
    grid-template-columns: 35px 1fr 60px 45px 60px;
    align-items: center;
    border-bottom: 2px solid #000;
    height: 62px;
    background-color: var(--ballot-pink);
}
.ballot-row:last-child {
    border-bottom: none;
}

.col-num {
    border-right: 2px solid #000;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.1rem;
    font-weight: 800;
    color: #000;
}
.col-candidate {
    padding-left: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 2px solid #000;
    height: 100%;
    color: #000;
}
.col-candidate .name {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: -0.2px;
}
.col-candidate .abbr {
    font-size: 0.65rem;
    font-weight: 600;
    color: #444;
}

.col-symbol {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    background-color: #fff;
    border-right: 2px solid #000;
}
.ballot-symbol-svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.col-led {
    height: 100%;
    border-right: 2px solid #000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.physical-led {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #300a0a;
    box-shadow: inset 0 2px 3px rgba(0,0,0,0.8);
    transition: background-color 0.1s, box-shadow 0.1s;
}
.physical-led.active {
    background-color: var(--led-red);
    box-shadow: 0 0 10px 3px #ff0000, inset 0 0 2px #ffffff;
}

.col-button {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.physical-blue-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: var(--button-blue);
    border: 3px solid #73a6fc;
    box-shadow: 0 4px 0 var(--button-blue-dark), 0 3px 6px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.05s, box-shadow 0.05s;
}
.physical-blue-btn:hover {
    background-color: var(--button-blue-light);
}
.physical-blue-btn:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 var(--button-blue-dark), 0 1px 3px rgba(0,0,0,0.3);
}

/* ==========================================================================
   3. RETRO TERMINAL & OVERLAYS
   ========================================================================== */
.terminal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(12px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.terminal-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.terminal-window {
    width: 90%;
    max-width: 800px;
    height: 80vh;
    background-color: #030804; /* Retro Green-Black */
    border: 3px solid #14532d;
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(22, 163, 74, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.terminal-header {
    background-color: #052e16;
    border-bottom: 2px solid #14532d;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.window-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.window-dot.red { background-color: #ef4444; }
.window-dot.yellow { background-color: #eab308; }
.window-dot.green { background-color: #22c55e; }
.terminal-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    color: #4ade80;
    margin-left: 8px;
}
.terminal-body {
    flex: 1;
    padding: 20px;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #4ade80; /* Monochromatic CRT green */
    overflow-y: auto;
    background-image: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 4px, 6px 100%;
}

.term-line {
    margin-bottom: 6px;
    white-space: pre-wrap;
}
.term-line.cmd::before {
    content: ">>> ";
    color: #86efac;
    font-weight: 700;
}
.term-line.error { color: #f87171; font-weight: 700; }
.term-line.success { color: #a3e635; }
.term-line.warning { color: #fef08a; }

.term-glitch {
    font-size: 1.15rem;
    font-weight: 800;
    color: #f87171;
    text-shadow: 2px 0 0 #06b6d4, -2px 0 0 #f97316;
    animation: textGlitch 0.25s infinite;
}
@keyframes textGlitch {
    0% { transform: translate(1px, 1px); }
    50% { transform: translate(-2px, 2px); }
    100% { transform: translate(2px, -1px); }
}

/* ==========================================================================
   4. GRAND ROAST ALERT MODAL
   ========================================================================== */
.roast-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.96);
    backdrop-filter: blur(15px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.roast-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.roast-card {
    width: 90%;
    max-width: 780px;
    background-color: #1a0f0f;
    /* Red-White Hazard Border Theme */
    border: 8px double #dc2626;
    border-radius: 12px;
    box-shadow: 0 0 60px rgba(220, 38, 38, 0.7);
    overflow: hidden;
    animation: cardPulse 1.8s infinite alternate;
}
@keyframes cardPulse {
    0% { box-shadow: 0 0 25px rgba(220, 38, 38, 0.4); }
    100% { box-shadow: 0 0 60px rgba(220, 38, 38, 0.85); }
}

.roast-header {
    background-color: #3b0707;
    border-bottom: 4px solid #dc2626;
    padding: 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.alert-icon { font-size: 2.8rem; }
.roast-header h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #ef4444;
    letter-spacing: 1.5px;
    font-family: 'Share Tech Mono', monospace;
}
.alert-badge {
    background-color: #dc2626;
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 4px;
    letter-spacing: 1px;
}
.roast-body {
    padding: 24px;
    max-height: 48vh;
    overflow-y: auto;
    background-color: #0f0808;
    border-bottom: 2px solid rgba(255,255,255,0.05);
}
.roast-text {
    font-size: 0.95rem;
    line-height: 1.65;
    color: #f1f5f9;
    text-align: justify;
}
.roast-highlight-red { color: #f87171; font-weight: 800; text-decoration: underline; }
.roast-highlight-orange { color: #fb923c; font-weight: 800; }
.roast-highlight-cyan { color: #4ade80; font-weight: 700; font-family: 'Fira Code', monospace; }

.roast-footer {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    background-color: #110909;
    position: relative;
    height: 80px;
}
.roast-btn {
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.85rem;
    min-width: 150px;
    border: 2px solid #4b5563;
    background: transparent;
    color: #9ca3af;
    transition: all 0.2s;
}
.roast-btn:hover {
    color: white;
    border-color: white;
}
#btn-apologize-1 {
    background-color: #dc2626;
    border: none;
    color: white;
}
#btn-apologize-1:hover {
    background-color: #b91c1c;
}
.btn-runaway {
    position: absolute;
    right: 30px;
    z-index: 10;
    background-color: #ef4444; /* solid red fill */
    color: #ffffff;
    font-weight: 800;
    border: 2px solid #ffffff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.5);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* ==========================================================================
   5. RESULTS MODAL
   ========================================================================== */
.results-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.results-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.results-card {
    width: 90%;
    max-width: 620px;
    background-color: #1e1d1a;
    border: 4px solid var(--plastic-border);
    border-radius: 12px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.6);
    overflow: hidden;
}
.results-header {
    background-color: #272520;
    border-bottom: 2px solid var(--plastic-border);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #e2e8f0;
}
.results-header h2 {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}
.btn-close-results {
    background: none;
    border: none;
    color: #948f7f;
    font-size: 1.8rem;
    cursor: pointer;
}
.btn-close-results:hover { color: white; }

.results-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.chart-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.chart-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.chart-row-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 700;
    color: #bdae9c;
}
.chart-row-name { color: #f1f5f9; }
.chart-progress-bar {
    width: 100%;
    height: 14px;
    background-color: #0f0c08;
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid #333;
}
.chart-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 7px;
    transition: width 0.6s cubic-bezier(0.1, 0.8, 0.2, 1);
}
.chart-fill-bjp { background: linear-gradient(to right, #e04f00, #f97316); }
.chart-fill-congress { background: linear-gradient(to right, #1d4ed8, #3b82f6); }
.chart-fill-aap { background: linear-gradient(to right, #0891b2, #06b6d4); }
.chart-fill-cjp { background: linear-gradient(to right, #b91c1c, #ef4444); }
.chart-fill-nota { background: linear-gradient(to right, #4b5563, #6b7280); }

.total-votes-count {
    text-align: center;
    border-top: 1px dashed var(--plastic-border);
    padding-top: 16px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--led-green);
}

/* ==========================================================================
   MOBILE RESPONSIVENESS (Media Queries)
   ========================================================================== */

@media (max-width: 768px) {
    body {
        padding: 8px;
        padding-top: 60px; /* space for disclaimer */
    }

    .polling-station {
        gap: 15px;
    }

    /* Header stacking */
    .station-header {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        text-align: center;
        padding: 12px;
    }
    .header-logo {
        flex-direction: column;
        gap: 6px;
    }
    .station-info {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    .booth-badge {
        width: 100%;
        text-align: center;
    }

    /* Table layout stacking */
    .polling-desk {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    /* Control Unit sizing */
    .cu-device {
        width: 100%;
        max-width: 320px;
    }

    /* Cardboard voting compartment */
    .cardboard-compartment {
        padding: 15px 8px;
        border-width: 6px;
        border-bottom-width: 12px;
    }
    
    .compartment-devices {
        gap: 20px;
    }

    /* VVPAT width */
    .vvpat-device {
        width: 100%;
        max-width: 280px;
    }

    /* Ballot Unit responsive sizing */
    .bu-device {
        width: 100%;
        max-width: 450px;
    }

    /* Ballot grid compression for smaller viewports */
    .ballot-row {
        grid-template-columns: 28px 1fr 50px 36px 52px;
        height: 56px;
    }
    .col-candidate .name {
        font-size: 0.65rem;
    }
    .col-candidate .abbr {
        font-size: 0.55rem;
    }
    .col-num {
        font-size: 0.95rem;
    }
    .col-symbol {
        padding: 4px;
    }
    .physical-blue-btn {
        width: 30px;
        height: 30px;
    }
    
    /* Roast modal responsive adjustments */
    .roast-card {
        border-width: 4px;
        width: 95%;
    }
    .roast-header {
        padding: 16px 12px;
    }
    .roast-header h2 {
        font-size: 1.1rem;
    }
    .roast-body {
        padding: 16px 12px;
        max-height: 45vh;
    }
    .roast-text {
        font-size: 0.85rem;
        line-height: 1.55;
    }
    .roast-footer {
        flex-direction: column;
        gap: 12px;
        height: auto;
        padding: 16px 12px;
        align-items: center;
    }
    .roast-btn {
        width: 100%;
        min-width: 0;
        text-align: center;
    }
    .btn-runaway {
        position: relative; /* let it sit layout naturally on mobile initially */
        right: auto;
    }
}

@media (max-width: 360px) {
    /* Super small smartphones */
    .ballot-row {
        grid-template-columns: 24px 1fr 42px 30px 42px;
        height: 52px;
    }
    .col-candidate .name {
        font-size: 0.6rem;
    }
    .col-num {
        font-size: 0.85rem;
    }
    .physical-blue-btn {
        width: 26px;
        height: 26px;
    }
}
