/* ============================================
   MERGIOS - Game Styles
   ============================================ */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #333;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Container */
.container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 30px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 2.5rem;
    color: #1e3c72;
    letter-spacing: 3px;
    font-weight: bold;
}

.game-info {
    display: flex;
    gap: 30px;
    font-size: 1.1rem;
    color: #555;
}

.game-info strong {
    color: #1e3c72;
    font-weight: bold;
}

/* Main Game Layout - Full Width Game Board */
.game-layout {
    display: flex;
    margin-bottom: 20px;
    flex: 1;
    min-height: 0;
}

/* ============================================
   LEFT: Stock Market
   ============================================ */

.stock-market {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    height: 100%;
}

.stock-market h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #1e3c72;
    border-bottom: 2px solid #1e3c72;
    padding-bottom: 8px;
}

/* Chain Cards */
.chain-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tier-divider {
    text-align: center;
    padding: 8px 0;
    margin: 5px 0;
    font-size: 0.85rem;
    font-weight: bold;
    color: #666;
    border-top: 2px solid #dee2e6;
    border-bottom: 2px solid #dee2e6;
    background: linear-gradient(to right, transparent, rgba(222, 226, 230, 0.3), transparent);
}

.chain-card {
    padding: 12px;
    border-radius: 8px;
    border-left: 5px solid;
    background: #f8f9fa;
    transition: transform 0.2s, box-shadow 0.2s;
}

.chain-card:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.chain-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-weight: bold;
}

.chain-name {
    font-size: 1rem;
}

.chain-price {
    font-size: 1rem;
    color: #2ecc71;
}

.chain-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #666;
}

/* Hotel Chain Colors */
.chain-card.luxor {
    border-left-color: #e74c3c;
    background: linear-gradient(to right, rgba(231, 76, 60, 0.1), #f8f9fa);
}

.chain-card.tower {
    border-left-color: #f39c12;
    background: linear-gradient(to right, rgba(243, 156, 18, 0.1), #f8f9fa);
}

.chain-card.american {
    border-left-color: #3498db;
    background: linear-gradient(to right, rgba(52, 152, 219, 0.1), #f8f9fa);
}

.chain-card.festival {
    border-left-color: #2ecc71;
    background: linear-gradient(to right, rgba(46, 204, 113, 0.1), #f8f9fa);
}

.chain-card.worldwide {
    border-left-color: #8b4513;
    background: linear-gradient(to right, rgba(139, 69, 19, 0.1), #f8f9fa);
}

.chain-card.continental {
    border-left-color: #1abc9c;
    background: linear-gradient(to right, rgba(26, 188, 156, 0.1), #f8f9fa);
}

.chain-card.imperial {
    border-left-color: #e91e63;
    background: linear-gradient(to right, rgba(233, 30, 99, 0.1), #f8f9fa);
}

/* ============================================
   RIGHT: GAME BOARD
   ============================================ */

.game-board-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(9, 1fr);
    gap: 6px;
    background: rgb(170, 160, 150);
    padding: 10px;
    border-radius: 8px;
    width: 100%;
    max-height: 100%;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    /* Force board to maintain 12:9 aspect ratio so tiles stay square */
    aspect-ratio: 12 / 9;
    /* Ensure grid doesn't wrap - explicitly set grid behavior */
    grid-auto-flow: dense;
    overflow: hidden;
}

/* Tile wrapper creates the 3D ridge effect */
.tile-wrapper {
    border: 4px solid rgb(200, 190, 180);
    border-top-color: rgba(0, 0, 0, 0.3);
    border-left-color: rgba(0, 0, 0, 0.3);
    border-bottom-color: rgba(255, 255, 255, 0.5);
    border-right-color: rgba(255, 255, 255, 0.5);
    border-radius: 3px;
    background: rgb(190, 180, 170);
    padding: 0;
    display: flex;
    /* Force wrapper to be square */
    aspect-ratio: 1 / 1;
    min-height: 0;
    min-width: 0;
}

/* Individual Board Tiles */
.tile {
    flex: 1;
    background: linear-gradient(135deg, rgb(100, 85, 50) 0%, rgb(90, 75, 40) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border-radius: 3px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    /* 3D raised tile border effect */
    border: 3px solid;
    border-top-color: rgba(255, 255, 255, 0.3);
    border-left-color: rgba(255, 255, 255, 0.3);
    border-bottom-color: rgba(0, 0, 0, 0.4);
    border-right-color: rgba(0, 0, 0, 0.4);
}

/* Empty slots (no tile class modifiers) get darker, inset effect */
.tile:not([class*="chain-"]):not(.unincorporated):not(.placed-last):not(.unplayable) {
    background: linear-gradient(135deg, rgb(140, 120, 70) 0%, rgb(130, 110, 60) 100%);
    opacity: 0.6;
    /* Reverse border for inset look */
    border-top-color: rgba(0, 0, 0, 0.4);
    border-left-color: rgba(0, 0, 0, 0.4);
    border-bottom-color: rgba(255, 255, 255, 0.2);
    border-right-color: rgba(255, 255, 255, 0.2);
}

/* Only placed tiles get hover effect */
.tile[class*="chain-"]:hover,
.tile.unincorporated:hover,
.tile.placed-last:hover {
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Highlight target cell when hovering over hand tile - only for empty slots */
.tile.highlight-target:not([class*="chain-"]):not(.unincorporated):not(.placed-last) {
    background: linear-gradient(135deg, rgb(140, 120, 90) 0%, rgb(120, 100, 70) 100%) !important;
    transform: scale(1.05);
    z-index: 15;
    opacity: 1 !important;
    /* Bright white 3D border for highlight */
    border-top-color: rgba(255, 255, 255, 0.6) !important;
    border-left-color: rgba(255, 255, 255, 0.6) !important;
    border-bottom-color: rgba(0, 0, 0, 0.6) !important;
    border-right-color: rgba(0, 0, 0, 0.6) !important;
}

/* Discarded board tile (would merge safe chains) */
.tile.tile-discarded {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
    opacity: 0.7 !important;
    position: relative;
}

.discarded-x {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.9);
    text-shadow:
        2px 2px 4px rgba(0, 0, 0, 0.8),
        -2px -2px 4px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 10;
}

/* For tiles already placed, add a subtle scale */
.tile.highlight-target[class*="chain-"],
.tile.highlight-target.unincorporated,
.tile.highlight-target.placed-last {
    transform: scale(1.05);
    z-index: 15;
    opacity: 1 !important;
}

.tile-label {
    font-family: 'Arial Narrow', 'Roboto Condensed', 'Impact', Arial, sans-serif;
    letter-spacing: 1px;
    font-stretch: condensed;
}

/* Chain overlay - hotel letter displayed on founder tile only */
.chain-overlay {
    font-family: 'Arial Narrow', 'Roboto Condensed', 'Impact', Arial, sans-serif;
    font-size: 4vmin; /* Responsive: scales with viewport */
    font-weight: bold;
    letter-spacing: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    background: inherit;
    border-radius: 3px;
}

/* Dim the coordinate text on chain tiles (but not founder) */
.tile[class*="chain-"]:not(.chain-founder) .tile-label {
    opacity: 0.4;
}

/* Safe lock badge on founder tile */
.safe-lock-badge {
    position: absolute;
    top: 0px;
    right: 0px;
    font-size: 1.2rem;
    z-index: 20;
    text-shadow:
        1px 1px 2px rgba(0, 0, 0, 0.8),
        -1px -1px 2px rgba(0, 0, 0, 0.8),
        1px -1px 2px rgba(0, 0, 0, 0.8),
        -1px 1px 2px rgba(0, 0, 0, 0.8);
    pointer-events: auto;
    cursor: help;
}

/* Unincorporated Tile (single tile not in a chain) */
.tile.unincorporated {
    background: linear-gradient(135deg, #4a4a4a 0%, #3a3a3a 100%);
    /* 3D border with gray tones */
    border-top-color: rgba(100, 100, 100, 0.5) !important;
    border-left-color: rgba(100, 100, 100, 0.5) !important;
    border-bottom-color: rgba(50, 50, 50, 0.8) !important;
    border-right-color: rgba(80, 80, 80, 0.8) !important;
}

/* Unplayable Tile (would create 8th chain or merge safe chains) */
.tile.unplayable {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    opacity: 0.7;
    /* 3D border with red tones */
    border-top-color: rgba(231, 76, 60, 0.5) !important;
    border-left-color: rgba(231, 76, 60, 0.5) !important;
    border-bottom-color: rgba(192, 57, 43, 0.8) !important;
    border-right-color: rgba(192, 57, 43, 0.8) !important;
}

/* Chain Tiles - Colored by Hotel Chain with 3D borders */
.tile.chain-luxor {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border-top-color: rgba(231, 76, 60, 0.5) !important;
    border-left-color: rgba(231, 76, 60, 0.5) !important;
    border-bottom-color: rgba(192, 57, 43, 0.8) !important;
    border-right-color: rgba(192, 57, 43, 0.8) !important;
}

.tile.chain-tower {
    background: linear-gradient(135deg, #f39c12 0%, #d68910 100%);
    border-top-color: rgba(243, 156, 18, 0.5) !important;
    border-left-color: rgba(243, 156, 18, 0.5) !important;
    border-bottom-color: rgba(214, 137, 16, 0.8) !important;
    border-right-color: rgba(214, 137, 16, 0.8) !important;
}

.tile.chain-american {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border-top-color: rgba(52, 152, 219, 0.5) !important;
    border-left-color: rgba(52, 152, 219, 0.5) !important;
    border-bottom-color: rgba(41, 128, 185, 0.8) !important;
    border-right-color: rgba(41, 128, 185, 0.8) !important;
}

.tile.chain-festival {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    border-top-color: rgba(46, 204, 113, 0.5) !important;
    border-left-color: rgba(46, 204, 113, 0.5) !important;
    border-bottom-color: rgba(39, 174, 96, 0.8) !important;
    border-right-color: rgba(39, 174, 96, 0.8) !important;
}

.tile.chain-worldwide {
    background: linear-gradient(135deg, #8b4513 0%, #6f3609 100%);
    border-top-color: rgba(139, 69, 19, 0.5) !important;
    border-left-color: rgba(139, 69, 19, 0.5) !important;
    border-bottom-color: rgba(111, 54, 9, 0.8) !important;
    border-right-color: rgba(111, 54, 9, 0.8) !important;
}

.tile.chain-continental {
    background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%);
    border-top-color: rgba(26, 188, 156, 0.5) !important;
    border-left-color: rgba(26, 188, 156, 0.5) !important;
    border-bottom-color: rgba(22, 160, 133, 0.8) !important;
    border-right-color: rgba(22, 160, 133, 0.8) !important;
}

.tile.chain-imperial {
    background: linear-gradient(135deg, #e91e63 0%, #c2185b 100%);
    border-top-color: rgba(233, 30, 99, 0.5) !important;
    border-left-color: rgba(233, 30, 99, 0.5) !important;
    border-bottom-color: rgba(194, 24, 91, 0.8) !important;
    border-right-color: rgba(194, 24, 91, 0.8) !important;
}

/* Recently Placed Tile - removed animation, just use default brown tile style */
.tile.placed-last {
    background: linear-gradient(135deg, rgb(60, 45, 24) 0%, rgb(50, 35, 14) 100%) !important;
    opacity: 1 !important;
}

/* Chain tile wrappers - make the wrapper match the chain color for monolithic look */
.tile-wrapper:has(.chain-luxor) {
    background: #c0392b;
    border-color: #c0392b;
}

.tile-wrapper:has(.chain-tower) {
    background: #d68910;
    border-color: #d68910;
}

.tile-wrapper:has(.chain-american) {
    background: #2980b9;
    border-color: #2980b9;
}

.tile-wrapper:has(.chain-festival) {
    background: #27ae60;
    border-color: #27ae60;
}

.tile-wrapper:has(.chain-worldwide) {
    background: #6f3609;
    border-color: #6f3609;
}

.tile-wrapper:has(.chain-continental) {
    background: #16a085;
    border-color: #16a085;
}

.tile-wrapper:has(.chain-imperial) {
    background: #c2185b;
    border-color: #c2185b;
}

/* ============================================
   BOTTOM: PLAYERS & TILES SECTION
   ============================================ */

footer.players-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.players-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.players-table thead th {
    font-weight: bold;
    color: #1e3c72;
    padding: 4px 8px;
    min-height: 54px;
    background: #e9ecef;
    border: 1px solid #dee2e6;
    text-align: center;
}

.players-table .portfolio-header {
    background: #d0d7de;
    text-align: right;
}

.players-table .portfolio-header-left {
    background: #d0d7de;
    text-align: left;
    padding: 4px 8px;
}

.tiles-header-right {
    text-align: right;
    padding: 4px 8px;
    background: #e9ecef;
}

.player-header-align {
    text-align: left !important;
}

.tiles-header-align {
    text-align: left !important;
}

.tiles-header-combined {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    background: #e9ecef;
}

.tiles-header-combined .tiles-label {
    text-align: left;
    font-size: 0.8rem;
}

.tiles-header-combined .draw-buttons {
    display: flex;
    gap: 5px;
}

.portfolio-subheader {
    font-size: 0.8rem;
    padding: 4px !important;
    background: #e9ecef !important;
}

.portfolio-subheader-right {
    text-align: right !important;
}

.chain-icon-col {
    width: 30px;
    padding: 2px !important;
}

.chain-data-col {
    width: 50px;
    padding: 2px !important;
    font-size: 0.65rem;
    line-height: 1.2;
}

.chain-data-col .avail {
    color: #666;
    font-weight: normal;
    text-align: right;
}

.chain-data-col .price {
    color: #2ecc71;
    font-weight: bold;
    text-align: right;
}

.chain-mini {
    width: 24px;
    height: 24px;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.75rem;
    border: 2px solid;
    border-top-color: rgba(255, 255, 255, 0.4);
    border-left-color: rgba(255, 255, 255, 0.4);
    border-bottom-color: rgba(0, 0, 0, 0.3);
    border-right-color: rgba(0, 0, 0, 0.3);
    margin: 0 auto;
}

.chain-mini.luxor {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.chain-mini.tower {
    background: linear-gradient(135deg, #f39c12 0%, #d68910 100%);
}

.chain-mini.american {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.chain-mini.festival {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}

.chain-mini.worldwide {
    background: linear-gradient(135deg, #8b4513 0%, #6f3609 100%);
}

.chain-mini.continental {
    background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%);
}

.chain-mini.imperial {
    background: linear-gradient(135deg, #e91e63 0%, #c2185b 100%);
}

.players-table tbody td {
    padding: 4px;
    border: 1px solid #dee2e6;
    vertical-align: middle;
}

.player-name {
    font-size: 1rem;
    padding: 10px !important;
    background: #f8f9fa;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 600;
}

.player-name:hover {
    background: #e9ecef;
}

.player-name.active {
    background: linear-gradient(to right, #1e3c72, #2a5298);
    color: white;
    font-weight: bold;
}

.player-tiles {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.hand-tiles {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.portfolio-cell {
    text-align: right;
    font-size: 0.75rem;
    /* min-width: 50px; */
    white-space: nowrap;
}

.portfolio-net {
    font-weight: bold;
    color: #2ecc71;
    font-size: 0.85rem;
}

.btn-small {
    padding: 8px !important;
    font-size: 0.9rem;
    height: 44px;
    box-sizing: border-box;
}

.btn-draw {
    white-space: nowrap;
}

.hand-tile {
    background: linear-gradient(135deg, rgb(80, 65, 44) 0%, rgb(70, 55, 34) 100%);
    color: white;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Arial Narrow', 'Roboto Condensed', 'Impact', Arial, sans-serif;
    letter-spacing: 0;
    font-stretch: condensed;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    /* 3D raised tile border effect - matches board tiles */
    border: 3px solid;
    border-top-color: rgba(255, 255, 255, 0.3);
    border-left-color: rgba(255, 255, 255, 0.3);
    border-bottom-color: rgba(0, 0, 0, 0.4);
    border-right-color: rgba(0, 0, 0, 0.4);
    /* Square tiles with fixed dimensions - 44px minimum touch target for mobile */
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    max-width: 44px;
    max-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hand-tile:hover {
    transform: translateY(-3px);
    /* Brighter 3D borders on hover - matches board tile highlight */
    border-top-color: rgba(255, 255, 255, 0.6) !important;
    border-left-color: rgba(255, 255, 255, 0.6) !important;
    border-bottom-color: rgba(0, 0, 0, 0.6) !important;
    border-right-color: rgba(0, 0, 0, 0.6) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.hand-tile.selected {
    background: linear-gradient(135deg, rgb(100, 85, 64) 0%, rgb(90, 75, 54) 100%);
    /* Bright white 3D border for selected state */
    border-top-color: rgba(255, 255, 255, 0.7);
    border-left-color: rgba(255, 255, 255, 0.7);
    border-bottom-color: rgba(0, 0, 0, 0.6);
    border-right-color: rgba(0, 0, 0, 0.6);
}

.hand-tile.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(50%);
}

.hand-tile.disabled:hover {
    transform: none;
    box-shadow:
        2px 2px 4px rgba(0, 0, 0, 0.3),
        inset -1px -1px 2px rgba(0, 0, 0, 0.2),
        inset 1px 1px 2px rgba(255, 255, 255, 0.1);
}

/* Temporarily unplayable tile (would create 8th chain) */
.hand-tile.eighth-chain-blocked {
    opacity: 0.5;
    filter: grayscale(30%);
    position: relative;
}

.hand-tile.eighth-chain-blocked::after {
    content: '🚫';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.8rem;
}

/* Stock Tiles (displayed in player stocks section) */
.stock-tile {
    width: 88px;
    height: 44px;
    min-width: 88px;
    min-height: 44px;
    max-width: 88px;
    max-height: 44px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 8px;
    border-radius: 3px;
    position: relative;
    border: 3px solid;
    border-top-color: rgba(255, 255, 255, 0.3);
    border-left-color: rgba(255, 255, 255, 0.3);
    border-bottom-color: rgba(0, 0, 0, 0.4);
    border-right-color: rgba(0, 0, 0, 0.4);
}

.stock-tile .chain-letter {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.stock-tile .stock-count {
    position: absolute;
    bottom: 2px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 3px;
    min-width: 22px;
    text-align: center;
}

.stock-tile .stock-value {
    position: absolute;
    top: 2px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: #2ecc71;
    font-size: 0.65rem;
    font-weight: bold;
    padding: 2px 4px;
    border-radius: 3px;
}

/* Stock Tile Chain Colors */
.stock-tile.chain-luxor {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border-top-color: rgba(231, 76, 60, 0.5) !important;
    border-left-color: rgba(231, 76, 60, 0.5) !important;
    border-bottom-color: rgba(192, 57, 43, 0.8) !important;
    border-right-color: rgba(192, 57, 43, 0.8) !important;
}

.stock-tile.chain-tower {
    background: linear-gradient(135deg, #f39c12 0%, #d68910 100%);
    border-top-color: rgba(243, 156, 18, 0.5) !important;
    border-left-color: rgba(243, 156, 18, 0.5) !important;
    border-bottom-color: rgba(214, 137, 16, 0.8) !important;
    border-right-color: rgba(214, 137, 16, 0.8) !important;
}

.stock-tile.chain-american {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border-top-color: rgba(52, 152, 219, 0.5) !important;
    border-left-color: rgba(52, 152, 219, 0.5) !important;
    border-bottom-color: rgba(41, 128, 185, 0.8) !important;
    border-right-color: rgba(41, 128, 185, 0.8) !important;
}

.stock-tile.chain-festival {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    border-top-color: rgba(46, 204, 113, 0.5) !important;
    border-left-color: rgba(46, 204, 113, 0.5) !important;
    border-bottom-color: rgba(39, 174, 96, 0.8) !important;
    border-right-color: rgba(39, 174, 96, 0.8) !important;
}

.stock-tile.chain-worldwide {
    background: linear-gradient(135deg, #8b4513 0%, #6f3609 100%);
    border-top-color: rgba(139, 69, 19, 0.5) !important;
    border-left-color: rgba(139, 69, 19, 0.5) !important;
    border-bottom-color: rgba(111, 54, 9, 0.8) !important;
    border-right-color: rgba(111, 54, 9, 0.8) !important;
}

.stock-tile.chain-continental {
    background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%);
    border-top-color: rgba(26, 188, 156, 0.5) !important;
    border-left-color: rgba(26, 188, 156, 0.5) !important;
    border-bottom-color: rgba(22, 160, 133, 0.8) !important;
    border-right-color: rgba(22, 160, 133, 0.8) !important;
}

.stock-tile.chain-imperial {
    background: linear-gradient(135deg, #e91e63 0%, #c2185b 100%);
    border-top-color: rgba(233, 30, 99, 0.5) !important;
    border-left-color: rgba(233, 30, 99, 0.5) !important;
    border-bottom-color: rgba(194, 24, 91, 0.8) !important;
    border-right-color: rgba(194, 24, 91, 0.8) !important;
}

/* Cash Tile */
.cash-tile {
    width: 88px;
    height: 44px;
    min-width: 88px;
    min-height: 44px;
    max-width: 88px;
    max-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    border-radius: 3px;
    position: relative;
    border: 3px solid;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    border-top-color: rgba(46, 204, 113, 0.5);
    border-left-color: rgba(46, 204, 113, 0.5);
    border-bottom-color: rgba(39, 174, 96, 0.8);
    border-right-color: rgba(39, 174, 96, 0.8);
    color: white;
    font-weight: bold;
    font-size: 0.85rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Stock Buying Modal */
.stock-buy-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    border: 2px solid transparent;
}

.stock-buy-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 3px;
}

.stock-buy-info .chain-letter {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    width: 30px;
    text-align: center;
}

.chain-name-text {
    font-weight: bold;
    min-width: 100px;
}

.chain-price-text {
    color: #2ecc71;
    font-weight: bold;
}

.stock-buy-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stock-qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 2px solid #3498db;
    background: white;
    color: #3498db;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.stock-qty-btn:hover {
    background: #3498db;
    color: white;
}

.stock-qty-btn:active {
    transform: scale(0.95);
}

.stock-qty-display {
    font-size: 1.2rem;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

/* Discarded Tiles Section */
.discarded-tiles-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid rgba(0, 0, 0, 0.1);
}

.discarded-tiles-section h4 {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: #666;
    text-align: center;
}

.discarded-tiles-grid {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.discarded-tile {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
    padding: 10px 15px;
    border-radius: 3px;
    font-size: 1rem;
    font-weight: 400;
    font-family: 'Arial Narrow', 'Roboto Condensed', 'Impact', Arial, sans-serif;
    letter-spacing: 1px;
    font-stretch: condensed;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    border: 3px solid;
    border-top-color: rgba(255, 255, 255, 0.2);
    border-left-color: rgba(255, 255, 255, 0.2);
    border-bottom-color: rgba(0, 0, 0, 0.3);
    border-right-color: rgba(0, 0, 0, 0.3);
    opacity: 0.6;
    text-decoration: line-through;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn {
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.2);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1280px) {
    header h1 {
        font-size: 2rem;
    }

    /* Game board sidebar only (not portal navigation) */
    .game-layout .sidebar {
        width: 240px;
    }

    .tile {
        font-size: 1.3rem;
        min-height: 40px;
    }

    .hand-tile {
        /* Removed padding override - keep default fixed size */
        font-size: 1rem;
    }
}

@media (max-width: 1024px) {
    .game-layout {
        flex-direction: column;
    }

    /* Game board sidebar only (not portal navigation) */
    .game-layout .sidebar {
        width: 100%;
        flex-direction: row;
    }

    .stock-market,
    .players-list {
        flex: 1;
    }

}

/* ============================================
   MODAL: HOTEL CHAIN SELECTOR
   ============================================ */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 600px;
    text-align: center;
}

.modal-content h2 {
    color: #1e3c72;
    margin-bottom: 10px;
    font-size: 2rem;
}

.modal-content p {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.chain-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.chain-btn {
    padding: 20px;
    border: 3px solid transparent;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.chain-btn:hover {
    transform: scale(1.05);
    border-color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.chain-icon {
    font-size: 1.5rem;
    font-weight: bold;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Chain button colors matching game chains */
.chain-btn.luxor {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.chain-btn.tower {
    background: linear-gradient(135deg, #f39c12 0%, #d68910 100%);
}

.chain-btn.american {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.chain-btn.festival {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}

.chain-btn.worldwide {
    background: linear-gradient(135deg, #8b4513 0%, #6f3609 100%);
}

.chain-btn.continental {
    background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%);
}

.chain-btn.imperial {
    background: linear-gradient(135deg, #e91e63 0%, #c2185b 100%);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 7.5px 10px;
    border-radius: 8px;
    margin-bottom: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease-out, fadeOut 0.3s ease-in 2.7s;
    max-width: 300px;
}

.toast.success {
    background: rgba(46, 204, 113, 0.95);
}

.toast.error {
    background: rgba(231, 76, 60, 0.95);
}

.toast.info {
    background: rgba(52, 152, 219, 0.95);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html, body {
            height: 100%;
            width: 100%;
            overflow: auto;
            background: #2c3e50;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        .table-container {
            width: 100vw;
            display: flex;
            justify-content: center;
            align-items: flex-start;
            padding: 0;
            margin-bottom: 0;
        }

        .game-board {
            /* Use the smaller of width or height to maintain square */
            width: min(100vw, 100vh);
            height: min(100vw, 100vh);
            border-collapse: collapse;
            table-layout: fixed;
        }

        .game-board td {
            border: 1px solid rgba(255, 255, 255, 0.3);
            text-align: center;
            vertical-align: middle;
            font-size: 1.2rem;
            background: #4a5568;
            color: white;
            font-weight: bold;
            text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
            position: relative;
            cursor: pointer;
        }

        .game-board td:hover {
            background: #5a6578;
        }

        .game-board th {
            border: 1px solid rgba(255, 255, 255, 0.3);
            text-align: center;
            vertical-align: middle;
            font-weight: bold;
            background: #34495e;
            font-size: 1rem;
            color: #ecf0f1;
        }

        .row-header {
            background: #34495e;
            font-weight: bold;
            color: #ecf0f1;
            font-size: 1rem !important;
        }

        /* Tile coordinates - hidden by default (mobile) */
        .tile-coord {
            display: none;
            font-size: 1rem;
            color: rgba(255, 255, 255, 0.5);
            font-weight: normal;
            text-shadow: none;
        }

        /* Desktop view - hide headers, show coordinates */
        @media (min-width: 768px) {
            /* Only hide game board headers, not portfolio table headers */
            .game-board th {
                display: none;
            }

            .row-header {
                display: none;
            }

            .tile-coord {
                display: block;
            }
        }

        /* Placed tile styles */
        .placed-last {
            background: #1a1a1a !important;
            box-shadow: inset 0 0 0 4px rgba(0,0,0,0.4),
                        inset 0 0 0 5px rgba(255,255,255,0.3),
                        inset 8px 8px 12px rgba(0,0,0,0.5) !important;
        }

        .unincorporated {
            background: #1a1a1a !important;
            box-shadow: inset 0 0 0 4px rgba(0,0,0,0.4),
                        inset 0 0 0 5px rgba(255,255,255,0.3) !important;
        }

        /* Chain styles */
        .chain-luxor {
            background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
            box-shadow: inset 0 0 0 4px rgba(0,0,0,0.4),
                        inset 0 0 0 5px rgba(255,255,255,0.3) !important;
        }

        .chain-tower {
            background: linear-gradient(135deg, #f39c12 0%, #d68910 100%) !important;
            box-shadow: inset 0 0 0 4px rgba(0,0,0,0.4),
                        inset 0 0 0 5px rgba(255,255,255,0.3) !important;
        }

        .chain-american {
            background: linear-gradient(135deg, #3498db 0%, #2980b9 100%) !important;
            box-shadow: inset 0 0 0 4px rgba(0,0,0,0.4),
                        inset 0 0 0 5px rgba(255,255,255,0.3) !important;
        }

        .chain-festival {
            background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%) !important;
            box-shadow: inset 0 0 0 4px rgba(0,0,0,0.4),
                        inset 0 0 0 5px rgba(255,255,255,0.3) !important;
        }

        .chain-worldwide {
            background: linear-gradient(135deg, #8b4513 0%, #6f3609 100%) !important;
            box-shadow: inset 0 0 0 4px rgba(0,0,0,0.4),
                        inset 0 0 0 5px rgba(255,255,255,0.3) !important;
        }

        .chain-continental {
            background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%) !important;
            box-shadow: inset 0 0 0 4px rgba(0,0,0,0.4),
                        inset 0 0 0 5px rgba(255,255,255,0.3) !important;
        }

        .chain-imperial {
            background: linear-gradient(135deg, #e91e63 0%, #c2185b 100%) !important;
            box-shadow: inset 0 0 0 4px rgba(0,0,0,0.4),
                        inset 0 0 0 5px rgba(255,255,255,0.3) !important;
        }

        /* Chain founder tile overlays */
        .chain-founder .tile-coord {
            opacity: 0.3;
        }

        .chain-overlay {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 2rem;
            font-weight: bold;
            color: white;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
            pointer-events: none;
        }

        .safe-lock-badge {
            position: absolute;
            top: 2px;
            right: 2px;
            font-size: 0.8rem;
            opacity: 0.9;
        }

        /* Hand tile styles */
        .hand-tile {
            background: linear-gradient(135deg, rgb(80, 65, 44) 0%, rgb(70, 55, 34) 100%);
            color: white;
            width: 44px;
            height: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 3px;
            font-size: 0.7rem;
            font-weight: bold;
            border: 1px solid rgb(180, 145, 95);
            cursor: pointer;
        }

        .hand-tile:hover {
            transform: scale(1.05);
            box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
        }

        .hand-tile.disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .hand-tile.eighth-chain-blocked {
            opacity: 0.6;
            background: linear-gradient(135deg, rgb(60, 45, 24) 0%, rgb(50, 35, 14) 100%);
        }

        .highlight-target {
            box-shadow: 0 0 20px rgba(255, 255, 0, 0.8) !important;
            animation: pulse 0.5s infinite alternate;
        }

        @keyframes pulse {
            from { box-shadow: 0 0 20px rgba(255, 255, 0, 0.8); }
            to { box-shadow: 0 0 30px rgba(255, 255, 0, 1); }
        }

        /* Persistent glow for current player's tiles */
        .player-tile-glow {
            box-shadow: inset 0 0 10px rgba(180, 145, 95, 0.9) !important;
            position: relative;
            z-index: 10;
        }

        /* Small coordinate label on glowing board tiles */
        .glow-coord-label {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 0.5rem;
            color: rgba(255, 255, 255, 0.8);
            font-weight: normal;
            pointer-events: none;
            z-index: 20;
            white-space: nowrap;
        }

        /* Portfolio table overrides */
        .portfolio-table td,
        .portfolio-table th {
            font-size: 0.65rem !important;
            padding: 4px 4px !important;
            line-height: 1;
            height: auto !important;
        }

        /* First column (emoji/logo) - center aligned and narrower */
        .portfolio-table td:nth-child(1),
        .portfolio-table th:nth-child(1) {
            text-align: center !important;
            width: 1.2rem !important;
            padding: 0 2px !important;
        }

        /* Second column (chain names) - left aligned */
        .portfolio-table td:nth-child(2),
        .portfolio-table th:nth-child(2) {
            text-align: left !important;
        }

        /* Third and fourth columns ($ and #) - center aligned */
        .portfolio-table td:nth-child(3),
        .portfolio-table th:nth-child(3),
        .portfolio-table td:nth-child(4),
        .portfolio-table th:nth-child(4) {
            text-align: center !important;
        }

        /* Player columns (5+) - right aligned */
        .portfolio-table td:nth-child(n+5),
        .portfolio-table th:nth-child(n+5) {
            text-align: right !important;
        }

        /* Current turn indicator - will be set dynamically via JS */
        .portfolio-table td.active-player,
        .portfolio-table th.active-player {
            border-left: 3px solid #f39c12 !important;
            border-right: 3px solid #f39c12 !important;
        }

        .portfolio-table th.active-player {
            border-top: 3px solid #f39c12 !important;
            background: #f39c12 !important;
        }

        .portfolio-table tbody tr:last-child td.active-player {
            border-bottom: 3px solid #f39c12 !important;
        }

        /* Desktop media query - increase portfolio table font size */
        @media (min-width: 768px) {
            .portfolio-table td,
            .portfolio-table th {
                font-size: 0.85rem !important;
            }
        }

        /* Chain icon cells in portfolio table */
        .portfolio-chain-icon {
            color: white !important;
            font-weight: bold !important;
        }

        .portfolio-chain-icon.imperial {
            background: linear-gradient(135deg, #e91e63 0%, #c2185b 100%) !important;
        }

        .portfolio-chain-icon.continental {
            background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%) !important;
        }

        .portfolio-chain-icon.worldwide {
            background: linear-gradient(135deg, #8b4513 0%, #6b3410 100%) !important;
        }

        .portfolio-chain-icon.festival {
            background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%) !important;
        }

        .portfolio-chain-icon.american {
            background: linear-gradient(135deg, #3498db 0%, #2980b9 100%) !important;
        }

        .portfolio-chain-icon.tower {
            background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%) !important;
        }

        .portfolio-chain-icon.luxor {
            background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
        }

        /* Cash/Net Worth cells */
        .portfolio-cash-icon {
            background: white !important;
        }

        /* Modal styles */
        .modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.7);
        }

        .modal.active {
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .modal-content {
            background-color: #2c3e50;
            padding: 10px;
            border-radius: 10px;
            max-width: 455px;
            /* width: 82%; */
            color: white;
            max-height: 90vh;
            overflow-y: auto;
        }

        .modal-content h2 {
            margin-bottom: 5px;
            color: #ecf0f1;
        }

        .chain-buttons {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-top: 20px;
        }

        .chain-btn {
            width: 100%;
            padding: 7px 15px;
            border: none;
            border-radius: 5px;
            color: white;
            font-weight: bold;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 10px;
        }

        .chain-btn .chain-icon {
            font-size: 2em;
        }

        .chain-btn.imperial { background: linear-gradient(135deg, #e91e63 0%, #c2185b 100%); }
        .chain-btn.continental { background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%); }
        .chain-btn.worldwide { background: linear-gradient(135deg, #8b4513 0%, #6f3609 100%); }
        .chain-btn.festival { background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%); }
        .chain-btn.american { background: linear-gradient(135deg, #3498db 0%, #2980b9 100%); }
        .chain-btn.tower { background: linear-gradient(135deg, #f39c12 0%, #d68910 100%); }
        .chain-btn.luxor { background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); }

        .btn {
            padding: 0;
            border: none;
            border-radius: 5px;
            font-weight: bold;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .btn-primary {
            background: #2ecc71;
            color: white;
            padding: 10px 20px;
        }

        .btn-secondary {
            background: #3498db;
            color: white;
            padding: 10px 20px;
        }

        /* Game action buttons (Buy/Draw/End) - no padding needed */
        .btn-action-buy {
            background: #2ecc71;
            color: white;
        }

        .btn-action-draw {
            background: #3498db;
            color: white;
        }

        .btn-action-end {
            background: #e74c3c;
            color: white;
        }

        /* Stock Buy Modal Styles */
        .stock-buy-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 2px;
            margin-top: 10px;
            background: #34495e;
            border-radius: 5px;
            border: 2px solid transparent;
        }

        .stock-buy-info {
            display: flex;
            align-items: center;
            margin-right: 12px;
            gap: 12px;
        }

        .chain-mini {
            width: 32px;
            height: 32px;
            border-radius: 3px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: bold;
            font-size: 1rem;
            border: 2px solid rgba(255,255,255,0.3);
        }

        .chain-mini.luxor {
            background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
        }

        .chain-mini.tower {
            background: linear-gradient(135deg, #f39c12 0%, #d68910 100%);
        }

        .chain-mini.american {
            background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
        }

        .chain-mini.festival {
            background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
        }

        .chain-mini.worldwide {
            background: linear-gradient(135deg, #8b4513 0%, #6f3609 100%);
        }

        .chain-mini.continental {
            background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%);
        }

        .chain-mini.imperial {
            background: linear-gradient(135deg, #e91e63 0%, #c2185b 100%);
        }

        .chain-name-text {
            font-weight: bold;
            color: #ecf0f1;
        }

        .chain-price-text {
            color: #2ecc71;
            font-weight: bold;
        }

        .stock-buy-controls {
            display: flex;
            align-items: center;
            gap: 2px;
        }

        .stock-qty-btn {
            width: 36px;
            height: 36px;
            border-radius: 4px;
            border: 2px solid #3498db;
            background: white;
            color: #3498db;
            font-size: 1.2rem;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .stock-qty-btn:hover {
            background: #3498db;
            color: white;
        }

        .stock-qty-btn:active {
            transform: scale(0.95);
        }

        .stock-qty-display {
            font-size: 1.2rem;
            font-weight: bold;
            min-width: 30px;
            text-align: center;
            color: #ecf0f1;
        }

        /* Toast notifications */
        #toast-container {
            position: fixed;
            top: 20px;
            right: 20px;
            z-index: 2000;
        }

        .toast {
            background: rgba(46, 204, 113, 0.95);
            color: white;
            padding: 15px 20px;
            border-radius: 5px;
            margin-bottom: 10px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
            animation: slideIn 0.3s ease-out;
        }

        .toast.error {
            background: rgba(231, 76, 60, 0.95);
        }

        .toast.info {
            background: rgba(52, 152, 219, 0.95);
        }

        @keyframes slideIn {
            from {
                transform: translateX(400px);
                opacity: 0;
            }
            to {
                transform: translateX(0);
                opacity: 1;
            }
        }

/* ========================================
 * Options Table Styles (for index.php cards)
 * ======================================== */

.options-table {
    width: 100%;
    margin-bottom: 0;
    border-collapse: collapse;
}

.options-table td {
    padding: 0;
    vertical-align: middle;
}

.options-table .header-cell {
    font-size: 1.5em;
    color: #333;
    font-weight: bold;
    padding: 5px;
}

.options-table .subheader-cell {
    font-size: 1.3em;
    color: #333;
    font-weight: bold;
    padding: 5px;
}

.options-table .label-cell {
    min-width: 110px;
    font-weight: bold;
    color: #333;
    font-size: 0.95em;
    vertical-align: bottom;
    padding-top: 8px;
}

.options-table .input-cell {
    width: 55%;
    vertical-align: bottom;
    padding-top: 8px;
}

.options-table .spacer-cell {
    width: 2%;
    padding: 0;
}

.options-table .button-cell {
    width: 23%;
    padding-top: 5px;
    height: 100%;
    vertical-align: stretch;
}

.options-table .go-button {
    width: 100%;
    min-height: 80px;
    height: 100%;
    margin: 0;
    font-size: 0.9em;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
