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

:root {
    --bg-soft: #cfd982;
    --green-500: #00843d;
    --green-400: #00a651;
    --orange-500: #f4811f;
    --white: #ffffff;
    --offwhite: #fafaf8;
    --gray-200: #e5e7eb;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-900: #111827;
    --radius-md: 18px;
    --radius-full: 9999px;
    --transition: 0.25s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

body {
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    font-family: 'Nunito', sans-serif;
    background-color: var(--bg-soft);
    position: relative;
    user-select: none;
}

/* ----- LANDING OVERLAY ----- */
#landing-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(1rem, 4vh, 2.5rem);
    background: var(--bg-soft);
    background-image: url('fundo.svg');
    background-size: cover;
    background-position: center;
    cursor: pointer;
    transition: opacity 0.45s ease, visibility 0.45s ease;
}
#landing-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.landing-image {
    width: clamp(200px, 55vw, 560px);
    animation: gentleFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 10px 20px rgba(0,60,20,0.25));
}
@keyframes gentleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
.landing-text {
    font-family: 'Pacifico', cursive;
    font-size: clamp(1.8rem, 5vw, 3.5rem);
    color: var(--green-500);
    text-align: center;
    animation: pulseText 2.2s ease infinite;
    text-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
@keyframes pulseText {
    0%, 100% { opacity: 0.9; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.02); }
}
.landing-sub {
    font-weight: 800;
    font-size: clamp(0.7rem, 1.2vw, 1rem);
    color: var(--orange-500);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* ----- GAME WRAPPER ----- */
#game-wrapper {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: none;
    background-color: var(--bg-soft);
    overflow-y: auto;
    padding: 18px 14px 24px 14px;
}
#game-wrapper.active {
    display: block;
}

/* GRELHA RESPONSIVA */
#prizes-grid {
    display: grid;
    gap: 16px;
    justify-content: center;
    align-items: start;
    width: 100%;
    margin: 0 auto;
    grid-auto-rows: auto;
}

/* PINGO - QUADRADO PERFEITO */
.pingo {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
    transition: transform var(--transition), filter 0.2s ease;
    will-change: transform;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    border: none;
}

.pingo:hover:not(.opened) {
    transform: scale(1.03) translateY(-3px);
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.2));
    z-index: 2;
}

.pingo:active:not(.opened) {
    transform: scale(0.97);
}

.pingo.opened {
    cursor: default;
    filter: brightness(0.7) saturate(0.6);
    transform: none;
}

.pingo-label {
    position: relative;
    font-weight: 900;
    font-size: clamp(0.65rem, 2.2vw, 1rem);
    text-align: center;
    line-height: 1.3;
    padding: 0 6px;
    color: white;
    max-width: 90%;
    word-break: break-word;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.pingo.opened .pingo-label {
    opacity: 1;
}

/* ----- MODAL ----- */
#prize-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    background: rgba(0, 20, 6, 0.85);
    backdrop-filter: blur(18px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}
#prize-modal.active {
    opacity: 1;
    pointer-events: all;
}
.modal-card {
    background: transparent;
    background-image: url('popup.svg');
    background-size: cover;
    background-position: center;
    width: min(86vw, 540px);
    aspect-ratio: 1 / 1;
    transform: scale(0.85) translateY(30px);
    transition: transform 0.5s cubic-bezier(0.2, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}
#prize-modal.active .modal-card {
    transform: scale(1) translateY(0);
}
.modal-body {
    padding: 1rem 1.8rem 2rem;
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.prize-image-full {
    width: min(140px, 38%);
    height: auto;
    margin-bottom: 0.5rem;
    animation: popIn 0.5s cubic-bezier(0.18,1,0.3,1);
    filter: drop-shadow(0 8px 18px rgba(0,0,0,0.2));
}
@keyframes popIn {
    0% { transform: scale(0.2) rotate(-15deg); opacity: 0; }
    70% { transform: scale(1.05) rotate(2deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}
.modal-label {
    font-weight: 800;
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    color: var(--green-500);
    text-transform: uppercase;
}
.modal-prize-name {
    font-size: clamp(1.3rem, 3.2vw, 1.9rem);
    font-weight: 900;
    color: var(--gray-900);
    margin: 0.6rem 0 1.2rem;
    line-height: 1.2;
}
.btn-close-modal {
    background: var(--green-500);
    border: none;
    color: white;
    padding: 0.7rem 2.5rem;
    border-radius: var(--radius-full);
    font-weight: 800;
    font-size: 1rem;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 5px 14px rgba(0,80,30,0.4);
}
.btn-close-modal:active { transform: scale(0.96); }

/* ----- CONFETTI ----- */
#confetti-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 400;
}

/* ----- ADMIN PANEL ----- */
/* ----- ADMIN PANEL (BOTTOM DRAWER) ----- */
#admin-panel {
    position: fixed;
    bottom: -100%;          /* começa escondido abaixo da viewport */
    left: 0;
    width: 100%;
    max-height: 80vh;       /* altura máxima de 80% da viewport */
    background: #fff;
    z-index: 600;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -6px 30px rgba(0,0,0,0.2);
    transition: bottom 0.35s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    border-radius: 24px 24px 0 0;
    overflow: hidden;
    border-top: 1px solid var(--gray-200);
}
#admin-panel.open {
    bottom: 0;              /* desliza para cima */
}
.admin-bar {
    padding: 18px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
}
.admin-bar h2 { font-size: 1.2rem; font-weight: 900; }
.admin-close-btn {
    background: #f0f0f0;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    border: none;
    cursor: pointer;
}
.admin-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px 30px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    background: var(--offwhite);
}
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stat-box {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 18px;
    padding: 12px 14px;
}
.stat-box .big {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--green-500);
}
textarea#prize-input {
    width: 100%;
    min-height: 140px;
    padding: 12px;
    border-radius: 16px;
    border: 1.5px solid var(--gray-200);
    font-family: monospace;
    font-size: 0.85rem;
    background: #fff;
}
.btn-primary {
    background: var(--green-500);
    color: white;
    border: none;
    border-radius: 40px;
    padding: 14px;
    font-weight: 800;
    width: 100%;
    cursor: pointer;
}
.btn-outline, .btn-danger {
    width: 100%;
    padding: 13px;
    border-radius: 40px;
    font-weight: 800;
    cursor: pointer;
    background: white;
}
.btn-danger { border: 1.5px solid #fca5a5; color: #c2410c; }
#admin-hint {
    position: fixed;
    bottom: 12px;
    left: 16px;
    font-size: 0.55rem;
    color: rgba(0,0,0,0.35);
    z-index: 50;
    pointer-events: none;
}
.ripple {
    position: fixed;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,230,110,0.6), rgba(255,200,50,0));
    transform: translate(-50%,-50%) scale(0);
    animation: rippleAnim 0.6s ease-out;
    pointer-events: none;
    z-index: 8;
}
@keyframes rippleAnim {
    to { transform: translate(-50%,-50%) scale(5); opacity: 0; }
}
.pingo.just-opened {
    animation: gentleFlash 0.25s ease-out;
}
@keyframes gentleFlash {
    0% { filter: brightness(1.2); }
    100% { filter: brightness(0.7) saturate(0.6); }
}