/* ==========================================================================
   ANOTADOR PRO — Hoja de estilos compartida
   Usada por todas las páginas del sitio (index, juegos, guías, legales)
   ========================================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; user-select: none; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body { background: #2d5a27; font-family: 'Segoe UI', Roboto, sans-serif; display: flex; flex-direction: column; min-height: 100vh; color: #fdf5e6; }

/* ---------- Anuncios ---------- */
.ad-top, .ad-bottom, .ad-mid { width: 100%; min-height: 50px; background: #000; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; margin: 4px 0; }

/* ---------- Header ---------- */
.app-header { background: #1a3a1a; display: flex; align-items: center; padding: 8px 16px; border-bottom: 2px solid #000; gap: 8px; }
.menu-hamburger { font-size: 2rem; background: none; border: none; color: #ff9f43; cursor: pointer; width: 50px; }
.logo-area { flex: 1; text-align: center; font-weight: 800; font-size: 1.2rem; }
.logo-area a { color: #fdf5e6; text-decoration: none; }
.game-indicator { background: #ff9f43; color: #1a3a1a; padding: 4px 12px; border-radius: 40px; font-size: 0.8rem; font-weight: bold; white-space: nowrap; }
.reset-global { font-size: 1.8rem; background: none; border: none; color: #ff9f43; width: 50px; cursor: pointer; }

/* ---------- Drawer / menú lateral ---------- */
.drawer { position: fixed; top: 0; left: -300px; width: 280px; height: 100%; background: #1e3a1e; z-index: 1100; transition: left 0.25s; display: flex; flex-direction: column; box-shadow: 4px 0 20px rgba(0,0,0,0.6); border-right: 2px solid #ff9f43; overflow-y: auto; }
.drawer.open { left: 0; }
.drawer-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 1050; display: none; }
.drawer-overlay.active { display: block; }
.drawer-item { padding: 14px 20px; font-size: 1.1rem; font-weight: bold; border-bottom: 1px solid #3a6b3a; cursor: pointer; text-decoration: none; color: #fdf5e6; display: block; }
.drawer-item:active { background: #2a5a2a; }
.drawer-subheader { padding: 12px 20px 4px; font-size: 0.8rem; color: #ff9f43; }
.sugerencias-box { margin-top: auto; padding: 20px; border-top: 2px solid #ff9f43; }
.sugerencias-box textarea { width: 100%; padding: 8px; border-radius: 12px; background: #fdf5e6; border: none; margin: 8px 0; font-family: inherit; }
.sugerencias-box button { background: #ff9f43; border: none; width: 100%; padding: 8px; font-weight: bold; border-radius: 40px; cursor: pointer; }
.firma-dev { font-size: 0.7rem; text-align: center; padding: 15px; background: #0f2a0f; color: #ccaaff; }

.game-viewport { flex: 1; padding: 12px; overflow-y: auto; max-width: 900px; margin: 0 auto; width: 100%; }

/* ---------- Pantalla de inicio / hub de juegos ---------- */
.inicio-juegos { display: flex; flex-direction: column; align-items: center; gap: 16px; margin: 16px 0 24px; }
.btn-juego-inicio { background: #ff9f43; color: #1a3a1a; border: none; font-size: 1.5rem; font-weight: bold; padding: 14px 20px; border-radius: 60px; width: 80%; max-width: 320px; cursor: pointer; text-align: center; box-shadow: 0 4px 0 #b4621a; text-decoration: none; display: block; }
.btn-juego-inicio:active { transform: translateY(2px); box-shadow: 0 2px 0 #b4621a; }
.btn-juego-inicio.secundario { background: #3a6b3a; color: #fdf5e6; font-size: 1.2rem; box-shadow: 0 4px 0 #1f3e1f; }
.btn-juego-inicio.secundario:active { box-shadow: 0 2px 0 #1f3e1f; }

/* ---------- Contenido informativo / SEO ---------- */
.contenido-informativo, .contenido-seo { background: #1f3e1fcc; border-radius: 28px; padding: 18px; margin-top: 8px; border: 1px solid #ff9f43; text-align: left; }
.contenido-informativo h2, .contenido-seo h2 { color: #ff9f43; margin: 16px 0 8px; font-size: 1.3rem; border-left: 4px solid #ff9f43; padding-left: 12px; }
.contenido-informativo h3, .contenido-seo h3 { color: #ffd966; margin: 12px 0 6px; font-size: 1.05rem; }
.contenido-informativo p, .contenido-informativo li, .contenido-seo p, .contenido-seo li { line-height: 1.55; margin-bottom: 8px; font-size: 0.95rem; }
.contenido-informativo ul, .contenido-informativo ol, .contenido-seo ul, .contenido-seo ol { margin-left: 20px; margin-bottom: 12px; }
.contenido-seo article { border-bottom: 1px solid #3a6b3a; padding-bottom: 16px; margin-bottom: 16px; }
.contenido-seo h1 { color: #ff9f43; font-size: 1.25rem; margin-bottom: 12px; border-left: 4px solid #ff9f43; padding-left: 12px; line-height: 1.4; }

footer { background: #0f2a0f; text-align: center; padding: 16px; font-size: 0.8rem; margin-top: 16px; }
footer a { color: #ff9f43; text-decoration: none; margin: 0 8px; }
footer .footer-links { margin-bottom: 8px; }

/* ---------- Migas de pan / navegación entre juegos ---------- */
.breadcrumbs { font-size: 0.8rem; padding: 8px 4px; color: #cdeccb; }
.breadcrumbs a { color: #ff9f43; text-decoration: none; }
.juegos-relacionados { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; justify-content: center; }
.juegos-relacionados a { background: #1a3a1a; color: #ff9f43; padding: 8px 16px; border-radius: 30px; text-decoration: none; font-size: 0.85rem; border: 1px solid #ff9f4377; }

/* ---------- Tarjetas de jugador / equipo (Truco, Escoba, Cuarenta, Libre) ---------- */
.equipos-grid { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin-bottom: 24px; }
.card-jugador { background: #1a3a1acc; border-radius: 24px; padding: 12px; flex: 1; min-width: 180px; backdrop-filter: blur(2px); border: 1px solid #ff9f4377; transition: all 0.1s; position: relative; }
.repartidor-activo { border: 3px solid #ffd700; background: #2a5a2acc; box-shadow: 0 0 0 2px #ff9f43; }
.nombre-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.nombre-input { background: transparent; border: none; text-align: center; font-size: 1.15rem; font-weight: bold; color: #ff9f43; flex: 1; min-width: 100px; font-family: inherit; }
.btn-repartir { background: #3a6b3a; color: #ffd966; border: 1px solid #ff9f43; padding: 4px 10px; border-radius: 30px; font-weight: bold; cursor: pointer; font-size: 0.7rem; }
.puntos-grande { font-size: 2rem; text-align: center; margin: 8px 0; font-weight: bold; }
.estado-truco { text-align: center; background: #c0392b; display: inline-block; width: auto; margin: 4px auto; padding: 2px 12px; border-radius: 30px; font-size: 0.75rem; }
.estado-truco.buenas { background: #27ae60; }

/* ---------- Fósforos ---------- */
.fosforos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; justify-items: center; min-height: 100px; margin: 12px 0; }
.cuadro-fosforo { position: relative; width: 50px; height: 50px; background: #2b482b; border-radius: 8px; }
.palito { position: absolute; background: #e0c090; border: 1px solid #3b2f2f; border-radius: 2px; }
.cabeza { position: absolute; background: #8b0000; width: 6px; height: 7px; border-radius: 50%; top: -4px; left: -2px; }
.izq { left: 6px; top: 4px; width: 4px; height: 40px; }
.sup { left: 6px; top: 4px; width: 36px; height: 4px; }
.sup .cabeza { left: auto; right: -5px; top: -2px; }
.der { right: 5px; top: 4px; width: 4px; height: 40px; }
.der .cabeza { top: auto; bottom: -5px; }
.inf { left: 6px; bottom: 4px; width: 36px; height: 4px; }
.inf .cabeza { left: -5px; top: -2px; }
.diag { left: 4px; top: 22px; width: 44px; height: 4px; transform: rotate(-45deg); background: #b03030; border: none; }
.diag .cabeza { right: -4px; left: auto; top: -2px; }

/* ---------- Botones de puntaje ---------- */
.botones-punto { display: flex; justify-content: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.btn-punto { font-size: 1.6rem; width: 48px; border: none; border-radius: 30px; background: #fdf5e6; font-weight: bold; cursor: pointer; }
.btn-menos { background: #e74c3c; color: white; }
.btn-punto-personalizado { font-size: 0.95rem; width: auto; padding: 0 14px; height: 40px; border: none; border-radius: 30px; background: #ff9f43; color: #1a3a1a; font-weight: bold; cursor: pointer; }

/* ---------- Panel de configuración ---------- */
.config-panel { background: #1f3e1fcc; backdrop-filter: blur(8px); border-radius: 32px; padding: 24px; text-align: center; max-width: 380px; margin: 30px auto; border: 2px solid #ff9f43; }
.jugadores-opciones { display: flex; justify-content: center; gap: 20px; margin: 20px 0; flex-wrap: wrap; }
.jugador-num { background: #2d5a27; border: none; color: white; font-size: 1.6rem; width: 65px; border-radius: 40px; padding: 8px; cursor: pointer; }
.jugador-num.selected { background: #ff9f43; color: #1a3a1a; }
.btn-empezar { background: #ff9f43; border: none; padding: 12px 24px; font-weight: bold; border-radius: 60px; font-size: 1.1rem; cursor: pointer; }
.config-panel input[type="text"] { width: 100%; padding: 10px; border-radius: 14px; border: none; margin: 6px 0; text-align: center; font-size: 1rem; font-family: inherit; }

/* ---------- Histórico (Chinchón / Cuarenta) ---------- */
.historico-chin { background: #142014; border-radius: 24px; padding: 12px; overflow-x: auto; margin-top: 20px; }
.historico-chin table { width: 100%; border-collapse: collapse; color: #fdf5e6; font-size: 0.8rem; }
.historico-chin th, .historico-chin td { border: 1px solid #ff9f4377; padding: 6px; text-align: center; }
.ronda-input { width: 80px; background: #fdf5e6; border: none; border-radius: 12px; padding: 6px; text-align: center; font-size: 1rem; font-family: inherit; }
.btn-agregar { background: #ff9f43; border: none; padding: 8px 20px; border-radius: 40px; margin: 8px 4px; cursor: pointer; font-weight: bold; }

/* ---------- Generala: planilla de categorías ---------- */
.generala-tabla { width: 100%; border-collapse: collapse; background: #142014; border-radius: 16px; overflow: hidden; margin-top: 12px; }
.generala-tabla th, .generala-tabla td { border: 1px solid #ff9f4377; padding: 8px 6px; text-align: center; font-size: 0.85rem; }
.generala-tabla th { background: #1a3a1a; color: #ff9f43; }
.generala-tabla td.categoria { text-align: left; font-weight: bold; color: #ffd966; }
.generala-tabla input { width: 55px; background: #fdf5e6; border: none; border-radius: 8px; padding: 6px 2px; text-align: center; font-size: 0.9rem; font-family: inherit; }
.generala-tabla tr.fila-total td { background: #1a3a1a; font-weight: bold; color: #ff9f43; }

/* ---------- Modal reglamento ---------- */
.modal-reglamento { position: fixed; top: 5%; left: 5%; width: 90%; max-width: 550px; max-height: 85%; background: #fef7e0; color: #1e3a1e; border-radius: 32px; z-index: 1300; overflow-y: auto; padding: 20px; box-shadow: 0 0 0 1000px rgba(0,0,0,0.8); }
.tabs-reglas { display: flex; gap: 8px; margin-bottom: 20px; border-bottom: 1px solid #c0a050; flex-wrap: wrap; }
.tab-regla { background: #d4c090; padding: 6px 12px; border-radius: 20px 20px 0 0; cursor: pointer; }
.tab-regla.active { background: #ff9f43; }
.contenido-regla { white-space: pre-line; line-height: 1.4; max-height: 60vh; overflow-y: auto; }
.cerrar-modal { background: #2d5a27; color: white; border: none; padding: 8px 18px; border-radius: 60px; margin-top: 16px; cursor: pointer; }

/* ---------- Cartel de ganador ---------- */
.cartel-ganador { position: absolute; top: 35%; left: 20%; background: gold; color: black; padding: 8px 20px; font-weight: bold; font-size: 1.5rem; border-radius: 40px; transform: rotate(-6deg); z-index: 200; white-space: nowrap; pointer-events: none; }
@keyframes flashWin { 0% { background-color: #2d5a27; } 50% { background-color: #ffd966; } 100% { background-color: #2d5a27; } }
.flash-win { animation: flashWin 0.5s ease-in-out 3; }

/* ---------- Páginas de contenido general (guías, legales) ---------- */
.pagina-simple { max-width: 760px; margin: 0 auto; padding: 8px 4px 24px; }
.pagina-simple .card { background: #1f3e1fcc; border-radius: 20px; padding: 20px; margin-bottom: 16px; border: 1px solid #3a6b3a; }
.pagina-simple h1 { color: #ff9f43; font-size: 1.5rem; margin-bottom: 14px; }
.pagina-simple h2 { color: #ff9f43; font-size: 1.2rem; margin: 20px 0 8px; border-left: 4px solid #ff9f43; padding-left: 12px; }
.pagina-simple h3 { color: #ffd966; font-size: 1rem; margin: 14px 0 6px; }
.pagina-simple p, .pagina-simple li { line-height: 1.65; margin-bottom: 10px; font-size: 0.95rem; }
.pagina-simple ul, .pagina-simple ol { margin-left: 20px; margin-bottom: 12px; }
.guias-lista { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.guia-card { background: #1a3a1acc; border: 1px solid #ff9f4377; border-radius: 18px; padding: 14px 18px; text-decoration: none; color: #fdf5e6; display: block; }
.guia-card strong { color: #ff9f43; display: block; font-size: 1.05rem; margin-bottom: 4px; }
.guia-card span { font-size: 0.85rem; color: #cdeccb; }

/* ---------- Ahorcado ---------- */
.ahorcado-categorias { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 20px 0; }
.categoria-btn { background: #2d5a27; border: 1px solid #ff9f4377; color: #fdf5e6; font-size: 1rem; padding: 10px 18px; border-radius: 40px; cursor: pointer; }
.categoria-btn.selected { background: #ff9f43; color: #1a3a1a; font-weight: bold; }
.ahorcado-tablero { display: flex; flex-direction: column; align-items: center; gap: 18px; margin: 10px 0 20px; }
.ahorcado-dibujo { width: 180px; height: 200px; }
.ahorcado-dibujo .parte { stroke: #fdf5e6; stroke-width: 4; fill: none; stroke-linecap: round; visibility: hidden; }
.ahorcado-dibujo .soporte { stroke: #e0c090; visibility: visible; }
.ahorcado-palabra { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ahorcado-letra { width: 34px; height: 42px; border-bottom: 3px solid #ff9f43; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: bold; color: #fdf5e6; }
.ahorcado-info { text-align: center; font-size: 0.9rem; color: #cdeccb; }
.teclado-ahorcado { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 480px; margin: 0 auto; }
.tecla-ahorcado { width: 38px; height: 42px; border: none; border-radius: 8px; background: #fdf5e6; color: #1a3a1a; font-weight: bold; font-size: 1.05rem; cursor: pointer; }
.tecla-ahorcado.correcta { background: #27ae60; color: white; }
.tecla-ahorcado.incorrecta { background: #e74c3c; color: white; }
.tecla-ahorcado:disabled { opacity: 0.5; cursor: default; }

/* ---------- Impostor ---------- */
.impostor-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 20px 0; }
.impostor-nombre-btn { background: #2d5a27; border: 1px solid #ff9f4377; color: #fdf5e6; font-size: 1.1rem; font-weight: bold; padding: 18px 10px; border-radius: 18px; cursor: pointer; }
.impostor-nombre-btn:active { background: #ff9f43; color: #1a3a1a; }
.rol-pantalla { text-align: center; padding: 30px 10px; }
.rol-titulo { font-size: 2rem; font-weight: 800; margin-bottom: 12px; }
.rol-titulo.tripulante { color: #27ae60; }
.rol-titulo.impostor { color: #e74c3c; }
.rol-palabra { font-size: 1.2rem; margin-bottom: 24px; }
.btn-ocultar { background: #fdf5e6; color: #1a3a1a; border: none; width: 100%; max-width: 320px; padding: 14px; border-radius: 40px; font-weight: bold; font-size: 1.05rem; cursor: pointer; }
.timer-grande { font-size: 3.5rem; font-weight: 800; text-align: center; color: #ff9f43; margin: 20px 0; font-variant-numeric: tabular-nums; }
.timer-botones { display: flex; justify-content: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.resultado-impostor { text-align: center; padding: 20px; }
.resultado-impostor .nombre-revelado { color: #e74c3c; font-size: 1.8rem; font-weight: 800; margin: 10px 0; }
.resultado-impostor .palabra-revelada { color: #ff9f43; font-size: 1.3rem; font-weight: bold; }
.nombre-input-simple { width: 100%; padding: 12px; border-radius: 14px; border: none; margin: 10px 0; text-align: center; font-size: 1.1rem; font-family: inherit; }

/* ---------- Dados decorativos (Generala) ---------- */
.dados-decorativos { display: flex; gap: 10px; justify-content: center; margin: 4px 0 20px; flex-wrap: wrap; }
.dado { width: 42px; height: 42px; background: #fdf5e6; border-radius: 9px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 5px; gap: 2px; box-shadow: 0 3px 0 #b4621a; animation: dadoAparecer 0.4s ease-out backwards; }
.dado .punto { width: 7px; height: 7px; border-radius: 50%; background: #1a3a1a; }
.dado .p-tl { grid-column: 1; grid-row: 1; }
.dado .p-tr { grid-column: 3; grid-row: 1; }
.dado .p-ml { grid-column: 1; grid-row: 2; }
.dado .p-mr { grid-column: 3; grid-row: 2; }
.dado .p-bl { grid-column: 1; grid-row: 3; }
.dado .p-br { grid-column: 3; grid-row: 3; }
.dado .p-c { grid-column: 2; grid-row: 2; }
@keyframes dadoAparecer { from { transform: translateY(-14px) rotate(-8deg); opacity: 0; } to { transform: translateY(0) rotate(0); opacity: 1; } }
.dado:nth-child(1) { animation-delay: 0s; }
.dado:nth-child(2) { animation-delay: 0.08s; }
.dado:nth-child(3) { animation-delay: 0.16s; }
.dado:nth-child(4) { animation-delay: 0.24s; }
.dado:nth-child(5) { animation-delay: 0.32s; }
.dado.clickeable { cursor: pointer; user-select: none; transition: transform 0.1s; }
.dado.clickeable:active { transform: scale(0.92); }
.dado.sostenido { box-shadow: 0 0 0 3px #ff9f43, 0 3px 0 #b4621a; background: #fff7e6; }
.dado.girando { animation: dadoGirar 0.35s ease-in-out; }
@keyframes dadoGirar { 0% { transform: rotate(0); } 50% { transform: rotate(15deg) scale(1.05); } 100% { transform: rotate(0); } }

/* ---------- Tirador de dados interactivo (Generala) ---------- */
.turno-indicator { text-align: center; font-size: 1.05rem; font-weight: bold; color: #ffd966; margin-bottom: 6px; }
.dado-controles { text-align: center; margin: 10px 0 16px; }
.dado-controles .tiradas-info { display: block; font-size: 0.8rem; color: #cdeccb; margin-top: 6px; }
.categorias-sugeridas { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 10px 0 4px; }
.chip-categoria { background: #1a3a1a; border: 1px solid #ff9f4377; color: #fdf5e6; padding: 8px 14px; border-radius: 30px; font-size: 0.82rem; cursor: pointer; font-weight: bold; }
.chip-categoria:disabled { opacity: 0.3; cursor: default; }
.chip-categoria .valor { color: #ff9f43; margin-left: 4px; }
.generala-tabla th.turno-col { background: #ff9f4333; color: #ffd966; }

@media (max-width: 700px) { .card-jugador { min-width: 170px; } }
