/* ============================================
   CLAWPET - Virtual AI Pet
   Cute, Playful, Tamagotchi Style
   ============================================ */

:root {
    --bg: #1a1625;
    --bg-card: #251f35;
    --bg-light: #2d2640;
    --border: #3d3555;
    --text: #fff;
    --text-dim: #a099b0;
    --pink: #ff6b9d;
    --purple: #9b6dff;
    --blue: #6bb3ff;
    --green: #6bff9b;
    --yellow: #ffd96b;
    --red: #ff6b6b;
    --font-main: 'Nunito', sans-serif;
    --font-pixel: 'Press Start 2P', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(155, 109, 255, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(255, 107, 157, 0.1) 0%, transparent 40%);
}

.app {
    max-width: 500px;
    margin: 0 auto;
    padding: 1rem;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 1.5rem;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
}

.accent {
    color: var(--pink);
}

.coins {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 2px solid var(--yellow);
    border-radius: 50px;
    font-weight: 700;
}

/* Pet Section */
.pet-section {
    text-align: center;
    padding: 1rem;
}

.pet-container {
    background: var(--bg-card);
    border: 3px solid var(--border);
    border-radius: 30px;
    padding: 2rem;
    position: relative;
}

.pet-mood {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.375rem 0.75rem;
    background: var(--green);
    color: var(--bg);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
}

.pet-display {
    position: relative;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.pet {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 100%);
    border-radius: 50%;
    position: relative;
    animation: petIdle 2s ease-in-out infinite;
    box-shadow: 0 10px 30px rgba(155, 109, 255, 0.3);
}

@keyframes petIdle {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.02); }
}

.pet.happy {
    animation: petHappy 0.5s ease-in-out;
}

@keyframes petHappy {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1) rotate(-5deg); }
    75% { transform: scale(1.1) rotate(5deg); }
}

.pet.eating {
    animation: petEat 0.3s ease-in-out 3;
}

@keyframes petEat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pet.sleeping {
    animation: petSleep 2s ease-in-out infinite;
    filter: brightness(0.7);
}

@keyframes petSleep {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.98); }
}

.pet-eyes {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
}

.eye {
    width: 16px;
    height: 20px;
    background: white;
    border-radius: 50%;
    position: relative;
}

.eye::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #222;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: eyeMove 3s ease-in-out infinite;
}

@keyframes eyeMove {
    0%, 100% { transform: translate(-50%, -50%); }
    25% { transform: translate(-30%, -50%); }
    75% { transform: translate(-70%, -50%); }
}

.pet-mouth {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 10px;
    background: #222;
    border-radius: 0 0 20px 20px;
}

.pet-blush {
    position: absolute;
    width: 15px;
    height: 8px;
    background: rgba(255, 150, 150, 0.5);
    border-radius: 50%;
    top: 55%;
}

.pet-blush.left { left: 15%; }
.pet-blush.right { right: 15%; }

.pet-shadow {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    animation: shadowPulse 2s ease-in-out infinite;
}

@keyframes shadowPulse {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.3; }
    50% { transform: translateX(-50%) scale(0.8); opacity: 0.2; }
}

.pet-name {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.edit-name {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.edit-name:hover {
    opacity: 1;
}

.pet-level {
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* Stats */
.stats-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 20px;
    margin-bottom: 1rem;
}

.stat-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stat-icon {
    font-size: 1.25rem;
}

.stat-info {
    flex: 1;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 0.25rem;
}

.bar {
    height: 12px;
    background: var(--bg-light);
    border-radius: 6px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
}

.bar-fill.health { background: linear-gradient(90deg, var(--red), var(--pink)); }
.bar-fill.hunger { background: linear-gradient(90deg, var(--yellow), #ffa500); }
.bar-fill.happiness { background: linear-gradient(90deg, var(--green), #00ff88); }
.bar-fill.energy { background: linear-gradient(90deg, var(--blue), var(--purple)); }

.stat-value {
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 30px;
    text-align: right;
}

/* Actions */
.actions-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    padding: 1rem 0.5rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 15px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    transform: translateY(-3px);
    border-color: var(--pink);
    box-shadow: 0 5px 15px rgba(255, 107, 157, 0.2);
}

.action-btn:active {
    transform: scale(0.95);
}

.action-icon {
    font-size: 1.5rem;
}

.action-text {
    font-weight: 700;
    font-size: 0.85rem;
}

.action-cost {
    font-size: 0.65rem;
    color: var(--text-dim);
}

/* Shop */
.shop-section, .games-section, .achievements-section {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 1rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.shop-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem;
    background: var(--bg-light);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.shop-item:hover {
    border-color: var(--yellow);
    transform: scale(1.05);
}

.item-icon {
    font-size: 1.5rem;
}

.item-name {
    font-size: 0.7rem;
    font-weight: 600;
}

.item-price {
    font-size: 0.6rem;
    color: var(--yellow);
}

/* Games */
.games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.game-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--purple) 0%, var(--pink) 100%);
    border: none;
    border-radius: 15px;
    color: white;
    font-family: var(--font-main);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.game-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(155, 109, 255, 0.4);
}

.game-btn span:first-child {
    font-size: 1.5rem;
}

/* Achievements */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.achievement {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: 12px;
    opacity: 0.4;
    filter: grayscale(1);
    text-align: center;
}

.achievement.unlocked {
    opacity: 1;
    filter: none;
    border: 2px solid var(--yellow);
}

.achievement span:first-child {
    font-size: 1.25rem;
}

.achievement span:last-child {
    font-size: 0.6rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 1rem;
    color: var(--text-dim);
    font-size: 0.85rem;
}

/* Effects Container */
.effects-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.floating-effect {
    position: absolute;
    font-size: 1.5rem;
    animation: floatUp 1s ease-out forwards;
}

@keyframes floatUp {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-100px) scale(1.5); opacity: 0; }
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 0.875rem 1.5rem;
    background: var(--purple);
    color: white;
    border-radius: 50px;
    font-weight: 700;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1001;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Responsive */
@media (max-width: 400px) {
    .actions-section {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .shop-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
