:root {
    --caudalie-green: #2e4b3b;
    --caudalie-green-light: #4a7c59;
    --caudalie-gold: #c8a97e;
    --caudalie-gold-light: #e6cba3;
    --caudalie-cream: #f4f1ea;
    --text-dark: #1a1a1a;
    --text-light: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--caudalie-cream);
    color: var(--text-dark);
    overflow: hidden; /* Prevent scrolling, it's a game screen */
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Animated vine/lab background */
    background: linear-gradient(135deg, var(--caudalie-cream) 0%, #e0d8c8 100%);
}

/* Background animation container */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 50% 50%, rgba(200, 169, 126, 0.1) 0%, transparent 60%);
    z-index: 0;
    pointer-events: none;
}

h1, h2, h3 {
    font-family: 'Playfair Display', serif;
}

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, transform 0.5s ease;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.screen.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
}

/* Glassmorphism Panels */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px rgba(46, 75, 59, 0.1);
    max-width: 600px;
    width: 90%;
}

.text-center { text-align: center; }

/* Typography */
.main-title {
    font-size: 3.5rem;
    color: var(--caudalie-green);
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}
.subtitle {
    font-size: 1.2rem;
    color: var(--caudalie-gold);
    text-transform: uppercase;
    letter-spacing: 2px;
}
.desc {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 2rem;
}
.gold-text {
    color: var(--caudalie-gold);
}

/* Buttons */
button {
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.3s ease;
}

.primary-btn {
    background-color: var(--caudalie-green);
    color: var(--text-light);
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(46, 75, 59, 0.2);
}

.primary-btn:hover:not(:disabled) {
    background-color: var(--caudalie-green-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 75, 59, 0.3);
}

.primary-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.secondary-btn {
    background-color: transparent;
    color: var(--caudalie-green);
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    border-radius: 50px;
    font-weight: 600;
    border: 2px solid var(--caudalie-green);
}

.secondary-btn:hover {
    background-color: rgba(46, 75, 59, 0.05);
}

.pulse-glow {
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(200, 169, 126, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(200, 169, 126, 0); }
    100% { box-shadow: 0 0 0 0 rgba(200, 169, 126, 0); }
}

/* Avatar Selection */
.avatar-selection {
    margin-bottom: 2rem;
}
.avatar-selection h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}
.avatars {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}
.avatar-btn {
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}
.avatar-btn .emoji {
    font-size: 2.5rem;
}
.avatar-btn:hover {
    background: #fff;
    transform: translateY(-2px);
}
.avatar-btn.selected {
    border-color: var(--caudalie-gold);
    background: rgba(200, 169, 126, 0.1);
}

/* Hub Screen */
.hub-panel {
    max-width: 800px;
}
.hub-title {
    font-size: 2.5rem;
    color: var(--caudalie-green);
    margin-bottom: 1rem;
}
.doors-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}
.door-wrapper {
    perspective: 1000px;
}
.door {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem 1rem;
    width: 160px;
    cursor: pointer;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.door .door-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}
.door h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--caudalie-green);
}
.door .status {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 600;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
}

.door.locked {
    filter: grayscale(100%) opacity(0.6);
    cursor: not-allowed;
}
.door.locked .status {
    background: #eee;
    color: #888;
}
.door.unlocked:hover {
    transform: translateY(-5px) rotateY(10deg);
    box-shadow: 0 8px 25px rgba(46, 75, 59, 0.15);
    border-color: var(--caudalie-gold);
}
.door.unlocked .status {
    background: rgba(200, 169, 126, 0.2);
    color: var(--caudalie-gold);
}

/* Minigame Headers */
.minigame-screen {
    background: linear-gradient(to bottom, var(--caudalie-cream), #fff);
    align-items: center;
    justify-content: flex-start;
    padding-top: 4rem;
}
.minigame-header {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 1.5rem 3rem;
    border-radius: 0 0 24px 24px;
    position: absolute;
    top: 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    text-align: center;
    max-width: 800px;
    z-index: 20;
}
.minigame-header h2 {
    color: var(--caudalie-green);
    margin-bottom: 0.5rem;
}

/* Back Button */
#back-button {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 0.8rem 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--caudalie-green);
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}
#back-button:hover {
    background: #fff;
    transform: translateX(-2px);
}
#back-button svg {
    width: 20px;
    height: 20px;
}
#back-button.hidden {
    display: none;
}

/* Toast */
#toast-container {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.toast {
    background: var(--caudalie-green);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    animation: toastIn 0.3s ease forwards, toastOut 0.3s ease 2.7s forwards;
    opacity: 0;
}
@keyframes toastIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes toastOut { from { transform: translateY(0); opacity: 1; } to { transform: translateY(20px); opacity: 0; } }

/* ----------------- LAB ROOM ----------------- */
.bottles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 10rem;
    max-width: 800px;
}
.bottle {
    width: 80px;
    height: 120px;
    background: #fff;
    border-radius: 40px 40px 10px 10px;
    border: 3px solid #eee;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 1rem;
    font-size: 2rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}
.bottle::before {
    content: '';
    position: absolute;
    top: -20px;
    width: 30px;
    height: 20px;
    background: #ddd;
    border-radius: 5px;
}
.bottle:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.bottle.wrong.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
    border-color: #ff6b6b;
}
.bottle.correct {
    /* Slightly golden tint hint */
    background: linear-gradient(to bottom, #fff, rgba(200, 169, 126, 0.1));
}
.bottle.correct.glow {
    animation: itemGlow 1s forwards;
    border-color: var(--caudalie-gold);
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

@keyframes itemGlow {
    0% { box-shadow: 0 0 0 rgba(200, 169, 126, 0); }
    50% { box-shadow: 0 0 30px rgba(200, 169, 126, 0.8); transform: scale(1.1); }
    100% { box-shadow: 0 0 50px rgba(200, 169, 126, 1); transform: scale(1.1); background: var(--caudalie-gold-light); }
}

/* ----------------- VINEYARD ROOM ----------------- */
.vineyard-scene {
    position: relative;
    width: 100%;
    height: 60vh;
    margin-top: 8rem;
    background: radial-gradient(circle at center, rgba(74, 124, 89, 0.1) 0%, transparent 70%);
}
.vineyard-item {
    position: absolute;
    cursor: pointer;
    transition: all 0.3s ease;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}
.vineyard-item:hover {
    transform: scale(1.2) rotate(5deg);
    filter: drop-shadow(0 8px 12px rgba(200, 169, 126, 0.4));
}
.vineyard-item.collected {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}
.inventory {
    position: absolute;
    bottom: 3rem;
    display: flex;
    gap: 1rem;
    background: var(--glass-bg);
    padding: 1rem 2rem;
    border-radius: 50px;
    backdrop-filter: blur(10px);
}
.inv-slot {
    width: 50px;
    height: 50px;
    border: 2px dashed var(--caudalie-green-light);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}
.inv-slot.filled {
    border-style: solid;
    border-color: var(--caudalie-gold);
    background: rgba(200, 169, 126, 0.2);
}

/* ----------------- PHARMACY ROOM ----------------- */
.shelves {
    margin-top: 12rem;
    width: 80%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 4rem;
}
.shelf {
    height: 20px;
    background: #d4cfc5;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    padding: 0 2rem;
}
.pharma-product {
    width: 60px;
    height: 100px;
    background: #fff;
    border-radius: 10px;
    margin-bottom: 20px; /* sit on shelf */
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 5px 10px rgba(0,0,0,0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
}
.pharma-product:hover {
    transform: translateY(-10px);
}
.pharma-product.wrong {
    /* No visual hint until click */
}
.pharma-product.wrong.shake {
    animation: shake 0.5s both;
}
.pharma-product.correct.glow {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(3);
    z-index: 1000;
    box-shadow: 0 0 50px var(--caudalie-gold);
    border: 2px solid var(--caudalie-gold);
}

/* ----------------- END SCREEN ----------------- */
.final-reveal {
    position: relative;
    z-index: 20;
}
.final-product {
    font-size: 6rem;
    margin: 2rem 0;
    position: relative;
    display: inline-block;
}
.product-name {
    font-size: 1.2rem;
    font-family: 'Playfair Display', serif;
    color: var(--caudalie-green);
    margin-top: 1rem;
}
.glow-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(200, 169, 126, 0.6) 0%, transparent 70%);
    z-index: -1;
    animation: pulseGlowBg 3s infinite alternate;
}
@keyframes pulseGlowBg {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    100% { transform: translate(-50%, -50%) scale(1.5); opacity: 1; }
}
.reward-box {
    background: rgba(255,255,255,0.5);
    padding: 1.5rem;
    border-radius: 16px;
    margin: 2rem 0;
    border: 1px dashed var(--caudalie-gold);
}
.promo-code {
    font-size: 2rem;
    font-weight: 800;
    color: var(--caudalie-green);
    letter-spacing: 2px;
    margin: 0.5rem 0;
}
.promo-desc {
    color: var(--caudalie-gold);
    font-weight: 600;
}
.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}
.floating {
    animation: float 4s ease-in-out infinite;
}
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

#particles-container {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 10;
}
.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--caudalie-gold);
    border-radius: 50%;
    opacity: 0;
    animation: fall 4s linear infinite;
}
@keyframes fall {
    0% { transform: translateY(-50px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

/* Responsive */
@media (max-width: 600px) {
    .main-title { font-size: 2.5rem; }
    .doors-container { flex-direction: column; align-items: center; }
    .action-buttons { flex-direction: column; }
    .bottles-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .pharma-product { width: 40px; font-size: 1rem; }
}
