/* ============================================================
   WINDOWS 95 SYSTEM STYLE (CLEAN REWRITE)
   ============================================================ */
:root {
    --win-gray: #c0c0c0;
    --win-white: #ffffff;
    --win-dark-gray: #808080;
    --win-black: #000000;
    --win-blue: #000080;
    --win-blue-light: #1084d0;
    --table-green: #0b6b2e;
}

html, body {
    margin: 0; padding: 0; width: 100%; height: 100%;
    overflow: hidden; font-family: "Tahoma", sans-serif;
    display: flex; flex-direction: column;
    background: linear-gradient(to right, var(--table-green), #0b6b2e);
}

/* --- TITLE BAR --- */
#title-bar {
    height: 28px; flex-shrink: 0; z-index: 1000;
    background: linear-gradient(to right, var(--win-blue), var(--win-blue-light));
    color: white; font-size: 14px; font-weight: bold;
    display: flex; align-items: center; padding: 0 10px;
}

/* --- MENU BAR --- */
#menu-bar {
    height: 30px; flex-shrink: 0; z-index: 2000;
    background: var(--win-gray);
    border-bottom: 1px solid var(--win-dark-gray);
    box-shadow: inset 1px 1px var(--win-white);
}

.menu-root {
    list-style: none; margin: 0; padding: 0 5px;
    display: flex; flex-direction: row; font-size: 12px;
}

.menu-item {
    position: relative; padding: 6px 10px;
    cursor: default; color: black;
}

.menu-item:hover { background: var(--win-blue); color: white; }

.dropdown {
    display: none; position: absolute; top: 100%; left: 0;
    background: var(--win-gray); list-style: none; padding: 2px;
    min-width: 160px; z-index: 5000;
    border-top: 2px solid var(--win-white);
    border-left: 2px solid var(--win-white);
    border-right: 2px solid var(--win-dark-gray);
    border-bottom: 2px solid var(--win-dark-gray);
}

.menu-item:hover .dropdown { display: block; }

.dropdown li { padding: 5px 20px; color: black; white-space: nowrap; }
.dropdown li:hover { background: var(--win-blue); color: white !important; }

.separator {
    height: 1px;
    margin: 4px 3px;
    background: #808080;
    border-bottom: 1px solid #ffffff;
    pointer-events: none;
}

.separator:hover,
.separator:active,
.separator:focus {
    background: none !important;
}

.dropdown .separator {
    padding: 0;
    margin: 2px 2px;
    height: 2px;
    line-height: 0;
    min-height: 0;

    background: none;
    border-top: 1px solid #808080;
    border-bottom: 1px solid #ffffff;

    pointer-events: none;
}


/* --- GAME AREA --- */
#table-scroll {
    flex-grow: 1; position: relative;
    overflow: auto; background-color: var(--table-green);
}

#game-table { position: relative; padding: 20px; min-width: 100%; min-height: 100%; }

.card { position: absolute; width: 89px; z-index: 50; }

.checkable::before { content: "✓"; display: inline-block; width: 15px; visibility: hidden; }
.checkable.checked::before { visibility: visible; }

/* --- DIALOG / MSG BOX --- */

#win95-modal-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.2);
    display: flex; align-items: center; justify-content: center;
    height: auto;       
}

/* .modal-content {
    background: #ffffff;
    border: 2px inset #808080;
    padding: 10px;

    white-space: pre-wrap;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;

    max-height: 65vh;
    overflow-y: auto;
}

.modal-titlebar {
    background: #000080;
    color: white;
    padding: 4px 6px;
    font-weight: bold;
    font-family: Tahoma, Arial, sans-serif;
    margin-bottom: 6px;
} */



.win95-dialog .win-title-bar {
    background: var(--win-blue);
    color: white;
    padding: 3px 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.win-close {
    width: 16px;
    height: 14px;
    padding: 0;
    line-height: 10px;
    font-weight: bold;
}

.modal.hidden {
    display: none !important;
}


.win95-dialog-body { padding: 20px; font-size: 13px; color: black; }

.win95-bevel-out {
    border-top: 2px solid var(--win-white);
    border-left: 2px solid var(--win-white);
    border-right: 2px solid var(--win-dark-gray);
    border-bottom: 2px solid var(--win-dark-gray);
}

.card {
    position: absolute;
    width: 89px;   /* Matches your orig_card_x_size */
    height: 132px; /* Matches your orig_card_y_size */
    background-color: white; /* Fallback if image fails */
    border-radius: 4px;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
    background-repeat: no-repeat;
    background-position: center;
}

.column {
    position: absolute;
    width: 89px;
    height: 132px;
    /* Optional: add a border to see where columns are during debug */
    /* border: 1px dashed rgba(255,255,255,0.2); */
}

/* The Default Suit: Green Placeholder */
.column-requisite {
    position: absolute;
    width: 89px;
    height: 132px;
    box-sizing: border-box;
    border: 1px solid rgba(0, 0, 0, 0.5); /* Thin black border */
    background-color: rgba(0, 0, 0, 0.15); /* Dark green tint on green table */
    z-index: 1;
}

/* The Grey Suit (Backcolor 8) */
.column-requisite.style-grey {
    background-color: #395f37; /* Classic Win95 Silver/Grey */   
    border: 1px solid #000000;
}

/* ShapeSelektor costume (Black see-through net) */

.selection-box {
    position: absolute;
    width: 89px;
    height: 132px;
    pointer-events: none;  /* Don't block clicks on the card beneath */
    z-index: 1000;
    
    /* Yellow glowing border */
    border: 3px solid #FFD700;  /* Gold/yellow solid border */
    border-radius: 6px;
    
    /* Animated pulsing glow effect */
    box-shadow: 
        0 0 10px #FFD700,
        0 0 20px #FFD700,
        0 0 30px #FFA500,
        inset 0 0 10px rgba(255, 215, 0, 0.3);
    
    /* Subtle pulsing animation */
    animation: selection-pulse 1.5s ease-in-out infinite;
}

@keyframes selection-pulse {
    0%, 100% {
        box-shadow: 
            0 0 10px #FFD700,
            0 0 20px #FFD700,
            0 0 30px #FFA500,
            inset 0 0 10px rgba(255, 215, 0, 0.3);
        border-color: #FFD700;
    }
    50% {
        box-shadow: 
            0 0 15px #FFD700,
            0 0 30px #FFD700,
            0 0 45px #FFA500,
            inset 0 0 15px rgba(255, 215, 0, 0.5);
        border-color: #FFA500;
    }
}

/* --- WIN95 DIALOG BACKGROUND FIX --- */

.win95-dialog {
    background-color: var(--win-gray); /* #c0c0c0 */
}

.win95-dialog-body {
    background-color: var(--win-gray);
}



/* METROPOLY */

.pawn-offset-1 { transform: translate(0, 0); }
.pawn-offset-2 { transform: translate(16px, 16px); }
.pawn-offset-3 { transform: translate(16px, 0); }
/* matches your VB figuraXoffset logic exactly */

/* --- WIN95 INTERACTIVE ELEMENTS --- */
button, .win-btn {
    background: var(--win-gray);
    border-top: 2px solid var(--win-white);
    border-left: 2px solid var(--win-white);
    border-right: 2px solid var(--win-black);
    border-bottom: 2px solid var(--win-black);
    padding: 4px 10px;
    font-family: "Tahoma", sans-serif;
    font-size: 12px;
    outline: none;
}

button:active, .win-btn:active {
    border-top: 2px solid var(--win-black);
    border-left: 2px solid var(--win-black);
    border-right: 2px solid var(--win-white);
    border-bottom: 2px solid var(--win-white);
    padding: 5px 9px 3px 11px; /* Shifts text 1px down-right */
}

/* Inset Bevel (for the Status Bar and Input boxes) */
.win-field, .win-inset {
    background: var(--win-white);
    border-top: 2px solid var(--win-dark-gray);
    border-left: 2px solid var(--win-dark-gray);
    border-right: 2px solid var(--win-white);
    border-bottom: 2px solid var(--win-white);
    padding: 2px;
}

/* --- METROPOLY LAYOUT --- */
#metropoly-main-layout {
    display: flex;
    flex-grow: 1;
    overflow: hidden; /* Prevents whole-page scrolling */
    background: var(--win-dark-gray); /* Grey padding around the board */
}

#sidebar {
    width: 280px;
    background: var(--win-gray);
    border-right: 2px solid var(--win-white);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 10;
}

#game-viewport {
    flex-grow: 1;
    overflow: auto; /* The board itself can scroll */
    padding: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

#game-board {
    display: grid; /* We use CSS Grid for the 32px tiles */
    position: relative;
    background: #ffffff;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.5);
}

.tile {
    width: 32px;
    height: 32px;
    position: relative;
}

.tile img {
    position: absolute;
    top: 0;
    left: 0;
    width: 32px;
    height: 32px;
}

/* Layering Z-Indices */
.layer-base { z-index: 1; }
.layer-road { z-index: 2; }
.layer-building { z-index: 3; }
.layer-flag { z-index: 4; }

/* The Pawns (Figurice) */
.pawn {
    position: absolute;
    width: 16px;
    height: 16px;
    z-index: 100;
    border: 1px solid black;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    transition: all 0.3s ease-in-out; /* Smooth movement instead of VB "jumping" */
}


/* Hide Sidebar when in CardGames mode */
body.cardgames-mode #sidebar { display: none; }

/* Hide Table-Scroll when in Metropoly mode */
body.metropoly-mode #table-scroll { display: none; }


/* Make top-level items that are buttons have feedback */
.menu-item:active {
    background: var(--win-white);
    box-shadow: inset 1px 1px var(--win-black);
}

/* Ensure the hidden class is respected in the menu */
.menu-item.hidden {
    display: none !important;
}

.center-image {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Container for title bar buttons */
.win95-title-controls {
    display: flex;
    align-items: center;
}

/* Close button */
.win95-btn-close {
    width: 18px;
    height: 16px;

    padding: 0;
    margin-left: 4px;

    font-family: "MS Sans Serif", Tahoma, sans-serif;
    font-size: 11px;
    font-weight: bold;

    color: black;
    background: #c0c0c0;

    border-top: 1px solid #ffffff;
    border-left: 1px solid #ffffff;
    border-right: 1px solid #404040;
    border-bottom: 1px solid #404040;

    cursor: pointer;
}

/* Pressed state */
.win95-btn-close:active {
    border-top: 1px solid #404040;
    border-left: 1px solid #404040;
    border-right: 1px solid #ffffff;
    border-bottom: 1px solid #ffffff;

    padding-top: 1px;
    padding-left: 1px;
}

/* === TITLE BAR === */
.win95-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    height: 22px;
    padding: 2px 3px 2px 6px;

    font-family: "MS Sans Serif", Tahoma, sans-serif;
    font-size: 12px;
    font-weight: bold;

    color: white;
    background: linear-gradient(to right, #000080, #1084d0);

    user-select: none;
}

/* Title text */
.win95-title-text {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}