/* Modern, mobile-friendly Drug Wars theme */

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #121212;
    color: #e0e0e0;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

#game-container {
    width: 100%;
    max-width: 540px;
    background-color: #1a1a1a;
    padding: 16px;
    border: 2px solid #333;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.1);
}

header {
    text-align: center;
    border-bottom: 1px solid #444;
    padding-bottom: 12px;
    margin-bottom: 20px;
}

h1 {
    color: #39ff14;
    margin: 0;
    letter-spacing: 5px;
    font-size: 1.8em;
}

#stats {
    font-size: 1.1em;
    margin-top: 10px;
    color: #fff;
    font-weight: 600;
}

#status-bar {
    font-size: 1em;
    color: #ccc;
    margin-top: 6px;
}

#bust-chance-bar {
    font-size: 1em;
    color: #ff6644;
    margin-top: 6px;
    font-weight: bold;
}

#game-screen {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#message-log {
    height: 100px;
    overflow-y: auto;
    border: 1px solid #444;
    padding: 10px;
    font-size: 0.95em;
    background: #0a0a0a;
    line-height: 1.4;
}

.log-bad { color: #ff6b6b; }
.log-good { color: #51cf66; }
.log-event { color: #fcc419; }

section {
    border: 1px solid #333;
    padding: 12px;
    background: #222;
}

h2 {
    color: #39ff14;
    font-size: 1.2em;
    margin-top: 0;
    text-decoration: underline;
    margin-bottom: 10px;
}

.shop-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 8px 6px;
    text-align: left;
    border-bottom: 1px solid #333;
}

th {
    color: #39ff14;
    font-weight: bold;
}

.qty-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

.qty-input {
    width: 45px;
    background: #111;
    color: #fff;
    border: 1px solid #555;
    padding: 4px 6px;
    text-align: center;
    font-family: inherit;
    font-size: 1em;
}

button {
    background: #2d2d2d;
    color: #fff;
    border: 1px solid #555;
    padding: 8px 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95em;
    font-weight: 600;
}

button:hover {
    background: #39ff14;
    color: #000;
    border-color: #39ff14;
}

button:disabled {
    border-color: #444;
    color: #555;
    cursor: not-allowed;
    background: #222;
}

/* Max/All buttons get a slightly different look */
.buy-max-btn,
.sell-all-btn {
    font-weight: bold;
    background: #1a1a1a;
    border-color: #777;
    color: #ddd;
    padding: 8px 8px;
    font-size: 0.9em;
}

.buy-max-btn:hover:not(:disabled) {
    background: #ffaa00;
    border-color: #ffaa00;
    color: #000;
}

.sell-all-btn:hover:not(:disabled) {
    background: #51cf66;
    border-color: #51cf66;
    color: #000;
}

#inventory-list, #city-buttons {
    list-style: none;
    padding: 0;
    margin: 0;
}

#inventory-list li {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #333;
}

#city-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

footer {
    margin-top: 20px;
    text-align: center;
}

#restart-btn {
    width: 100%;
    padding: 12px;
    font-weight: bold;
    font-size: 1em;
    background: #39ff14;
    color: #000;
    border: none;
}

.save-controls {
    margin-top: 20px;
    text-align: center;
    display: flex;
    gap: 8px;
    justify-content: center;
}

.save-controls button {
    flex: 1;
    max-width: 140px;
    padding: 10px;
}

#end-screen {
    display: none;
    text-align: center;
    padding: 15px 0;
}

#end-screen h2 {
    font-size: 1.4em;
    text-decoration: none;
    color: #39ff14;
}

#end-stats {
    margin: 10px 0;
    line-height: 1.8;
    color: #ccc;
}

#end-rank {
    font-size: 1.2em;
    color: #fcc419;
    margin-top: 8px;
}

/* === Loan Shark Dialog === */
.ls-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 999;
}

.ls-panel {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: #222;
    border: 2px solid #fcc419;
    padding: 20px;
    z-index: 1000;
    min-width: 300px;
    max-width: 90vw;
    text-align: center;
}

.ls-panel h3 {
    margin-top: 0;
    color: #fcc419;
}

.ls-panel p {
    margin: 6px 0;
    font-size: 0.95em;
    color: #ddd;
}

.ls-action-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 10px 0;
}

.ls-action-group input[type="number"] {
    width: 70px;
    background: #111;
    color: #fff;
    border: 1px solid #555;
    padding: 6px;
    font-family: inherit;
    text-align: center;
}

.ls-warning {
    color: #ff6b6b;
    margin-top: 10px;
}

/* Scrollbar */
#message-log::-webkit-scrollbar { width: 6px; }
#message-log::-webkit-scrollbar-track { background: #111; }
#message-log::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
#message-log::-webkit-scrollbar-thumb:hover { background: #555; }

/* === Rumor Banner === */
#rumor-banner {
    font-size: 0.9em;
    color: #fcc419;
    margin-top: 6px;
    animation: glow-rumor 2s infinite;
}

@keyframes glow-rumor {
    0%, 100% { text-shadow: 0 0 4px rgba(255, 170, 0, 0.3); }
    50% { text-shadow: 0 0 12px rgba(255, 170, 0, 0.8); }
}

/* === Trend Arrows === */
.trend {
    font-size: 0.85em;
    margin-left: 6px;
}

.trend.up { color: #51cf66; }
.trend.down { color: #ff6b6b; }

/* === Price Highlighting === */
.price-floor {
    background: rgba(81, 207, 102, 0.15);
}

.price-ceiling {
    background: rgba(255, 170, 0, 0.15);
}

/* === Unavailable Products === */
.product-unavailable {
    opacity: 0.5;
}

.product-unavailable td {
    text-decoration: line-through;
}

/* === Rumor City Button === */
.rumor-city {
    border-color: #fcc419 !important;
    color: #fcc419 !important;
    animation: glow-rumor 2s infinite;
}

.rumor-city:hover {
    background: #fcc419 !important;
    color: #000 !important;
}
