:root {
    --jungle-dark: #1a4d2e;
    --jungle-green: #2d6a4f;
    --jungle-light: #40916c;
    --jungle-bright: #52b788;
    --gold: #f9a825;
    --gold-light: #ffd54f;
    --orange: #ff6b35;
    --cream: #f5f0e1;
    --brown: #5d4037;
    --brown-dark: #3e2723;
}

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

body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, var(--jungle-dark) 0%, var(--jungle-green) 50%, var(--jungle-light) 100%);
    min-height: 100vh;
    overflow: hidden;
    touch-action: manipulation;
}

/* Screen Container */
.screen {
    display: none;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    position: fixed;
    top: 0;
    left: 0;
    flex-direction: column;
    overflow: hidden;
}

.screen.active {
    display: flex;
}

/* Menu Screen */
#menuScreen {
    background: url('../assets/background.png') center center / cover no-repeat;
    position: relative;
}

#menuScreen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(26, 77, 46, 0.7) 0%, rgba(26, 77, 46, 0.4) 50%, rgba(26, 77, 46, 0.8) 100%);
}

.menu-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    padding: 20px;
}

/* Logo */
.game-logo {
    margin-top: 30px;
    text-align: center;
}

.game-logo img {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.game-title {
    font-family: 'Bangers', cursive;
    font-size: 2.8rem;
    color: var(--gold);
    text-shadow: 3px 3px 0 var(--brown-dark), 5px 5px 10px rgba(0,0,0,0.5);
    margin-top: 15px;
    letter-spacing: 3px;
}

.game-subtitle {
    font-size: 1rem;
    color: var(--cream);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    margin-top: 5px;
    font-weight: 600;
}

/* Coin Display */
.coin-display {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.4);
    padding: 8px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(5px);
}

.coin-icon {
    font-size: 1.2rem;
}

.coin-amount {
    font-family: 'Bangers', cursive;
    font-size: 1.2rem;
    color: var(--gold);
}

/* Play Button */
.play-btn {
    margin-top: 30px;
    padding: 18px 60px;
    font-family: 'Bangers', cursive;
    font-size: 2rem;
    color: var(--brown-dark);
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 8px 0 var(--brown), 0 15px 30px rgba(0,0,0,0.4);
    transition: all 0.15s ease;
    letter-spacing: 2px;
}

.play-btn:active {
    transform: translateY(4px);
    box-shadow: 0 4px 0 var(--brown), 0 8px 15px rgba(0,0,0,0.4);
}

/* Tabs */
.tabs-container {
    margin-top: auto;
    width: 100%;
    max-width: 400px;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    border-radius: 25px 25px 0 0;
    padding: 10px;
}

.tabs {
    display: flex;
    gap: 3px;
}

.tab-btn {
    flex: 1;
    padding: 10px 5px;
    border: none;
    background: transparent;
    color: var(--cream);
    font-family: 'Nunito', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: var(--jungle-bright);
    color: var(--brown-dark);
}

.tab-btn svg {
    display: block;
    margin: 0 auto 4px;
    width: 20px;
    height: 20px;
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 15px;
    max-height: 40vh;
    overflow-y: auto;
}

.tab-content.active {
    display: block;
}

/* Levels Grid */
.levels-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.zone-title {
    grid-column: 1 / -1;
    font-family: 'Bangers', cursive;
    color: var(--gold);
    font-size: 1.1rem;
    margin: 8px 0 3px;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}

.level-btn {
    aspect-ratio: 1;
    border: none;
    border-radius: 12px;
    font-family: 'Bangers', cursive;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.level-btn.unlocked {
    background: linear-gradient(135deg, var(--jungle-bright) 0%, var(--jungle-light) 100%);
    color: white;
    box-shadow: 0 3px 0 var(--jungle-dark);
}

.level-btn.unlocked:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 var(--jungle-dark);
}

.level-btn.locked {
    background: rgba(0,0,0,0.3);
    color: rgba(255,255,255,0.4);
}

.level-btn.completed {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--brown-dark);
    box-shadow: 0 3px 0 var(--brown);
}

.level-stars {
    font-size: 0.5rem;
    margin-top: 2px;
}

/* Settings */
.settings-section {
    margin-bottom: 15px;
}

.settings-label {
    color: var(--cream);
    font-weight: 700;
    margin-bottom: 8px;
    display: block;
    font-size: 0.9rem;
}

.language-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.lang-btn {
    padding: 10px;
    border: 2px solid transparent;
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
    color: var(--cream);
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.lang-btn.active {
    background: var(--jungle-bright);
    border-color: var(--gold);
    color: white;
}

.lang-flag {
    font-size: 1.2rem;
}

.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.toggle-label {
    color: var(--cream);
    font-weight: 600;
    font-size: 0.9rem;
}

.toggle {
    width: 46px;
    height: 26px;
    background: rgba(0,0,0,0.3);
    border-radius: 13px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle.active {
    background: var(--jungle-bright);
}

.toggle::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: all 0.3s ease;
}

.toggle.active::after {
    left: 23px;
}

/* Shop */
.shop-header {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.shop-category-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    color: var(--cream);
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shop-category-btn.active {
    background: var(--gold);
    color: var(--brown-dark);
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.shop-item {
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 12px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.shop-item.owned {
    border-color: var(--jungle-bright);
}

.shop-item.equipped {
    border-color: var(--gold);
    background: rgba(249, 168, 37, 0.2);
}

.shop-item-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 8px;
}

.shop-item-name {
    color: var(--cream);
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.shop-item-price {
    color: var(--gold);
    font-family: 'Bangers', cursive;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.shop-item-btn {
    margin-top: 8px;
    padding: 6px 15px;
    border: none;
    border-radius: 15px;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shop-item-btn.buy {
    background: var(--gold);
    color: var(--brown-dark);
}

.shop-item-btn.equip {
    background: var(--jungle-bright);
    color: white;
}

.shop-item-btn.equipped {
    background: rgba(255,255,255,0.2);
    color: var(--cream);
}

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

/* About */
.about-content {
    color: var(--cream);
    line-height: 1.5;
    font-size: 0.9rem;
}

.about-title {
    font-family: 'Bangers', cursive;
    color: var(--gold);
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.about-section {
    margin-bottom: 15px;
}

/* Game Screen */
#gameScreen {
    background: url('../assets/background.png') center center / cover no-repeat;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, transparent 100%);
}

.header-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(5px);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.level-num {
    font-family: 'Bangers', cursive;
    font-size: 1.4rem;
    color: var(--gold);
    text-shadow: 2px 2px 0 rgba(0,0,0,0.5);
}

.kicks-left {
    font-size: 0.85rem;
    color: white;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
}

.star-goal {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 5px;
}

.star-goal span {
    font-size: 1.2rem;
}

/* Game Canvas Container */
.game-canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Control Panel */
.control-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
}

.control-instruction {
    text-align: center;
    color: white;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

/* Direction Selector */
.direction-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.direction-btn {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.direction-btn:active {
    background: var(--jungle-bright);
    transform: scale(0.95);
}

.angle-display {
    font-family: 'Bangers', cursive;
    font-size: 2rem;
    color: var(--gold);
    min-width: 80px;
    text-align: center;
}

/* Power Bar */
.power-container {
    display: none;
    flex-direction: column;
    align-items: center;
}

.power-container.active {
    display: flex;
}

.power-bar-bg {
    width: 100%;
    max-width: 300px;
    height: 30px;
    background: rgba(0,0,0,0.5);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.power-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--jungle-bright) 0%, var(--gold) 50%, var(--orange) 100%);
    width: 100%;
}

.power-indicator {
    position: absolute;
    top: 0;
    width: 6px;
    height: 100%;
    background: white;
    box-shadow: 0 0 10px white;
    transition: left 0.016s linear;
}

.kick-btn {
    margin-top: 15px;
    padding: 15px 50px;
    font-family: 'Bangers', cursive;
    font-size: 1.5rem;
    color: var(--brown-dark);
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 5px 0 var(--brown);
    transition: all 0.1s ease;
}

.kick-btn:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 var(--brown);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, var(--jungle-green) 0%, var(--jungle-dark) 100%);
    border-radius: 25px;
    padding: 30px;
    text-align: center;
    max-width: 320px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    border: 3px solid var(--jungle-bright);
}

.modal-title {
    font-family: 'Bangers', cursive;
    font-size: 2.2rem;
    color: var(--gold);
    text-shadow: 3px 3px 0 rgba(0,0,0,0.3);
    margin-bottom: 10px;
}

.modal-stars {
    font-size: 2.5rem;
    margin: 15px 0;
}

.modal-message {
    color: var(--cream);
    font-size: 1rem;
    margin-bottom: 15px;
}

.modal-coins {
    color: var(--gold);
    font-family: 'Bangers', cursive;
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-family: 'Bangers', cursive;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn.primary {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--brown-dark);
    box-shadow: 0 4px 0 var(--brown);
}

.modal-btn.secondary {
    background: rgba(255,255,255,0.2);
    color: white;
}

.modal-btn:active {
    transform: translateY(2px);
}

/* Pause Modal */
.pause-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.pause-btn {
    padding: 15px;
    border: none;
    border-radius: 15px;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.pause-btn.resume {
    background: linear-gradient(135deg, var(--jungle-bright) 0%, var(--jungle-light) 100%);
    color: white;
}

.pause-btn.restart {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--brown-dark);
}

.pause-btn.menu {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* Scrollbar */
.tab-content::-webkit-scrollbar {
    width: 5px;
}

.tab-content::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
    border-radius: 3px;
}

.tab-content::-webkit-scrollbar-thumb {
    background: var(--jungle-bright);
    border-radius: 3px;
}

/* Animations */
@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.pulse {
    animation: pulse 0.8s ease-in-out infinite;
}

/* Responsive */
@media (max-width: 360px) {
    .game-title { font-size: 2.2rem; }
    .levels-grid { gap: 8px; }
    .level-btn { font-size: 1rem; }
    .tab-btn { font-size: 0.65rem; padding: 8px 3px; }
}

