/* Silicon Tycoon - Base Vanilla/Modern Theme */

:root {
    /* Modern Color Palette */
    --primary: #4A90E2;           /* Calm Blue */
    --primary-dark: #2E5C8A;      /* Dark Blue */
    --primary-light: #7FB3E8;     /* Light Blue */
    --secondary: #50C878;         /* Emerald Green */
    --secondary-dark: #3A9B5C;    /* Dark Green */
    --accent: #FF6B6B;            /* Coral Red */
    --gold: #F5A623;              /* Orange Gold */
    --black: #1A1A1A;             /* Near Black */
    --text: #333333;              /* Dark Gray */
    --text-light: #666666;        /* Medium Gray */
    --bg: #FFFFFF;                /* White */
    --bg-secondary: #F5F5F5;      /* Light Gray */
    --border: #DDDDDD;            /* Border Gray */

    /* Compatibility aliases for theme components */
    --teal-primary: var(--primary);
    --teal-dark: var(--primary-dark);
    --teal-light: var(--primary-light);
    --magenta-primary: var(--secondary);
    --magenta-dark: var(--secondary-dark);
    --magenta-light: var(--accent);
    --cream: var(--text);
    --dark-bg: var(--bg-secondary);
    --panel-bg: var(--bg-secondary);

    /* Semantic text/bg vars used across new pages */
    --text-muted: #888888;
    --text-primary: #333333;
    --bg-dark: #F0F0F0;

    /* Typography */
    --font-display: 'Poiret One', cursive;
    --font-body: 'Montserrat', sans-serif;
}

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

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 20px;
}

/* ==================== HEADER ==================== */

.art-deco-header {
    text-align: center;
    padding: 30px 0;
    position: relative;
}

/* Compact header on inner pages (no game title) */
.art-deco-header:not(.full-header) .subtitle {
    margin-top: 8px;
    margin-bottom: 8px;
}

.header-decoration {
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--primary) 20%,
        var(--secondary) 50%,
        var(--primary) 80%,
        transparent 100%);
    margin: 10px auto;
    max-width: 600px;
}

.header-decoration.top,
.header-decoration.bottom {
    clip-path: none;
}

.game-title {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 400;
    letter-spacing: 0.3em;
    color: var(--primary);
    margin-bottom: 10px;
    animation: none;
}

.subtitle {
    font-family: var(--font-body);
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    color: var(--text-light);
    text-transform: uppercase;
    margin-top: 20px;
}

/* ==================== NAVIGATION ==================== */

.screen-navigation {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.nav-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 20px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-width: 120px;
    clip-path: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-button::before {
    display: none;
}

.nav-button:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 4px 8px rgba(74, 144, 226, 0.2);
}

.nav-button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 8px rgba(74, 144, 226, 0.3);
}

.nav-button.active .nav-label {
    color: white;
}

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

.nav-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.nav-label {
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    transition: color 0.3s ease;
}

/* ==================== MAIN CONTENT ==================== */

.main-content {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    margin: 30px 0;
}

/* ==================== CONTROL PANEL ==================== */

.control-panel {
    position: relative;
}

.panel-frame {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 25px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    clip-path: none;
}

.panel-header {
    margin: 25px 0 20px 0;
    text-align: center;
}

.panel-header:first-child {
    margin-top: 0;
}

.panel-header h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    letter-spacing: 0.2em;
    color: var(--primary);
    margin: 10px 0;
}

.chevron-divider {
    height: 1px;
    background: var(--border);
    margin: 10px 0;
}

.chevron-divider::before,
.chevron-divider::after {
    display: none;
}

/* ==================== THEME UTILITY CLASSES ==================== */

.beefy-border-panel,
.beefy-border-canvas,
.beefy-border-stats,
.beefy-border-button {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chevron-corners-xlarge,
.chevron-corners-large,
.chevron-corners-medium,
.chevron-corners-button,
.chevron-corners-small {
    clip-path: none;
    border-radius: 8px;
}

.border-glow-animated::before {
    display: none;
}

.themed-panel-bg {
    background: var(--bg);
}

/* Scanline effect - disabled for vanilla */
body::after {
    display: none;
}

/* ==================== FORM CONTROLS ==================== */

.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    margin-bottom: 8px;
}

.maturity-value {
    float: right;
    color: var(--secondary);
    font-weight: 700;
}

.art-deco-select,
.art-deco-input {
    width: 100%;
    padding: 12px 15px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    clip-path: none;
}

.art-deco-select:focus,
.art-deco-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.art-deco-select option {
    background: var(--bg);
    color: var(--text);
}

/* Slider Styling */
.slider-container {
    position: relative;
    padding: 10px 0;
}

.art-deco-slider {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    position: relative;
}

.art-deco-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    clip-path: none;
}

.art-deco-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    clip-path: none;
}

/* Button Styling */
.art-deco-button {
    width: 100%;
    padding: 15px;
    background: var(--primary);
    border: none;
    border-radius: 6px;
    color: white;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    text-shadow: none;
    clip-path: none;
}

.art-deco-button::before,
.art-deco-button::after {
    display: none;
}

.art-deco-button:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
    text-shadow: none;
}

.art-deco-button:active {
    transform: translateY(0);
}

.art-deco-button.secondary {
    background: var(--bg-secondary);
    color: var(--text);
    border: 2px solid var(--border);
}

.art-deco-button.secondary:hover {
    background: var(--border);
    border-color: var(--primary);
}

.art-deco-button.primary {
    background: var(--primary);
    color: white;
}

/* ==================== CANVAS AREA ==================== */

.canvas-area {
    position: relative;
}

.canvas-frame {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 8px;
    min-height: 700px;
    height: 700px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    clip-path: none;
}

#pixi-container {
    width: 100%;
    height: 100%;
}

#pixi-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* ==================== STATS PANEL ==================== */

.stats-panel {
    margin-top: 30px;
}

.stats-frame {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 25px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    clip-path: none;
}

.stat-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: var(--bg-secondary);
    border-left: 4px solid var(--primary);
    border-radius: 4px;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-light);
    margin-bottom: 8px;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    font-family: var(--font-display);
}

/* Yield Breakdown */
.yield-breakdown {
    margin-top: 20px;
}

.yield-breakdown h4 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    letter-spacing: 0.2em;
    color: var(--primary);
    text-align: center;
    margin: 10px 0;
}

.yield-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.yield-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.color-indicator {
    width: 20px;
    height: 20px;
    border: 2px solid var(--text);
    border-radius: 4px;
    clip-path: none;
}

.color-indicator.perfect {
    background: #00FF00;
    box-shadow: none;
}

.color-indicator.diminished {
    background: #FFFF00;
    box-shadow: none;
}

.color-indicator.damaged {
    background: #FFA500;
    box-shadow: none;
}

.color-indicator.unusable {
    background: #FF0000;
    box-shadow: none;
}

.yield-label {
    font-weight: 600;
    color: var(--text);
    flex: 1;
}

.yield-count {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

.yield-percent {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ==================== THEME SWITCHER BUTTON ==================== */

.theme-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--primary);
    border: 2px solid var(--primary-dark);
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    clip-path: none;
}

.theme-switcher:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .game-title {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    .game-title {
        font-size: 2rem;
        letter-spacing: 0.2em;
    }

    .subtitle {
        font-size: 1rem;
        letter-spacing: 0.2em;
    }

    .panel-header h3 {
        font-size: 1.4rem;
    }

    .control-group label {
        font-size: 1rem;
    }

    .art-deco-select,
    .art-deco-input {
        font-size: 1.1rem;
        padding: 14px 16px;
    }

    .art-deco-button {
        font-size: 1.1rem;
        padding: 16px;
        min-height: 50px;
    }

    .stat-label {
        font-size: 1rem;
    }

    .stat-value {
        font-size: 2.2rem;
    }

    .yield-breakdown h4 {
        font-size: 1.2rem;
    }

    .yield-label {
        font-size: 1rem;
    }

    .yield-count {
        font-size: 1.2rem;
    }

    .yield-percent {
        font-size: 1rem;
    }

    .screen-navigation {
        gap: 10px;
        margin-top: 20px;
    }

    .nav-button {
        padding: 12px 14px;
        min-width: 100px;
        min-height: 48px;
        gap: 6px;
    }

    .nav-icon {
        font-size: 1.6rem;
    }

    .nav-label {
        font-size: 0.75rem;
        letter-spacing: 0.1em;
    }

    .theme-switcher {
        width: 56px;
        height: 56px;
        font-size: 1.8rem;
    }

    .art-deco-slider::-webkit-slider-thumb {
        width: 32px;
        height: 32px;
    }

    .art-deco-slider::-moz-range-thumb {
        width: 32px;
        height: 32px;
    }

    .stat-group {
        grid-template-columns: 1fr;
    }

    .yield-categories {
        grid-template-columns: 1fr;
    }

    .canvas-frame {
        min-height: 500px;
        height: 500px;
    }

    .container {
        padding: 10px;
    }

    .main-content {
        gap: 20px;
    }

    .panel-frame {
        padding: 15px;
    }

    .control-panel {
        max-height: none;
    }

    .art-deco-select {
        -webkit-appearance: none;
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234A90E2' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        padding-right: 40px;
    }
}

/* ==========================================
   BATCH LIBRARY MODAL
   ========================================== */

.batch-library-modal {
    max-width: 800px;
    max-height: 80vh;
    width: 90%;
}

.batch-library-modal .modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: 60vh;
}

.library-controls {
    margin-bottom: 20px;
}

.library-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.library-item {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    padding: 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.library-item:hover {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.item-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--primary);
    font-family: var(--font-display);
    letter-spacing: 0.05em;
}

.item-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-family: var(--font-body);
}

.action-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg);
}

.delete-btn:hover {
    background: #e74c3c;
    border-color: #e74c3c;
}

.item-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.detail-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.detail-value {
    color: var(--text);
    font-size: 0.9rem;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state p {
    margin: 0;
}

/* ===== Foundry Market Styles ===== */

.foundry-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    padding: 20px;
    overflow-y: auto;
    max-height: 600px;
}

/* Responsive grid adjustments */
@media (max-width: 1400px) {
    .foundry-list {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 900px) {
    .foundry-list {
        grid-template-columns: 1fr;
    }
}

.foundry-card {
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 400px;
}

.foundry-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.4);
}

.foundry-list > p {
    grid-column: 1 / -1;
    text-align: center;
    color: #888;
    padding: 60px 20px;
    font-size: 1.1em;
}

.foundry-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}

.foundry-card-header h3 {
    margin: 0;
    font-size: 1.4em;
    color: var(--primary);
}

.tier-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: bold;
    letter-spacing: 0.05em;
}

.foundry-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.foundry-card-body > p {
    margin-bottom: auto;
}

.foundry-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85em;
}

.stat-value {
    color: var(--text);
    font-weight: 600;
    font-size: 0.9em;
}

.pricing-section {
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 255, 255, 0.05);
    border-radius: 4px;
    border: 1px solid rgba(0, 255, 255, 0.2);
}

.select-foundry-btn {
    width: 100%;
    margin-top: 15px;
}

.contracts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 500px;
    overflow-y: auto;
    padding: 10px;
}

.contract-card {
    padding: 12px;
    background: rgba(0, 255, 255, 0.05);
    border-radius: 4px;
    border: 1px solid var(--primary);
    transition: all 0.2s ease;
}

.contract-card:hover {
    background: rgba(0, 255, 255, 0.1);
    border-color: var(--accent);
}

.contract-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.95em;
}

.inventory-card {
    padding: 10px 12px;
    background: rgba(0, 206, 209, 0.04);
    border-radius: 4px;
    border: 1px solid rgba(0, 206, 209, 0.3);
    transition: background 0.2s;
}

.inventory-card:hover {
    background: rgba(0, 206, 209, 0.09);
}

.inv-name {
    font-size: 0.88em;
    font-weight: 600;
    color: var(--cream, #F5F5DC);
    margin-bottom: 2px;
}

.inv-meta {
    font-size: 0.75em;
    color: var(--teal-dark, #888);
    margin-bottom: 4px;
}

.inv-qty {
    font-size: 1.0em;
    color: var(--teal-primary, #00FFFF);
    font-weight: 700;
    margin-bottom: 3px;
}

.inv-price {
    font-size: 0.82em;
    margin-bottom: 2px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}

.summary-row strong {
    color: var(--text-muted);
    font-weight: 600;
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-dialog {
    background: var(--bg);
    border: 3px solid var(--primary);
    border-radius: 8px;
    padding: 0;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 40px rgba(0, 206, 209, 0.4);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid var(--primary);
    background: rgba(0, 255, 255, 0.05);
}

.modal-header h2 {
    margin: 0;
    color: var(--primary);
    font-size: 1.5em;
}

.modal-close {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 2em;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    color: #ff0000;
    transform: scale(1.2);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

/* ==================== VANILLA OVERRIDES FOR ARCHITECTURE.CSS ==================== */
/* architecture.css uses hardcoded dark/deco styles. Override them here for vanilla. */

/* Die library search & filter inputs */
.search-input,
.filter-select {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
    border-radius: 4px;
}
.search-input:focus,
.filter-select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(74,144,226,0.15);
}

/* Die cards — remove chamfered clip-path, use clean card style */
.die-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    clip-path: none;
}
.die-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(74,144,226,0.15);
    transform: translateY(-3px);
}
.die-card-title   { color: var(--text); }
.die-card-type    { color: var(--primary); }
.die-stat-label   { color: var(--text-light); }
.die-stat-value   { color: var(--text); }
.icon-btn         { color: var(--text-light); }
.icon-btn:hover   { color: var(--primary); transform: scale(1.1); }

/* Modal dialog — remove clip-path & dark gradient */
.modal-dialog {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    clip-path: none;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.modal-header {
    border-bottom-color: var(--border);
}
.modal-header h3 {
    color: var(--text);
    font-family: var(--font-body);
}
.modal-footer {
    border-top-color: var(--border);
}
.modal-close       { color: var(--text-light); }
.modal-close:hover { color: var(--accent); }
.form-group label  { color: var(--text-light); }

/* Form info bar */
.form-info {
    background: var(--bg-secondary);
    border-left-color: var(--primary);
    color: var(--text);
    border-radius: 0 4px 4px 0;
}
.form-info strong { color: var(--primary); }

/* Component palette items */
.component-item {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text);
    border-radius: 4px;
}
.component-item:hover {
    border-color: var(--primary);
    background: var(--bg);
    transform: none;
    box-shadow: 0 2px 6px rgba(74,144,226,0.12);
}
.component-item.selected {
    background: rgba(74,144,226,0.12);
    border-color: var(--primary);
    transform: none;
}

/* Designer canvas area */
.designer-canvas-area {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

/* Canvas toolbar */
.canvas-toolbar {
    background: var(--bg);
    border-bottom-color: var(--border);
}
.tool-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
}
.tool-btn:hover {
    border-color: var(--primary);
    background: var(--bg);
    transform: none;
    box-shadow: 0 1px 4px rgba(74,144,226,0.2);
}
.tool-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.toolbar-divider { background: var(--border); }
.zoom-level      { color: var(--primary); }

/* Snap select dropdown */
.snap-select {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
}
.snap-select:hover,
.snap-select:focus { border-color: var(--primary); outline: none; }

/* Properties panel scrollbar */
.properties-content::-webkit-scrollbar-track { background: var(--bg-secondary); }
.properties-content::-webkit-scrollbar-thumb { background: var(--border); }
.properties-content::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* Palette & panel section headers */
.palette-header h4,
.panel-header h4 {
    color: var(--primary);
    font-family: var(--font-body);
    letter-spacing: 0.05em;
    font-weight: 700;
}

/* Architecture button variants */
.art-deco-button.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.art-deco-button.primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}
.art-deco-button.secondary {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text);
}
.art-deco-button.secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Mobile sticky modal header/footer & designer actions */
@media (max-width: 768px) {
    .modal-header { background: var(--bg) !important; }
    .modal-footer { background: var(--bg) !important; }
    .designer-actions { background: var(--bg) !important; }
}

/* Responsive layout for foundry market */
@media (max-width: 1200px) {
    .foundry-list {
        max-height: 500px;
    }

    .contracts-list {
        max-height: 400px;
    }
}

/* ── Utility theme-aware color classes ─────────────────────────────────── */
.text-teal    { color: var(--teal-primary, #00CED1); }
.text-gold    { color: var(--gold, #FFD700); }
.text-muted   { color: var(--teal-dark, #888); }
.text-cream   { color: var(--cream, #F5F5DC); }
.text-danger  { color: var(--accent, #ff4444); }
.text-success { color: var(--secondary, #00FF00); }

/* Tier badge classes */
.tier-badge-premium   { background: var(--gold, #FFD700);    color: #000; padding: 2px 8px; border-radius: 3px; font-size: 0.8em; }
.tier-badge-midrange  { background: #C0C0C0;                  color: #000; padding: 2px 8px; border-radius: 3px; font-size: 0.8em; }
.tier-badge-budget    { background: #CD7F32;                  color: #000; padding: 2px 8px; border-radius: 3px; font-size: 0.8em; }
.tier-badge-specialty { background: var(--magenta-primary, #9370DB); color: #000; padding: 2px 8px; border-radius: 3px; font-size: 0.8em; }

/* Status badge classes */
.status-badge { padding: 2px 5px; border-radius: 3px; font-size: 0.68em; font-weight: bold; color: #000; }
.status-pending   { background: var(--gold, #FFD700); }
.status-active    { background: var(--secondary, #00CC66); }
.status-completed { background: var(--teal-primary, #00CED1); }
.status-cancelled { background: var(--accent, #FF4444); }

/* Pricing highlight */
.price-teal  { color: var(--teal-primary, #00CED1); font-weight: bold; }
.price-gold  { color: var(--gold, #FFD700); font-weight: bold; }
.price-warn  { color: var(--gold, #FFD700); }
.price-ok    { color: var(--teal-dark, #aaa); }
.price-danger { color: var(--accent, #ff4444); }

/* Era selection card */
.era-card {
    text-align: left;
    padding: 14px 18px;
    background: rgba(0, 206, 209, 0.05);
    border: 1px solid rgba(0, 206, 209, 0.3);
    color: var(--cream, #ccc);
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s;
    width: 100%;
}
.era-card.era-card-hover,
.era-card:hover {
    background: rgba(0, 206, 209, 0.12);
    border-color: var(--teal-primary, #00CED1);
}

/* ── Game HUD — fixed top ribbon ───────────────────────────────────────── */
#game-hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 36px;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: rgba(0, 0, 0, 0.94);
    border-bottom: 1px solid var(--teal-dark, #0a4a4a);
    font-family: var(--font-body);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    backdrop-filter: blur(4px);
}

.hud-left,
.hud-right {
    display: flex;
    align-items: center;
    gap: 7px;
}

.hud-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
}

.hud-advance-btn {
    background: transparent;
    border: 1px solid var(--teal-dark, #1a4a4a);
    color: var(--teal-primary, #00CED1);
    font-family: var(--font-display, 'Poiret One'), sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    padding: 4px 14px;
    cursor: pointer;
    clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.hud-advance-btn:hover {
    background: var(--teal-dark, #1a4a4a);
    border-color: var(--teal-primary, #00CED1);
    color: var(--gold, #FFD700);
}

.hud-advance-btn:active,
.hud-advance-flash {
    background: var(--teal-primary, #00CED1) !important;
    color: #000 !important;
}

.hud-label {
    color: var(--teal-dark, #0a6a6a);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

#hud-date {
    color: var(--teal-light, #20B2AA);
    font-weight: 500;
}

#hud-balance {
    font-family: var(--font-display, monospace);
    font-size: 1.0rem;
    font-weight: 600;
    color: var(--teal-primary, #00CED1);
    letter-spacing: 0.04em;
    transition: color 0.3s;
}

.hud-sep {
    color: var(--teal-dark, #0a4a4a);
    margin: 0 4px;
}

/* Vanilla theme overrides */
body.theme-vanilla #game-hud {
    background: rgba(245, 245, 245, 0.97);
    border-bottom: 1px solid var(--border, #DDD);
}
body.theme-vanilla .hud-label { color: var(--text-light); }
body.theme-vanilla #hud-date  { color: var(--primary-dark); }
body.theme-vanilla #hud-balance { color: var(--primary); }

/* Vanilla: gold → dark amber so it's readable on white/light backgrounds */
body.theme-vanilla { --gold: #B8720A; }
body.theme-vanilla .text-gold  { color: #B8720A; }
body.theme-vanilla .price-gold { color: #B8720A; }
body.theme-vanilla .price-warn { color: #B8720A; }

/* ── Wafer Inspector Modal ─────────────────────────────────────────────────── */
.wafer-inspector-dialog {
    width: 92vw;
    max-width: 1400px;
    height: 88vh;
    max-height: 900px;
    display: flex;
    flex-direction: column;
    background: var(--bg-dark, #0d0d0d);
    border: 2px solid var(--teal-primary, #00CED1);
    overflow: hidden;
}

.wi-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 0;
}

.wi-sidebar {
    width: 220px;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(0, 206, 209, 0.25);
    background: rgba(0, 206, 209, 0.03);
    overflow: hidden;
}

.wi-sidebar-header {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(0, 206, 209, 0.2);
    text-align: center;
}

.wi-wafer-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.wi-wafer-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 0.78em;
    border-left: 3px solid transparent;
}

.wi-wafer-item:hover {
    background: rgba(0, 206, 209, 0.08);
}

.wi-wafer-item.selected {
    background: rgba(0, 206, 209, 0.12);
    border-left-color: var(--teal-primary, #00CED1);
}

.wi-wafer-num {
    font-family: var(--font-mono, monospace);
    color: var(--cream, #F5F5DC);
    min-width: 42px;
    font-size: 0.85em;
}

.wi-yield-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.wi-yield-fill {
    display: block;
    height: 100%;
    background: var(--secondary, #00CC66);
    border-radius: 3px;
    transition: width 0.2s;
}

.wi-yield-pct {
    min-width: 38px;
    text-align: right;
    color: var(--teal-primary, #00CED1);
    font-size: 0.85em;
}

.wi-aggregate-stats {
    padding: 10px 12px 12px;
    border-top: 1px solid rgba(0, 206, 209, 0.2);
    font-size: 0.82em;
}

.wi-aggregate-stats .yield-item {
    padding: 2px 0;
}

.wi-empty {
    padding: 20px;
    text-align: center;
    color: #888;
    font-size: 0.85em;
}

.wi-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.wi-canvas {
    flex: 1;
    min-height: 300px;
    overflow: hidden;
}

.wi-canvas canvas {
    width: 100% !important;
    height: 100% !important;
}

.wi-wafer-stats {
    padding: 10px 16px 12px;
    border-top: 1px solid rgba(0, 206, 209, 0.2);
    background: rgba(0, 206, 209, 0.03);
    font-size: 0.82em;
}

.wi-wafer-stats .yield-item {
    padding: 2px 0;
}

/* VIEW WAFERS button in contract/inventory cards */
.view-wafers-btn {
    margin-top: 5px;
    width: 100%;
    padding: 3px;
    background: transparent;
    border: 1px solid var(--teal-primary, #00CED1);
    color: var(--teal-primary, #00CED1);
    cursor: pointer;
    font-size: 0.72em;
    border-radius: 2px;
    letter-spacing: 0.05em;
    transition: background 0.15s, color 0.15s;
}

.view-wafers-btn:hover {
    background: rgba(0, 206, 209, 0.15);
}
