:root {
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --panel-bg: rgba(255, 255, 255, 0.72);
    --panel-border: rgba(255, 255, 255, 0.45);
    --text-color: #2d3748;
    --text-secondary: #718096;
    --primary: #ff7b90;
    --primary-hover: #ff526e;
    --secondary: #4fd1c5;
    --secondary-hover: #319795;
    --accent: #f6ad55;
    --danger: #fc8181;
    --glass-blur: blur(16px);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.06);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Outfit', 'Noto Sans KR', sans-serif;
    color: var(--text-color);
    background: var(--bg-gradient);
}

/* 3D Canvas */
#canvas-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

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

#ui-container * {
    pointer-events: auto;
}

/* Header UI */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 15px 25px;
    background: var(--panel-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    animation: slideDown 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.pet-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pet-emoji {
    font-size: 2.2rem;
    background: white;
    padding: 8px;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.pet-info h1 {
    font-size: 1.3rem;
    font-weight: 800;
    color: #1a202c;
}

.status-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.status-meta #pet-status-text {
    font-size: 0.85rem;
    font-weight: 600;
}

.weather-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(0,0,0,0.05);
    color: var(--text-color);
    display: inline-block;
    transition: var(--transition);
}

/* Weather classes */
.weather-badge.clear { background: #ffeeb2; color: #b7791f; }
.weather-badge.rain { background: #ebf8ff; color: #2b6cb0; }
.weather-badge.heatwave { background: #fed7d7; color: #c53030; }
.weather-badge.wind { background: #e2e8f0; color: #4a5568; }

.affinity-container {
    width: 250px;
}

.affinity-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-color);
}

.affinity-bar-outer {
    width: 100%;
    height: 10px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 5px;
    overflow: hidden;
}

.affinity-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #ffa8b6);
    border-radius: 5px;
    transition: width 0.5s ease-out;
}

/* Status Panel (Left Side) */
.status-panel {
    position: absolute;
    left: 20px;
    top: 105px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    width: 180px;
    background: var(--panel-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    animation: slideRight 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.status-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-icon {
    font-size: 1.4rem;
}

.status-bar-wrapper {
    flex-grow: 1;
}

.status-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 3px;
}

.status-bar-outer {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.status-bar-inner {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.hunger-fill { background: #fc8181; }
.thirst-fill { background: #4fd1c5; }
.cleanliness-fill { background: #f6ad55; }

/* Notification Message */
.game-notification {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(45, 55, 72, 0.92);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 100;
}

.game-notification.hidden {
    opacity: 0;
    transform: translate(-50%, -20px);
    pointer-events: none;
}

/* Action Panel (Bottom Center) */
.action-panel {
    display: flex;
    justify-content: center;
    gap: 12px;
    max-width: 900px;
    margin: 0 auto;
    padding: 15px 20px;
    background: var(--panel-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    animation: slideUp 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.action-btn {
    border: none;
    outline: none;
    padding: 12px 20px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 14px;
    background: white;
    color: var(--text-color);
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.06);
}

.action-btn:active {
    transform: translateY(-1px);
}

.action-btn#btn-pet {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe3e3 100%);
    border: 1px solid #ffccd5;
}
.action-btn#btn-pet:hover {
    background: linear-gradient(135deg, #ffe3e3 0%, #ffccd5 100%);
}

.action-btn#btn-walk {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #bbf7d0;
}
.action-btn#btn-walk:hover {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
}

.action-btn.toggle-btn.active {
    background: var(--secondary);
    color: white;
}

/* Shop Panel (Right Side) */
.shop-panel {
    position: absolute;
    right: 20px;
    top: 20px;
    bottom: 20px;
    width: 320px;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: var(--panel-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--panel-border);
    border-radius: 28px;
    box-shadow: var(--shadow);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease;
    animation: slideLeft 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.shop-panel.hidden {
    transform: translateX(360px);
    opacity: 0;
    pointer-events: none;
}

.shop-header h2 {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 5px;
}

.shop-header p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.shop-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 10px;
}

.tab-btn {
    border: none;
    background: none;
    outline: none;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
}

.shop-items-grid {
    flex-grow: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding-right: 5px;
}

/* Custom Scrollbar for Shop */
.shop-items-grid::-webkit-scrollbar {
    width: 6px;
}
.shop-items-grid::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.02);
    border-radius: 3px;
}
.shop-items-grid::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 3px;
}

.shop-item-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: white;
    border-radius: 18px;
    border: 1px solid rgba(0,0,0,0.02);
    cursor: pointer;
    transition: var(--transition);
}

.shop-item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

.shop-item-card.locked {
    background: #edf2f7;
    opacity: 0.65;
    cursor: not-allowed;
}

.shop-item-card.active {
    border-color: var(--primary);
    background: #fff5f5;
}

.item-visual {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #f7fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.shop-item-card.locked .item-visual {
    filter: grayscale(100%);
    opacity: 0.4;
}

.item-details {
    flex-grow: 1;
}

.item-name {
    font-size: 0.85rem;
    font-weight: 700;
    display: block;
}

.item-desc {
    font-size: 0.7rem;
    color: var(--text-secondary);
    display: block;
}

.item-unlock-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 10px;
    background: #edf2f7;
    color: var(--text-secondary);
    white-space: nowrap;
}

.locked .item-unlock-badge {
    background: #fed7d7;
    color: #c53030;
}

.shop-actions {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.edit-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
}

.exit-btn {
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 12px;
    border-radius: 14px;
    background: var(--text-color);
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

.exit-btn:hover {
    background: #1a202c;
}

/* Particle effect */
.heart-particle {
    position: absolute;
    pointer-events: none;
    font-size: 1.5rem;
    animation: particleUp 1s ease-out forwards;
    z-index: 1000;
}

/* Animations */
@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideRight {
    from { transform: translateX(-50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideLeft {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes particleUp {
    0% { transform: translateY(0) scale(0.5); opacity: 1; }
    50% { opacity: 1; }
    100% { transform: translateY(-100px) translateX(var(--tx, 0px)) scale(1.2); opacity: 0; }
}
