:root {
    --primary-color: #f7a840; /* Laranja Capivara fofa */
    --accent-color: #4CAF50; /* Verde Floresta vibrante */
    --text-color: #ffffff;
    --overlay-bg: rgba(0, 0, 0, 0.5);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-color: rgba(0, 0, 0, 0.3);
    --gradient-bg: linear-gradient(135deg, #f7a840 0%, #d48e2f 100%);
    --font-main: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
    touch-action: none; /* Previne scroll acidental no mobile */
    -webkit-user-select: none;
    user-select: none;
}

body, html {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background-color: #000;
}

#game-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* UI Overlay */
#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

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

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.8) 100%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-out, visibility 0.5s;
    backdrop-filter: blur(8px);
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

.content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 3rem;
    border-radius: 2rem;
    text-align: center;
    box-shadow: 0 20px 50px var(--shadow-color);
    max-width: 90%;
    width: 450px;
}

.game-title {
    font-size: 5rem;
    font-weight: 900;
    background: var(--gradient-bg);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -2px;
    margin-bottom: 0.5rem;
    text-shadow: 0 10px 20px rgba(247, 168, 64, 0.3);
}

.subtitle {
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: 400;
    opacity: 0.8;
    margin-bottom: 2rem;
}

.controls-hint {
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.control-item {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.key {
    background: #ffffff;
    color: #333;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    min-width: 30px;
    display: inline-block;
    box-shadow: 0 3px 0 #ccc;
}

.btn-primary {
    background: var(--gradient-bg);
    color: white;
    border: none;
    padding: 1.2rem 3rem;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 100px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 30px rgba(247, 168, 64, 0.4);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.name-input-container {
    margin-top: 1.5rem;
}

#player-name-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    width: 100%;
    text-align: center;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s, background-color 0.3s;
}

#player-name-input:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
}

#player-name-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Score board */
#score-container {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 10px 25px;
    border-radius: 20px;
    backdrop-filter: blur(15px);
    color: white;
    display: grid;
    grid-template-columns: repeat(4, auto);
    align-items: center;
    gap: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: all 0.3s;
    white-space: nowrap;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#player-name-display-label, #score-label, #record-label, #coin-label {
    font-size: 0.65rem;
    opacity: 0.6;
    letter-spacing: 1px;
    font-weight: 700;
}

#player-name-display, #score-value, #record-value, #coin-value {
    font-size: 1.4rem;
    font-weight: 900;
}

#player-name-display {
    color: var(--primary-color);
}

.record #record-value {
    color: #00E5FF; /* Cyan for record */
}

.coins #coin-value {
    color: #ffd700;
}

#score-container .score-item:not(:last-child) {
    border-right: 1px solid rgba(255,255,255,0.1);
    padding-right: 20px;
}

/* Game over screen additions */
#game-over-screen .title {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.final-score {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.final-coins {
    font-size: 1.5rem;
    color: #ffd700;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

#leaderboard-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: left;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#leaderboard-container h3 {
    text-align: center;
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

#leaderboard-list {
    list-style: none;
    padding: 0;
}

#leaderboard-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    color: white;
}

#leaderboard-list li:nth-child(1) { color: #FFD700; font-weight: bold; }
#leaderboard-list li:nth-child(2) { color: #C0C0C0; }
#leaderboard-list li:nth-child(3) { color: #CD7F32; }

#leaderboard-list li .name {
    font-weight: 700;
}

#leaderboard-list li .dist {
    opacity: 0.7;
}

.actions {
    margin-top: 1rem;
}

.share-hint {
    margin-top: 1.5rem;
    font-size: 0.8rem;
    opacity: 0.5;
    color: white;
}

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

.game-title {
    animation: float 4s ease-in-out infinite;
}

#game-footer {
    position: absolute;
    bottom: 20px;
    width: 100%;
    text-align: center;
    pointer-events: none;
    z-index: 5;
}

.footer-links {
    pointer-events: auto;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    font-size: 0.75rem;
    margin: 0 15px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--primary-color);
}

#touch-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    pointer-events: none;
    z-index: 999999; /* ABSOLUTAMENTE ACIMA DE TUDO */
}

.touch-zone {
    flex: 1;
    pointer-events: auto;
    /* Para debug mude para background: rgba(x,x,x,0.1) se necessário */
}

/* Área central de pulo um pouco maior */
#touch-center {
    flex: 1.5;
}

@media (max-width: 600px) {
    #touch-controls {
        height: 100%;
        top: 0;
    }
}
