:root {
    --primary-color: #6c5ce7;
    --secondary-color: #a29bfe;
    --text-color: #2d3436;
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.4);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Nunito', sans-serif;
    background-color: #2d3436; /* Dark Grey */
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

#app {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.bg-gradient {
    display: none;
}

/* UI Container */
.ui-container {
    position: relative;
    width: 100%;
    max-width: 450px;
    height: 100%;
    display: flex;
    flex-direction: column;
    pointer-events: none;
    z-index: 2;
}

.ui-container > * {
    pointer-events: auto;
}

/* Stats Group */
.stats-group {
    position: relative;
    width: 100%;
    background: none;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.stat-bar-compact {
    position: relative;
    width: 100%;
    height: 16px;
    background: rgba(0,0,0,0.3);
    overflow: hidden;
}

.stat-bar-compact .fill {
    height: 100%;
}

.stat-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 11px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    pointer-events: none;
    white-space: nowrap;
    z-index: 2;
}

.xp-level-text {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    color: white;
    font-size: 11px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    pointer-events: none;
    z-index: 2;
}

.stat-info-row {
    position: relative;
    width: 100%;
    height: 30px;
    background:none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    box-sizing: border-box;
}

.stat-text-inline {
    color: white;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Game Container & Rooms */
#game-container {
    position: relative;
    width: 100%;
    height: 50%;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    pointer-events: auto;
}

#room-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
    transition: background-image 0.3s ease-in-out;
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 20;
    border:none;
}

.nav-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

#nav-left { left: 10px; }
#nav-right { right: 10px; }

#room-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.interactable {
    position: absolute;
    cursor: pointer;
    transition: transform 0.2s;
    z-index: 2;
}

.interactable-img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.cushion { bottom: 0%; left: 15%; }
.cupboard { top: 25%; right: 15%; }
.bath { bottom: 20%; left: 50%; transform: translateX(-50%); }

/* Pet Sprite */
.pet-sprite {
    position: absolute;
    z-index: 10;
    width: 200px;
    height: auto;
    cursor: pointer;
    user-select: none;
    -webkit-user-drag: none;
    transform: translate(-50%, -50%);
    animation: breathe 3s ease-in-out infinite;
    transition: top 0.5s ease-in-out, left 0.5s ease-in-out, filter 0.2s;
}

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

.pet-sprite.bounce {
    animation: bounce 0.5s ease-out;
}

@keyframes bounce {
    0%, 100% { transform: translate(-50%, -50%) translateY(0) scale(1); }
    50% { transform: translate(-50%, -50%) translateY(-30px) scale(1.1); }
}

/* Icons & Particles */
.icon-img { width: 18px; height: 18px; object-fit: contain; }
.btn-icon-img { width: 32px; height: 32px; margin-bottom: 5px; object-fit: contain; }
.item-icon-img { width: 40px; height: 40px; object-fit: contain; }

img, #room-bg {
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.particle-img {
    position: absolute;
    width: 40px;
    height: 40px;
    pointer-events: none;
    animation: floatUp 1s ease-out forwards;
    z-index: 1000;
    object-fit: contain;
}

@keyframes floatUp {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-100px) scale(1.5); opacity: 0; }
}

/* Action Dock */
.action-dock {
    position: relative;
    z-index: 100;
    display: flex;
    flex-direction: column;
    background: none;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid var(--glass-border);
    overflow: hidden;
    height: 50%;
}

.action-buttons {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-grow: 1;
    padding: 15px 10px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 15px;
    width: 70px;
    height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    font-weight: bold;
    color: var(--text-color);
    font-size: 11px;
}

/* Modals */
#modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    pointer-events: auto;
}

#modal-overlay.hidden { display: none; }

.modal {
    background: white;
    width: 90%;
    max-height: 85%;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

.modal-content-split {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.modal-section h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: var(--text-color);
}

.divider {
    height: 1px;
    background: #eee;
    margin: 5px 0;
}

.item-list.horizontal-row {
    display: flex;
    flex-direction: row;
    gap: 15px;
    overflow-x: auto;
    padding: 5px 5px 15px 5px;
    -webkit-overflow-scrolling: touch;
}

.shop-item, .inventory-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    background: #f1f2f6;
    padding: 10px;
    border-radius: 15px;
    min-width: 120px;
    flex-shrink: 0;
    text-align: center;
}

.item-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
}

.item-details h4 {
    margin: 0;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

.item-details p {
    display: none; /* Hide description in row view to save space */
}


.item-action-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 12px;
}

/* Death Screen */
#death-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 300;
    pointer-events: auto;
}

#death-screen.hidden { display: none; }
.restart-btn {
    padding: 15px 40px;
    background: #ff6b6b;
    border: none;
    border-radius: 30px;
    color: white;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
}

.floating-text {
    position: absolute;
    color: white;
    font-family: 'Fredoka One', cursive; /* Match the font used in headers */
    font-size: 24px;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.5);
    pointer-events: none;
    z-index: 2000;
    white-space: nowrap;
    animation: floatTextUp 1.2s ease-out forwards;
}

@keyframes floatTextUp {
    0% { transform: translate(-50%, 0) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -60px) scale(1.2); opacity: 0; }
}
