@charset "UTF-8";

:root {
    /* Colors - Pastel & Glass Theme */
    --color-bg-fresh: #e3f2fd;
    --color-bg-stagnant: #cfd8dc;
    --color-bg-bad: #37474f;

    --color-text-main: #546e7a;
    --color-text-sub: #78909c;

    --color-accent: #ff8a80;
    /* Heart/Alert */
    --color-primary: #4dd0e1;
    /* Main Button */
    --color-primary-dark: #00bcd4;

    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);

    /* Fonts */
    --font-main: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Quicksand", sans-serif;
    --font-mono: "Roboto Mono", monospace;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    height: 100dvh;
    /* Mobile viewport fix */
    background-color: var(--color-bg-fresh);
    transition: background-color 2s ease;
    color: var(--color-text-main);
}

/* Background Image Layer */
#bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/room_bg.png');
    background-size: cover;
    background-position: center;
    opacity: 0.8;
    z-index: -2;
    transition: filter 3s ease, transform 20s ease-in-out;
}

/* Time of Day Themes */
body.theme-morning #bg-layer {
    filter: brightness(1.1) saturate(1.2);
}

body.theme-day #bg-layer {
    filter: none;
}

body.theme-sunset #bg-layer {
    filter: sepia(0.4) saturate(1.5) hue-rotate(-10deg);
}

body.theme-night #bg-layer {
    filter: brightness(0.6) hue-rotate(20deg) contrast(1.2);
}

/* --- Dirt Overlay --- */
#dirt-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Vignette style dirt */
    background: radial-gradient(circle at center, transparent 40%, rgba(60, 50, 40, 0.9) 110%);
    z-index: -1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 2s ease;
    mix-blend-mode: multiply;
}

/* Fever Mode */
body.fever-mode #bg-layer {
    animation: rainbow-bg 2s linear infinite;
    filter: none !important;
    opacity: 1;
}

body.fever-mode #dirt-layer {
    opacity: 0 !important;
}

body.fever-mode #app-container {
    animation: shake-light 0.5s ease-in-out infinite;
}

@keyframes rainbow-bg {
    0% {
        filter: hue-rotate(0deg) saturate(2);
    }

    100% {
        filter: hue-rotate(360deg) saturate(2);
    }
}

@keyframes shake-light {

    0%,
    100% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(2px, 2px);
    }

    50% {
        transform: translate(-2px, -2px);
    }

    75% {
        transform: translate(2px, -2px);
    }
}

/* UI Container */
#app-container {
    position: relative;
    width: 100%;
    max-width: 480px;
    height: 100%;
    height: 100dvh;
    max-height: 900px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 20px 15px;
    /* Slightly less padding for small screens */
    box-sizing: border-box;
    overflow-y: hidden;
    /* Prevent body scroll */
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
}

/* Header */
header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    padding: 10px 15px;
    border-radius: 24px;
    margin-bottom: 10px;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

h1 {
    font-size: 1.1rem;
    color: var(--color-text-main);
    margin: 0;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 5px;
}

h1::before {
    content: '☁';
    color: var(--color-primary);
}

#rank-badge {
    font-size: 0.75rem;
    color: white;
    background: var(--color-primary);
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
    align-self: flex-start;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

#rank-badge.rank-gold {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.6);
    transform: scale(1.1);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

#help-btn {
    background: white;
    color: var(--color-text-sub);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

#help-btn:hover,
#room-btn:hover {
    background: var(--color-primary);
    color: white;
    transform: rotate(15deg);
}

#room-btn {
    background: white;
    color: var(--color-text-sub);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

/* --- Level & Progress Bar --- */
#level-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    width: 140px;
}

#level-text {
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--color-text-sub);
}

#level-progress-bg {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

#level-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
    border-radius: 4px;
    transition: width 0.5s ease-out;
}

/* --- Main Stage --- */
#main-stage {
    flex-grow: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Info Bar (Outside Panel) */
#info-bar {
    width: 90%;
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 10px;
}

.info-panel {
    background: rgba(255, 255, 255, 0.7);
    padding: 8px 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    color: var(--color-text-main);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    flex: 1;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.info-panel:hover {
    transform: translateY(-2px);
}

/* CO2 Monitor Styles from previous step */
.info-panel.warning {
    color: #ef6c00;
    border-color: #ef6c00;
    background: rgba(255, 224, 178, 0.8);
    animation: pulse-warning 2s infinite;
}

.info-panel.danger {
    color: #c62828;
    border-color: #c62828;
    background: rgba(255, 205, 210, 0.8);
    animation: pulse-danger 1s infinite;
}

.info-panel.good {
    color: #2e7d32;
    border-color: #a5d6a7;
    background: rgba(232, 245, 233, 0.8);
}

@keyframes pulse-warning {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        opacity: 1;
    }
}

@keyframes pulse-danger {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.info-label {
    font-size: 0.7rem;
    color: var(--color-text-sub);
    display: block;
    margin-right: 4px;
}

.info-value {
    font-weight: bold;
    font-size: 1rem;
}

#mofu-container {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 1 / 1;
    position: relative;
    cursor: pointer;
    transition: transform 1s ease, filter 1s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 70%);
}

#room-decorations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    /* Behind Mofu (video is z-index 0 naturally if not set, but let's check) */
}

/* Decoration Items */
.decoration-item {
    position: absolute;
    font-size: 2rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
    transition: all 0.5s ease;
    opacity: 0;
    transform: scale(0.8);
}

.decoration-item.visible {
    opacity: 1;
    transform: scale(1);
}

/* Specific Items Positions */
.decor-plant {
    bottom: 5%;
    left: 5%;
    font-size: 2.5rem;
    z-index: 6;
    /* In front */
}

.decor-purifier {
    bottom: 5%;
    right: 5%;
    font-size: 2.2rem;
    z-index: 2;
}

.decor-aroma {
    bottom: 35%;
    right: 8%;
    font-size: 1.5rem;
    animation: float-slow 3s infinite alternate;
}

.decor-rug {
    bottom: 2%;
    left: 50%;
    transform: translateX(-50%) scaleX(2);
    font-size: 3rem;
    z-index: 0;
    opacity: 0.6;
}

.decor-sun {
    top: 5%;
    right: 20%;
    font-size: 2rem;
    animation: spin-slow 10s linear infinite;
    mix-blend-mode: screen;
}

@keyframes float-slow {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-5px);
    }
}

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

video#mofu-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
    transition: filter 0.5s ease;
    outline: none;
    border: none;
    pointer-events: none;
}

#click-target {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 5;
    cursor: pointer;
    border-radius: 50%;
}

/* Message Bubble */
#message-bubble {
    background: #fff;
    padding: 16px 24px;
    border-radius: 30px;
    border-top-left-radius: 4px;
    /* Asymmetric tail start at TOP */
    margin-top: 15px;
    /* Moved down slightly */
    margin-left: 60px;
    /* Offset from Mofu center */
    position: relative;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    font-size: 1rem;
    font-weight: bold;
    color: var(--color-text-main);
    text-align: left;
    max-width: 240px;
    min-width: 160px;
    line-height: 1.5;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    z-index: 6;
    border: 2px solid rgba(255, 255, 255, 0.9);
    animation: bubble-pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Tail for bubble (Top Left) */
#message-bubble::after {
    content: '';
    position: absolute;
    top: -10px;
    /* Pointing UP */
    left: 20px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 10px 12px 0;
    /* Triangle pointing up */
    border-color: transparent transparent #fff transparent;
    filter: drop-shadow(0 -2px 1px rgba(0, 0, 0, 0.02));
}

@keyframes bubble-pop-in {
    0% {
        transform: scale(0.5) translateY(10px);
        opacity: 0;
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Footer / Controls */
footer {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding-bottom: 20px;
    z-index: 10;
}

.control-wrapper {
    position: relative;
    width: 160px;
    height: 160px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.timer-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 160px;
    height: 160px;
    transform: rotate(-90deg);
    pointer-events: none;
}

.timer-ring circle {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    cx: 80;
    cy: 80;
    r: 70;
}

.ring-bg {
    stroke: rgba(255, 255, 255, 0.5);
}

.ring-progress {
    stroke: var(--color-primary);
    stroke-dasharray: 440;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.3s;
}

#ventilate-btn {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: none;
    background: white;
    color: var(--color-primary);
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(77, 208, 225, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2;
    overflow: hidden;
}

#ventilate-btn:hover {
    transform: scale(1.05);
    color: var(--color-primary-dark);
    box-shadow: 0 15px 35px rgba(77, 208, 225, 0.4);
}

#ventilate-btn:active {
    transform: scale(0.95);
}

body.fever-mode #ventilate-btn {
    background: linear-gradient(135deg, #fff, #fff9c4);
    color: #ff6f00;
    box-shadow: 0 0 30px #ffeb3b;
    animation: fever-pulse 0.5s infinite alternate;
}

@keyframes fever-pulse {
    from {
        transform: scale(1);
        box-shadow: 0 0 20px gold;
    }

    to {
        transform: scale(1.1);
        box-shadow: 0 0 40px orange;
    }
}

.btn-icon {
    font-size: 1.8rem;
    margin-bottom: 4px;
    display: block;
}

.btn-text {
    font-size: 0.8rem;
    line-height: 1.2;
}

#timer-text-display {
    font-size: 0.9rem;
    color: var(--color-text-sub);
    font-variant-numeric: tabular-nums;
    background: rgba(255, 255, 255, 0.5);
    padding: 4px 12px;
    border-radius: 12px;
    margin-top: -10px;
    z-index: 10;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(55, 71, 79, 0.2);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    margin-bottom: 10px;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

/* Calculator UI */
.calc-section {
    background: #f1f8e9;
    padding: 15px;
    border-radius: 12px;
    margin-top: 15px;
    text-align: left;
}

.calc-title {
    font-weight: bold;
    color: #33691e;
    margin-bottom: 10px;
    display: block;
    font-size: 0.9rem;
    border-bottom: 1px solid #c5e1a5;
    padding-bottom: 5px;
}

.form-group {
    margin-bottom: 10px;
}

.form-group label {
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
}

.form-group input[type="range"] {
    width: 100%;
    margin-top: 5px;
}

#calc-result {
    text-align: center;
    margin-top: 10px;
}

#calc-apply-btn {
    width: 100%;
    background: #81c784;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Modal Footer */
.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eee;
    padding-top: 15px;
    flex-shrink: 0;
}

/* Room Items */
.modal-desc {
    font-size: 0.8rem;
    color: #78909c;
    margin-bottom: 15px;
}

#room-item-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.room-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fafafa;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid #eee;
}

.room-item.locked {
    opacity: 0.5;
    filter: grayscale(1);
}

.item-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    color: var(--color-text-main);
}

.item-icon {
    font-size: 1.5rem;
}

/* Toggle Switch */
.switch-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--color-primary);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

.locked-text {
    font-size: 0.7rem;
    color: #ff8a80;
    font-weight: bold;
}

.modal-close-btn {
    /* Style inherited from previous button logic but specificity helps */
    background: #f5f5f5;
    color: #333;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
}

.danger-btn {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}

.danger-btn:hover {
    background: #ffcdd2;
}


/* Feedback Animations */
.feedback-heart {
    position: absolute;
    color: var(--color-accent);
    font-size: 2rem;
    pointer-events: none;
    z-index: 100;
    transition: all 1s ease;
    filter: drop-shadow(0 2px 4px rgba(255, 64, 129, 0.3));
}

.pop-in {
    animation: treasure-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes treasure-pop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes happy-spin {
    0% {
        transform: rotate(0deg) scale(1);
    }

    50% {
        transform: rotate(180deg) scale(1.1);
    }

    100% {
        transform: rotate(360deg) scale(1);
    }
}

@keyframes reckless-spin {
    0% {
        transform: rotate(0deg) scale(1);
    }

    100% {
        transform: rotate(1080deg) scale(1.3);
    }
}

/* Particle */
.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    pointer-events: none;
    animation: particle-fly 1.2s cubic-bezier(0, .9, .57, 1) forwards;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.particle.gold {
    background: gold;
    width: 12px;
    height: 12px;
    box-shadow: 0 0 15px orange;
}

@keyframes particle-fly {
    0% {
        transform: translate(0, 0) scale(1.2);
        opacity: 1;
    }

    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* --- Room Items Grid Override --- */
/* Overwriting previous list styles to Grid */

#room-item-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)) !important;
    gap: 15px !important;
    padding: 5px !important;
}

.room-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    background: #fff !important;
    padding: 15px 10px !important;
    border-radius: 16px !important;
    border: 2px solid #eee !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02) !important;
    position: relative !important;
    aspect-ratio: 1 / 1.1 !important;
}

.room-item:active {
    transform: scale(0.95);
}


/* --- Room Items Grid Override --- */
/* Stylish Glassmorphism Grid */

#room-item-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)) !important;
    gap: 15px !important;
    padding: 10px 5px !important;
}

.room-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.6) !important; /* Glass effect */
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    padding: 15px 10px !important;
    border-radius: 20px !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05) !important;
    position: relative !important;
    aspect-ratio: 1 / 1.1 !important;
    overflow: hidden !important;
}

.room-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1) !important;
    background: rgba(255, 255, 255, 0.8) !important;
}

.room-item:active {
    transform: scale(0.95);
}

.room-item.active {
    border-color: var(--color-primary) !important;
    background: rgba(224, 247, 250, 0.85) !important;
    box-shadow: 0 0 0 2px var(--color-primary), 0 8px 20px rgba(77, 208, 225, 0.4) !important;
}

/* Checkmark badge for active state */
.room-item.active::after {
    content: '✔';
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--color-primary);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.7rem;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    animation: pop-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.room-item.locked {
    opacity: 0.5 !important;
    filter: grayscale(1) !important;
    cursor: not-allowed !important;
    background: rgba(200, 200, 200, 0.3) !important;
    border-style: none !important;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05) !important;
}

.item-info {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
    font-weight: bold !important;
    color: var(--color-text-main) !important;
    width: 100% !important;
    z-index: 2;
}

.item-icon {
    font-size: 2.8rem !important;
    line-height: 1 !important;
    filter: drop-shadow(0 4px 4px rgba(0,0,0,0.1));
    transition: transform 0.3s ease;
}

.room-item:hover .item-icon {
    transform: scale(1.1);
}

.item-name {
    font-size: 0.75rem;
    text-align: center;
    line-height: 1.2;
    display: block !important; 
    margin-top: 5px;
    color: var(--color-text-sub);
}

/* Hide old toggle switch styling as we use card selection now */
.switch-toggle {
    display: none !important; 
}

.locked-text {
    font-size: 0.65rem !important;
    color: #ef5350 !important;
    font-weight: bold !important;
    margin-top: 5px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    padding: 3px 8px !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.modal-close-btn {
    background: linear-gradient(135deg, #f5f5f5, #eceff1);
    color: #546e7a;
    border: none;
    padding: 12px 28px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    min-width: 100px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.modal-close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
    background: #fff;
}

@keyframes pop-in {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

/* --- Stylish Room Item Themes --- */

/* Base Shine Effect */
.room-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 50%);
    pointer-events: none;
    z-index: 1;
}

/* 1. Plant (Nature Green) */
.room-item.decor-plant {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9) !important;
    border-color: #a5d6a7 !important;
}
.room-item.decor-plant.active {
    background: linear-gradient(135deg, #c8e6c9, #a5d6a7) !important;
    box-shadow: 0 0 0 2px #4caf50, 0 8px 20px rgba(76, 175, 80, 0.4) !important;
}
.room-item.decor-plant.active::after { background: #4caf50 !important; }

/* 2. Purifier (Clean Blue) */
.room-item.decor-purifier {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb) !important;
    border-color: #90caf9 !important;
}
.room-item.decor-purifier.active {
    background: linear-gradient(135deg, #bbdefb, #90caf9) !important;
    box-shadow: 0 0 0 2px #2196f3, 0 8px 20px rgba(33, 150, 243, 0.4) !important;
}
.room-item.decor-purifier.active::after { background: #2196f3 !important; }

/* 3. Aroma (Floral Pink) */
.room-item.decor-aroma {
    background: linear-gradient(135deg, #fce4ec, #f8bbd0) !important;
    border-color: #f48fb1 !important;
}
.room-item.decor-aroma.active {
    background: linear-gradient(135deg, #f8bbd0, #f48fb1) !important;
    box-shadow: 0 0 0 2px #e91e63, 0 8px 20px rgba(233, 30, 99, 0.4) !important;
}
.room-item.decor-aroma.active::after { background: #e91e63 !important; }

/* 4. Rug (Cozy Orange/Brown) */
.room-item.decor-rug {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2) !important;
    border-color: #ffcc80 !important;
}
.room-item.decor-rug.active {
    background: linear-gradient(135deg, #ffe0b2, #ffcc80) !important;
    box-shadow: 0 0 0 2px #ff9800, 0 8px 20px rgba(255, 152, 0, 0.4) !important;
}
.room-item.decor-rug.active::after { background: #ff9800 !important; }

/* 5. Sun (Golden Yellow) */
.room-item.decor-sun {
    background: linear-gradient(135deg, #fffde7, #fff9c4) !important;
    border-color: #fff59d !important;
}
.room-item.decor-sun.active {
    background: linear-gradient(135deg, #fff9c4, #fff59d) !important;
    box-shadow: 0 0 0 2px #fbc02d, 0 8px 20px rgba(251, 192, 45, 0.4) !important;
}
.room-item.decor-sun.active::after { background: #fbc02d !important; }


/* --- Glass Bubble Decorations & Button Upgrade --- */

/* Placed Decoration Items (Glass Bubbles) */
.decoration-item {
    position: absolute;
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    border-radius: 50%;
    /* Glass Effect */
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.1));
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 
        0 4px 10px rgba(0, 0, 0, 0.1),
        inset 0 0 10px rgba(255, 255, 255, 0.3),
        inset 10px 10px 20px rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    transition: all 0.5s ease;
    animation: float-bubble 4s infinite ease-in-out;
    z-index: 5; /* Ensure visibility */
}

/* Specific Sizes/Positions Overrides */
/* Note: Position logic remains, but we add centering for the icon inside bubble */

.decor-plant {
    /* Slightly green tint */
    background: radial-gradient(circle at 30% 30%, rgba(200, 230, 201, 0.4), rgba(255, 255, 255, 0.1)) !important;
    border-color: rgba(165, 214, 167, 0.6) !important;
}

.decor-purifier {
    /* Blue tint */
    background: radial-gradient(circle at 30% 30%, rgba(187, 222, 251, 0.4), rgba(255, 255, 255, 0.1)) !important;
    border-color: rgba(144, 202, 249, 0.6) !important;
}

.decor-aroma {
    /* Pink tint */
    width: 60px;
    height: 60px;
    font-size: 2rem;
    background: radial-gradient(circle at 30% 30%, rgba(248, 187, 208, 0.4), rgba(255, 255, 255, 0.1)) !important;
}

.decor-rug {
    /* Rug is special - it needs to be flat on floor, not a bubble */
    /* Remove bubble styles for rug */
    width: auto;
    height: auto;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    border-radius: 0 !important;
    animation: none !important;
    
    /* Re-apply rug positioning */
    transform: translateX(-50%) scaleX(2) rotateX(60deg) !important; /* Perspective effect */
    bottom: 5% !important;
    opacity: 0.8 !important;
    filter: drop-shadow(0 10px 10px rgba(0,0,0,0.2)) !important;
}

.decor-sun {
    /* Golden tint */
    background: radial-gradient(circle at 30% 30%, rgba(255, 249, 196, 0.6), rgba(255, 255, 255, 0.1)) !important;
    box-shadow: 0 0 20px rgba(251, 192, 45, 0.3), inset 0 0 10px rgba(255, 255, 255, 0.5) !important;
    animation: float-bubble 6s infinite ease-in-out !important; /* Slower float */
}

@keyframes float-bubble {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Room Button Upgrade */
#room-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #ffffff, #f0f4c3);
    color: #827717;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 1.2rem;
}

#room-btn:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
    background: linear-gradient(135deg, #fff, #dce775);
}

