/* ============================================
   VARIÁVEIS E RESET
   ============================================ */
:root {
    --bg-dark: #87CEEB;
    --bg-card: #e59f5c;
    --text-primary: #3d1c04;
    --text-muted: #7c4420;
    --law-color: #2563eb;
    --outlaw-color: #dc2626;
    --accent-yellow: #facc15;
    --border-color: #512503;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ============================================
   BASE - BODY E HTML
   ============================================ */
html, body {
    overflow: hidden;
}

body {
    background-color: #c87528;
    color: var(--text-primary);
    font-family: 'Bebas Neue', 'Nunito', sans-serif;
    font-weight: 700;
    line-height: 1.6;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    background-image: url('images/bg.png');
    background-size: cover;
    background-position: center center;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Overlay de fundo colorido (vitória/derrota) */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    pointer-events: none;
    transition: background-color 1s ease;
}

body.bg-winner-law::before {
    background-color: rgba(37, 99, 235, 0.4);
}

body.bg-winner-outlaw::before {
    background-color: rgba(220, 38, 38, 0.4);
}

/* ============================================
   MENU LATERAL
   ============================================ */

#side-menu-panel.open {
    right: 0 !important;
}

/* O botão hamburger tem z-index 1300, acima do painel (1200) */
#btn-hamburger {
    transition: opacity 0.2s;
}

#btn-hamburger:active {
    opacity: 0.7;
}

#side-menu-panel button:active {
    transform: translateY(3px);
    box-shadow: none !important;
}

/* ============================================
   CARD DE IDENTIDADE — tamanho fixo
   ============================================ */
.role-card {
    padding: 20px;
    text-align: center;
    margin: 10px 0;
    min-height: 340px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* ============================================
   TIPOGRAFIA - TÍTULOS E TEXTOS
   ============================================ */
h1, h2, h3, .logo-text {
    font-family: 'Bebas Neue', cursive;
    letter-spacing: 1px;
    color: #ffffff;
    text-shadow:
        -3px -3px 0 #881337,
         3px -3px 0 #881337,
        -3px  3px 0 #881337,
         3px  3px 0 #881337,
         0    4px 0 #881337;
    margin-bottom: 20px;
}

.neon-text {
    color: #ffffff;
    text-shadow:
        -2px -2px 0 #881337,
         2px -2px 0 #881337,
        -2px  2px 0 #881337,
         2px  2px 0 #881337,
         0    3px 0 #881337;
}

.neon-text.yellow { color: #ffde59; }
.neon-text.blue   { color: #60a5fa; }
.neon-text.red    { color: #dc2626; text-shadow: -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff, 2px 2px 0 #fff, 0 3px 0 #fff; }

.titulo-tela {
    color: #ffde59;
    text-shadow:
        -1.5px -1.5px 0 var(--border-color),
         1.5px -1.5px 0 var(--border-color),
        -1.5px  1.5px 0 var(--border-color),
         1.5px  1.5px 0 var(--border-color),
         0      3px   0 var(--border-color);
    text-align: center;
    font-size: 1.3rem;
    line-height: 1.2;
    margin-bottom: 12px;
}

.titulo-branco {
    color: #ffffff;
    text-shadow:
        -1.5px -1.5px 0 var(--border-color),
         1.5px -1.5px 0 var(--border-color),
        -1.5px  1.5px 0 var(--border-color),
         1.5px  1.5px 0 var(--border-color),
         0      3px   0 var(--border-color);
    text-align: center;
    margin-bottom: 12px;
}

.error-msg {
    color: #881337;
    font-size: 1.1rem;
    margin-top: 10px;
    min-height: 20px;
    font-weight: 800;
}

.role-card h3 {
    text-shadow: none;
    color: #881337;
}

/* ============================================
   LAYOUT - CONTAINER E TELAS
   ============================================ */
#app-container {
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100vh;
    width: min(100vw, calc(100vh * 9 / 16));
    padding: 20px;
    overflow: hidden;
}

.screen {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
    animation: bounceIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.screen::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
}

.screen.active {
    display: flex;
}

/* ============================================
   UTILITÁRIOS
   ============================================ */
.hidden { display: none !important; }
.mt-4   { margin-top: 20px; }
.mt-2   { margin-top: 10px; }
.text-center { text-align: center; }

/* ============================================
   FORMULÁRIOS E INPUTS
   ============================================ */
input[type="text"] {
    width: 100%;
    padding: 15px 25px;
    background: #fff;
    border: 6px solid #881337;
    border-radius: 40px;
    color: #881337;
    font-size: 1.8rem;
    font-weight: 700;
    font-family: 'Bebas Neue', sans-serif;
    outline: none;
    box-shadow: 0 6px 0px rgba(136, 19, 55, 0.2);
    text-align: center;
}

input[type="text"]::placeholder {
    color: rgba(136, 19, 55, 0.4);
}

/* ============================================
   BOTÕES
   ============================================ */
.btn {
    padding: 15px 30px;
    border: 6px solid #881337;
    border-radius: 40px;
    font-family: 'Bebas Neue', cursive;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    text-align: center;
    width: auto;
    color: #881337;
    background: #ffffff;
    box-shadow: 0 8px 0px #881337;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn:active {
    transform: translateY(6px);
    box-shadow: 0 2px 0px #881337 !important;
}

.btn:disabled {
    opacity: 0.6;
    filter: grayscale(1);
    pointer-events: none;
    box-shadow: 0 4px 0px #881337 !important;
}

.btn.lg {
    width: 100%;
    padding: 20px;
    font-size: 1.8rem;
}

.btn-primary,
.btn-neon-blue,
.btn-neon-red {
    background: #ffffff;
    color: #881337;
}

/* ============================================
   CARDS E CONTAINERS
   ============================================ */
.card,
.role-card,
.setup-extras,
.board-status {
    background: #ffffff;
    border: 6px solid #881337;
    border-radius: 30px;
    padding: 20px;
    box-shadow: 0 10px 0px rgba(136, 19, 55, 0.1);
    color: #881337;
    margin-bottom: 20px;
}

.board-status {
    margin-top: 60px;
}
/* .role-card tem estilos extras na seção MENU LATERAL acima */

/* ============================================
   LISTAS
   ============================================ */
.list-group {
    list-style: none;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-group li {
    padding: 12px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 2.2rem;
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 700;
    color: #881337;
    background: #ffffff;
    border-radius: 40px;
    border: 6px solid #881337;
    box-shadow: 0 6px 0px rgba(136, 19, 55, 0.1);
}

.list-group li button {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 2rem;
    display: flex;
    align-items: center;
    transition: transform 0.2s;
}

.list-group li button:hover {
    transform: scale(1.2);
}

.selectable-list {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.selectable-item {
    padding: 15px;
    font-size: 1.5rem;
    text-align: center;
    background: #ffffff;
    border: 4px solid #881337;
    border-radius: 20px;
    color: #881337;
    cursor: pointer;
    transition: transform 0.1s, background 0.15s;
}

.selectable-item:active {
    transform: scale(0.97);
}

.selectable-item.selected {
    background: #ffde59;
    transform: scale(1.03);
    box-shadow: 0 6px 0px #881337;
}

/* ============================================
   TABULEIRO - MISSÕES E REJEIÇÕES
   ============================================ */
.mission-track {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    padding: 0 10px;
}

.mission-bubble {
    width: 45px;
    height: 45px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    border: 5px solid #881337;
    color: #881337;
    box-shadow: 0 5px 0px rgba(136, 19, 55, 0.2);
    position: relative;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mission-bubble.current {
    transform: scale(1.2);
    border-color: #ffde59;
    box-shadow: 0 0 15px #ffde59;
}

.mission-bubble.success {
    background: #2563eb;
    color: white;
    border-color: #881337;
}

.mission-bubble.fail {
    background: #dc2626;
    color: white;
    border-color: #881337;
}

.reject-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
}

.reject-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    border: 4px solid #881337;
}

.reject-dot.filled {
    background: #dc2626;
}

/* ============================================
   CARTAS DE PERSONAGEM
   ============================================ */
.spies-list {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 4px dashed #881337;
    text-align: left;
}

#spies-ul {
    list-style: none;
    padding-left: 0;
    color: #881337;
    font-size: 1.3rem;
    font-weight: 800;
}

/* ============================================
   CARDS DE REGRAS AVANÇADAS
   ============================================ */
.mode-card {
    background: #ffffff;
    border: 6px solid #881337;
    border-radius: 40px;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    cursor: pointer;
    transition: transform 0.1s;
    box-shadow: 0 8px 0px rgba(136, 19, 55, 0.1);
}

.mode-card:active {
    transform: translateY(4px);
    box-shadow: 0 4px 0px rgba(136, 19, 55, 0.1);
}

.card-icon-container {
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.rule-icon {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.card-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.rule-title {
    font-size: 1.1rem;
    font-weight: 900;
    line-height: 1.1;
    color: #881337;
}

.card-check-container {
    margin-right: 10px;
}

.custom-checkbox {
    width: 35px;
    height: 35px;
    border: 6px solid #881337;
    border-radius: 10px;
    display: block;
    background: white;
    position: relative;
}

.hidden-check {
    display: none;
}

.hidden-check:checked + .custom-checkbox {
    background: #881337;
}

.hidden-check:checked + .custom-checkbox::after {
    content: '✓';
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.8rem;
    font-weight: 900;
}

.info-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    width: 25px;
    height: 25px;
    background: #881337;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-style: italic;
    font-weight: 900;
    z-index: 2;
}

.checked-visual {
    background: #881337 !important;
}

.checked-visual::after {
    content: '✓';
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.8rem;
    font-weight: 900;
}

/* ============================================
   AVATAR E PERFIL ONLINE
   ============================================ */
.avatar-carousel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.avatar-display {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 4px solid #881337;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.arrow-btn {
    background: #881337;
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    transition: transform 0.1s;
}

.arrow-btn:active {
    transform: scale(0.92);
}

/* ============================================
   ANIMAÇÕES
   ============================================ */
@keyframes bounceIn {
    0%   { opacity: 0; transform: scale(0.9) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes warningPulse {
    0%   { transform: scale(1);    color: white; }
    25%  { transform: scale(1.15); color: #dc2626; }
    50%  { transform: scale(1.05); color: #ff0000; }
    75%  { transform: scale(1.15); color: #dc2626; }
    100% { transform: scale(1);    color: white; }
}

.warning-pulse {
    animation: warningPulse 0.8s ease-in-out;
    display: block;
    text-align: center;
}
