/* ═══════════════════════════════════════════════════════════════
   TRILHA ALFABÉTICA V2 — game.css
   Visual: lago com vitórias-régias, sapo saltando A→Z
   Mobile-First | EducaJogos 2026
═══════════════════════════════════════════════════════════════ */

/* ─── Variables ─────────────────────────────────────────────── */
:root {
    --pad-size:   clamp(40px, 9.5vw, 56px);
    --frog-size:  clamp(22px, 5vw, 32px);
}

/* ─── Fullscreen ─────────────────────────────────────────────── */
.fullscreen-btn {
    position: absolute;
    top: 10px; right: 10px;
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.5);
    color: white;
    width: 36px; height: 36px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
    z-index: 20;
}
.fullscreen-btn:hover { background: rgba(255,255,255,0.4); }

/* ─── Wrapper externo do jogo ────────────────────────────────── */
.game-container {
    position: relative;
    background: linear-gradient(180deg, #1e2d1a 0%, #1b6b34 8%, #1464a0 25%, #0d4a7a 100%);
    border-radius: 20px;
    padding: 20px 16px 16px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.35);
    overflow: hidden;
}

/* ─── Screens ────────────────────────────────────────────────── */
.game-screen { display: none; }

/* ─── Difficulty Screen ──────────────────────────────────────── */
#difficultyScreen { text-align: center; padding: 20px 0 10px; }
.diff-title {
    color: #fff;
    font-family: var(--font-primary);
    font-size: clamp(18px, 4vw, 26px);
    margin-bottom: 6px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.diff-subtitle {
    color: rgba(255,255,255,0.8);
    font-family: var(--font-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}
.diff-cards {
    display: flex; gap: 12px;
    justify-content: center; flex-wrap: wrap;
}
.diff-card {
    background: rgba(255,255,255,0.12);
    border: 2px solid rgba(255,255,255,0.25);
    border-radius: 16px;
    padding: 20px 14px;
    width: clamp(90px, 28vw, 138px);
    cursor: pointer;
    transition: all 0.25s ease;
    color: white; text-align: center;
}
.diff-card:hover {
    transform: translateY(-4px);
    background: rgba(255,255,255,0.22);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}
.diff-card .diff-icon  { font-size: 36px; display: block; margin-bottom: 8px; }
.diff-card .diff-label { font-family: var(--font-primary); font-size: 16px; font-weight: 700; display: block; }
.diff-card .diff-info  { font-family: var(--font-secondary); font-size: 12px; color: rgba(255,255,255,0.8); display: block; margin-top: 4px; }
.diff-card.easy   { border-color: #52b788; }
.diff-card.medium { border-color: #f9c74f; }
.diff-card.hard   { border-color: #f77f00; }

/* ─── Game Screen HUD ────────────────────────────────────────── */
#gameScreen { padding-bottom: 8px; }
.game-hud {
    display: flex; align-items: center;
    justify-content: space-between;
    gap: 8px; margin-bottom: 12px;
    flex-wrap: wrap;
    position: relative; z-index: 10;
}
.progress-wrap { flex: 1; min-width: 140px; }
.progress-label {
    color: rgba(255,255,255,0.9);
    font-family: var(--font-secondary);
    font-size: 12px; margin-bottom: 4px;
}
.progress-bar {
    background: rgba(255,255,255,0.2);
    border-radius: 8px; height: 10px; overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #52b788, #f9c74f);
    border-radius: 8px;
    transition: width 0.4s ease;
    width: 0%;
}
.btn-walk {
    background: linear-gradient(135deg, #f9c74f, #f3722c);
    color: white; border: none; border-radius: 12px;
    padding: 10px 18px;
    font-family: var(--font-primary);
    font-size: 15px; font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(243,114,44,0.4);
    transition: all 0.2s ease;
    display: none;
}
.btn-walk:hover { transform: translateY(-2px); }

/* ═══════════════════════════════════════════════════════════════
   LAGO COM PEDRAS
═══════════════════════════════════════════════════════════════ */

/* Container do lago — posição relativa para pads absolutos */
#lakeScene {
    position: relative;
    width: 100%;
    min-height: 360px;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 12px;
    /* Agua azul clara como lago tropical */
    background: #25aee8;
}

/* Ondulação da água (canvas com requestAnimationFrame no JS) */
#lakeCanvas {
    position: absolute;
    inset: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Margem de terra/areia — topo (destino: Z) */
.lake-bank-top {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 40px;
    background: linear-gradient(180deg, #7a4a1e 0%, #9a6028 60%, #b8832e 85%, transparent 100%);
    border-radius: 14px 14px 40% 60% / 14px 14px 20px 20px;
    z-index: 1;
}
/* Margem de terra/areia — fundo (início: A) */
.lake-bank-bottom {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 40px;
    background: linear-gradient(0deg, #7a4a1e 0%, #9a6028 60%, #b8832e 85%, transparent 100%);
    border-radius: 60% 40% 14px 14px / 20px 20px 14px 14px;
    z-index: 1;
}

/* Ilhas/pedaços de terra decorativos */
.nenufar {
    position: absolute;
    border-radius: 44% 56% 38% 62% / 52% 40% 60% 48%;
    background: radial-gradient(circle at 42% 36%, #b87832 0%, #8a5218 60%, #603408 100%);
    border: 2.5px solid #3e1f04;
    opacity: 0.80;
    z-index: 1;
    pointer-events: none;
}

/* Marcador de início (antes da letra A) */
#frogStart {
    position: absolute;
    z-index: 6;
    font-size: 11px;
    color: rgba(255,255,255,0.9);
    background: rgba(0,80,0,0.55);
    padding: 2px 7px;
    border-radius: 8px;
    font-family: var(--font-secondary);
    white-space: nowrap;
}

/* SVG da trilha pontilhada */
#pathSvg {
    position: absolute;
    inset: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: visible;
}

/* ─── Pedras (pads) ──────────────────────────────────────────── */
.pad {
    position: absolute;
    width: var(--pad-size);
    height: var(--pad-size);
    /* Blob irregular como pedra */
    border-radius: 44% 56% 60% 40% / 52% 38% 62% 48%;
    display: flex; align-items: center; justify-content: center;
    transform: translate(-50%, -50%);
    cursor: default;
    z-index: 5;
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
    /* Pedra marrom */
    background: radial-gradient(circle at 38% 32%,
        #c49060 0%, #9b6034 45%, #7a4520 75%, #4a2508 100%);
    box-shadow:
        0 0 0 2.5px #2e1404,
        inset 0 3px 5px rgba(255,220,180,0.22),
        inset 0 -4px 7px rgba(0,0,0,0.4),
        0 5px 14px rgba(0,0,0,0.5);
}
/* cada pedra tem forma ligeiramente diferente */
.pad:nth-child(2n)   { border-radius: 55% 45% 38% 62% / 48% 60% 40% 52%; }
.pad:nth-child(3n)   { border-radius: 38% 62% 50% 50% / 60% 40% 60% 40%; }
.pad:nth-child(4n)   { border-radius: 60% 40% 45% 55% / 45% 55% 45% 55%; }
/* reflexo de luz na pedra */
.pad::before {
    content: '';
    position: absolute; top: 12%; left: 18%;
    width: 35%; height: 28%;
    border-radius: 44% 56% 60% 40% / 52% 38% 62% 48%;
    background: rgba(255,235,200,0.22);
    transform: rotate(-20deg);
    pointer-events: none;
}
.pad-letter {
    font-family: var(--font-primary);
    font-size: clamp(14px, 3vw, 20px);
    font-weight: 700;
    color: #fff8ee;
    text-shadow: 0 1px 4px rgba(0,0,0,0.75);
    user-select: none;
    position: relative; z-index: 2;
}

/* Pedra em branco — precisa de letra */
.pad-blank {
    background: radial-gradient(circle at 38% 32%,
        #d8b080 0%, #bA7d3f 45%, #9a5e20 75%, #6a380a 100%) !important;
    cursor: pointer;
    animation: float-pad 3s ease-in-out infinite;
}
.pad-blank:nth-child(odd)  { animation-duration: 3.5s; animation-delay: 0.5s; }
.pad-blank:nth-child(even) { animation-duration: 2.7s; animation-delay: 1.2s; }

@keyframes float-pad {
    0%,100% { box-shadow: 0 0 0 2.5px #2e1404, inset 0 3px 5px rgba(255,220,180,.22), inset 0 -4px 7px rgba(0,0,0,.4), 0 4px 10px rgba(0,0,0,.4); }
    50%     { box-shadow: 0 0 0 2.5px #2e1404, inset 0 3px 5px rgba(255,220,180,.22), inset 0 -4px 7px rgba(0,0,0,.4), 0 9px 20px rgba(0,0,0,.35); transform: translate(-50%,-50%) translateY(-3px); }
}
.pad-blank .pad-letter { color: rgba(255,255,255,0.45); font-size: clamp(18px,4vw,26px); }
.pad-blank:hover {
    filter: brightness(1.18); animation: none;
    transform: translate(-50%,-50%) scale(1.12);
    box-shadow: 0 0 0 3px #fffbe6, 0 8px 22px rgba(0,0,0,0.45);
}

/* Pedra selecionada para digitação */
.pad-active {
    background: radial-gradient(circle at 38% 36%,
        #ffe566 0%, #f9c74f 50%, #e09b00 100%) !important;
    animation: pulse-active 0.85s ease-in-out infinite !important;
    cursor: pointer;
    border-radius: 44% 56% 60% 40% / 52% 38% 62% 48% !important;
}
.pad-active .pad-letter { color: #4a2c00 !important; }
@keyframes pulse-active {
    0%,100% { box-shadow: 0 0 0 3px #fff, 0 6px 18px rgba(249,199,79,.5); transform: translate(-50%,-50%) scale(1); }
    50%     { box-shadow: 0 0 0 5px #fff, 0 10px 28px rgba(249,199,79,.8); transform: translate(-50%,-50%) scale(1.1); }
}

/* Animação de acerto */
.pad-correct-anim {
    animation: pop-correct 0.4s cubic-bezier(0.36,0.07,0.19,0.97) !important;
}
@keyframes pop-correct {
    0%   { transform: translate(-50%,-50%) scale(1); }
    40%  { transform: translate(-50%,-50%) scale(1.4); }
    70%  { transform: translate(-50%,-50%) scale(0.9); }
    100% { transform: translate(-50%,-50%) scale(1); }
}
/* Flash de erro */
.pad-wrong-flash {
    animation: flash-wrong 0.35s ease !important;
}
@keyframes flash-wrong {
    0%,100% { filter: brightness(1); }
    50%     { filter: brightness(1.5) hue-rotate(-60deg); }
}
/* Pad onde o sapo está */
.pad-current {
    box-shadow: 0 0 0 3px #fff,
                0 0 20px rgba(255,255,255,0.5),
                0 5px 14px rgba(0,0,0,.5) !important;
}

/* ─── Sapo ───────────────────────────────────────────────────── */
#frog {
    position: absolute;
    font-size: var(--frog-size);
    line-height: 1;
    pointer-events: none;
    z-index: 10;
    /* Âncora: centro-base do emoji ficará no centro do pad */
    transform: translate(-50%, -90%);
    transition: left 0.28s cubic-bezier(0.34,1.56,0.64,1),
                top  0.28s cubic-bezier(0.34,1.56,0.64,1);
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}
.frog-jump { animation: jump-anim 0.28s ease; }
@keyframes jump-anim {
    0%   { transform: translate(-50%,-90%) scale(1); }
    35%  { transform: translate(-50%,-170%) scale(1.2,0.8); }
    70%  { transform: translate(-50%,-80%) scale(0.85,1.2); }
    100% { transform: translate(-50%,-90%) scale(1); }
}

/* ─── Labels Início / Fim ────────────────────────────────────── */
.lake-label {
    position: absolute; z-index: 6;
    font-family: var(--font-secondary); font-size: 11px;
    color: rgba(255,255,255,0.9);
    background: rgba(0,0,0,0.38);
    padding: 2px 8px; border-radius: 8px;
}

/* ─── Teclado visual ─────────────────────────────────────────── */
.keyboard-area { display: none; padding: 10px 0 4px; }
.keyboard-label {
    color: rgba(255,255,255,0.8);
    font-family: var(--font-secondary);
    font-size: 12px; text-align: center; margin-bottom: 8px;
}
.keyboard {
    display: flex; flex-wrap: wrap;
    gap: 5px; justify-content: center;
}
.key {
    background: rgba(255,255,255,0.18);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 10px;
    color: white;
    font-family: var(--font-primary);
    font-size: clamp(13px,2.8vw,17px);
    font-weight: 700;
    width: clamp(32px,7.5vw,42px);
    height: clamp(34px,7.5vw,44px);
    cursor: pointer;
    transition: all 0.15s;
    display: flex; align-items: center; justify-content: center;
}
.key:hover  { background: rgba(255,255,255,0.35); transform: translateY(-2px); }
.key:active { transform: scale(0.92); }
.key-wrong {
    animation: key-shake 0.35s ease;
    background: rgba(231,76,60,0.6) !important;
}
@keyframes key-shake {
    0%,100% { transform: translateX(0); }
    25%     { transform: translateX(-5px); }
    75%     { transform: translateX(5px); }
}

/* ─── Victory Screen ─────────────────────────────────────────── */
#victoryScreen { text-align: center; padding: 30px 16px 20px; }
.victory-frog { font-size: 64px; display: block; margin-bottom: 8px; }
.victory-title {
    color: #fff;
    font-family: var(--font-primary);
    font-size: clamp(22px, 5vw, 32px);
    margin-bottom: 4px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.victory-sub {
    color: rgba(255,255,255,0.85);
    font-family: var(--font-secondary);
    font-size: 15px; margin-bottom: 20px;
}
.stars-row {
    display: flex; justify-content: center;
    gap: 10px; margin-bottom: 20px;
}
.star {
    font-size: 44px;
    color: rgba(255,255,255,0.2);
    filter: grayscale(1);
    transition: all 0.4s ease;
}
.star.earned {
    color: #f9c74f;
    filter: grayscale(0) drop-shadow(0 0 8px rgba(249,199,79,0.8));
    animation: star-pop 0.5s cubic-bezier(0.36,0.07,0.19,0.97) forwards;
}
.star.earned:nth-child(1) { animation-delay: 0.1s; }
.star.earned:nth-child(2) { animation-delay: 0.25s; }
.star.earned:nth-child(3) { animation-delay: 0.4s; }
@keyframes star-pop {
    0%   { transform: scale(0) rotate(-30deg); }
    60%  { transform: scale(1.3) rotate(5deg); }
    80%  { transform: scale(0.9); }
    100% { transform: scale(1); }
}
.victory-info {
    background: rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 12px 20px;
    margin: 0 auto 20px; max-width: 260px;
}
.victory-info p {
    color: rgba(255,255,255,0.9);
    font-family: var(--font-secondary);
    font-size: 15px; margin: 4px 0;
}
.victory-btns {
    display: flex; gap: 10px;
    justify-content: center; flex-wrap: wrap;
}
.btn-play-again {
    background: linear-gradient(135deg, #52b788, #2d9e55);
    color: white; border: none;
    border-radius: 25px; padding: 12px 24px;
    font-family: var(--font-primary);
    font-size: 16px; font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(82,183,136,0.4);
    transition: all 0.2s;
}
.btn-play-again:hover { transform: translateY(-2px); }
.btn-change-diff {
    background: rgba(255,255,255,0.18);
    color: white;
    border: 2px solid rgba(255,255,255,0.4);
    border-radius: 25px; padding: 12px 24px;
    font-family: var(--font-primary);
    font-size: 15px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}
.btn-change-diff:hover { background: rgba(255,255,255,0.28); }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 400px) {
    :root { --pad-size: 38px; --frog-size: 20px; }
    .key  { width: 28px; height: 32px; font-size: 12px; }
}
