:root {
    --bg-dark: #0f172a;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --primary: #38bdf8; /* Lighter Cyan */
    --pro-gold: #fbbf24;
    --water-color: rgba(56, 189, 248, 0.7);
    --water-surface: rgba(186, 230, 253, 0.8);
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --text-main: #f8fafc;
    --font-family: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background: var(--bg-gradient);
    color: var(--text-main);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.background-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.25;
    z-index: -1;
}

.orb-1 {
    width: 60vw; height: 60vw;
    background: var(--primary);
    top: -20%; left: -20%;
}

.orb-2 {
    width: 50vw; height: 50vw;
    background: #8b5cf6;
    bottom: -10%; right: -20%;
}

/* Base App Containers */
.game-wrapper, .menu-view {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    max-width: 800px;
    z-index: 10;
}

.hidden {
    display: none !important;
}

/* ====== LEVEL SELECT VIEW ====== */

.menu-view {
    align-items: center;
    justify-content: flex-start;
    padding-top: 5rem;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
}
.menu-view::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome, Safari */
}

h1.title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.pro-tag {
    color: var(--pro-gold);
    background: rgba(251, 191, 36, 0.15);
    padding: 0 0.5rem;
    border-radius: 8px;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.subtitle {
    color: #94a3b8;
    margin-bottom: 3rem;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 1rem;
    width: 100%;
    max-width: 600px;
    padding-bottom: 2rem;
}

.level-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.2s;
}

.level-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.level-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    filter: grayscale(100%);
}

.level-btn.solved {
    border-color: var(--pro-gold);
    background: rgba(251, 191, 36, 0.1);
}

.level-num {
    font-size: 1.5rem;
    font-weight: 700;
}

.level-stars {
    font-size: 0.7rem;
    letter-spacing: 2px;
    margin-top: 5px;
}

/* ====== GAME VIEW ====== */

.hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 30px rgba(0,0,0,0.2);
}

.objective {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.objective span:first-child {
    font-size: 0.75rem;
    color: #cbd5e1;
    letter-spacing: 1px;
}

.objective span:last-child {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.center-hud {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.stars-display {
    font-size: 1.2rem;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
    transition: all 0.3s;
}

.moves-tracker {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 2px;
    font-weight: 500;
}

.moves-tracker .highlight {
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
}

.hud-controls {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    justify-content: flex-end;
}

.icon-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: white;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.icon-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
}

.icon-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.message-area {
    text-align: center;
    height: 24px;
    margin: 1rem 0;
    font-size: 1.1rem;
    color: #e2e8f0;
    font-weight: 500;
}

/* Jars Physics */
.jars-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1.5rem;
    padding-bottom: 2rem;
    perspective: 1000px;
}

.jar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: bottom center;
}

.jar-wrapper:hover {
    transform: translateY(-8px);
}

.jar-wrapper.selected {
    transform: translateY(-15px) scale(1.05);
}

.jar-wrapper.selected .jar {
    box-shadow: 0 0 25px var(--primary), inset 0 0 10px rgba(56, 189, 248, 0.2);
    border-color: var(--primary);
}

.jar {
    width: 90px;
    background: rgba(255, 255, 255, 0.03);
    border: 3px solid var(--glass-border);
    border-top: none;
    border-radius: 0 0 20px 20px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(4px);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.2);
}

/* Water liquid behavior */
.water {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--water-color);
    transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-top: 3px solid var(--water-surface);
    box-shadow: 0 -5px 15px rgba(56, 189, 248, 0.5);
}

.capacity-label {
    font-size: 1.1rem;
    font-weight: 800;
    background: rgba(0,0,0,0.3);
    padding: 0.2rem 0.8rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Context Menu & Modals */
.action-menu {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(1);
    background: #0f172a;
    padding: 1.5rem;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    border: 1px solid var(--glass-border);
    z-index: 100;
    width: 250px;
}

.action-menu.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.9);
}

.action-menu button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 1.2rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.2s;
}

.action-menu button:hover {
    background: var(--primary);
    color: #0f172a;
}

.action-menu #btn-cancel {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 0.8rem;
}

.controls-hint {
    text-align: center;
    font-size: 0.9rem;
    color: #94a3b8;
    margin-top: auto;
}

.secondary-btn, .cta-btn {
    border-radius: 50px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.secondary-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 0.8rem 1.5rem;
}

.secondary-btn:hover {
    background: rgba(255,255,255,0.1);
}

.cta-btn {
    background: var(--primary);
    color: #0f172a;
    border: none;
    padding: 1rem 2rem;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 25px rgba(56, 189, 248, 0.6);
}

/* Modals */
.modal {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    transition: opacity 0.3s;
}

.glass-panel {
    background: rgba(30, 41, 59, 0.7);
    padding: 2.5rem;
    border-radius: 24px;
    text-align: center;
    border: 1px solid var(--glass-border);
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    max-width: 400px;
    width: 90%;
}

.stars-animation {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    letter-spacing: 5px;
    text-shadow: 0 0 20px var(--pro-gold);
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .jar { width: 70px; }
    .jars-container { gap: 1rem; }
    .hud { padding: 0.8rem; }
}
