/* ================================================
   ACERTE O TEMPO — Planeta Net × ExpoAgro 2026
   style.css
   ================================================ */

/* ---------- Fontes locais ---------- */
@font-face {
    font-family: 'Gilroy';
    src: url('../fonts/Gilroy-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
}
@font-face {
    font-family: 'Gilroy';
    src: url('../fonts/Gilroy-SemiBold.otf') format('opentype');
    font-weight: 600;
    font-style: normal;
}
@font-face {
    font-family: 'Gilroy';
    src: url('../fonts/Gilroy-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
}
@font-face {
    font-family: 'Gilroy';
    src: url('../fonts/Gilroy-ExtraBold.otf') format('opentype');
    font-weight: 900;
    font-style: normal;
}

/* ---------- Variáveis ---------- */
:root {
    --red-1: #3d0000;
    --red-5: #ff3333;
    --gold:  #FFD700;
    --white: #ffffff;
    --font:  'Gilroy', 'Segoe UI', Arial, sans-serif;
    --mono:  'Courier New', 'Lucida Console', monospace;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { width: 100%; min-height: 100vh; }

body {
    font-family: var(--font);
    color: var(--white);
    background: var(--red-1);
    overflow-x: hidden;
}

/* ================================================
   FUNDO DECORATIVO
   ================================================ */
.bg-decor {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background: radial-gradient(ellipse 90% 80% at 50% 35%,
        #be0000 0%, #8c0000 45%, #4a0000 78%, #2a0000 100%);
}

.glow-center {
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 80vw; height: 55vh;
    background: radial-gradient(ellipse at center,
        rgba(200, 0, 0, 0.35) 0%, transparent 70%);
}

.arc { position: absolute; border-radius: 50%; }

.arc-left {
    width: 560px; height: 560px;
    left: -290px; top: 50%;
    transform: translateY(-50%);
    border: 56px solid rgba(160, 0, 0, 0.22);
    box-shadow:
        0 0 0  56px rgba(140, 0, 0, 0.15),
        0 0 0 112px rgba(120, 0, 0, 0.09),
        0 0 0 168px rgba(100, 0, 0, 0.05);
}

.arc-right {
    width: 700px; height: 700px;
    right: -350px; top: -260px;
    border: 56px solid rgba(160, 0, 0, 0.18);
    box-shadow:
        0 0 0  56px rgba(140, 0, 0, 0.12),
        0 0 0 112px rgba(120, 0, 0, 0.07),
        0 0 0 168px rgba(100, 0, 0, 0.04);
}

/* ================================================
   LAYOUT PRINCIPAL
   ================================================ */
.page {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
    max-width: 900px;
    margin: 0 auto;
    padding: 0.6rem 1.2rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

/* ================================================
   HEADER
   ================================================ */
.site-header {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.4rem 0;
}

.logo-planeta { display: flex; align-items: center; }

.logo-img {
    height: 120px;
    filter: brightness(0) invert(1);
    object-fit: contain;
}

/* Fallback quando imagem não carrega */
.logo-fallback { display: none; align-items: center; gap: 10px; }

.logo-planeta.fallback .logo-img     { display: none; }
.logo-planeta.fallback .logo-fallback { display: flex; }

.fallback-name { font-weight: 900; font-size: 1.25rem; letter-spacing: 2px; line-height: 1.1; }
.fallback-sub  { font-size: 0.65rem; letter-spacing: 4px; opacity: 0.75; }

/* ================================================
   TÍTULO
   ================================================ */
.title-section { text-align: center; }

.game-title {
    font-weight: 900;
    font-size: clamp(2.6rem, 7vw, 5.5rem);
    letter-spacing: 4px;
    line-height: 1;
    text-shadow:
        3px 3px 0   rgba(0,0,0,0.45),
        0   0   28px rgba(255, 80, 80, 0.25);
}

.game-subtitle {
    font-weight: 600;
    font-size: clamp(0.72rem, 1.7vw, 1rem);
    letter-spacing: 1.5px;
    opacity: 0.88;
    margin-top: 0.3rem;
}

.gold { color: var(--gold); }

/* ================================================
   CAIXA TEMPO ALVO
   ================================================ */
.target-box {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    background: #100000;
    border: 2px solid #2a0000;
    border-radius: 8px;
    padding: 0.5rem 2.8rem;
    box-shadow: 0 0 24px rgba(0,0,0,0.55);
}

.target-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: rgba(255,255,255,0.6);
}

.target-time {
    font-family: var(--mono);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 5px;
    color: var(--red-5);
    text-shadow: 0 0 14px rgba(255, 60, 60, 0.75);
}

/* ================================================
   CRONÔMETRO
   ================================================ */
.chron-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.chron-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.4rem;
}

.timer {
    font-family: var(--mono);
    font-size: clamp(5rem, 14vw, 9rem);
    font-weight: 900;
    letter-spacing: 8px;
    color: var(--white);
    text-shadow:
        0 0 30px rgba(255,255,255,0.35),
        0 0 60px rgba(255,255,255,0.12);
    min-width: 4.6ch;
    text-align: center;
    user-select: none;
    transition: color 0.12s, text-shadow 0.12s;
}

.timer.running {
    color: #fff;
    animation: timerPulse 0.45s ease-in-out infinite;
}

.timer.winner {
    color: var(--gold);
    text-shadow:
        0 0 18px var(--gold),
        0 0 40px rgba(255, 215, 0, 0.5);
    animation: timerGlow 0.55s ease-in-out infinite alternate;
}

.timer.miss { color: #ff6666; }

/* Traços decorativos laterais */
.ticks { display: flex; flex-direction: column; gap: 7px; flex-shrink: 0; }

.t { display: block; height: 3px; background: rgba(255,255,255,0.42); border-radius: 2px; }

.ticks-left  .t1 { width: 36px; }
.ticks-left  .t2 { width: 24px; margin-left: 12px; }
.ticks-left  .t3 { width: 16px; margin-left: 20px; }

.ticks-right .t1 { width: 36px; }
.ticks-right .t2 { width: 24px; }
.ticks-right .t3 { width: 16px; }

/* ================================================
   BOTÃO DE AÇÃO
   ================================================ */
.btn-action {
    background: linear-gradient(180deg, #ff5252 0%, #cc0000 100%);
    color: var(--white);
    font-family: var(--font);
    font-weight: 900;
    font-size: 1.4rem;
    letter-spacing: 3px;
    border: none;
    border-radius: 100px;
    padding: 1rem 5rem;
    cursor: pointer;
    box-shadow:
        0 6px 22px rgba(0,0,0,0.42),
        0 0 0 3px rgba(255,255,255,0.12);
    transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
    min-width: 260px;
    user-select: none;
}

.btn-action:hover {
    background: linear-gradient(180deg, #ff7070 0%, #dd0000 100%);
    transform: translateY(-2px);
    box-shadow:
        0 10px 28px rgba(0,0,0,0.5),
        0 0 0 3px rgba(255,255,255,0.2);
}

.btn-action:active {
    transform: translateY(1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* Dica de teclado */
.hint {
    min-height: 1.2em;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 1px;
    opacity: 0.7;
    text-align: center;
}

/* ================================================
   MODAL DE RESULTADO
   ================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-card {
    background: radial-gradient(ellipse at top, #c20000 0%, #550000 100%);
    border: 2px solid rgba(255,255,255,0.22);
    border-radius: 22px;
    padding: 2.4rem 2rem;
    text-align: center;
    max-width: 440px;
    width: 92%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.65);
    animation: modalSlideIn 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.modal-emoji { font-size: 3.8rem; margin-bottom: 0.4rem; line-height: 1; }

.modal-title {
    font-weight: 900;
    font-size: 1.9rem;
    letter-spacing: 3px;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}

.modal-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.stat { display: flex; flex-direction: column; gap: 0.15rem; }

.stat-label {
    font-size: 0.65rem;
    letter-spacing: 2px;
    opacity: 0.65;
    text-transform: uppercase;
}

.stat-value {
    font-family: var(--mono);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gold);
    text-shadow: 0 0 12px rgba(255,215,0,0.55);
    letter-spacing: 2px;
}

.stat-sep { width: 1px; height: 50px; background: rgba(255,255,255,0.2); }

.modal-msg {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.55;
    margin-bottom: 1.5rem;
    opacity: 0.92;
}

/* ================================================
   ANIMAÇÕES
   ================================================ */
@keyframes timerPulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.025); }
}

@keyframes timerGlow {
    from { text-shadow: 0 0 12px var(--gold), 0 0 24px rgba(255,215,0,0.4); }
    to   { text-shadow: 0 0 24px var(--gold), 0 0 50px rgba(255,215,0,0.65), 0 0 80px rgba(255,215,0,0.25); }
}

@keyframes modalSlideIn {
    from { transform: scale(0.82) translateY(24px); opacity: 0; }
    to   { transform: scale(1)    translateY(0);    opacity: 1; }
}

/* ================================================
   RESPONSIVIDADE
   ================================================ */
@media (max-width: 600px) {
    .ticks { display: none; }

    .timer { font-size: 4.5rem; letter-spacing: 4px; }

    .game-title { font-size: 2.4rem; letter-spacing: 2px; }

    .logo-img     { height: 56px; }

    .btn-action { font-size: 1.15rem; padding: 0.85rem 2.5rem; min-width: 200px; }

    .target-time { font-size: 1.6rem; }
}

@media (max-width: 400px) {
    .page { padding: 0.5rem 0.75rem 1.5rem; gap: 0.6rem; }

    .timer { font-size: 3.5rem; letter-spacing: 3px; }

    .modal-card  { padding: 1.8rem 1.2rem; }
    .modal-title { font-size: 1.5rem; }
    .stat-value  { font-size: 1.4rem; }
}
