:root {
    --bg-color: #1a1a1a;
    --text-color: #33ff33;
    /* Classic terminal green */
    --accent-color: #ff3333;
    --border-color: #33ff33;
    --font-pixel: 'Press Start 2P', cursive;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-pixel);
    font-size: 12px;
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-container {
    width: 98vw;
    max-width: 1400px;
    height: 98vh;
    border: 4px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    background-color: #000;
    position: relative;
    box-shadow: 0 0 20px rgba(51, 255, 51, 0.2);
}

/* Header */
.game-header {
    border-bottom: 2px dashed var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.stats-bar {
    display: flex;
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Main Display */
.main-display {
    flex: 1;
    border: 2px solid var(--border-color);
    padding: 10px;
    overflow-y: auto;
    margin-bottom: 10px;
    background-color: #0a0a0a;
    position: relative;
}

.system-msg {
    color: #888;
}

.event-text {
    margin-top: 10px;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px dotted var(--border-color);
}

/* Actions */
.action-area {
    display: flex;
    border: 2px solid var(--text-color);
    margin-bottom: 20px;
    overflow: hidden;
}

.action-area .pixel-btn {
    flex: 1;
    border: none;
    border-right: 2px solid var(--text-color);
    padding: 15px;
    background-color: #000;
    border-radius: 0;
}

.action-area .pixel-btn:last-child {
    border-right: none;
}

.pixel-btn {
    background-color: #000;
    color: var(--text-color);
    border: 2px solid var(--text-color);
    padding: 10px 20px;
    font-family: var(--font-pixel);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.1s;
    text-transform: uppercase;
}

.pixel-btn:hover {
    background-color: var(--text-color);
    color: #000;
}

.pixel-btn:active {
    transform: translateY(2px);
}

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

/* Footer */
.game-footer {
    min-height: 280px;
    border-top: 2px dashed var(--border-color);
    padding-top: 15px;
    display: flex;
    gap: 20px;
}

.footer-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px dashed var(--border-color);
    padding-right: 10px;
}

.footer-right {
    flex: 3;
    display: flex;
    flex-direction: column;
}

.section-title {
    margin-bottom: 8px;
    font-size: 14px;
    color: #888;
    text-decoration: underline;
}

.sub-section-title {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.backpack-container {
    display: flex;
    gap: 15px;
    flex: 1;
}

.backpack-sub-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    overflow-y: auto;
    flex: 1;
    max-height: 220px;
    align-content: start;
}

.item-card {
    border: 1px solid #444;
    padding: 6px;
    font-size: 12px;
    text-align: center;
    cursor: pointer;
    background-color: #050505;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-all;
}

.item-card.equipped {
    border-color: #ff3333;
    box-shadow: 0 0 8px rgba(255, 51, 51, 0.4);
    background-color: #200;
}

.item-card:hover {
    border-color: var(--text-color);
    background-color: #111;
    box-shadow: 0 0 8px rgba(51, 255, 51, 0.3);
}

.talent-item {
    font-size: 12px;
    padding: 6px 0;
    border-bottom: 1px solid #222;
}

/* Start Screen Overlay */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.big-btn {
    font-size: 18px;
    padding: 15px 40px;
}

.game-title {
    font-size: 24px;
    color: var(--text-color);
    margin-bottom: 20px;
    text-shadow: 0 0 10px var(--text-color);
}

.hidden {
    display: none;
}

/* Scanline Effect */
.scanline::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(to bottom,
            rgba(18, 16, 16, 0) 50%,
            rgba(0, 0, 0, 0.25) 50%);
    background-size: 100% 4px;
    z-index: 2;
    pointer-events: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: var(--text-color);
    border: 1px solid #000;
}