:root {
    --red: #ff4757;
    --orange: #ffa502;
    --yellow: #eccc68;
    --bg: #050510;
    --glass: rgba(0, 0, 0, 0.6);
}

* {
    margin: 0; padding: 0; box-sizing: border-box;
    font-family: 'Gowun Batang', serif;
    user-select: none;
}

body {
    background: var(--bg);
    color: #f1f2f6;
    overflow: hidden;
}

#game-wrapper {
    position: relative;
    width: 100vw; height: 100vh;
}

canvas {
    display: block;
}

/* UI */
#ui {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stats {
    width: 250px;
    background: var(--glass);
    padding: 15px;
    border-radius: 10px;
    border-left: 5px solid var(--red);
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px;
    font-size: 0.8rem;
    font-weight: 700;
}

.bar-bg {
    flex: 1;
    height: 10px;
    background: #2f3542;
    border-radius: 5px;
    overflow: hidden;
}

.fill {
    height: 100%;
    width: 100%;
    transition: width 0.3s;
}

.fill.red { background: var(--red); }
.fill.orange { background: var(--orange); }
.fill.yellow { background: var(--yellow); }

.top-center {
    position: absolute;
    top: 30px; left: 50%;
    transform: translateX(-50%);
    text-align: center;
    background: var(--glass);
    padding: 10px 40px;
    border-radius: 50px;
}

#day-info { font-size: 1.5rem; font-weight: 800; letter-spacing: 2px; }
#time-status { color: var(--yellow); }

.inventory {
    position: absolute;
    bottom: 30px; left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    background: var(--glass);
    padding: 15px 30px;
    border-radius: 20px;
    pointer-events: auto;
}

.item {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* OVERLAYS */
.overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.box {
    text-align: center;
    padding: 60px;
}

.box h1 {
    font-family: 'Nanum Myeongjo', serif;
    font-size: 4rem;
    letter-spacing: 15px;
    margin-bottom: 10px;
}

.box h2 {
    font-size: 1.2rem;
    opacity: 0.6;
    margin-bottom: 40px;
}

#start-btn, #game-over button {
    background: transparent;
    color: white;
    border: 2px solid white;
    padding: 15px 60px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
}

#start-btn:hover {
    background: white;
    color: black;
}

.hidden { display: none !important; }
