/* ==========================================================================
   SISTEMA DE DESIGN & ESTILOS - HORA DA SEGURANÇA CARD GAME (COMPACTO & RESPONSIVO)
   www.horadaseguranca.com
   ========================================================================== */

:root {
    /* Paleta de Cores Principais - AMBIENTE CLARO */
    --bg-light: #f8fafc;
    --bg-gradient: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    
    --primary-blue: #0284c7;
    --primary-blue-dark: #0369a1;
    --primary-blue-glow: rgba(2, 132, 199, 0.2);
    
    --safety-gold: #d97706;
    --safety-gold-light: #fffbeb;
    --safety-gold-glow: rgba(217, 119, 6, 0.2);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    /* Cores de Alerta SST */
    --color-risk: #dc2626;
    --color-risk-bg: #fef2f2;
    --color-risk-border: #fca5a5;
    --color-risk-glow: rgba(220, 38, 38, 0.2);
    
    --color-control: #16a34a;
    --color-control-bg: #f0fdf4;
    --color-control-border: #86efac;
    --color-control-glow: rgba(22, 163, 74, 0.2);
    
    /* Tipografia */
    --font-heading: 'Outfit', -apple-system, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;
    
    /* Efeitos */
    --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.12);
    --transition-fast: 0.18s ease;
    --transition-bounce: 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Dimensões fluidas das cartas (escalam com a tela, com piso legível) */
    --card-w: clamp(78px, 8.2vw, 104px);
    --card-h: calc(var(--card-w) * 1.32);
    --slot-w: clamp(82px, 8.6vw, 108px);
    --slot-h: calc(var(--slot-w) * 1.32);
}

/* RESET E BASE */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    /* Escala tipográfica fluida: acompanha a largura da tela */
    font-size: clamp(14px, 0.55vw + 12.2px, 17px);
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh; /* corrige a barra de endereço no celular */
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    padding-bottom: env(safe-area-inset-bottom);
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: var(--transition-fast);
}

/* CABEÇALHO COMPACTO */
.app-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.4rem 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    color: #0f172a;
}

.brand-tagline {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.site-link-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary-blue-dark);
}

.site-link-btn:hover {
    background: var(--primary-blue);
    color: #ffffff;
    border-color: var(--primary-blue);
}

/* LAYOUT PRINCIPAL */
.main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
}

.screen-box {
    width: 100%;
    animation: fadeIn 0.25s ease-out;
}

.hidden {
    display: none !important;
}

/* BOTOES GERAIS */
.btn {
    font-family: var(--font-heading);
    font-weight: 700;
    padding: 0.6rem 1.1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    text-align: center;
    font-size: 0.9rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
}

.btn-block { width: 100%; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: white;
}

.btn-secondary {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: var(--text-primary);
}

.btn-gold {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
}

.btn-icon {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: var(--text-primary);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
}

.btn-icon.muted { opacity: 0.4; filter: grayscale(1); }

/* TELA WELCOME */
.hero-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.75rem 1.25rem;
    text-align: center;
    max-width: 720px;
    margin: 0.5rem auto;
    box-shadow: var(--shadow-md);
}

.hero-logo-img {
    width: 75px;
    height: 75px;
    margin-bottom: 0.5rem;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
    color: #0f172a;
}

.hero-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    line-height: 1.4;
}

.rules-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    text-align: left;
    margin-bottom: 1.25rem;
}

.rules-card h3 {
    font-family: var(--font-heading);
    color: #0f172a;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.rules-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.rules-card li {
    font-size: 0.82rem;
    line-height: 1.35;
    color: var(--text-secondary);
    padding-left: 0.4rem;
    border-left: 3px solid var(--primary-blue);
}

.game-setup-box {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    text-align: left;
}

.input-group label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.input-group input {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.mode-buttons-row {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    flex-wrap: wrap;
}

.marketing-footer-banner {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.8rem;
    color: #b45309;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    align-items: center;
}

/* ARENA DE JOGO (LAYOUT COMPACTO SEM ROLAGEM) */
.game-status-bar {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.4rem 0.85rem;
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(0, 1.6fr) minmax(120px, 1fr) 36px;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 50;
}

.player-score-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8fafc;
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.avatar-icon { font-size: 1.3rem; }

.player-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
}

.score-value {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-blue-dark);
}

.card-badge {
    font-size: 0.62rem;
    background: #e2e8f0;
    padding: 0.05rem 0.3rem;
    border-radius: 3px;
    color: var(--text-secondary);
    font-weight: 600;
}

.center-round-info {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}

.turn-banner {
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 800;
    padding: 0.25rem 0.85rem;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.turn-player-1 { background: var(--primary-blue); color: white; }
.turn-player-2 { background: #7c3aed; color: white; }

.instruction-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* MAOS DOS JOGADORES - COMPACTO & COM BOTAO DO OLHO (PRIVACIDADE) */
.player-hand-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.4rem 0.75rem;
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.hand-label-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.hand-label {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
}

.btn-eye-toggle {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 0.2rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: var(--transition-fast);
}

.btn-eye-toggle:hover {
    background: var(--primary-blue);
    color: #ffffff;
    border-color: var(--primary-blue);
}

.cards-deck-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.deck-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.section-title {
    font-size: 0.7rem;
    font-weight: 700;
}

.hand-cards-row {
    display: flex;
    gap: clamp(0.25rem, 0.6vw, 0.5rem);
    justify-content: flex-start;
    align-items: center;
    min-height: calc(var(--card-h) + 8px);
    width: 100%;
    /* Rolagem horizontal suave em vez de cortar as cartas */
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding: 4px 2px;
}

.hand-cards-row::-webkit-scrollbar { height: 5px; }
.hand-cards-row::-webkit-scrollbar-track { background: transparent; }
.hand-cards-row::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.hand-cards-row::-webkit-scrollbar-thumb:hover { background: var(--primary-blue); }

/* MESA CENTRAL / ARENA COMPACTA */
.table-arena {
    background: #ffffff;
    border: 1.5px dashed #cbd5e1;
    border-radius: 14px;
    padding: 0.6rem clamp(0.5rem, 2vw, 1rem);
    margin-bottom: 0.5rem;
    display: grid;
    grid-template-columns: 1fr clamp(56px, 7vw, 84px) 1fr;
    align-items: center;
    justify-items: center;
    gap: clamp(0.35rem, 1vw, 0.75rem);
    min-height: calc(var(--slot-h) + 34px);
    box-shadow: var(--shadow-sm);
}

.slot-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    width: 100%;
}

.slot-label {
    font-family: var(--font-heading);
    font-size: 0.68rem;
    font-weight: 800;
}

.card-slot {
    width: var(--slot-w);
    height: var(--slot-h);
    border: 1.5px dashed #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    flex-shrink: 0;
}

.empty-slot-msg {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.25rem;
}

.vs-divider {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}

.vs-circle {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 0.85rem;
}

.mitigate-label {
    font-size: 0.6rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
}


/* CARTAS — dimensionamento fluido (nunca ficam ilegíveis) */
.card {
    flex: 0 0 var(--card-w);
    width: var(--card-w);
    height: var(--card-h);
    scroll-snap-align: start;
    border-radius: 8px;
    padding: 0.35rem 0.3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: var(--transition-fast);
    background: #ffffff;
    border: 1px solid #cbd5e1;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.05);
}

.card.playable {
    cursor: pointer;
}

.card.playable:hover, .card.playable:active {
    transform: translateY(-4px) scale(1.06);
    z-index: 10;
    border-color: var(--primary-blue);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

.card.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

/* Carta de Risco & Controle */
.card-risk {
    border-color: var(--color-risk-border);
    background: linear-gradient(180deg, var(--color-risk-bg) 0%, #ffffff 100%);
}

.card-control {
    border-color: var(--color-control-border);
    background: linear-gradient(180deg, var(--color-control-bg) 0%, #ffffff 100%);
}

.card-back {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid var(--primary-blue);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
}

.card-logo-bg img {
    width: 28px;
    height: 28px;
    opacity: 0.85;
}

.card-back-text {
    font-family: var(--font-heading);
    font-size: 0.58rem;
    font-weight: 800;
    color: var(--primary-blue-dark);
}

/* CONTEÚDO DA CARTA COMPACTA */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.card-type-badge {
    font-size: clamp(0.44rem, 0.55vw, 0.55rem);
    font-weight: 800;
    padding: 0.05rem 0.25rem;
    border-radius: 3px;
    text-transform: uppercase;
    white-space: nowrap;
}

.risk-badge { background: #fee2e2; color: var(--color-risk); }
.control-badge { background: #dcfce7; color: var(--color-control); }

.card-severity {
    font-size: clamp(0.46rem, 0.58vw, 0.58rem);
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

.card-icon {
    font-size: clamp(1.05rem, 1.5vw, 1.45rem);
    text-align: center;
    line-height: 1;
    margin: 0.1rem 0;
}

.card-title {
    font-family: var(--font-heading);
    font-size: clamp(0.56rem, 0.72vw, 0.7rem);
    font-weight: 700;
    line-height: 1.15;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
    word-break: break-word;
    hyphens: auto;
}

.card-desc {
    display: none;
}

.card-footer {
    font-size: clamp(0.45rem, 0.58vw, 0.58rem);
    color: var(--text-muted);
    font-weight: 600;
    border-top: 1px solid #e2e8f0;
    padding-top: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

/* CARTA NA MESA */
.card-in-table {
    width: var(--slot-w);
    height: var(--slot-h);
    max-width: var(--slot-w);
    flex: 0 0 auto;
}


/* MODAIS */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 0.75rem;
}

.modal-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    max-width: 440px;
    width: 100%;
    padding: 1.25rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.modal-gold { border: 2px solid var(--safety-gold); }

.modal-header { display: flex; flex-direction: column; gap: 0.3rem; }

.feedback-badge {
    align-self: flex-start;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
}

.badge-success { background: #dcfce7; color: var(--color-control); border: 1px solid #86efac; }
.badge-danger { background: #fee2e2; color: var(--color-risk); border: 1px solid #fca5a5; }
.badge-warning { background: #fef3c7; color: #d97706; border: 1px solid #fde68a; }

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
}

.text-success { color: var(--color-control); }
.text-danger { color: var(--color-risk); }

.feedback-card-summary {
    background: #f8fafc;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.85rem;
    line-height: 1.45;
    margin: 0.4rem 0;
    border: 1px solid #e2e8f0;
}

.incorrect-summary { border-left: 3.5px solid var(--color-risk); }

.highlight-risk { color: var(--color-risk); font-weight: 700; }
.highlight-control { color: var(--color-control); font-weight: 700; }
.correct-solution { color: #d97706; font-weight: 700; display: block; margin-top: 0.2rem; }

.sst-tip-box {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    padding: 0.65rem;
    font-size: 0.78rem;
    line-height: 1.35;
    color: #0369a1;
}

.tiebreak-icon { font-size: 2.2rem; margin-bottom: 0.3rem; }

.tiebreak-highlight-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.88rem;
    color: #b45309;
    margin: 0.65rem 0;
}


/* TELA VITÓRIA */
.victory-card {
    background: #ffffff;
    border: 2px solid #f59e0b;
    border-radius: 20px;
    padding: 2rem 1.25rem;
    text-align: center;
    max-width: 580px;
    margin: 1rem auto;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.victory-icon-large { font-size: 3.2rem; }

.victory-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 900;
    color: #0f172a;
}

.victory-subtitle { font-size: 0.88rem; color: var(--text-secondary); }

.final-scores-box {
    width: 100%;
    background: #f8fafc;
    border-radius: 10px;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
}

.final-scores-box h3 { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.4rem; }

.scores-row { display: flex; justify-content: center; gap: 0.65rem; }

.final-score-pill {
    background: #e0f2fe;
    border: 1px solid #7dd3fc;
    color: #0369a1;
    padding: 0.4rem 0.85rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
}

.marketing-cta-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
}

.cta-logo { width: 50px; height: 50px; object-fit: contain; }

.cta-text h4 { font-size: 0.9rem; color: #0f172a; margin-bottom: 0.15rem; }

.cta-text p { font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 0.5rem; }

/* ANIMAÇÕES */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.anim-pop { animation: popIn 0.25s var(--transition-bounce); }

@keyframes popIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}


/* ==========================================================================
   RESPONSIVIDADE — TABLET (≤1024px)
   ========================================================================== */
@media (max-width: 1024px) {
    :root {
        --card-w: clamp(76px, 11vw, 96px);
        --slot-w: clamp(80px, 11.5vw, 100px);
    }

    .main-content { padding: 0.6rem; }

    .game-status-bar {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr) 34px;
    }

    .player-name { max-width: 78px; }
}

/* ==========================================================================
   RESPONSIVIDADE — CELULAR (≤640px)
   ========================================================================== */
@media (max-width: 640px) {
    :root {
        /* No celular as cartas rolam lateralmente, então mantêm tamanho legível */
        --card-w: 84px;
        --slot-w: 84px;
    }

    .main-content { padding: 0.4rem; }

    .app-header { padding: 0.35rem 0.6rem; }
    .brand-title { font-size: 0.95rem; }
    .brand-tagline { display: none; }
    .site-link-btn { font-size: 0.7rem; padding: 0.25rem 0.55rem; }

    /* Status: turno em cima, jogadores lado a lado, som no canto */
    .game-status-bar {
        grid-template-columns: 1fr 1fr auto;
        grid-template-areas:
            "info info info"
            "p1   p2   sound";
        padding: 0.4rem 0.5rem;
        gap: 0.4rem;
    }
    .center-round-info { grid-area: info; }
    .p1-score-box { grid-area: p1; }
    .p2-score-box { grid-area: p2; }
    #btn-toggle-sound { grid-area: sound; }

    .player-score-card { padding: 0.3rem 0.45rem; gap: 0.35rem; }
    .avatar-icon { font-size: 1.15rem; }
    .player-name { font-size: 0.72rem; max-width: 100%; }
    .score-value { font-size: 1rem; }
    .turn-banner { font-size: 0.78rem; padding: 0.22rem 0.7rem; }
    .instruction-text { font-size: 0.72rem; line-height: 1.25; }

    .player-hand-container { padding: 0.4rem; margin-bottom: 0.4rem; }
    .hand-label { font-size: 0.68rem; }

    /* Riscos e Controles empilhados, cada um rolando lateralmente */
    .cards-deck-wrapper { grid-template-columns: 1fr; gap: 0.5rem; }
    .hand-cards-row { gap: 0.35rem; justify-content: flex-start; }

    .card { padding: 0.3rem 0.22rem; border-radius: 7px; }
    .card-title { -webkit-line-clamp: 3; }

    /* Botões maiores para o toque */
    .btn-eye-toggle { padding: 0.3rem 0.7rem; font-size: 0.72rem; }
    .btn-icon { width: 32px; height: 32px; }

    .table-arena {
        padding: 0.5rem 0.4rem;
        gap: 0.35rem;
        grid-template-columns: 1fr 52px 1fr;
    }
    .slot-label { font-size: 0.6rem; text-align: center; line-height: 1.2; }
    .vs-circle { width: 34px; height: 34px; font-size: 0.78rem; }
    .mitigate-label { font-size: 0.5rem; text-align: center; }

    /* Tela inicial mais confortável no celular */
    .hero-card { padding: 1.25rem 0.9rem; border-radius: 14px; }
    .hero-logo-img { width: 62px; height: 62px; }
    .hero-title { font-size: 1.35rem; }
    .hero-subtitle { font-size: 0.85rem; }
    .rules-card { padding: 0.8rem; }
    .rules-card li { font-size: 0.78rem; }
    .mode-buttons-row { flex-direction: column; }
    .mode-buttons-row .btn { width: 100%; }
    .input-group input { font-size: 16px; } /* evita zoom automático no iOS */

    .marketing-cta-box { flex-direction: column; text-align: center; }
}

/* ==========================================================================
   RESPONSIVIDADE — CELULARES PEQUENOS (≤380px)
   ========================================================================== */
@media (max-width: 380px) {
    :root {
        --card-w: 78px;
        --slot-w: 78px;
    }

    .brand-title { font-size: 0.86rem; }
    .site-link-btn { font-size: 0.64rem; }
    .hero-title { font-size: 1.2rem; }
    .table-arena { grid-template-columns: 1fr 44px 1fr; }
    .vs-circle { width: 30px; height: 30px; font-size: 0.7rem; }
    .slot-label { font-size: 0.55rem; }
}

/* ==========================================================================
   CELULAR DEITADO (landscape) — aproveita a largura, reduz a altura
   ========================================================================== */
@media (max-height: 500px) and (orientation: landscape) {
    :root {
        --card-w: 72px;
        --slot-w: 72px;
    }

    .app-header { position: static; padding: 0.25rem 0.6rem; }
    .main-content { padding: 0.3rem; }
    .game-status-bar { padding: 0.3rem 0.5rem; margin-bottom: 0.3rem; }
    .player-hand-container { padding: 0.3rem 0.45rem; margin-bottom: 0.3rem; }
    /* De volta a duas colunas: sobra largura no modo deitado */
    .cards-deck-wrapper { grid-template-columns: 1fr 1fr; gap: 0.4rem; }
    .table-arena { min-height: auto; padding: 0.35rem; }
    .hand-label-bar { margin-bottom: 0.15rem; }
}

/* ==========================================================================
   TELA DE PRIVACIDADE — MODO 2 JOGADORES NO MESMO DISPOSITIVO
   Após cada jogada todas as cartas são ocultadas e este bloqueio aparece,
   garantindo que o adversário não veja a mão de quem vai jogar.
   ========================================================================== */

.privacy-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(1rem + env(safe-area-inset-top)) 1rem calc(1rem + env(safe-area-inset-bottom));
    background:
        radial-gradient(circle at 20% 15%, rgba(2, 132, 199, 0.35), transparent 55%),
        radial-gradient(circle at 82% 85%, rgba(217, 119, 6, 0.32), transparent 55%),
        linear-gradient(135deg, #0f172a 0%, #12325e 55%, #0d2a56 100%);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    animation: privacyFadeIn 0.28s ease both;
    overflow-y: auto;
}

.privacy-backdrop.hidden { display: none; }

@keyframes privacyFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.privacy-card {
    width: min(460px, 100%);
    background: var(--bg-card);
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.55);
    padding: clamp(1.4rem, 3.2vw, 2.1rem) clamp(1.1rem, 3vw, 1.8rem);
    text-align: center;
    animation: privacyPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes privacyPop {
    from { opacity: 0; transform: translateY(18px) scale(0.94); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.privacy-icon {
    font-size: clamp(2.4rem, 6vw, 3.1rem);
    line-height: 1;
    margin-bottom: 0.55rem;
    animation: privacyLock 2.6s ease-in-out infinite;
}

@keyframes privacyLock {
    0%, 88%, 100% { transform: rotate(0deg); }
    92%           { transform: rotate(-9deg); }
    96%           { transform: rotate(9deg); }
}

.privacy-badge {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary-blue-dark);
    background: #e0f2fe;
    border: 1px solid #7dd3fc;
    border-radius: 999px;
    padding: 0.28rem 0.75rem;
    margin-bottom: 0.7rem;
}

.privacy-title {
    font-family: var(--font-heading);
    font-size: clamp(1.15rem, 3.4vw, 1.5rem);
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.22;
    margin-bottom: 0.45rem;
}

.privacy-sub {
    font-size: clamp(0.82rem, 1.9vw, 0.92rem);
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.05rem;
}

.privacy-player-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    background: var(--bg-light);
    border: 1.5px dashed #cbd5e1;
    border-radius: 16px;
    padding: 0.9rem 0.8rem;
    margin-bottom: 1.05rem;
}

.privacy-player-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.privacy-player-name {
    font-family: var(--font-heading);
    font-size: clamp(1.25rem, 4vw, 1.75rem);
    font-weight: 900;
    line-height: 1.15;
    color: var(--primary-blue-dark);
    word-break: break-word;
}

.privacy-player-name.p1 { color: var(--primary-blue-dark); }
.privacy-player-name.p2 { color: var(--safety-gold); }

.privacy-action {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    margin-top: 0.15rem;
}

.privacy-warn {
    margin-top: 0.8rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #92400e;
    background: var(--safety-gold-light);
    border: 1px solid #fcd34d;
    border-radius: 12px;
    padding: 0.5rem 0.65rem;
    line-height: 1.4;
}

@media (max-width: 640px) {
    .privacy-card { border-radius: 18px; }
    .privacy-player-box { padding: 0.75rem 0.6rem; }
}

@media (max-height: 500px) and (orientation: landscape) {
    .privacy-backdrop { align-items: flex-start; }
    .privacy-icon { font-size: 1.9rem; margin-bottom: 0.3rem; }
    .privacy-card { padding: 1rem; }
    .privacy-sub { margin-bottom: 0.7rem; }
    .privacy-player-box { padding: 0.55rem; margin-bottom: 0.7rem; }
    .privacy-warn { margin-top: 0.55rem; }
}
