/* ===== Fonte Inter (local, offline) ===== */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('assets/inter-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('assets/inter-700.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 900;
    font-display: swap;
    src: url('assets/inter-900.woff2') format('woff2');
}

/* ===== Reset / base ===== */
* { box-sizing: border-box; }

html, body {
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: #111827;
    color: #ffffff;
    overflow: hidden;
    touch-action: manipulation;
    display: flex;
    flex-direction: column;
    position: relative;
    /* Safe areas */
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

button {
    font-family: inherit;
    border: none;
    background: none;
    color: inherit;
}

/* ===== Lados dos times ===== */
.team-side {
    flex: 1 1 0%;
    min-height: 0;
    position: relative;
    overflow: hidden;
    transition: background-color 0.5s;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}
.side-green  { background-color: #10b981; }
.side-orange { background-color: #f97316; }

/* Bloco central do número (não captura toque) */
.score-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    text-align: center;
}

.base-score {
    font-size: 1.25rem;
    font-weight: 700;
    opacity: 0.6;
    line-height: 1;
    margin-bottom: 0.25rem;
}
.base-score.hidden { display: none; }

/* Número gigante */
.text-giant {
    font-size: min(60vw, 38vh);
    line-height: 1;
    font-weight: 900;
    letter-spacing: -0.05em;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.25));
}

/* Animação pop no número */
.score-anim { transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1); }
.pop { transform: scale(1.15); }

/* ===== Indicadores de toque (cima soma / baixo diminui) ===== */
.tap-hint {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    color: rgba(255,255,255,0.26);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}
.tap-hint svg { width: 34px; height: 34px; }
.hint-plus  { top: max(14px, env(safe-area-inset-top)); }
.hint-minus { bottom: max(14px, env(safe-area-inset-bottom)); }

/* ===== Controles centrais (reset / config / fullscreen) ===== */
.center-controls {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.ctrl-btn {
    border-radius: 9999px;
    background: #ffffff;
    color: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.35);
    cursor: pointer;
    transition: transform 0.2s;
}
.ctrl-btn:hover  { transform: scale(1.1); }
.ctrl-btn:active { transform: scale(0.95); }

.ctrl-reset  { width: 56px; height: 56px; border: 4px solid rgba(17,24,39,0.1); }
.ctrl-reset svg { width: 28px; height: 28px; transition: transform 0.5s; }
.ctrl-reset:hover svg { transform: rotate(180deg); }

.ctrl-config { width: 44px; height: 44px; background: rgba(255,255,255,0.92); }
.ctrl-config svg { width: 22px; height: 22px; }

.ctrl-fs { width: 36px; height: 36px; background: rgba(255,255,255,0.9); }
.ctrl-fs svg { width: 18px; height: 18px; }
.hidden { display: none !important; }

/* ===== Banner de prorrogação ===== */
.overtime-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    background: #ffffff;
    color: #000000;
    padding: 0.25rem 0.5rem;
    padding-top: max(0.25rem, env(safe-area-inset-top));
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transform: translateY(-100%);
    transition: transform 0.3s;
}
.overtime-banner.active { transform: translateY(0); }
.overtime-banner .ot-title {
    font-size: 0.875rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.overtime-banner .ot-sub {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
}

/* ===== Overlay de vitória ===== */
.winner-overlay {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    text-align: center;
    padding: 1rem;
}
.winner-overlay.visible { display: flex; }
.winner-title {
    font-size: 1.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin: 0 0 1.5rem;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.25));
}
.winner-score {
    font-size: clamp(3.5rem, 18vw, 8rem);
    font-weight: 900;
    line-height: 1;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.25));
}
.winner-time {
    font-size: 1.25rem;
    font-weight: 700;
    color: rgba(255,255,255,0.7);
    letter-spacing: 0.1em;
    margin-bottom: 2.5rem;
}
.btn-newgame {
    padding: 1rem 2.5rem;
    background: #ffffff;
    color: #111827;
    border-radius: 9999px;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0,0,0,0.35);
    transition: transform 0.2s;
}
.btn-newgame:hover  { transform: scale(1.05); }
.btn-newgame:active { transform: scale(0.95); }

/* ===== Prompt iOS ===== */
.ios-prompt {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 80;
    background: #1f2937;
    color: #ffffff;
    padding: 0.75rem 1rem;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
    transform: translateY(100%);
    transition: transform 0.3s;
}
.ios-prompt.visible { transform: translateY(0); }
.ios-prompt .txt { flex: 1; font-size: 0.875rem; line-height: 1.25; }
.ios-prompt svg.inline { width: 1rem; height: 1rem; display: inline; vertical-align: middle; }
.ios-prompt .close {
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    flex-shrink: 0;
}
.ios-prompt .close:hover { color: #ffffff; }

/* ===== Modal de configurações ===== */
.settings-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 1rem;
}
.settings-overlay.visible { display: flex; }
.settings-card {
    width: 100%;
    max-width: 340px;
    background: #1f2937;
    border-radius: 1.25rem;
    padding: 1.5rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.settings-card h2 {
    margin: 0 0 0.25rem;
    font-size: 1.25rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.settings-card .hint {
    margin: 0 0 1.25rem;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
}
.settings-section { margin-bottom: 1.25rem; }
.settings-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.6);
    margin-bottom: 0.6rem;
}
.target-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}
.target-opt {
    padding: 0.75rem 0;
    border-radius: 0.75rem;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.75);
    font-size: 1.1rem;
    font-weight: 900;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, transform 0.1s;
}
.target-opt:active { transform: scale(0.94); }
.target-opt.selected {
    background: #16a34a;
    color: #ffffff;
}

/* toggle prorrogação */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.toggle-row .toggle-texts { flex: 1; }
.toggle-row .toggle-texts strong { font-size: 0.95rem; }
.toggle-row .toggle-texts span {
    display: block;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.45);
    margin-top: 2px;
}
.switch {
    position: relative;
    width: 52px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 9999px;
    background: rgba(255,255,255,0.2);
    cursor: pointer;
    transition: background-color 0.2s;
}
.switch.on { background: #16a34a; }
.switch .knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 9999px;
    background: #ffffff;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.switch.on .knob { transform: translateX(22px); }

.settings-actions { margin-top: 1.5rem; }
.btn-apply {
    width: 100%;
    padding: 0.85rem;
    border-radius: 0.85rem;
    background: #16a34a;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: transform 0.1s, background-color 0.15s;
}
.btn-apply:hover  { background: #15803d; }
.btn-apply:active { transform: scale(0.97); }

/* links do modal (Clubinho / Augusto) */
.settings-links {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.link-btn {
    display: block;
    text-align: center;
    text-decoration: none;
    padding: 0.75rem;
    border-radius: 0.85rem;
    font-size: 0.9rem;
    font-weight: 700;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.9);
    border: 1px solid rgba(255,255,255,0.12);
    transition: background-color 0.15s, transform 0.1s;
}
.link-btn:hover  { background: rgba(255,255,255,0.14); }
.link-btn:active { transform: scale(0.97); }

/* dedicatória */
.dedication {
    margin: 0.85rem 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255,255,255,0.5);
}
.dedication .heart {
    width: 14px;
    height: 14px;
    color: #ef4444;
}

/* ===== Layout desktop / landscape (lado a lado) ===== */
@media (min-width: 768px) {
    body { flex-direction: row; }
    .text-giant { font-size: min(35vw, 80vh); }
    .base-score { font-size: 2.25rem; }
    .overtime-banner .ot-title { font-size: 1.125rem; }
    .overtime-banner .ot-sub { font-size: 0.75rem; }
    .winner-title { font-size: 3rem; }
    .winner-time { font-size: 1.875rem; }
    .btn-newgame { font-size: 1.5rem; }
}

/* Celular deitado (landscape baixo) → lado a lado */
@media (orientation: landscape) and (max-height: 500px) {
    body { flex-direction: row; }
    .text-giant { font-size: min(38vw, 70vh); }
}
