:root {
    --primary: #ffd700;
    --ui-bg: rgba(0, 0, 0, 0.85);
    --border: #ffffff;
    --accent: #00ffcc;
}

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

body {
    background-color: #050505;
    color: #fff;
    font-family: 'Press Start 2P', cursive;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* CRT Overlay */
.crt-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 4px, 3px 100%;
    z-index: 1000;
    pointer-events: none;
}

.scanlines {
    position: fixed;
    inset: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%);
    background-size: 100% 2px;
    z-index: 1001;
    pointer-events: none;
    animation: scanline 10s linear infinite;
}

@keyframes scanline {
    0% { transform: translateY(0); }
    100% { transform: translateY(100%); }
}

/* Start Screen */
.start-screen {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.start-screen .logo {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 50px;
    text-shadow: 4px 4px 0 #8b0000;
    animation: pulse 2s infinite;
}

.start-prompt {
    font-size: 12px;
    animation: blink 1s infinite;
    cursor: pointer;
}

.version {
    position: absolute;
    bottom: 20px;
    font-size: 8px;
    color: #444;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Achievement Toast */
#achievement-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.achievement {
    background: #111;
    border: 3px solid var(--primary);
    padding: 15px 20px;
    color: #fff;
    font-size: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 6px 6px 0 #000;
    animation: slideIn 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes slideIn {
    from { transform: translateX(120%); }
    to { transform: translateX(0); }
}

/* Game Container */
.game-container {
    width: 960px;
    height: 640px;
    background: #000;
    position: relative;
    border: 8px solid var(--border);
    box-shadow: 0 0 50px rgba(0,0,0,1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.ui-header {
    height: 60px;
    background: var(--ui-bg);
    border-bottom: 2px solid #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    font-size: 10px;
    z-index: 5;
}

.stats-box { display: flex; align-items: center; gap: 20px; }
.bgm-control {
    background: #000;
    border: 1px solid #fff;
    padding: 4px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Scene & Parallax */
.world-scene {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.scene-background {
    position: absolute;
    top: -10%; left: -10%; width: 120%; height: 120%;
    background-size: cover;
    background-position: center;
    transition: opacity 0.5s ease;
    opacity: 0;
}

#time-filter {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    transition: background 2s ease;
}
.night-mode #time-filter { background: rgba(0, 20, 60, 0.45); }

/* Interactive Object */
.interactive-obj {
    position: absolute;
    top: 40%;
    right: 20%;
    width: 60px;
    height: 60px;
    background: rgba(0, 255, 204, 0.2);
    border: 2px dashed var(--accent);
    cursor: pointer;
    z-index: 4;
}
.interactive-obj:hover { background: rgba(0, 255, 204, 0.4); }
.terminal-spark {
    width: 100%; height: 100%;
    animation: blink 0.2s infinite;
    background: var(--accent);
    opacity: 0.1;
}

/* Character */
.character-bust {
    position: absolute;
    bottom: 120px;
    left: 40px;
    width: 280px;
    height: 280px;
    z-index: 10;
    border: 6px solid var(--primary);
    border-radius: 50%;
    background: #000;
    overflow: hidden;
    perspective: 1000px;
}
.character-bust img { width: 100%; height: 100%; object-fit: cover; }

/* Inventory & Tabs */
.inventory-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
}

.inventory-box {
    width: 500px;
    background: #0a0a0c;
    border: 4px solid #fff;
    padding: 25px;
    box-shadow: 12px 12px 0 var(--primary);
}

.inv-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #222;
    padding-bottom: 10px;
}

.nav-btn {
    background: #000;
    color: #444;
    border: 1px solid #222;
    padding: 8px 15px;
    font-size: 8px;
    cursor: pointer;
    font-family: inherit;
}

.nav-btn.active {
    color: var(--primary);
    border-color: var(--primary);
    background: #111;
}

.guild-item {
    display: block;
    padding: 15px;
    border: 2px solid #222;
    margin-bottom: 10px;
    color: #fff;
    text-decoration: none;
    font-size: 10px;
    transition: 0.2s;
}
.guild-item:hover {
    border-color: var(--accent);
    background: #00110a;
    transform: translateX(10px);
}

/* Dialogue Box */
.dialogue-box {
    height: 160px;
    background: var(--ui-bg);
    border-top: 4px solid #fff;
    padding: 30px 40px;
    position: relative;
    z-index: 100;
}

.speaker-name {
    position: absolute;
    top: -25px;
    left: 30px;
    background: #000;
    color: var(--primary);
    padding: 8px 25px;
    border: 2px solid #fff;
    font-size: 14px;
}

#dialogue-text { font-size: 12px; line-height: 1.8; }

/* Choice System */
.choice-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 200;
    width: 400px;
}

.choice-btn {
    background: rgba(0,0,0,0.9);
    color: #fff;
    border: 2px solid #fff;
    padding: 12px 20px;
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 4px 4px 0 rgba(255,255,255,0.2);
}

.choice-btn:hover {
    background: var(--primary);
    color: #000;
    transform: translateX(10px);
    box-shadow: 4px 4px 0 #000;
}

.controls-hint {
    position: absolute;
    bottom: 15px;
    left: 40px;
    font-size: 8px;
    color: rgba(255,255,255,0.3);
}

.blinking-cursor {
    position: absolute;
    bottom: 20px;
    right: 30px;
    font-size: 16px;
    animation: blink 0.8s infinite;
}

.hidden { display: none !important; }

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@media (max-width: 1000px) {
    .game-container { width: 100vw; height: 100vh; border: none; }
    .character-bust { width: 200px; height: 200px; left: 50%; transform: translateX(-50%) !important; bottom: 180px; }
}
