/* ==========================================================================
   CSS Variables - Derived from ui.config.ts for consistency
   ========================================================================== */
:root {
    /* Core colors from UI_COLORS */
    --bg-dark: rgb(20, 20, 20);              /* UI_COLORS.HEADER */
    --bg-game: rgb(30, 30, 30);              /* UI_COLORS.GAME_AREA */
    --bg-panel: rgb(50, 50, 50);             /* UI_COLORS.PANEL_BACKGROUND */
    --bg-glass: rgba(30, 30, 30, 0.85);      /* Glassmorphism base */
    --bg-glass-hover: rgba(40, 40, 40, 0.9);

    /* Interactive colors */
    --accent-primary: rgb(100, 180, 100);    /* UI_COLORS.INTERACTIVE_ACTIVE */
    --accent-primary-hover: rgb(120, 200, 120);
    --interactive-idle: rgb(70, 70, 70);     /* UI_COLORS.INTERACTIVE_IDLE */
    --interactive-hover: rgb(90, 90, 90);    /* UI_COLORS.INTERACTIVE_HOVER */
    --accent-danger: rgb(200, 50, 50);       /* UI_COLORS.TILE_OUTLINE_INVALID */

    /* Text colors */
    --text-main: rgb(225, 225, 225);         /* UI_COLORS.TEXT_LIGHT */
    --text-dark: rgb(25, 25, 25);            /* UI_COLORS.TEXT_DARK */
    --text-muted: rgb(180, 180, 180);
    --text-label: rgb(180, 180, 180);        /* UI_COLORS.TEXT_LABEL - sidebar labels */

    /* Borders and shadows */
    --border-light: rgba(255, 255, 255, 0.1);
    --border-medium: rgba(255, 255, 255, 0.15);
    --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --shadow-glow: 0 0 20px rgba(100, 180, 100, 0.4);

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Font */
    --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ==========================================================================
   Base reset and setup
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-main);
    font-size: 14px;
}

body {
    display: flex;
    flex-direction: column;
    background: var(--bg-game);
}

/* Header Bar */
#header-bar {
    height: 40px;
    min-height: 20px;
    background: rgb(20, 20, 20);
    display: flex;
    align-items: center;
    padding: 0 10px;
    color: rgb(225, 225, 225);
    flex-shrink: 0;
}

/* Header button */
.header-btn {
    background: rgb(70, 70, 70);
    color: rgb(225, 225, 225);
    border: none;
    padding: 6px 14px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 12px;
    transition: background 0.15s ease;
    margin-left: auto;
}

.header-btn:hover {
    background: rgb(90, 90, 90);
}

.header-btn:active {
    background: rgb(100, 180, 100);
}

/* Game Container (Middle Section) */
#game-container {
    flex: 1;
    min-height: 100px;
    background: rgb(30, 30, 30);
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    overflow: hidden;
    /* Prevent browser from handling touch gestures (pinch-zoom, pan) */
    touch-action: none;
}

#game-container canvas {
    display: block;
    /* Ensure canvas also prevents browser touch handling */
    touch-action: none;
}

/* Text colors */
.text-light {
    color: rgb(225, 225, 225);
}

.text-dark {
    color: rgb(25, 25, 25);
}

.text-on-variable {
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 6px;
    border-radius: 2px;
}

/* Interactive elements */
.btn {
    background: rgb(70, 70, 70);
    color: rgb(225, 225, 225);
    border: none;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 12px;
    transition: background 0.15s ease;
}

.btn:hover {
    background: rgb(90, 90, 90);
}

.btn:active,
.btn.active {
    background: rgb(100, 180, 100);
}

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

/* Progress bars */
.progress-bar {
    height: 20px;
    background: rgb(40, 40, 40);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    transition: width 0.1s linear;
}

.progress-bar-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    color: rgb(225, 225, 225);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Time bar specific colors */
.progress-dawn {
    background: rgb(255, 180, 120);
}

.progress-day {
    background: rgb(255, 220, 100);
}

.progress-dusk {
    background: rgb(180, 100, 120);
}

.progress-night-early {
    background: rgb(50, 50, 100);
}

.progress-night-late {
    background: rgb(50, 50, 100);
}

/* Season bar */
.progress-warm {
    background: rgb(180, 200, 100);
}

.progress-cold {
    background: rgb(150, 200, 230);
}

/* GUI section headers */
.gui-section-header {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgb(180, 180, 180);
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgb(70, 70, 70);
}

/* GUI rows for content layout */
.gui-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 10px;
}

.gui-row:last-child {
    margin-bottom: 0;
}

.gui-label {
    font-size: 12px;
    min-width: 60px;
}

/* Scrollable content within GUI columns */
.gui-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar styling */
.gui-scroll::-webkit-scrollbar {
    width: 6px;
}

.gui-scroll::-webkit-scrollbar-track {
    background: rgb(40, 40, 40);
}

.gui-scroll::-webkit-scrollbar-thumb {
    background: rgb(80, 80, 80);
    border-radius: 3px;
}

.gui-scroll::-webkit-scrollbar-thumb:hover {
    background: rgb(100, 100, 100);
}

/* Worker status display styles */
.worker-status-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.worker-status-header {
    font-size: 11px;
    padding: 1px 4px;
    border-bottom: 1px solid #555;
}

.worker-status-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 4px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
    align-content: start;
}

.worker-row {
    display: flex;
    align-items: center;
    padding: 1px 4px;
    cursor: pointer;
    border-radius: 2px;
    font-size: 11px;
}

/* Subtle vertical divider between worker columns */
.worker-row:nth-child(odd) {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    margin-right: -6px;
    padding-right: 12px;
}

.worker-row:hover {
    background-color: rgba(90, 90, 90, 0.8);
}

.worker-row.selected {
    background-color: rgba(100, 180, 100, 0.3);
}

.worker-name {
    flex: 0 0 60px;
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.worker-status-icon {
    flex: 0 0 20px;
    text-align: center;
    font-size: 11px;
    cursor: help;
}

.worker-hunger-bar {
    flex: 1;
    height: 14px;
    background-color: #333;
    border-radius: 2px;
    position: relative;
    margin-left: 4px;
    overflow: hidden;
}

.hunger-fill {
    height: 100%;
    transition: width 0.2s ease;
}

.hunger-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
}

/* Wood Forecast Display Styles */
.wood-forecast-container {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wood-forecast-header {
    font-size: 11px;
    padding: 1px 4px;
    border-bottom: 1px solid #555;
    font-weight: bold;
    text-align: center;
}

.wood-forecast-bar {
    flex: 1;
    display: flex;
    flex-direction: column-reverse;
    padding: 4px;
    min-height: 0;
}

.wood-forecast-segment {
    position: relative;
    background-color: #222;
    border: 1px solid #444;
    border-radius: 2px;
    margin-bottom: 2px;
    overflow: hidden;
    cursor: help;
    min-height: 8px;
}

.wood-forecast-segment:first-child {
    margin-bottom: 0;
}

.wood-forecast-fill {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    transition: height 0.2s ease, background-color 0.2s ease;
}

.wood-forecast-segment-label {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 9px;
    color: rgba(255, 255, 255, 0.7);
    pointer-events: none;
    z-index: 1;
}

.wood-forecast-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    opacity: 0.5;
    font-size: 10px;
    font-style: italic;
}

/* Camp Info Bar (horizontal summary in CAMP mode) */
.camp-info-bar {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 10px;
    font-size: 11px;
}

.camp-info-item {
    display: flex;
    gap: 4px;
}

.camp-info-label {
    color: rgb(180, 180, 180);
}

.camp-info-value {
    color: rgb(225, 225, 225);
    font-weight: bold;
}

/* ==========================================================================
   Lobby UI Overlay
   ========================================================================== */
#lobby-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
}

#lobby-ui.active {
    display: flex;
}

/* Lobby Container - Grid Layout */
.lobby-container {
    width: 90%;
    max-width: 900px;
    height: 80%;
    max-height: 600px;
    display: grid;
    grid-template-columns: 260px 1fr;
    grid-template-rows: 60px 1fr;
    gap: var(--spacing-md);
}

/* Lobby Header */
.lobby-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    padding: 0 var(--spacing-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

.lobby-version {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.25);
    pointer-events: none;
    user-select: none;
}

.lobby-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(45deg, #fff, var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lobby-header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.lobby-status {
    font-size: 13px;
    color: var(--text-muted);
}

.lobby-status.connected {
    color: var(--accent-primary);
}

.lobby-user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 13px;
}

/* Lobby Sidebar */
.lobby-sidebar {
    grid-row: 2;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* Card Component */
.lobby-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
}

.lobby-card h3 {
    margin: 0 0 var(--spacing-md) 0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

/* Profile Card */
.profile-card .profile-name-row {
    margin-bottom: var(--spacing-md);
}

.profile-card .profile-name-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: var(--spacing-xs);
}

.profile-card .profile-name-display {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.profile-card .profile-color-row {
    margin-top: var(--spacing-md);
}

.profile-card .profile-color-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
}

.profile-card .profile-color-display {
    height: 32px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-medium);
    transition: border-color 0.15s ease;
}

.profile-card .profile-color-display.clickable {
    cursor: pointer;
}

.profile-card .profile-color-display.clickable:hover {
    border-color: var(--accent-primary);
}

/* Color Picker Modal */
.color-picker-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.color-picker-input {
    width: 64px;
    height: 48px;
    padding: 2px;
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-md);
    background: var(--bg-panel);
    cursor: pointer;
}

.color-picker-preview {
    flex: 1;
    height: 48px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-medium);
}

/* Guest Card */
.guest-card {
    text-align: center;
}

.guest-card .guest-message {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
}

/* Actions Card */
.actions-card {
    padding: var(--spacing-md);
}

/* Lobby Buttons */
.lobby-btn {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s ease;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-main);
}

.lobby-btn-primary {
    background: var(--accent-primary);
    color: var(--text-main);
}

.lobby-btn-primary:hover {
    background: var(--accent-primary-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.lobby-btn-primary:active {
    transform: translateY(0);
}

.lobby-btn-secondary {
    background: var(--interactive-idle);
    color: var(--text-main);
}

.lobby-btn-secondary:hover {
    background: var(--interactive-hover);
}

.lobby-btn-full {
    width: 100%;
    height: 48px;
    font-size: 13px;
}

.lobby-btn-small {
    padding: 6px 12px;
    font-size: 11px;
}

/* Games Area */
.games-area {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.games-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.games-header h3 {
    margin: 0;
}

/* Games List */
.games-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding-right: var(--spacing-sm);
}

.games-empty {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-muted);
}

.game-item {
    background: rgba(255, 255, 255, 0.03);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.game-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-medium);
    transform: translateX(4px);
}

.game-info h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    color: var(--text-main);
    font-weight: 600;
}

.game-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.game-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.player-count {
    font-size: 13px;
    font-weight: 500;
    color: var(--accent-primary);
}

/* Lobby Inputs */
.lobby-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-light);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.lobby-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.lobby-input:read-only {
    cursor: default;
    border-color: var(--accent-primary);
    background: rgba(100, 180, 100, 0.1);
}

.lobby-input::placeholder {
    color: var(--text-muted);
}

/* Login Modal */
.lobby-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100;
    display: none;
    justify-content: center;
    align-items: center;
}

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

.lobby-modal {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    width: 320px;
}

.lobby-modal h2 {
    margin: 0 0 var(--spacing-lg) 0;
    font-size: 20px;
    color: var(--text-main);
    text-align: center;
}

.lobby-modal .form-group {
    margin-bottom: var(--spacing-md);
}

.lobby-modal .form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: var(--spacing-xs);
}

.lobby-modal .form-error {
    color: var(--accent-danger);
    font-size: 12px;
    text-align: center;
    margin-bottom: var(--spacing-md);
    min-height: 16px;
}

.lobby-modal .form-actions {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.lobby-modal .form-actions .lobby-btn {
    flex: 1;
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Lobby scrollbar styling */
.games-list::-webkit-scrollbar {
    width: 6px;
}

.games-list::-webkit-scrollbar-track {
    background: transparent;
}

.games-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

.games-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   Inventory Mode Styles
   ========================================================================== */
.inventory-mode-container {
    display: flex;
    flex-direction: row;
    gap: 15px;
    height: 100%;
}

.inventory-column {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.inventory-column-global {
    width: 40%;
}

.inventory-column-camps {
    width: 60%;
    border-left: 1px solid #555;
    padding-left: 15px;
}

.inventory-column-header {
    font-size: 11px;
    font-weight: bold;
    color: rgb(180, 180, 180);
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgb(70, 70, 70);
}

.inventory-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inventory-resource-name {
    min-width: 45px;
    font-weight: bold;
    font-size: 11px;
}

.inventory-bar-container {
    flex: 1;
    height: 14px;
    background: #333;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.inventory-bar-fill {
    height: 100%;
    transition: width 0.2s ease;
}

.inventory-amount {
    min-width: 35px;
    text-align: right;
    font-size: 10px;
}

.inventory-amount-camps {
    min-width: 60px;
    text-align: right;
    font-size: 10px;
}

.inventory-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    opacity: 0.5;
    font-size: 12px;
    font-style: italic;
}

/* ==========================================================================
   Action List Layout (2-column grid for action buttons)
   ========================================================================== */

/* Wrapper for 2-column action button layout */
.action-column-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.action-section-header {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgb(180, 180, 180);
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgb(70, 70, 70);
}

.action-content-row {
    display: flex;
    flex-direction: row;
    gap: 8px;
    flex: 1;
    min-height: 0;
}

.action-buttons-column {
    flex: 0 0 40%;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.action-context-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.action-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.list-btn {
    background: rgb(70, 70, 70);
    color: rgb(225, 225, 225);
    border: none;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 12px;
    text-align: left;
    transition: background 0.15s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.list-btn:hover {
    background: rgb(90, 90, 90);
}

.list-btn.active {
    background: rgb(100, 180, 100);
    color: #fff;
}

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

.list-btn:disabled:hover {
    background: rgb(70, 70, 70);
}

.list-btn-indicator {
    font-size: 10px;
    opacity: 0.5;
}

/* Context Panel (hover details) */
.context-panel {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
}

.context-title {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 6px;
    color: rgb(100, 180, 100);
}

.context-desc {
    font-size: 11px;
    line-height: 1.4;
    color: #ccc;
    margin-bottom: 8px;
}

.context-costs {
    font-size: 11px;
}

.resource-cost {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2px 0;
}

.resource-cost:last-child {
    border-bottom: none;
}

.cost-ok {
    color: #aaa;
}

.cost-bad {
    color: #ff6666;
}

/* ==========================================================================
   Notification Shared Styles (used by slide-out panel)
   ========================================================================== */

#notification-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-xs);
}

/* Notification list scrollbar */
#notification-list::-webkit-scrollbar {
    width: 6px;
}

#notification-list::-webkit-scrollbar-track {
    background: transparent;
}

#notification-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

#notification-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Individual notification */
.notification-item {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
    font-size: 0.75rem;
    animation: notification-slide-in 0.2s ease;
}

@keyframes notification-slide-in {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification-item:last-child {
    margin-bottom: 0;
}

.notification-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.notification-item-type {
    font-weight: bold;
    color: var(--accent-primary);
    font-size: 0.7rem;
}

.notification-item-count {
    background: var(--interactive-idle);
    border-radius: 8px;
    padding: 1px 6px;
    font-size: 0.6rem;
    color: var(--text-main);
}

.notification-item-message {
    color: var(--text-main);
    line-height: 1.3;
}

.notification-item-time {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Empty state */
.notification-empty {
    text-align: center;
    padding: var(--spacing-lg);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-style: italic;
}

/* ==========================================================================
   Vertical Sidebar (Phase 1)
   ========================================================================== */

#ui-sidebar {
    position: fixed;
    top: 40px;  /* Below header */
    right: 0;
    width: 320px;
    height: calc(100vh - 40px);  /* Full height minus header - fallback for older browsers */
    height: calc(100dvh - 40px); /* Dynamic viewport height - accounts for mobile/tablet browser chrome */
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    border-left: 1px solid var(--border-light);
    z-index: 60;
    color: var(--text-main);
    font-size: 12px;
}

/* Sidebar sections */
.sidebar-section {
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.sidebar-section:last-child {
    border-bottom: none;
}

/* Mode selection grid */
#sidebar-modes {
    padding: var(--spacing-md);
}

.mode-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-sm);
}

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    background: var(--interactive-idle);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-main);
    padding: var(--spacing-xs);
}

.mode-btn:hover {
    background: var(--interactive-hover);
    transform: scale(1.05);
}

.mode-btn.active {
    background: var(--accent-primary);
    border-color: rgba(255, 255, 255, 0.3);
}

.mode-btn svg {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
}

.mode-btn-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.mode-btn.active .mode-btn-label {
    opacity: 1;
}

/* Scrollable content area */
#sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

#sidebar-content::-webkit-scrollbar {
    width: 6px;
}

#sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

#sidebar-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Accordion sections */
.accordion-section {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(0, 0, 0, 0.2);
    user-select: none;
    transition: background 0.15s ease;
}

.accordion-header:hover {
    background: rgba(0, 0, 0, 0.3);
}

.accordion-header span:first-child {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.accordion-arrow {
    font-size: 10px;
    transition: transform 0.2s ease;
    color: var(--text-muted);
}

.accordion-section.expanded .accordion-arrow {
    transform: rotate(180deg);
}

.accordion-body {
    display: none;
    padding: var(--spacing-md);
}

.accordion-section.expanded .accordion-body {
    display: block;
}

/* Sidebar action buttons - 2-column grid layout */
#sidebar-action-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

#sidebar-action-buttons .action-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

/* Sidebar context box */
#sidebar-action-context {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#sidebar-action-context .context-panel {
    background: rgba(0, 0, 0, 0.2);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Info sub-sections */
.info-subsection {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-subsection:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.info-subsection.scrollable {
    max-height: 150px;
    overflow-y: auto;
}

/* Notification toggle section in sidebar */
#sidebar-notifications {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Notification header - extends accordion-header */
.notification-header {
    width: 100%;
    border: none;
    font-family: var(--font-main);
}

.notification-header.active {
    background: rgba(0, 0, 0, 0.3);
}

.notification-header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.notification-badge-count {
    background: var(--accent-primary);
    color: var(--text-dark);
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
}

.notification-badge-count.hidden {
    display: none;
}

/* Arrow rotation when notification panel is open */
.notification-header.active .accordion-arrow {
    transform: rotate(90deg);
}

/* ==========================================================================
   Notification Slide-Out Panel (Phase 4)
   ========================================================================== */

#notification-slideout {
    position: fixed;
    top: 40px;                    /* Below header */
    right: 320px;                 /* Sidebar width - positions left edge of slide-out at sidebar's left edge */
    width: 280px;
    height: calc(100vh - 40px);   /* Full height minus header (matches sidebar) - fallback */
    height: calc(100dvh - 40px);  /* Dynamic viewport height - accounts for mobile/tablet browser chrome */
    background: rgba(40, 40, 40, 0.95);
    border-left: 1px solid var(--border-light);
    transform: translateX(100%);  /* Hidden: slid to the right */
    transition: transform 0.2s ease-out;
    z-index: 55;                  /* Above map, BELOW sidebar (60) */
    display: flex;
    flex-direction: column;
    pointer-events: auto;
}

#notification-slideout.notification-slideout-collapsed {
    transform: translateX(100%);  /* Hidden: slid to the right (under sidebar) */
}

#notification-slideout.notification-slideout-expanded {
    transform: translateX(0);     /* Visible: in position to left of sidebar */
}

.notification-slideout-header {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--border-light);
    gap: var(--spacing-sm);
    background: rgba(30, 30, 30, 0.7);
    flex-shrink: 0;
}

.notification-slideout-title {
    flex: 1;
    font-weight: bold;
    font-size: 13px;
    color: var(--text-main);
}

.notification-slideout-debug-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    cursor: pointer;
    color: var(--text-muted);
    user-select: none;
}

.notification-slideout-debug-toggle input {
    cursor: pointer;
    width: 12px;
    height: 12px;
}

.notification-slideout-debug-toggle:hover {
    color: var(--text-main);
}

.notification-slideout-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s ease;
}

.notification-slideout-close:hover {
    color: var(--text-main);
}

.notification-slideout-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-sm);
}

/* Notification list scrollbar for slide-out */
.notification-slideout-list::-webkit-scrollbar {
    width: 6px;
}

.notification-slideout-list::-webkit-scrollbar-track {
    background: transparent;
}

.notification-slideout-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

.notification-slideout-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Legacy badge ID selector for backwards compatibility */
#sidebar-notification-badge {
    background: var(--accent-primary);
    color: var(--text-dark);
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
}

#sidebar-notification-badge.hidden {
    display: none;
}

/* ==========================================================================
   Floating Action Context Tooltip
   ========================================================================== */

#action-context-tooltip {
    position: fixed;
    top: 180px;                              /* Fixed position below mode buttons */
    right: 328px;                            /* Sidebar width (320px) + gap (8px) */
    width: 260px;
    padding: 12px;
    background: rgba(40, 40, 40, 0.95);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 59;                             /* Below sidebar (60), above map */

    /* Hidden by default */
    opacity: 0;
    pointer-events: none;
    transform: translateX(10px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

#action-context-tooltip.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.action-context-title {
    font-size: 12px;
    font-weight: bold;
    color: var(--accent-primary);
    margin-bottom: 6px;
}

.action-context-desc {
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.action-context-costs {
    font-size: 11px;
}

/* Reuse existing cost styling for floating tooltip */
#action-context-tooltip .resource-cost {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2px 0;
    color: var(--text-main);
}

#action-context-tooltip .resource-cost:last-child {
    border-bottom: none;
}

/* Placement criteria checklist */
.action-context-criteria {
    font-size: 11px;
    margin-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 4px;
}

.action-context-criteria:empty {
    display: none;
}

.action-context-criteria .cost-ok {
    color: #66cc66;
    font-weight: bold;
}

.action-context-criteria .cost-bad {
    font-weight: bold;
}

.action-context-criteria .criteria-fail {
    background: rgba(200, 80, 80, 0.2);
    border-radius: 2px;
    padding-left: 4px;
    padding-right: 4px;
}

/* Food Allocation Slider - colors applied via JS from ui.config.ts */
.food-allocation-slider {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #333;
}

.food-slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 4px;
}

/* No color definitions for labels - applied via JS */

#food-slider-input {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    /* background gradient set via JS */
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

#food-slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

#food-slider-input::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.food-slider-values {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-top: 4px;
}

/* No color definitions for values - applied via JS */

/* ==========================================================================
   Sidebar Info Panel (Phase 3A)
   ========================================================================== */

/* Info bar container - vertical layout for structure summary */
.sidebar-info-bar {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 8px;
    font-size: 11px;
}

/* Info row - horizontal layout with space-between */
.sidebar-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

/* Individual info item container */
.sidebar-info-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Right-aligned info item */
.sidebar-info-right {
    margin-left: auto;
}

/* Editable item needs extra styling */
.sidebar-info-editable {
    flex-wrap: nowrap;
}

/* Info label (muted text) */
.sidebar-info-label {
    color: rgba(180, 180, 180, 1);
}

/* Info value (bright text, bold) */
.sidebar-info-value {
    color: rgba(225, 225, 225, 1);
    font-weight: bold;
}

/* Name value with overflow handling */
.sidebar-info-name {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Display container for editable items (name + edit button) */
.sidebar-info-display {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Edit button (pencil) */
.sidebar-info-edit-btn {
    padding: 0 3px;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
    border: 1px solid rgba(102, 102, 102, 1);
    border-radius: 2px;
    background: rgba(51, 51, 51, 1);
    color: rgba(255, 255, 255, 1);
    transition: background 0.15s ease;
}

.sidebar-info-edit-btn:hover {
    background: rgba(70, 70, 70, 1);
}

/* Input container (shown in edit mode) */
.sidebar-info-input-container {
    display: none;
}

/* Name edit input */
.sidebar-info-input {
    width: 80px;
    padding: 2px 4px;
    font-size: 11px;
    border: 1px solid rgba(102, 102, 102, 1);
    border-radius: 2px;
    background: rgba(51, 51, 51, 1);
    color: rgba(255, 255, 255, 1);
}

.sidebar-info-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* ==========================================================================
   Phase 3B: Sidebar Info Sub-sections
   ========================================================================== */

/* Collapsible sub-section headers */
.sidebar-subsection {
    margin-bottom: var(--spacing-sm);
}

.sidebar-subsection:last-child {
    margin-bottom: 0;
}

.sidebar-subsection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
    user-select: none;
    transition: background 0.15s ease;
    margin-bottom: 6px;
}

.sidebar-subsection-header:hover {
    background: rgba(0, 0, 0, 0.25);
}

.sidebar-subsection-header span:first-child {
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.sidebar-subsection-arrow {
    font-size: 8px;
    transition: transform 0.2s ease;
    color: var(--text-muted);
}

.sidebar-subsection.collapsed .sidebar-subsection-arrow {
    transform: rotate(-90deg);
}

.sidebar-subsection-body {
    display: block;
}

.sidebar-subsection.collapsed .sidebar-subsection-body {
    display: none;
}

/* =====================================================================
   Resources Sub-section (Inventory Table)
   ===================================================================== */

.sidebar-info-resources {
    font-size: 11px;
}

.sidebar-resource-table {
    width: 100%;
    border-collapse: collapse;
}

.sidebar-resource-table th {
    text-align: left;
    padding: 2px 4px;
    font-size: 9px;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-resource-table th.text-center {
    text-align: center;
}

.sidebar-resource-row td {
    padding: 3px 4px;
    vertical-align: middle;
}

/* Resource name column */
.sidebar-resource-name {
    font-weight: bold;
    white-space: nowrap;
    color: var(--text-label);
}

/* Prohibit button */
.sidebar-resource-prohibit-btn {
    background: rgba(70, 70, 70, 0.5);
    border: 1px solid rgba(102, 102, 102, 0.5);
    border-radius: 2px;
    padding: 1px 4px;
    font-size: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
    min-width: 24px;
    text-align: center;
}

.sidebar-resource-prohibit-btn:hover {
    background: rgba(90, 90, 90, 0.6);
}

.sidebar-resource-prohibit-btn.prohibited {
    background: rgba(170, 50, 50, 0.5);
    color: rgb(255, 100, 100);
}

/* Level buttons (min/target) */
.sidebar-resource-level-btn {
    background: rgba(70, 70, 70, 0.5);
    border: 1px solid rgba(102, 102, 102, 0.5);
    border-radius: 2px;
    padding: 1px 4px;
    font-size: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
    min-width: 32px;
    text-align: center;
    color: var(--text-main);
}

.sidebar-resource-level-btn:hover:not(:disabled) {
    background: rgba(90, 90, 90, 0.6);
}

.sidebar-resource-level-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Storage bar container */
.sidebar-resource-bar-cell {
    width: 100%;
}

.sidebar-resource-bar-container {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sidebar-resource-bar {
    flex: 1;
    height: 12px;
    background: rgba(51, 51, 51, 1);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.sidebar-resource-bar-fill {
    height: 100%;
    transition: width 0.2s ease;
}

/* Bar color states */
.sidebar-resource-bar-fill.critical {
    background: rgb(170, 30, 20);
}

.sidebar-resource-bar-fill.low {
    background: rgb(230, 180, 50);
}

.sidebar-resource-bar-fill.satisfied {
    background: rgb(110, 170, 20);
}

.sidebar-resource-bar-fill.full {
    background: rgb(15, 160, 170);
}

/* Level markers on bar */
.sidebar-resource-marker {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    z-index: 5;
}

.sidebar-resource-marker.min-marker {
    background: rgb(200, 50, 50);
}

.sidebar-resource-marker.target-marker {
    background: rgb(120, 80, 180);
}

/* Amount label */
.sidebar-resource-amount {
    font-size: 9px;
    min-width: 40px;
    text-align: right;
    color: var(--text-muted);
}

/* =====================================================================
   Workers Sub-section
   ===================================================================== */

.sidebar-info-workers {
    font-size: 11px;
}

.sidebar-workers-container {
    max-height: 150px;
    overflow-y: auto;
}

.sidebar-workers-container::-webkit-scrollbar {
    width: 4px;
}

.sidebar-workers-container::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-workers-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

.sidebar-worker-row {
    display: flex;
    align-items: center;
    padding: 3px 4px;
    cursor: pointer;
    border-radius: 2px;
    transition: background 0.1s ease;
    gap: 4px;
}

.sidebar-worker-row:hover {
    background: rgba(90, 90, 90, 0.5);
}

.sidebar-worker-row.selected {
    background: rgba(100, 180, 100, 0.3);
}

.sidebar-worker-row.freezing {
    background: rgba(100, 180, 220, 0.25);
}

.sidebar-worker-row.freezing.selected {
    background: rgba(100, 180, 180, 0.3);
}

.sidebar-worker-name {
    flex: 0 0 55px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-label);
}

.sidebar-king-crabs-container .sidebar-worker-name {
    flex: 0 0 100px;
}

.sidebar-worker-status-icon {
    flex: 0 0 22px;
    text-align: center;
    cursor: help;
}

.sidebar-worker-hunger-bar {
    flex: 1;
    height: 10px;
    background: rgba(51, 51, 51, 1);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
    min-width: 40px;
}

.sidebar-worker-hunger-fill {
    height: 100%;
    transition: width 0.2s ease;
}

.sidebar-worker-hunger-fill.satiated {
    background: rgb(110, 170, 20);
}

.sidebar-worker-hunger-fill.hungry {
    background: rgb(230, 180, 50);
}

.sidebar-worker-hunger-fill.starving {
    background: rgb(170, 30, 20);
}

.sidebar-worker-hunger-marker {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
}

.sidebar-worker-hunger-marker.hungry-threshold {
    background: rgb(230, 180, 50);
}

.sidebar-worker-hunger-marker.starving-threshold {
    background: rgb(170, 30, 20);
}

.sidebar-workers-empty {
    padding: 8px;
    text-align: center;
    opacity: 0.5;
    font-style: italic;
    font-size: 10px;
}

/* =====================================================================
   Assignments Sub-section (Camp only)
   ===================================================================== */

.sidebar-info-assignments {
    font-size: 11px;
}

.sidebar-assignment-row {
    display: flex;
    align-items: center;
    padding: 3px 4px;
    gap: 4px;
}

.sidebar-assignment-label {
    flex: 0 0 55px;
    font-weight: bold;
    white-space: nowrap;
    color: var(--text-label);
}

.sidebar-assignment-controls {
    display: flex;
    align-items: center;
    gap: 2px;
}

.sidebar-assignment-btn {
    width: 18px;
    height: 18px;
    padding: 0;
    background: rgba(70, 70, 70, 0.5);
    border: 1px solid rgba(102, 102, 102, 0.5);
    border-radius: 2px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s ease;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-assignment-btn:hover:not(:disabled) {
    background: rgba(90, 90, 90, 0.6);
}

.sidebar-assignment-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.sidebar-assignment-value {
    min-width: 24px;
    text-align: center;
    font-weight: bold;
}

.sidebar-assignment-suffix {
    font-size: 9px;
    color: var(--text-muted);
    margin-left: 6px;
    min-width: 20px;
}

/* =====================================================================
   Destinations Sub-section (Silo only)
   ===================================================================== */

.sidebar-info-destinations {
    font-size: 11px;
}

.sidebar-destinations-container {
    max-height: 120px;
    overflow-y: auto;
}

.sidebar-destinations-container::-webkit-scrollbar {
    width: 4px;
}

.sidebar-destinations-container::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-destinations-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

.sidebar-destination-row {
    display: flex;
    align-items: center;
    padding: 3px 4px;
    gap: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-destination-row:last-child {
    border-bottom: none;
}

.sidebar-destination-prohibit-btn {
    background: rgba(70, 70, 70, 0.5);
    border: 1px solid rgba(102, 102, 102, 0.5);
    border-radius: 2px;
    padding: 1px 4px;
    font-size: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
    min-width: 24px;
    text-align: center;
}

.sidebar-destination-prohibit-btn:hover {
    background: rgba(90, 90, 90, 0.6);
}

.sidebar-destination-prohibit-btn.prohibited {
    background: rgba(170, 50, 50, 0.5);
    color: rgb(255, 100, 100);
}

.sidebar-destination-name {
    flex: 1;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-destination-distance {
    font-size: 9px;
    color: var(--text-muted);
    white-space: nowrap;
}

.sidebar-destinations-empty {
    padding: 8px;
    text-align: center;
    opacity: 0.5;
    font-style: italic;
    font-size: 10px;
}

/* =====================================================================
   Wood Forecast Sub-section
   ===================================================================== */

.sidebar-info-forecast {
    font-size: 11px;
}

.sidebar-forecast-bar-container {
    display: flex;
    height: 20px;
    gap: 2px;
    background: rgba(34, 34, 34, 1);
    border-radius: 2px;
    padding: 2px;
}

.sidebar-forecast-segment {
    position: relative;
    background: rgba(68, 68, 68, 1);
    border-radius: 2px;
    overflow: hidden;
    cursor: help;
    min-width: 8px;
}

.sidebar-forecast-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    transition: width 0.2s ease;
}

.sidebar-forecast-fill.critical {
    background: rgb(170, 30, 20);
}

.sidebar-forecast-fill.low {
    background: rgb(230, 180, 50);
}

.sidebar-forecast-fill.satisfied {
    background: rgb(110, 170, 20);
}

.sidebar-forecast-empty {
    padding: 8px;
    text-align: center;
    opacity: 0.5;
    font-style: italic;
    font-size: 10px;
}

/* =====================================================================
   Sidebar Inventory Panel (Phase 5A)
   ===================================================================== */

.sidebar-inventory-panel {
    padding: var(--spacing-md);
}

.sidebar-inventory-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    max-height: 100%;
    overflow-y: auto;
}

.sidebar-inventory-content::-webkit-scrollbar {
    width: 4px;
}

.sidebar-inventory-content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-inventory-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

/* Inventory section (Global or Camp) */
.sidebar-inventory-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-inventory-global {
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Section header */
.sidebar-inventory-header {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Other layers indicator */
.sidebar-inventory-other-layers {
    font-size: 10px;
    color: var(--text-muted);
    font-style: italic;
    padding: 2px 0;
    opacity: 0.7;
}

/* Empty state messages */
.sidebar-inventory-empty {
    font-size: 11px;
    font-style: italic;
    color: var(--text-muted);
    padding: 8px 0;
    text-align: center;
    opacity: 0.6;
}

.sidebar-inventory-help {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    opacity: 0.5;
    padding-bottom: 4px;
}

/* Resource rows in inventory panel use shared sidebar-resource-* classes
   from the info panel for visual consistency */

/* =====================================================================
   Tile Info in Sidebar (TILE mode)
   ===================================================================== */

#sidebar-info-tile {
    font-size: 11px;
}

#sidebar-info-tile .gui-row {
    display: flex;
    align-items: center;
    padding: 4px 0;
    gap: 8px;
}

#sidebar-info-tile .gui-row:last-child {
    padding-bottom: 0;
}

#sidebar-info-tile .gui-label {
    min-width: 70px;
    color: var(--text-muted);
    font-size: 11px;
}

#sidebar-info-tile .gui-placeholder {
    text-align: center;
    padding: 8px;
    opacity: 0.5;
    font-style: italic;
}

#sidebar-info-tile .progress-bar {
    flex: 1;
    height: 18px;
    background: rgba(51, 51, 51, 1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

/* ==========================================================================
   Time Overlay (floating upper-left)
   ========================================================================== */

.time-overlay {
    position: fixed;
    top: 65px;
    left: 18px;
    z-index: 58;
    display: none;  /* Hidden by default, shown when game is active */
    flex-direction: row;
    align-items: flex-start;
    gap: 6px;
    pointer-events: auto;
}

.time-overlay.visible {
    display: flex;
}

.time-overlay-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.time-overlay-bars {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Base bar styling */
.time-overlay-bar {
    width: 260px;
    border-radius: 7px;
    overflow: hidden;
    position: relative;
    display: flex;
}

/* Day bar - taller */
.time-overlay-bar-day {
    height: 14px;
    border-radius: 7px;
}

/* Season bar - shorter */
.time-overlay-bar-season {
    height: 10px;
    border-radius: 5px;
}

/* Period/season segment styling */
.time-overlay-segment {
    height: 100%;
    flex-shrink: 0;
}

/* Progress marker - container for circle and line */
.time-overlay-marker {
    position: absolute;
    top: 50%;
    z-index: 10;
    transform: translate(-50%, -50%);
}

/* Thin vertical line behind circle for precise time indication */
.time-overlay-marker::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 1px;
    background: rgba(0, 0, 0, 0.5);
    transform: translateX(-50%);
}

/* Circle indicator on top of line */
.time-overlay-marker::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    border-radius: 50%;
    background: rgb(255, 255, 255);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.6),
        0 0 3px rgba(0, 0, 0, 0.5);
    transform: translate(-50%, -50%);
}

/* Larger marker for day bar */
.time-overlay-marker-large {
    width: 8px;
    height: 8px;
}

.time-overlay-marker-large::before {
    height: 14px;
    margin-top: -7px;
}

.time-overlay-marker-large::after {
    width: 8px;
    height: 8px;
}

/* Smaller marker for season bar */
.time-overlay-marker-small {
    width: 6px;
    height: 6px;
}

.time-overlay-marker-small::before {
    height: 10px;
    margin-top: -5px;
}

.time-overlay-marker-small::after {
    width: 6px;
    height: 6px;
}

/* Tick marks - small white indicators at period/day boundaries */
.time-overlay-tick {
    position: absolute;
    top: 0;
    width: 1px;
    height: 100%;
    background: rgba(255, 255, 255, 0.65);
    z-index: 5;
    transform: translateX(-50%);
}

/* Dark tick marks for visibility on light/yellow backgrounds */
.time-overlay-tick-dark {
    background: rgba(80, 80, 80, 0.7);
}

/* Text - subtle white with dark shadow for readability, centered */
.time-overlay-text {
    font-size: 10px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    text-shadow:
        -1px -1px 1px rgba(0, 0, 0, 0.7),
        1px -1px 1px rgba(0, 0, 0, 0.7),
        -1px 1px 1px rgba(0, 0, 0, 0.7),
        1px 1px 1px rgba(0, 0, 0, 0.7),
        0 0 3px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    letter-spacing: 0.3px;
    text-align: center;
}

/* Pause button - left side, matches combined bar height */
.time-overlay-pause-btn {
    background: rgba(70, 70, 70, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    width: 27px;
    height: 27px;  /* day bar (14) + gap (3) + season bar (10) */
    cursor: pointer;
    transition: background 0.15s ease;
    color: rgb(255, 255, 255);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
}

.time-overlay-pause-btn:hover {
    background: rgba(90, 90, 90, 0.8);
}

.time-overlay-pause-btn.active {
    background: rgba(100, 180, 100, 0.8);
}

/* Emergency recall button — right side of time overlay, mirrors pause button */
.time-overlay-recall-btn {
    background: rgba(160, 40, 40, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    width: 27px;
    height: 27px;  /* day bar (14) + gap (3) + season bar (10) */
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
    color: rgb(255, 255, 255);
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
}

.time-overlay-recall-btn:hover {
    background: rgba(200, 50, 50, 0.9);
}

.time-overlay-recall-btn:active {
    background: rgba(220, 60, 60, 1.0);
}

.time-overlay-recall-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}
