:root {
    --window-bg: #c0c0c0;
    --text-color: #000;
    --border-light: #ffffff;
    --border-dark: #808080;
    --border-darker: #404040;
    --button-face: #c0c0c0;
    --title-bar-bg: #000080;
    --title-text: #ffffff;
}

html {
    overflow: hidden;
}

body {
    background: #008080;
    margin: 0;
    padding: 0;
    font-family: 'MS Sans Serif', Arial, sans-serif;
    font-size: 14px;
    min-height: 100vh;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    overflow: hidden;
    font-feature-settings: "liga" 0, "kern" 0, "calt" 0;
    font-variant-ligatures: none;
    -webkit-font-feature-settings: "liga" 0, "kern" 0, "calt" 0;
    -moz-font-feature-settings: "liga" 0, "kern" 0, "calt" 0;
    -ms-font-feature-settings: "liga" 0, "kern" 0, "calt" 0;
}

/* Windows 98 Desktop Background Elements */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        url('images/background-sideleft.png'),
        url('images/background-bottomleft.png'),
        url('images/background-bottomright.jpg');
    background-position: 
        top left,
        bottom left,
        bottom right;
    background-repeat: no-repeat;
    z-index: -1;
}

/* Windows 98 Taskbar */
.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 26px;
    background-color: #C0C0C0;
    z-index: 9999;
    display: block !important;
    border-top: 2px solid #ffffff;
}

/* Ensure content stays above the taskbar */
.window {
    margin-bottom: 30px;
    width: 600px;
    background: #c0c0c0;
    border: 1px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    box-shadow: 1px 1px 0 #000000;
    margin: 10px auto 0 !important;
    position: relative;
    padding: 1px;
    user-select: none;
}

.taskbar::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 316px;
    height: 100%;
    background-image: url('images/background-bottomleft.png');
    background-repeat: no-repeat;
    background-position: bottom left;
    z-index: 2;
}

.taskbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 200px;
    height: 100%;
    background-image: url('images/background-bottomright.jpg');
    background-repeat: no-repeat;
    background-position: bottom right;
    z-index: 2;
}

.taskbar-top {
    height: 2px;
    background: #C0C0C0;
}

.taskbar-main {
    display: flex;
    height: 24px;
    background-color: #C0C0C0;
}

.taskbar-start {
    width: 316px;
    height: 100%;
    background-image: url('images/background-bottomleft.png');
    background-repeat: no-repeat;
    background-position: bottom left;
}

.taskbar-middle {
    flex: 1;
    height: 100%;
    background-color: #C0C0C0;
}

.taskbar-end {
    width: 200px;
    height: 100%;
    background-image: url('images/background-bottomright.jpg');
    background-repeat: no-repeat;
    background-position: bottom right -1px;
}

.window::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 1px solid;
    border-color: #dfdfdf #404040 #404040 #dfdfdf;
    pointer-events: none;
}

.title-bar {
    background: #000080;
    color: white;
    padding: 3px 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 18px;
    margin: 2px 2px 3px 2px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.title {
    font-weight: bold;
    font-size: 14px;
    margin: 0 3px;
    font-family: 'MS Sans Serif', Arial, sans-serif;
}

.title-buttons {
    display: flex;
    gap: 2px;
    margin-right: 2px;
}

.title-buttons button {
    width: 18px;
    height: 16px;
    font-size: 16px;
    line-height: 14px;
    text-align: center;
    padding: 0;
    color: black;
    background: #c0c0c0;
    border: 1px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    min-width: unset;
    display: flex;
    align-items: center;
    justify-content: center;
}

.title-buttons button.close {
    align-items: flex-start;
    justify-content: flex-end;
    padding: 0px 0.5px 2px 0;
    font-size: 20px;
    font-weight: 200;
    font-family: "Segoe UI", Tahoma, sans-serif;
    font-stretch: ultra-condensed;
    margin-left: 2px;
    line-height: 12px;
    width: 18px;
    height: 16px;
    color: black;
    background: #c0c0c0;
    border: 1px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    min-width: unset;
    display: flex;
}

.title-buttons button.maximize {
    align-items: center;
    justify-content: center;
    padding: 0;
}

.title-buttons button.maximize img {
    width: 11px;
    height: 11px;
    display: block;
    padding-top: 1px;
}

.title-buttons button.minimize {
    align-items: flex-start;
    padding-top: 1px;
    line-height: 10px;
    font-size: 13px;
    font-weight: bold;
}

/* Windows-specific adjustments */
.windows-os .title-buttons button.close,
.windows-os .dialog-close {
    font-size: 25px !important;
    line-height: 10px !important;
    padding: 0 !important;
}

.content {
    padding: 4px;
}

.main-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 8px;
    margin: 0 4px 8px 4px;
    align-items: start;
}

.left-column, .right-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
}

.location-section {
    border: 1px solid #808080;
    padding: 4px;
    background: #c0c0c0;
    display: flex;
    flex-direction: column;
    height: fit-content;
}

.location-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    margin-top: 4px;
}

.action-row {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 0;
    padding-top: 6px;
    padding-bottom: 6px;
}

.control-row {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    margin-top: -7px;
    padding-top: 8px;
    padding-bottom: 5px;
}

.prices {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-top: -2px;
    padding-top: 6px;
}

.inventory {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-top: 0;
    padding-top: 1px;
}

.prices table, .inventory table {
    flex: 1;
    margin-top: 0;
}

.header {
    margin-bottom: 2px;
    font-weight: normal;
}

/* Stats Section */
.stats {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 2px;
    margin-bottom: 6px;
}

.stat-line {
    display: flex;
    align-items: center;
    height: 30px;
    background: #000000;
    padding: 3px;
    margin-bottom: 6px;
    width: calc(100% + 3px);
    box-sizing: border-box;
}

.stat-line label {
    width: 60px;
    color: #ffffff;
    margin-left: 4px;
    margin-right: 4px;
}

.digital-display {
    display: flex;
    align-items: stretch;
    gap: 2px;
    height: 100%;
    padding: 1px;
    background: #1a1a1a;
    width: 100%;
    box-sizing: border-box;
    font-family: 'PixelOperator8', monospace !important;
    font-size: 22px !important;
    letter-spacing: 0 !important;
    line-height: 1 !important;
}

.label-box, .digit-box, .empty-space {
    color: inherit;
    width: 15px;
    min-width: 15px;
    max-width: 15px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'PixelOperator8', monospace !important;
    font-size: 22px !important;
    letter-spacing: 0 !important;
    line-height: 1 !important;
    padding: 2px 0 0 0;
    box-sizing: border-box;
    flex: 1;
}

.label-box.colon {
    font-weight: 900;
}

.empty-space {
    color: transparent;
}

.digit-box {
    /* No special styles - inherits from base class */
}

.green .digit-box, .green .label-box, .green .empty-space { 
    background: #003800;
    color: #00ff00;
}

.red .digit-box, .red .label-box, .red .empty-space { 
    background: #401818;
    color: #ff0000;
}

.yellow .digit-box, .yellow .label-box, .yellow .empty-space { 
    background: #282800;
    color: #ffff00;
}

.health-line {
    display: flex;
    align-items: center;
    height: 24px;
    background: #c0c0c0;
    padding: 7px;
    position: relative;
    top: 8px;
}

.health-line label {
    width: 60px;
    margin-left: 4px;
}

.health-bar {
    flex: 1;
    height: 20px;
    background: #ff0000;
    border: 1px solid #000000;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffff00;
    font-size: 15px;
    font-family: 'MS Sans Serif', Arial, sans-serif;
    overflow: hidden;
}

.health-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #0000a8;
    transition: width 0.3s ease;
}

.health-text {
    position: relative;
    z-index: 1;
    text-shadow: 1px 1px 0 #000;
}

/* Location Section */
.location-text {
    margin-bottom: 4px;
    font-weight: normal;
}

.location-btn {
    height: 36px;
    padding: 4px 6px;
    text-align: center;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #ffffff #808080 #404040 #dfdfdf;
    color: black;
    font-family: 'MS Sans Serif', Arial, sans-serif;
    font-size: 14px;
    cursor: pointer;
}

.location-btn:active {
    border-color: #404040 #dfdfdf #dfdfdf #404040;
    padding: 5px 5px 3px 7px;
}

.location-btn.current {
    background-color: #c0c0c0;
    color: #808080;
    cursor: default;
    text-shadow: 1px 1px 0 #ffffff;
    pointer-events: none;
}

.location-btn.current:active {
    border-color: #ffffff #808080 #404040 #dfdfdf;
    padding: 4px 6px;
    text-shadow: 1px 1px 0 #ffffff;
}

/* Action Buttons */
.action-btn {
    width: 88px;
    height: 32px;
    padding: 0;
}

.action-btn:disabled {
    background: #c0c0c0;
    color: #808080;
    text-shadow: 1px 1px 0 #fff;
    cursor: default;
    pointer-events: none;
}

.action-btn:disabled:active {
    border-color: #ffffff #808080 #808080 #ffffff;
    padding: 2px 6px;
    text-shadow: 1px 1px 0 #ffffff;
}

/* Market Section */
.market-section {
    display: flex;
    gap: 6px;
    padding: 2px;
}

/* Common table styles */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 2px solid;
    border-color: #808080 #ffffff #ffffff #808080;
    box-shadow: inset 1px 1px #808080, inset -1px -1px #ffffff;
    margin: 2px;
}

th {
    padding: 3px 5px;
    height: 16px;
    line-height: 16px;
    background: #c0c0c0;
    text-align: left;
    font-weight: normal;
    border: 1px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
}

td {
    padding: 3px 5px;
    height: 16px;
    line-height: 16px;
    border: none;
    box-sizing: border-box;
}

tr {
    height: 16px;
    line-height: 16px;
}

/* Price Table Specific */
.price-table {
    table-layout: fixed;
}

.price-table th:first-child { width: 70%; }
.price-table th:last-child { width: 30%; }

.price-table tr {
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.price-table td {
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.price-table tr:empty td {
    height: 16px;
    line-height: 16px;
    content: " ";
}

/* Inventory Table Specific */
.inventory-table {
    table-layout: fixed;
}

.inventory-table th:first-child { width: 50%; }
.inventory-table th:nth-child(2) { width: 20%; }
.inventory-table th:last-child { width: 30%; }

.inventory-table tr {
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.inventory-table td {
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inventory-table tr:empty td {
    height: 16px;
    line-height: 16px;
    content: " ";
}

.inventory-table tr.selected, .price-table tr.selected {
    background-color: #0000a8;
    color: white;
}

/* Control Row */
.control-btn {
    width: 98px;
    height: 32px;
    padding: 0;
}

/* Global Button Style */
button {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #ffffff #808080 #404040 #dfdfdf;
    color: black;
    font-family: 'MS Sans Serif', Arial, sans-serif;
    font-size: 14px;
    padding: 2px 6px;
    cursor: pointer;
    min-width: 90px;
    position: relative;
}

button:active {
    border-color: #404040 #dfdfdf #dfdfdf #404040;
    padding: 3px 5px 1px 7px;
}

button:not(.current):not(:disabled):active::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border: 1px dotted black;
}

button:disabled {
    background: #c0c0c0;
    color: #808080;
    text-shadow: 1px 1px 0 #fff;
    cursor: default;
    pointer-events: none;
}

button:disabled:hover {
    background: #c0c0c0;
    color: #808080;
    text-shadow: 1px 1px 0 #fff;
    cursor: default;
    pointer-events: none;
}

/* Dialog Windows */
.dialog {
    position: fixed;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #c0c0c0;
    border: 1px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    box-shadow: 1px 1px 0 #000000;
    width: 470px;
    z-index: 1000;
    padding: 1px;
}

.dialog::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 1px solid;
    border-color: #dfdfdf #404040 #404040 #dfdfdf;
    pointer-events: none;
}

.dialog-title-bar {
    background: #000080;
    color: white;
    padding: 3px 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 18px;
    margin: 2px 2px 3px 2px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.dialog-title {
    font-weight: bold;
    font-size: 14px;
    margin: 0 3px;
    font-family: 'MS Sans Serif', Arial, sans-serif !important;
}

.dialog-close {
    width: 18px;
    height: 16px;
    font-size: 20px;
    font-weight: 200;
    font-family: "Segoe UI", Tahoma, sans-serif;
    font-stretch: ultra-condensed;
    line-height: 12px;
    text-align: center;
    padding: 0px 0.5px 2px 0;
    color: black;
    background: #c0c0c0;
    border: 1px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    min-width: unset;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    margin-left: 2px;
}

.dialog-close:active {
    border-color: #808080 #ffffff #ffffff #808080;
    padding: 1px 0px 1px 1px;
}

.dialog-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-family: 'MS Sans Serif', Arial, sans-serif !important;
}

.dialog-main-content {
    border: 1px solid #808080;
    padding: 12px;
    margin-right: 95px;
    font-family: 'MS Sans Serif', Arial, sans-serif !important;
}

.dialog-message {
    margin-bottom: 12px;
    line-height: 1.4;
    font-family: 'MS Sans Serif', Arial, sans-serif !important;
}

.dialog-input-row {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    font-family: 'MS Sans Serif', Arial, sans-serif !important;
}

.dialog-input {
    background: white;
    border: 1px solid;
    border-color: #808080 #ffffff #ffffff #808080;
    padding: 3px 5px;
    width: 130px;
    font-family: 'MS Sans Serif', Arial, sans-serif !important;
    font-size: 14px;
    color: black;
    cursor: default;
    box-shadow: inset 1px 1px #808080, inset -1px -1px #ffffff;
}

.dialog-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: absolute;
    right: 5px;
    top: calc(50% + 10px);
    transform: translateY(-50%);
    padding-left: 10px;
    background: #c0c0c0;
}

.dialog-button {
    width: 75px;
    height: 28px;
    padding: 0;
}

/* Stats Section */
.stats-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 12px;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-label {
    width: 45px;
    font-family: 'MS Sans Serif', Arial, sans-serif;
    text-transform: capitalize;
}

.stat-value {
    display: flex;
    gap: 1px;
    padding: 2px;
    background: #000;
    border: 2px solid;
    border-color: var(--border-dark) var(--border-light) var(--border-light) var(--border-dark);
}

.health-container {
    grid-column: span 2;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.health-label {
    width: 45px;
    font-family: 'MS Sans Serif', Arial, sans-serif;
    text-transform: capitalize;
}

/* Location Section */
.location-label {
    margin-bottom: 6px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 4px;
    margin: 12px 0;
}

.action-btn {
    padding: 3px 12px;
}

/* Market Container */
.market-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 12px 0;
}

.section-label, .trenchcoat-space {
    margin-bottom: 4px;
    font-family: 'MS Sans Serif', Arial, sans-serif;
}

.drug-list table {
    width: 100%;
    border: 2px solid;
    border-color: var(--border-dark) var(--border-light) var(--border-light) var(--border-dark);
    background: #fff;
    border-collapse: collapse;
}

.drug-list th, .drug-list td {
    padding: 2px 4px;
    border: 1px solid var(--border-dark);
    text-align: left;
    font-family: 'MS Sans Serif', Arial, sans-serif;
}

.drug-list tr.selected {
    background-color: #000080;
    color: #fff;
}

.drug-list tr.unavailable {
    color: #808080;
    font-style: italic;
}

/* Bottom Buttons */
.bottom-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 12px;
}

.control-btn {
    padding: 3px 12px;
}

/* Dialog Styling */
.finance-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.finance-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
}

/* Event Dialog */
.event-dialog {
    text-align: center;
    padding: 12px;
    font-family: 'MS Sans Serif', Arial, sans-serif;
}

.event-dialog img {
    margin-bottom: 8px;
}

.event-dialog .health-bar {
    margin: 8px 0;
}

.event-dialog .action-buttons {
    justify-content: center;
}

.event-dialog .dialog-main-content,
.event-dialog .dialog-content,
.event-dialog .dialog-message {
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.event-dialog .dialog-message {
    margin-bottom: 16px;
}

.event-dialog .dialog-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.event-dialog .dialog-button {
    min-width: 80px;
}

@media (max-width: 600px) {
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .health-bar {
        grid-column: 1;
    }
    
    .drug-lists {
        grid-template-columns: 1fr;
    }
    
    .location-buttons {
        grid-template-columns: 1fr;
    }
}

@font-face {
    font-family: 'MS Sans Serif';
    src: url('fonts/MS Sans Serif/MS Sans Serif.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'MS Sans Serif';
    src: url('fonts/MS Sans Serif/MS Sans Serif Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

/* Add link to Press Start 2P font */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

.menu-bar {
    display: flex;
    padding: 2px;
}

.menu-item {
    position: relative;
    padding: 2px 8px;
    cursor: default;
    font-family: 'MS Sans Serif', Arial, sans-serif;
}

.menu-item:hover {
    background: #000080;
    color: white;
}

.menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #c0c0c0;
    border: 1px solid;
    border-color: #808080 #000000 #000000 #808080;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
    min-width: 150px;
    z-index: 1000;
}

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

.menu-option {
    padding: 4px 20px;
    cursor: default;
    color: black;
    font-family: 'MS Sans Serif', Arial, sans-serif;
}

.menu-option:hover {
    background: #000080;
    color: white;
}

.finances-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
    align-items: center;
    margin-right: 0px;
}

.finance-input {
    background: white;
    border: 1px solid;
    border-color: #808080 #ffffff #ffffff #808080;
    padding: 3px 5px;
    width: 100px;
    font-family: 'MS Sans Serif', Arial, sans-serif !important;
    font-size: 14px !important;
    color: black;
    cursor: default;
    box-shadow: inset 1px 1px #808080, inset -1px -1px #ffffff;
}

.finance-input:read-only {
    background: white;
    font-size: 14px !important;
}

#trenchcoatTable {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 2px solid;
    border-color: #808080 #ffffff #ffffff #808080;
    box-shadow: inset 1px 1px #808080, inset -1px -1px #ffffff;
    margin: 2px;
    table-layout: fixed;
}

#trenchcoatTable tbody {
    display: table-row-group;
}

#trenchcoatTable th {
    background: #c0c0c0;
    text-align: left;
    font-weight: normal;
    border: 1px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    padding: 0 5px;
    height: 20px;
    box-sizing: border-box;
}

#trenchcoatTable td {
    padding: 0 5px;
    height: 20px;
    border: none;
    box-sizing: border-box;
}

#trenchcoatTable tr {
    height: 20px;
    line-height: 20px;
}

#trenchcoatTable tbody tr.selected {
    background-color: #333;
    color: #0f0;
}

#trenchcoatTable tbody tr:not(.empty-row) {
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

#trenchcoatTable tbody tr:not(.empty-row):hover {
    background-color: #000080;
    color: white;
}

#trenchcoatTable tbody tr:not(.empty-row).selected {
    background-color: #333;
    color: #0f0;
}

#trenchcoatTable tbody tr.empty-row {
    cursor: default;
    pointer-events: none;
    background-color: transparent !important;
}

#trenchcoatTable tbody tr.empty-row:hover {
    background-color: transparent !important;
}

#sellDialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #c0c0c0;
    border: 1px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    box-shadow: 1px 1px 0 #000000;
    width: 470px;
    z-index: 1000;
    padding: 1px;
}

#sellDialog::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 1px solid;
    border-color: #dfdfdf #404040 #404040 #dfdfdf;
    pointer-events: none;
}

#sellDialog .dialog-title-bar {
    background: #000080;
    color: white;
    padding: 3px 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 18px;
    margin: 2px 2px 3px 2px;
}

#sellDialog .dialog-close {
    width: 18px;
    height: 16px;
    font-size: 18px;
    font-weight: 200;
    font-family: 'MS Sans Serif', "Segoe UI", Tahoma, sans-serif;
    font-stretch: ultra-condensed;
    line-height: 12px;
    text-align: center;
    padding: 0px 0.5px 0px 0;
    color: black;
    background: #c0c0c0;
    border: 1px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    min-width: unset;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    margin-left: 2px;
}

#sellDialog .dialog-close:active {
    border-color: #808080 #ffffff #ffffff #808080;
    padding: 0px 0.5px 0px 0;
}

#sellDialog .dialog-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-family: 'MS Sans Serif', Arial, sans-serif !important;
}

#sellDialog .dialog-message {
    margin-bottom: 12px;
    line-height: 1.4;
    font-family: 'MS Sans Serif', Arial, sans-serif !important;
}

#sellDialog .dialog-input {
    width: 110px !important;
    height: 21px;
    border: 1px solid #808080;
    background: white;
    padding: 2px 4px;
    font-family: 'MS Sans Serif', Arial, sans-serif !important;
}

#sellDialog .dialog-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: absolute;
    right: 5px;
    top: calc(50% + 10px);
    transform: translateY(-50%);
    padding-left: 10px;
    background: #c0c0c0;
}

#sellDialog .dialog-button {
    width: 75px;
    height: 28px;
    padding: 0;
}

#trenchcoatTable th {
    height: 20px;
    padding: 0 5px;
    background: #c0c0c0;
    text-align: left;
    font-weight: normal;
    border: 1px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
}

#trenchcoatTable th:first-child { width: 50%; }
#trenchcoatTable th:nth-child(2) { width: 20%; }
#trenchcoatTable th:last-child { width: 30%; }

.window.dragging, .window.dragging * {
    cursor: default !important;
}

.dialog.dragging, .dialog.dragging * {
    cursor: default !important;
}

#financesDialog {
    width: 300px;
}

#depositDialog, #withdrawDialog, #payLoanDialog {
    width: 329px;
}

#depositDialog .dialog-main-content,
#withdrawDialog .dialog-main-content,
#payLoanDialog .dialog-main-content {
    border: none;
    padding: 12px;
    margin-right: 0;
}

#depositDialog .dialog-buttons,
#withdrawDialog .dialog-buttons,
#payLoanDialog .dialog-buttons {
    position: static;
    transform: none;
    flex-direction: row;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

#depositDialog .dialog-content,
#withdrawDialog .dialog-content,
#payLoanDialog .dialog-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

#policeDialog .dialog-main-content,
#muggerDialog .dialog-main-content,
#coatDealerDialog .dialog-main-content,
#gunDealerDialog .dialog-main-content,
#friendDialog .dialog-main-content,
#marketEventDialog .dialog-main-content {
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    text-align: center !important;
}

#policeDialog .dialog-message,
#muggerDialog .dialog-message,
#coatDealerDialog .dialog-message,
#gunDealerDialog .dialog-message,
#friendDialog .dialog-message,
#marketEventDialog .dialog-message {
    border: none !important;
    padding: 0 !important;
    margin: 0 0 8px 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-family: 'MS Sans Serif', Arial, sans-serif !important;
    text-align: center !important;
}

#policeDialog .dialog-buttons,
#muggerDialog .dialog-buttons,
#coatDealerDialog .dialog-buttons,
#gunDealerDialog .dialog-buttons,
#friendDialog .dialog-buttons,
#marketEventDialog .dialog-buttons {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    margin-top: 8px !important;
    position: static !important;
    transform: none !important;
    padding: 0 !important;
    background: transparent !important;
    width: 100% !important;
}

#policeDialog .dialog-button,
#muggerDialog .dialog-button,
#coatDealerDialog .dialog-button,
#gunDealerDialog .dialog-button,
#friendDialog .dialog-button,
#marketEventDialog .dialog-button {
    margin: 0 !important;
    min-width: 90px !important;
    height: 32px !important;
    padding: 2px 6px !important;
    background: #c0c0c0 !important;
    border: 2px solid !important;
    border-color: #ffffff #808080 #404040 #dfdfdf !important;
    color: black !important;
    font-family: 'MS Sans Serif', Arial, sans-serif !important;
    font-size: 14px !important;
    cursor: pointer !important;
    position: relative !important;
}

#policeDialog .dialog-button:active,
#muggerDialog .dialog-button:active,
#coatDealerDialog .dialog-button:active,
#gunDealerDialog .dialog-button:active,
#friendDialog .dialog-button:active,
#marketEventDialog .dialog-button:active {
    border-color: #404040 #dfdfdf #dfdfdf #404040 !important;
    padding: 3px 5px 1px 7px !important;
}

#policeDialog .dialog-button:not(.current):not(:disabled):active::after,
#muggerDialog .dialog-button:not(.current):not(:disabled):active::after,
#coatDealerDialog .dialog-button:not(.current):not(:disabled):active::after,
#gunDealerDialog .dialog-button:not(.current):not(:disabled):active::after,
#friendDialog .dialog-button:not(.current):not(:disabled):active::after,
#marketEventDialog .dialog-button:not(.current):not(:disabled):active::after {
    content: '' !important;
    position: absolute !important;
    top: 2px !important;
    left: 2px !important;
    right: 2px !important;
    bottom: 2px !important;
    border: 1px dotted black !important;
}

@font-face {
    font-family: 'PixelOperator8';
    src: url('fonts/Pixel-Operator-8/PixelOperator8.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

#policeDialog .dialog-title,
#muggerDialog .dialog-title,
#coatDealerDialog .dialog-title,
#gunDealerDialog .dialog-title,
#friendDialog .dialog-title,
#marketEventDialog .dialog-title,
#sellDialog .dialog-title,
#financesDialog .dialog-title,
#depositDialog .dialog-title,
#withdrawDialog .dialog-title,
#payLoanDialog .dialog-title {
    font-family: 'MS Sans Serif', Arial, sans-serif !important;
    font-weight: bold !important;
    font-size: 14px !important;
    margin: 0 3px !important;
}

#buyDialog .dialog-input {
    width: 110px !important;
    height: 21px;
    border: 1px solid #808080;
    background: white;
    padding: 2px 4px;
    font-family: 'MS Sans Serif', Arial, sans-serif !important;
}

#policeDialog {
    width: 310px;
    max-width: 310px;
    position: fixed;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #c0c0c0;
    border: 1px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    box-shadow: 1px 1px 0 #000000;
    z-index: 1000;
    padding: 1px;
}

#policeDialog .event-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
}

#policeDialog .health-bar {
    flex: 1;
    height: 20px;
    background: #ff0000;
    border: 1px solid #000000;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffff00;
    font-size: 15px;
    font-family: 'MS Sans Serif', Arial, sans-serif;
    overflow: hidden;
}

#policeDialog .health-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #0000a8;
    transition: width 0.3s ease;
}

#policeDialog .health-text {
    position: relative;
    z-index: 1;
    text-shadow: 1px 1px 0 #000;
}

#policeDialog .police-content {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 8px;
}

#policeDialog .police-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

#policeDialog .dialog-message {
    text-align: left !important;
    margin: 0 !important;
}

#policeDialog .police-health {
    display: flex;
    gap: 8px;
    align-items: center;
    text-align: left;
    width: 100%;
    margin-top: 8px;
    padding-top: 5px;
}

#policeDialog .police-health label {
    text-align: left;
    min-width: 45px;
}

#policeDialog .dialog-button:disabled {
    background: #c0c0c0 !important;
    color: #808080 !important;
    text-shadow: 1px 1px 0 #fff !important;
    cursor: default !important;
    pointer-events: none !important;
    border-color: #ffffff #808080 #808080 #ffffff !important;
}

#policeDialog .dialog-button:disabled:active {
    border-color: #ffffff #808080 #808080 #ffffff !important;
    padding: 2px 6px !important;
    text-shadow: 1px 1px 0 #ffffff !important;
}

#gunDealerDialog {
    width: 360px;
    max-width: 360px;
    position: fixed;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #c0c0c0;
    border: 1px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    box-shadow: 1px 1px 0 #000000;
    z-index: 1000;
    padding: 1px;
}

#friendDialog {
    width: 360px;
}

#muggerDialog {
    width: 360px;
}

.finish-btn {
    width: 100%;
    height: 100%;
    min-height: 140px;
    padding: 20px 0;
    font-size: 24px;
    font-weight: bold;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #ffffff #808080 #404040 #dfdfdf;
    color: black;
    font-family: Arial, sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.finish-btn:active {
    border-color: #404040 #dfdfdf #dfdfdf #404040;
    padding: 9px 7px 7px 9px;
}

.high-scores-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    table-layout: fixed;
    background: white;
    border: 2px solid;
    border-color: #808080 #ffffff #ffffff #808080;
    box-shadow: inset 1px 1px #808080, inset -1px -1px #ffffff;
}

.high-scores-table th:first-child,
.high-scores-table td:first-child { width: 10%; text-align: center; }
.high-scores-table th:nth-child(2),
.high-scores-table td:nth-child(2) { width: 40%; text-align: left; }
.high-scores-table th:nth-child(3),
.high-scores-table td:nth-child(3) { width: 25%; text-align: right; }
.high-scores-table th:last-child,
.high-scores-table td:last-child { width: 25%; text-align: center; }

.high-scores-table th {
    background: #c0c0c0;
    text-align: left;
    font-weight: normal;
    border: 1px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    padding: 0 5px;
    height: 20px;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.high-scores-table td {
    padding: 0 5px;
    height: 20px;
    border: none;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.high-scores-table tr {
    height: 20px;
    line-height: 20px;
}

.high-scores-table tr.empty-row td {
    background: white;
}

#highScoresDialog {
    width: 470px;
    height: 500px;
    top: 42%;
}

#highScoresDialog .dialog-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    height: calc(100% - 50px);
    overflow: hidden;
}

#highScoresDialog .high-scores-table {
    flex: 1;
    margin-bottom: 16px;
    overflow-y: auto;
    display: block;
    width: 100%;
    max-height: calc(100% - 50px);
}

#highScoresDialog .high-scores-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #c0c0c0;
    display: table;
    width: 100%;
}

#highScoresDialog .high-scores-table tbody {
    display: block;
    overflow-y: auto;
    width: 100%;
}

#highScoresDialog .high-scores-table tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

#highScoresDialog .dialog-buttons {
    display: flex;
    justify-content: center;
    margin-top: auto;
    position: static;
    transform: none;
    padding: 0;
    background: transparent;
    width: 100%;
}

#highScoresDialog .dialog-button {
    min-width: 90px;
    height: 32px;
    padding: 2px 6px;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #ffffff #808080 #404040 #dfdfdf;
    color: black;
    font-family: 'MS Sans Serif', Arial, sans-serif;
    font-size: 14px;
    cursor: pointer;
    margin: 0 auto;
}

#scoreSubmission {
    margin-top: 16px;
    padding: 12px;
    background: #c0c0c0;
    border: 1px solid;
    border-color: #808080 #ffffff #ffffff #808080;
}

#scoreSubmission .dialog-message {
    margin-bottom: 12px;
    text-align: center;
    font-weight: bold;
}

#scoreSubmission .dialog-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

#scoreSubmission .dialog-input {
    flex: 1;
    background: white;
    border: 1px solid;
    border-color: #808080 #ffffff #ffffff #808080;
    padding: 2px 4px;
    font-family: 'MS Sans Serif', Arial, sans-serif;
    font-size: 14px;
}

#scoreSubmission .dialog-buttons {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

.dialog-button#submitScore {
    min-width: 126px;
    width: auto;
    padding: 11px 20px;
    height: 45px;
    line-height: 22px;
}

/* Mobile Layout */
@media (max-width: 768px) {
    html {
        overflow: auto;
    }

    body {
        overflow: auto;
        padding-bottom: 40px;
        height: auto;
        min-height: 100vh;
        background: #008080;
    }

    .window {
        width: 100%;
        max-width: 320px;
        height: auto;
        min-height: calc(100vh - 40px);
        margin: 10px auto 30px !important;
        overflow: visible;
        display: flex;
        flex-direction: column;
    }

    .content {
        flex: 1;
        overflow: visible;
        padding: 8px;
        display: flex;
        flex-direction: column;
    }

    .main-grid {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin: 0;
        padding: 0;
        overflow: visible;
    }

    .left-column, .right-column {
        width: 100%;
        overflow: visible;
        display: contents;
    }

    /* Stats and Digital Display */
    .stats {
        order: 1;
        width: 100%;
        max-width: 300px;
        margin: 0 auto 4px;
    }

    /* Locations - Move right after stats */
    .location-section {
        order: 2;
        width: 100%;
        max-width: 300px;
        margin: 4px auto 8px;
    }

    /* Health Bar */
    .health-line {
        order: 3;
        width: 100%;
        max-width: 300px;
        margin: 8px auto;
    }

    /* Available Drugs */
    .prices {
        order: 4;
        width: 100%;
        max-width: 300px;
        margin: 8px auto;
    }

    /* Action Buttons */
    .action-row {
        order: 5;
        width: 100%;
        max-width: 300px;
        margin: 8px auto;
    }

    /* Trenchcoat */
    .inventory {
        order: 6;
        width: 100%;
        max-width: 300px;
        margin: 8px auto;
    }

    /* Control Buttons */
    .control-row {
        order: 7;
        width: 100%;
        max-width: 300px;
        margin: 8px auto;
    }

    /* Adjust spacing between elements */
    .stat-line {
        margin-bottom: 4px;
    }

    .stat-line:last-child {
        margin-bottom: 0;
    }

    .health-line {
        margin-top: 12px;
    }

    /* Table Adjustments */
    .price-table, .inventory-table {
        width: 100%;
        margin: 0;
    }

    .price-table th, .price-table td,
    .inventory-table th, .inventory-table td {
        padding: 0 5px;
        font-size: 13px;
    }

    /* Dialog Adjustments */
    .dialog {
        width: 90% !important;
        max-width: 300px !important;
        top: 42% !important;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .dialog-content {
        padding: 8px;
    }

    .dialog-main-content {
        margin-right: 85px;
    }

    .dialog-buttons {
        right: 8px;
    }

    .dialog-button {
        width: 70px;
        height: 28px;
    }

    /* Taskbar adjustments */
    .taskbar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 26px;
        z-index: 9999;
    }

    .stats, .location-section, .prices, .inventory, .action-row, .control-row {
        width: 90%;
        max-width: 300px;
        margin: 4px auto;
    }

    /* Health Bar */
    .health-line {
        order: 3;
        margin-top: -4px;
        margin-left: -10px;
    }

    .health-bar {
        width: 90%;
    }

    /* Adjust spacing between elements */
    .stat-line {
        margin-bottom: 4px;
    }

    .stat-line:last-child {
        margin-bottom: 0;
    }

    /* Stats and Digital Display */
    .stats {
        order: 1;
        margin-bottom: 2px;
    }

    /* Locations - Move right after stats */
    .location-section {
        order: 2;
        margin-top: 2px;
        margin-bottom: 4px;
    }

    #highScoresDialog {
        width: 90% !important;
        max-width: 300px !important;
        height: auto !important;
        top: 42% !important;
    }

    /* Dialog Adjustments */
    #buyDialog, #sellDialog {
        width: 100% !important;
        max-width: 340px !important;
    }

    #buyDialog .dialog-main-content,
    #sellDialog .dialog-main-content {
        margin-right: 107px;
    }

    #buyDialog .dialog-input-row,
    #sellDialog .dialog-input-row {
        padding-right: 10px;
    }

    .dialog-buttons {
        right: 12px;
    }
} 