/* ============================================
   THIEF SIMULATOR - PHOTOREAL ENHANCED EDITION
   Master Stylesheet
   ============================================ */

/* CSS Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --color-bg-dark: #0a0a0f;
    --color-bg-medium: #151520;
    --color-bg-light: #1e1e2e;
    --color-primary: #f59e0b;
    --color-primary-dark: #d97706;
    --color-primary-glow: rgba(245, 158, 11, 0.4);
    --color-secondary: #64748b;
    --color-danger: #ef4444;
    --color-success: #22c55e;
    --color-warning: #eab308;
    --color-text: #e2e8f0;
    --color-text-dim: #94a3b8;
    --color-text-dark: #475569;
    
    /* Gradients */
    --gradient-gold: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
    --gradient-dark: linear-gradient(180deg, #1e1e2e 0%, #0a0a0f 100%);
    --gradient-steel: linear-gradient(135deg, #475569 0%, #334155 50%, #1e293b 100%);
    
    /* Shadows */
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-hard: 0 8px 32px rgba(0, 0, 0, 0.8);
    --shadow-glow: 0 0 30px var(--color-primary-glow);
    
    /* Typography */
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-display: Georgia, 'Times New Roman', serif;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--color-bg-dark);
    font-family: var(--font-main);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Game Container */
#game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
    background: var(--color-bg-dark);
}

/* Screen System */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    z-index: 10;
}

/* Full Screen SVG */
.full-screen-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Loading Screen */
#loading-screen {
    background: var(--gradient-dark);
    z-index: 100;
}

.loading-content {
    text-align: center;
    z-index: 10;
}

.loading-title {
    font-size: 4rem;
    font-weight: 900;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    letter-spacing: 0.2em;
    margin-bottom: 0.5rem;
    animation: pulse 2s ease-in-out infinite;
}

.loading-subtitle {
    font-size: 1.2rem;
    color: var(--color-secondary);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: 3rem;
}

.loading-bar {
    width: 400px;
    height: 6px;
    background: var(--color-bg-light);
    border-radius: 3px;
    overflow: hidden;
    margin: 0 auto 1rem;
}

.loading-progress {
    height: 100%;
    width: 0%;
    background: var(--gradient-gold);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.loading-text {
    color: var(--color-text-dim);
    font-size: 0.9rem;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Screen Header */
.screen-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, transparent 100%);
    z-index: 50;
}

.screen-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 0.1em;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--gradient-steel);
    color: var(--color-text);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--gradient-gold);
    color: #000;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    box-shadow: 0 0 40px var(--color-primary-glow);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.btn-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #000;
}

.btn-back {
    background: transparent;
    border: 2px solid var(--color-secondary);
    color: var(--color-text-dim);
}

.btn-back:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
}

/* Toggle Button */
.toggle-btn {
    padding: 0.5rem 1.5rem;
    background: var(--color-bg-light);
    border: 2px solid var(--color-secondary);
    border-radius: 20px;
    color: var(--color-text-dim);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.toggle-btn.active {
    background: var(--color-success);
    border-color: var(--color-success);
    color: #000;
}

/* Difficulty Buttons */
.difficulty-btns {
    display: flex;
    gap: 0.5rem;
}

.diff-btn {
    padding: 0.5rem 1rem;
    background: var(--color-bg-light);
    border: 2px solid var(--color-secondary);
    border-radius: 6px;
    color: var(--color-text-dim);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.diff-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #000;
}

.diff-btn:hover:not(.active) {
    border-color: var(--color-primary);
}

/* Modal System */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--color-bg-medium);
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-hard);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--color-primary);
    font-size: 1.8rem;
    letter-spacing: 0.1em;
}

.modal-large {
    max-width: 700px;
}

/* Settings Rows */
.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.setting-row:last-of-type {
    border-bottom: none;
    margin-bottom: 1.5rem;
}

.setting-row label {
    font-size: 1.1rem;
    color: var(--color-text);
}

/* How To Play Pages */
.howto-pages {
    min-height: 300px;
    margin-bottom: 1.5rem;
}

.howto-page {
    display: none;
}

.howto-page.active {
    display: block;
}

.howto-page h3 {
    color: var(--color-primary);
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.howto-page p {
    color: var(--color-text-dim);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.howto-page ul {
    list-style: none;
    padding-left: 0;
}

.howto-page li {
    color: var(--color-text-dim);
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.howto-page li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--color-primary);
}

.howto-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-indicator {
    color: var(--color-text-dim);
}

/* House Selection Grid */
.house-grid-container {
    flex: 1;
    width: 100%;
    padding: 5rem 2rem 2rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.house-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
}

.house-card {
    background: var(--color-bg-medium);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.house-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.house-card-preview {
    height: 400px;
    background: var(--color-bg-dark);
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}

.house-card-preview svg {
    width: 100%;
    height: 100%;
}

.house-card-info {
    padding: 1rem;
}

.house-card-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.house-card-address {
    font-size: 0.9rem;
    color: var(--color-text-dim);
    margin-bottom: 0.75rem;
}

.house-card-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.house-stat {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--color-text-dim);
}

.house-stat-icon {
    width: 16px;
    height: 16px;
}

.house-stat.has-alarm {
    color: var(--color-danger);
}

.house-stat.has-camera {
    color: var(--color-warning);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, transparent 100%);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

.page-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--color-bg-light);
    border: 2px solid var(--color-secondary);
    color: var(--color-text);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 600;
}

.page-btn:hover, .page-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #000;
}

/* Game HUD */
.game-hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    pointer-events: none;
}

.game-hud .hud-taskbar,
.game-hud .hud-top-right,
.game-hud .hud-center > *,
.game-hud .hud-right {
    pointer-events: auto;
}

.hud-center {
    pointer-events: none;
}

/* Taskbar at bottom */
.hud-taskbar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.9) 100%);
    border-top: 2px solid #c9a227;
    padding: 0 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    pointer-events: auto;
    z-index: 10;
    box-sizing: border-box;
}

.taskbar-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.taskbar-left {
    flex: 0 0 auto;
}

.taskbar-center {
    flex: 1 1 auto;
    justify-content: center;
}

.taskbar-right {
    flex: 0 0 auto;
    justify-content: flex-end;
}


.hud-top-right {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
    z-index: 10;
}

.hud-center {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 15;
}

.player-hub {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(201, 162, 39, 0.5);
    border-radius: 6px;
    padding: 0.5rem;
    min-width: 160px;
}

.hub-title {
    font-size: 0.7rem;
    font-weight: bold;
    color: #c9a227;
    margin-bottom: 0.4rem;
    text-align: center;
    border-bottom: 1px solid rgba(201, 162, 39, 0.3);
    padding-bottom: 0.25rem;
}

.player-tools {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
    justify-content: center;
}

.tool-item {
    font-size: 1.3rem;
    background: rgba(100, 100, 100, 0.3);
    padding: 0.4rem;
    border-radius: 4px;
    border: 2px solid #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-item:hover {
    background: rgba(150, 150, 150, 0.4);
    border-color: #888;
    transform: scale(1.1);
}

.tool-item.selected {
    background: rgba(201, 162, 39, 0.4);
    border-color: #c9a227;
    box-shadow: 0 0 10px rgba(201, 162, 39, 0.5);
}

.player-equipment {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.stolen-items-hub {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(201, 162, 39, 0.6);
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    min-width: 150px;
    text-align: center;
}

.stolen-items-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.stolen-items-count .count-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #c9a227;
    text-shadow: 0 0 10px rgba(201, 162, 39, 0.5);
    line-height: 1;
}

.stolen-items-count .count-label {
    font-size: 0.75rem;
    color: #a0a0a0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* SVG Inventory Items in top-left */
.inventory-items-svg {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-width: 320px;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.25rem;
    scrollbar-width: thin;
    scrollbar-color: #c9a227 rgba(0, 0, 0, 0.3);
}

.inventory-svg-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(201, 162, 39, 0.4);
    border-radius: 6px;
    padding: 0.25rem;
    width: 70px;
    transition: all 0.2s ease;
}

.inventory-svg-item:hover {
    background: rgba(201, 162, 39, 0.2);
    border-color: #c9a227;
    transform: scale(1.05);
}

.inventory-svg-item svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.inv-item-name {
    font-size: 0.6rem;
    color: #fff;
    text-align: center;
    margin-top: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 65px;
}

.inventory-items-svg::-webkit-scrollbar {
    width: 6px;
}

.inventory-items-svg::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.inventory-items-svg::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #c9a227, #a08020);
    border-radius: 3px;
}

.equipment-item {
    font-size: 1.3rem;
    background: rgba(201, 162, 39, 0.2);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    border: 1px solid #c9a227;
}

.shop-item-icon {
    width: 32px;
    height: 32px;
    background: var(--color-bg-light);
    border-radius: 6px;
    border: 1px solid var(--color-secondary);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0.25rem;
}

.shop-item-icon svg {
    width: 24px;
    height: 24px;
}

/* Stealth Meter */
.stealth-meter {
    width: 160px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    padding: 0.4rem;
    border: 1px solid rgba(201, 162, 39, 0.5);
}

.stealth-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.4rem;
    font-size: 0.75rem;
}

.stealth-bar {
    height: 8px;
    background: var(--color-bg-dark);
    border-radius: 4px;
    overflow: hidden;
}

.stealth-fill {
    height: 100%;
    background: var(--color-success);
    transition: width 0.3s ease, background 0.3s ease;
}

.stealth-fill.caution {
    background: var(--color-warning);
}

.stealth-fill.danger {
    background: var(--color-danger);
}

/* Alert Level */
.alert-level {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    border: 1px solid rgba(201, 162, 39, 0.5);
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
}

.alert-level.level-0 { color: var(--color-success); }
.alert-level.level-1 { color: #84cc16; }
.alert-level.level-2 { color: var(--color-warning); }
.alert-level.level-3 { color: #f97316; }
.alert-level.level-4 { color: var(--color-danger); animation: flash 0.5s infinite; }

@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Police Timer */
.police-timer {
    background: rgba(239, 68, 68, 0.9);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    animation: flash 0.5s infinite;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

/* Room Indicator */
.room-indicator {
    background: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    pointer-events: auto;
}

.room-name {
    font-weight: 600;
}

.room-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--color-bg-light);
    border: 1px solid var(--color-secondary);
    color: var(--color-text);
    cursor: pointer;
    transition: all var(--transition-fast);
    pointer-events: auto;
}

.room-nav-btn:hover:not(:disabled) {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #000;
}

.room-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Inventory Display */
.inventory-display {
    background: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 300px;
}

.inventory-title {
    font-size: 0.85rem;
    color: var(--color-text-dim);
    margin-bottom: 0.5rem;
}

.inventory-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-height: 120px;
    overflow-y: auto;
}

.inventory-item {
    background: var(--color-bg-light);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Tools Display */
.tools-display {
    background: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tool-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    font-size: 0.9rem;
}

.tool-count {
    color: var(--color-primary);
    font-weight: 600;
}

/* Break-in UI */
.breakin-ui {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
    z-index: 50;
}

/* Shop UI */
.shop-ui {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.85);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 50;
}

.shop-title {
    font-size: 1.5rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
    text-align: center;
}

.shop-balance {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.shop-balance span {
    color: var(--color-success);
    font-weight: 700;
}

.shop-section {
    margin-bottom: 1.5rem;
}

.shop-section-title {
    font-size: 1rem;
    color: var(--color-text-dim);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.shop-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--color-bg-light);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.shop-item-info h4 {
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.shop-item-info p {
    font-size: 0.85rem;
    color: var(--color-text-dim);
}

.shop-item-price {
    color: var(--color-primary);
    font-weight: 600;
}

.shop-item-owned {
    color: var(--color-success);
    font-size: 0.85rem;
}

/* Court UI */
.court-ui {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 600px;
    width: 90%;
    max-height: 60vh;
    overflow-y: auto;
    z-index: 50;
    padding-right: 1rem;
}

.court-ui::-webkit-scrollbar {
    width: 12px;
}

.court-ui::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
}

.court-ui::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #c9a227, #a08020);
    border-radius: 6px;
    border: 2px solid rgba(0, 0, 0, 0.3);
}

.court-ui::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #d9b237, #b09030);
}

.court-dialog {
    text-align: center;
    margin-bottom: 1.5rem;
}

.court-speaker {
    color: var(--color-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.court-text {
    font-size: 1.1rem;
    line-height: 1.6;
}

.court-choices {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Result Screen */
.result-content {
    background: var(--color-bg-medium);
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 600px;
    width: 90%;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
}

.result-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.result-title.success {
    color: var(--color-success);
}

.result-title.failure {
    color: var(--color-danger);
}

.result-subtitle {
    color: var(--color-text-dim);
    margin-bottom: 2rem;
}

.result-stats {
    text-align: left;
    margin-bottom: 2rem;
}

.result-stat {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.result-stat:last-child {
    border-bottom: none;
}

.result-stat-value {
    color: var(--color-primary);
    font-weight: 600;
}

.result-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Notification System */
#notification-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.notification {
    background: var(--color-bg-medium);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    border-left: 4px solid var(--color-primary);
    box-shadow: var(--shadow-hard);
    animation: slideIn 0.3s ease;
    max-width: 350px;
}

.notification.success {
    border-left-color: var(--color-success);
}

.notification.error {
    border-left-color: var(--color-danger);
}

.notification.warning {
    border-left-color: var(--color-warning);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--color-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-primary {
    color: var(--color-primary);
}

.text-success {
    color: var(--color-success);
}

.text-danger {
    color: var(--color-danger);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Responsive Adjustments */
@media (max-width: 768px) {
    .loading-title {
        font-size: 2.5rem;
    }
    
    .loading-bar {
        width: 280px;
    }
    
    .house-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        padding: 1.5rem;
    }
    
    .shop-ui {
        right: 1rem;
        left: 1rem;
        transform: none;
        top: auto;
        bottom: 1rem;
        max-height: 50vh;
    }
    
    .result-content {
        padding: 1.5rem;
    }
    
    .result-title {
        font-size: 2rem;
    }
}

/* ===== ENHANCED PAWN SHOP STYLES ===== */
.shop-title {
    font-family: 'Georgia', serif;
    font-size: 2rem;
    color: var(--color-primary);
    text-align: center;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
}

.shop-balance {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.money-value {
    color: var(--color-success);
    font-weight: bold;
    font-size: 1.4rem;
}

.shop-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.shop-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-dim);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.loot-list {
    max-height: 150px;
    overflow-y: auto;
    margin-bottom: 0.75rem;
}

.loot-list-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    margin-bottom: 0.25rem;
}

.item-value {
    color: var(--color-success);
    font-weight: 600;
}

.loot-total {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--color-success);
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.total-value {
    color: var(--color-success);
    font-weight: bold;
    font-size: 1.2rem;
}

.no-loot {
    color: var(--color-text-dim);
    text-align: center;
    padding: 1rem;
    font-style: italic;
}

.tool-shop-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tool-shop-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.tool-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tool-name {
    font-weight: 600;
    color: var(--color-text);
}

.tool-desc {
    font-size: 0.8rem;
    color: var(--color-text-dim);
}

.btn-large {
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* ===== COURT STYLES ===== */
.court-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.court-title {
    font-family: 'Georgia', serif;
    font-size: 2rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.court-charge {
    color: var(--color-danger);
    font-size: 1rem;
}

.court-dialog {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.judge-speech {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.speaker {
    font-weight: bold;
    color: var(--color-primary);
    font-size: 0.9rem;
}

.court-stats {
    margin-bottom: 1rem;
}

.win-chance {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.win-chance .good {
    color: var(--color-success);
    font-weight: bold;
}

.win-chance .bad {
    color: var(--color-danger);
    font-weight: bold;
}

.court-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.court-options .btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.court-options small {
    font-size: 0.75rem;
    opacity: 0.8;
}

.verdict-display {
    text-align: center;
    padding: 2rem;
}

.verdict-display h1 {
    margin-bottom: 1rem;
}

.verdict-display p {
    font-size: 1.2rem;
    color: var(--color-text-dim);
    margin-bottom: 0.5rem;
}

/* ===== NOTIFICATION ENHANCEMENTS ===== */
.notification {
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* ===== LOOT ITEM HOVER ===== */
.loot-item {
    transition: transform 0.2s ease;
}

.loot-item:hover {
    transform: scale(1.1);
}

/* ===== GAME HUD ENHANCEMENTS ===== */
.police-timer {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-family: monospace;
    font-size: 1.2rem;
    font-weight: bold;
    animation: pulse 1s ease infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.inventory-items {
    max-height: 200px;
    overflow-y: auto;
}

.inventory-item {
    padding: 0.4rem 0.6rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
}

/* ===== ATTORNEY SELECTION STYLES ===== */
.attorney-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.attorney-card {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--color-primary);
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.attorney-card:hover:not(.disabled) {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
}

.attorney-card.disabled {
    opacity: 0.5;
    border-color: #555;
}

.attorney-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.attorney-desc {
    font-size: 0.9rem;
    color: var(--color-text-dim);
    margin-bottom: 1rem;
}

.attorney-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.attorney-stat {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.stat-value {
    font-weight: bold;
}

.stat-value.good {
    color: var(--color-success);
}

.stat-value.bad {
    color: var(--color-danger);
}

.court-balance {
    text-align: center;
    font-size: 1.4rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(26, 26, 32, 0.9), rgba(42, 42, 48, 0.9));
    border: 2px solid #c9a227;
    border-radius: 8px;
    font-weight: bold;
}

.money-value {
    color: #22c55e;
    font-size: 1.6rem;
    text-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

/* ===== COURT DIALOG STYLES ===== */
.court-dialog-box {
    background: rgba(0, 0, 0, 0.4);
    border-left: 4px solid var(--color-primary);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.dialog-speaker {
    font-weight: bold;
    color: var(--color-primary);
    font-size: 1rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dialog-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--color-text);
    font-style: italic;
}

.court-subtitle {
    color: var(--color-text-dim);
    font-size: 1rem;
    margin-top: 0.5rem;
}

.court-charge-detail {
    color: var(--color-danger);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

/* ===== EVIDENCE STYLES ===== */
.evidence-list {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--color-danger);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.evidence-list h3 {
    color: var(--color-danger);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.evidence-item {
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.defense-summary {
    background: rgba(34, 197, 94, 0.1);
    border: 2px solid var(--color-success);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.defense-summary h4 {
    color: var(--color-success);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.defense-summary p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

/* ===== VERDICT STYLES ===== */
.verdict-box {
    border-left-color: var(--color-primary);
    border-width: 6px;
}

.verdict-result {
    text-align: center;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.verdict-result.not-guilty {
    background: rgba(34, 197, 94, 0.2);
    border: 3px solid var(--color-success);
}

.verdict-result.guilty {
    background: rgba(239, 68, 68, 0.2);
    border: 3px solid var(--color-danger);
}

.verdict-result.guilty {
    color: #ef4444;
    animation: verdictPulse 0.5s ease-in-out;
}

.verdict-result h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: verdictPulse 0.5s ease;
}

@keyframes verdictPulse {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.fine-amount {
    text-align: center;
    font-size: 1.5rem;
    padding: 1rem;
    background: rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* Safe Cracking UI */
.safe-cracking-ui {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background: rgba(10, 10, 15, 0.95);
    border: 3px solid #c9a227;
    border-radius: 8px;
    padding: 2rem;
    min-width: 500px;
    box-shadow: 0 0 30px rgba(201, 162, 39, 0.3);
}

.safe-panel h3 {
    color: #c9a227;
    text-align: center;
    margin: 0 0 1rem 0;
    font-size: 1.8rem;
}

.safe-panel p {
    color: #e0e0e0;
    text-align: center;
    margin-bottom: 1.5rem;
}

.safe-methods {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.safe-method-btn,
.safe-method-locked {
    flex: 1;
    padding: 1.5rem;
    background: rgba(30, 30, 40, 0.8);
    border: 2px solid #4a4a55;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.safe-method-btn:hover {
    background: rgba(40, 40, 50, 0.9);
    border-color: #c9a227;
    transform: translateY(-2px);
}

.safe-method-locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.method-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.method-name {
    color: #e0e0e0;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.method-chance {
    color: #22c55e;
    font-size: 1rem;
}

.method-desc {
    color: #888;
    font-size: 0.9rem;
}

#safe-cancel {
    width: 100%;
    margin-top: 1rem;
}

/* Player Money Display */
.hud-top-right {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 100;
}

.player-money {
    background: linear-gradient(135deg, #1a1a20, #2a2a30);
    border: 2px solid #c9a227;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: #22c55e;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    text-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

.screen-money-display {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #1a1a20, #2a2a30);
    border: 2px solid #c9a227;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: #22c55e;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    text-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
    z-index: 1000;
}

.money-icon {
    margin-right: 0.5rem;
}

.house-select-money {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #1a1a20, #2a2a30);
    border: 2px solid #c9a227;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: #22c55e;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    text-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
    z-index: 1000;
}

/* Shop Modal */
.shop-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.shop-modal-content {
    background: linear-gradient(135deg, #1a1a20, #2a2a30);
    border: 2px solid #c9a227;
    border-radius: 12px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #c9a227;
}

.shop-header h2 {
    margin: 0;
    color: #c9a227;
}

.btn-close {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
}

.shop-balance {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.shop-balance .money-value {
    color: #22c55e;
    font-weight: bold;
}

.shop-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.shop-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #c9a227;
    border-radius: 8px;
}

.shop-item-icon {
    flex-shrink: 0;
}

.shop-item-info h3 {
    margin: 0 0 0.5rem 0;
    color: #c9a227;
}

.shop-item-info p {
    margin: 0 0 0.5rem 0;
    color: #aaa;
    font-size: 0.9rem;
}

.shop-item-price {
    color: #22c55e;
    font-weight: bold;
    font-size: 1.2rem;
}

.shop-item button {
    min-width: 100px;
}

/* House selection scrollbar */
.house-grid {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 1rem;
}

.house-grid::-webkit-scrollbar {
    width: 12px;
}

.house-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
}

.house-grid::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #c9a227, #a08020);
    border-radius: 6px;
    border: 2px solid rgba(0, 0, 0, 0.3);
}

.house-grid::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #d9b237, #b09030);
}
