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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #ff69b4, #ffa500);
    height: 100vh;
    overflow: hidden;
}

#app {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* HUD */
#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#points-counter {
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 20px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    font-size: 20px;
    color: #333;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.points-icon {
    font-size: 22px;
}

/* 3D Scene - Always Fullscreen Background */
#scene-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

/* Tab System - Fullscreen Tabs */
.tab-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    z-index: 90;
    overflow-y: auto;
    display: none;
}

/* Hide header for room tab by never showing room tab screen */
#room-tab {
    display: none !important;
}

.tab-content {
    padding: 40px 20px 120px;
    max-width: 600px;
    margin: 0 auto;
}

.section-image {
    width: 128px;
    height: 128px;
    margin: 0 auto 30px;
    display: block;
    border-radius: 15px;
}

/* Tasks Tab */
#daily-question {
    background: linear-gradient(135deg, #ff69b4, #ffa500);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    color: white;
    box-shadow: 0 8px 30px rgba(255, 105, 180, 0.3);
}

.question-header {
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 15px;
    letter-spacing: 1px;
    font-weight: 600;
}

#question-text {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    line-height: 1.5;
}

#question-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 15px;
    padding: 15px;
    color: white;
    resize: none;
    min-height: 80px;
    margin-bottom: 15px;
    font-size: 16px;
    line-height: 1.5;
}

#question-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

#save-reflection {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.2s ease;
}

#save-reflection:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.tasks-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
}

#tasks-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.task-item {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.task-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.task-item.completed {
    background: rgba(76, 175, 80, 0.2);
    opacity: 0.8;
}

.task-text {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

.task-complete {
    background: #ff69b4;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    color: white;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-weight: bold;
}

.task-complete:hover {
    transform: scale(1.1);
    background: #e91e63;
}

#add-task {
    background: rgba(255, 105, 180, 0.15);
    border: 2px dashed #ff69b4;
    border-radius: 15px;
    padding: 20px;
    width: 100%;
    color: #ff69b4;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s ease;
}

#add-task:hover {
    background: rgba(255, 105, 180, 0.25);
    transform: translateY(-2px);
}

/* Shop Tab */
.shop-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.shop-tab {
    flex: 1;
    background: #f5f5f5;
    border: none;
    border-radius: 15px;
    padding: 15px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    min-width: 120px;
    font-weight: 500;
}

.shop-tab.active {
    background: linear-gradient(135deg, #ff69b4, #ffa500);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.3);
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
}

.shop-item {
    background: #f9f9f9;
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.shop-item:hover:not(.disabled):not(.owned) {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.2);
}

.shop-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.shop-item.owned {
    background: #e8f5e8;
    cursor: default;
}

.item-image {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    border-radius: 10px;
    display: block;
}

.item-name {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    font-weight: 500;
}

.item-price {
    font-size: 14px;
    color: #666;
    font-weight: bold;
}

/* Letters Tab */
.letter-section {
    max-width: 500px;
    margin: 0 auto;
}

#letter-text {
    width: 100%;
    min-height: 200px;
    border: 2px solid #ddd;
    border-radius: 20px;
    padding: 20px;
    font-size: 16px;
    resize: vertical;
    margin: 20px 0;
    background: white;
    line-height: 1.6;
    transition: border-color 0.2s ease;
}

#letter-text:focus {
    border-color: #ff69b4;
    outline: none;
}

.delivery-options {
    margin: 30px 0;
}

.delivery-options h4 {
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
    text-align: center;
}

.delivery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.delivery-btn {
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 15px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.delivery-btn:hover {
    background: #e9e9e9;
    transform: translateY(-2px);
}

.delivery-btn.selected {
    border-color: #ff69b4;
    background: rgba(255, 105, 180, 0.1);
    transform: translateY(-2px);
}

#send-letter {
    width: 100%;
    background: linear-gradient(135deg, #ff69b4, #ffa500);
    border: none;
    border-radius: 20px;
    padding: 20px;
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(255, 105, 180, 0.3);
}

#send-letter:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 105, 180, 0.4);
}

/* Breathing Tab */
.breathing-content {
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
}

#breathing-circle {
    width: 150px;
    height: 150px;
    background: linear-gradient(45deg, #ff69b4, #ffa500);
    border-radius: 50%;
    margin: 40px auto;
    transition: transform 0.3s ease;
    box-shadow: 0 8px 30px rgba(255, 105, 180, 0.3);
}

#breathing-text {
    font-size: 20px;
    color: #333;
    margin: 30px 0;
    font-weight: 500;
}

#start-breathing {
    background: linear-gradient(135deg, #ff69b4, #ffa500);
    border: none;
    border-radius: 20px;
    padding: 20px 30px;
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(255, 105, 180, 0.3);
}

#start-breathing:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 105, 180, 0.4);
}

/* Archive Tab */
#archive-list {
    max-width: 600px;
    margin: 0 auto;
}

.archive-item {
    background: #f9f9f9;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.archive-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.archive-date {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    font-weight: 500;
}

.archive-question {
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    font-size: 16px;
    line-height: 1.4;
}

.archive-reflection {
    color: #555;
    line-height: 1.6;
    font-size: 15px;
}

/* Inventory Tab */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.inventory-item {
    background: #f9f9f9;
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.inventory-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.item-status {
    font-size: 14px;
    color: #4caf50;
    font-weight: bold;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    max-width: 400px;
    margin: 0 auto;
}

.empty-state p {
    font-size: 16px;
    margin-top: 20px;
    line-height: 1.5;
}

/* Bottom Navigation */
#bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-around;
    padding: 15px 10px;
    border-top: 1px solid rgba(0,0,0,0.1);
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
}

.nav-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.6;
    min-width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.nav-btn.active {
    background: rgba(255, 105, 180, 0.2);
    opacity: 1;
    transform: translateY(-2px);
}

.nav-btn:hover {
    transform: translateY(-2px);
    opacity: 1;
}

.nav-icon {
    font-size: 20px;
    display: block;
}

.nav-title {
    font-size: 11px;
    font-weight: 500;
    display: block;
    line-height: 1;
}

/* Popup System */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    animation: fadeIn 0.2s ease;
}

.popup {
    background: white;
    border-radius: 25px;
    max-width: 400px;
    margin: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: popIn 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
}

.popup-header {
    background: linear-gradient(135deg, #ff69b4, #ffa500);
    color: white;
    padding: 20px 25px;
    border-radius: 25px 25px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.popup-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    color: white;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-content {
    padding: 25px;
    text-align: center;
    line-height: 1.6;
    color: #333;
}

.popup-actions {
    padding: 0 25px 25px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.popup-action {
    background: linear-gradient(135deg, #ff69b4, #ffa500);
    border: none;
    border-radius: 15px;
    padding: 12px 20px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    flex: 1;
    min-width: 120px;
    transition: all 0.2s ease;
}

.popup-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.3);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popIn {
    from { 
        opacity: 0; 
        transform: scale(0.8) translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: scale(1) translateY(0); 
    }
}

/* Responsive */
@media (max-width: 768px) {
    .shop-grid, .inventory-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .delivery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #breathing-circle {
        width: 120px;
        height: 120px;
    }
    
    #breathing-text {
        font-size: 18px;
    }
    
    .tab-content {
        padding: 30px 15px 100px;
    }
    
    .popup {
        margin: 15px;
        max-width: calc(100vw - 30px);
    }
    
    .nav-btn {
        padding: 6px 8px;
        min-width: 50px;
    }
    
    .nav-icon {
        font-size: 18px;
    }
    
    .nav-title {
        font-size: 10px;
    }
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}