/* ==========================================================================
   atiro.css - Clon Matacaballo + Señales 12 Elementos + Tablas (Responsive)
   ========================================================================== */
.atiro-container { max-width: 600px; margin: 0 auto; padding: 15px; font-family: 'Inter', sans-serif; box-sizing: border-box; width: 100%; overflow-x: hidden; }
.oculta { display: none !important; }
.activa { display: block; }

.atiro-header { text-align: center; margin-bottom: 20px; width: 100%; }
.atiro-title { font-family: 'Crimson Pro', serif; font-size: 2.2rem; color: #2c3e50; margin: 0 0 5px 0; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 10px; }
.atiro-subtitle { color: #666; font-size: 0.9rem; margin: 0; text-transform: uppercase; letter-spacing: 1px; }

.atiro-tabs { display: flex; width: 100%; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.05); margin-bottom: 25px; border: 1px solid #eee; }
.atiro-tab-btn { flex: 1; padding: 12px 5px; background: transparent; border: none; font-size: 0.85rem; font-weight: 700; color: #777; cursor: pointer; transition: all 0.2s; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.atiro-tab-btn i { font-size: 1.2rem; }
.atiro-tab-btn.active { background: #2c3e50; color: #fff; }
.atiro-tab-btn:not(.active):hover { background: #f5f5f5; }
.atiro-tab-content { display: none; width: 100%; animation: fadeInAtiro 0.3s ease-in-out; }
.atiro-tab-content.active { display: block; }
@keyframes fadeInAtiro { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.atiro-lobby-card { width: 100%; box-sizing: border-box; background: #fff; border-radius: 20px; padding: 25px; box-shadow: 0 8px 25px rgba(0,0,0,0.08); text-align: center; border: 1px solid #f0f0f0; }
.atiro-hook-phrase { font-size: 1.1rem; color: #333; font-weight: 700; line-height: 1.4; margin-bottom: 20px; }

.atiro-prizes-box { background: linear-gradient(135deg, #fffcf0 0%, #fff6d6 100%); border: 2px dashed #f1c40f; border-radius: 15px; padding: 15px; margin-bottom: 20px; }
.atiro-prizes-title { font-size: 0.85rem; text-transform: uppercase; color: #b89600; font-weight: 800; margin-bottom: 15px; letter-spacing: 1px; }
.atiro-prizes-grid { display: flex; justify-content: center; gap: 10px; }
.atiro-prize-item { background: #fff; border-radius: 10px; padding: 10px; flex: 1; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.atiro-prize-pos { font-size: 1.2rem; margin-bottom: 5px; }
.atiro-prize-val { font-weight: 800; color: #333; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; gap: 4px; }
.atiro-prize-val i { color: #f1c40f; font-size: 0.9rem; }

.atiro-btn-play { width: 100%; padding: 18px; font-size: 1.2rem; font-weight: 800; text-transform: uppercase; background: #2c3e50; color: white; border: none; border-radius: 50px; cursor: pointer; box-shadow: 0 6px 15px rgba(44, 62, 80, 0.3); transition: transform 0.1s; margin-bottom: 15px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.atiro-btn-play:active { transform: scale(0.97); }
.atiro-btn-play:disabled { background: #95a5a6; cursor: not-allowed; box-shadow: none; }

.atiro-estado-box { border-radius: 15px; padding: 20px; margin-bottom: 20px; text-align: center; }

.atiro-accordion-btn { width: 100%; text-align: left; background: #f9f9f9; border: 1px solid #eee; padding: 15px; font-weight: 700; color: #555; border-radius: 12px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: background 0.2s; }
.atiro-accordion-btn:hover { background: #f1f1f1; }
.atiro-accordion-content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; background: #fff; padding: 0 15px; text-align: left; font-size: 0.9rem; color: #666; line-height: 1.5; border-radius: 0 0 12px 12px; }
.atiro-accordion-content ul { padding-left: 20px; margin: 15px 0; }
.atiro-mensaje-error { background: #ffebee; color: #c0392b; padding: 15px; border-radius: 8px; border: 1px solid #ffcdd2; margin-bottom: 20px; font-size: 0.95rem; font-weight: bold; text-align: left;}

/* TABLAS RANKING E HISTORIAL */
.atiro-table-container { width: 100%; box-sizing: border-box; background: #fff; border-radius: 15px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.05); border: 1px solid #eee; }
.atiro-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.9rem; table-layout: fixed; }
.atiro-table th { background: #2c3e50; color: #fff; padding: 12px 10px; font-weight: 600; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 1px; }
.atiro-table td { padding: 12px 10px; border-bottom: 1px solid #f0f0f0; color: #444; vertical-align: middle; overflow-wrap: break-word; }
.atiro-table tr:last-child td { border-bottom: none; }
.atiro-td-nowrap { white-space: nowrap; font-weight: 600; font-size: 0.9rem; }

.atiro-row-gold { background: linear-gradient(90deg, #fffcf0 0%, #fff 100%); font-weight: 700; }
.atiro-row-silver { background: linear-gradient(90deg, #f8f9fa 0%, #fff 100%); font-weight: 700; }
.atiro-row-bronze { background: linear-gradient(90deg, #fff6f0 0%, #fff 100%); font-weight: 700; }
.atiro-medal { font-size: 1.2rem; margin-right: 5px; }

/* Control de nombres largos en la tabla */
.atiro-user-flex { display: flex; align-items: center; min-width: 0; flex: 1; gap: 10px; cursor: pointer; transition: opacity 0.2s; overflow: hidden; }
.atiro-shield-img { width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.08)); }
.atiro-shield-fallback { width: 28px; height: 28px; background: #f0f0f0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; color: #aaa; flex-shrink: 0; }
.atiro-user-texts { display: flex; flex-direction: column; min-width: 0; flex: 1; overflow: hidden; }
.atiro-user-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #333; font-size: 0.95rem; }
.atiro-user-sub { font-size: 0.7rem; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 1px; }

/* CUENTA ATRÁS Y JUEGO */
.atiro-countdown-card { width: 100%; box-sizing: border-box; background: #fff; border-radius: 20px; padding: 40px 20px; box-shadow: 0 8px 25px rgba(0,0,0,0.08); text-align: center; margin-top: 10px;}
.atiro-countdown-number { font-size: 6rem; font-family: 'Crimson Pro', serif; font-weight: 900; color: #2d5a27; margin: 10px 0; text-shadow: 3px 3px 0 #f0f0f0; line-height: 1; transition: all 0.2s ease; min-height: 100px; }
.atiro-countdown-label { color: #666; font-weight: 800; text-transform: uppercase; letter-spacing: 2px; }

.atiro-game-hud { width: 100%; box-sizing: border-box; background: #fff; border-radius: 15px; padding: 15px; box-shadow: 0 8px 25px rgba(0,0,0,0.08); text-align: center; }
.atiro-header-superior { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px; }
.caja-provincia-inline { text-align: center; flex: 1; }
.caja-provincia-inline p { margin: 0 0 2px 0; color: #6c757d; font-weight: bold; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.5px; }
.caja-provincia-inline h2 { margin: 0; color: #e31821; font-size: 1.6rem; text-transform: uppercase; font-family: 'Arial Black', sans-serif; letter-spacing: 1px; }
.btn-abandonar { background: transparent; color: #e74c3c; border: 2px solid #e74c3c; border-radius: 50%; width: 35px; height: 35px; font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0; }
.btn-abandonar:hover { background: #e74c3c; color: #fff; }

.cronometro-juego { font-size: 2.8rem; margin-bottom: 15px; display: flex; justify-content: center; align-items: center; gap: 10px; }
.reloj-texto { font-family: 'Courier New', monospace; font-weight: 900; color: #2c3e50; transition: color 0.2s; letter-spacing: -1px; }

/* GRID SEÑALES - EL CAMBIO CLAVE A minmax(0, 1fr) ESTÁ AQUÍ */
.opciones-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px 10px; width: 100%; }
.atiro-opcion-btn { position: relative; display: flex; flex-direction: column; align-items: center; padding-bottom: 15px; cursor: pointer; transition: transform 0.1s; background: transparent; border: none; outline: none; width: 100%; }
.atiro-opcion-btn:active:not(.bloqueado) { transform: scale(0.95); }
.atiro-opcion-btn.bloqueado { pointer-events: none; }
.atiro-opcion-btn::before, .atiro-opcion-btn::after { content: ''; position: absolute; bottom: 0; width: 3px; height: 22px; background: linear-gradient(to right, #95a5a6, #bdc3c7, #95a5a6); z-index: 1; border-left: 1px solid #7f8c8d; border-radius: 1px; }
.atiro-opcion-btn::before { left: 25%; }
.atiro-opcion-btn::after { right: 25%; }

/* CARTEL DE SEÑAL - EL OTRO CAMBIO CLAVE (word-break y hyphens) */
.atiro-opcion-cartel {
    width: 100%; background-color: #ffffff; border: 3px solid #d91e18; border-radius: 4px;
    padding: 6px 2px; min-height: 55px; display: flex; align-items: center; justify-content: center; text-align: center;
    font-family: 'Arial Black', Impact, sans-serif; font-size: clamp(0.5rem, 2.2vw, 0.85rem); line-height: 1.1; color: #111; text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15); z-index: 2; position: relative; box-sizing: border-box;
    word-break: break-word !important; overflow-wrap: anywhere !important; hyphens: auto; -webkit-hyphens: auto;
}
.atiro-opcion-btn.fallo .atiro-opcion-cartel { background: linear-gradient(to top right, transparent calc(50% - 2px), #d91e18 calc(50% - 2px), #d91e18 calc(50% + 2px), transparent calc(50% + 2px)), #f1f2f6; border-color: #95a5a6 !important; color: #7f8c8d; }
.atiro-opcion-btn.acierto .atiro-opcion-cartel { background-color: #2d5a27; border-color: #2d5a27 !important; color: #ffffff; box-shadow: 0 0 12px rgba(45, 90, 39, 0.6); transform: scale(1.05); }

.aviso-tiempo-extra { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: #c0392b; font-size: 1.5rem; font-weight: 900; text-shadow: 1px 1px 0 #fff; z-index: 10; animation: flotar 1s forwards; pointer-events: none; }
@keyframes flotar { 0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; } 100% { transform: translate(-50%, -150%) scale(1); opacity: 0; } }

@media (max-width: 600px) {
    .cronometro-juego { font-size: 2rem; margin-bottom: 10px; }
    .atiro-opcion-btn { padding-bottom: 12px; }
    .atiro-opcion-btn::before, .atiro-opcion-btn::after { height: 16px; }
    .atiro-opcion-cartel { min-height: 48px; border-width: 2px; }
    .opciones-grid { gap: 10px 6px; }
}

/* RESULTADOS Y MODALES */
.atiro-results-card { width: 100%; box-sizing: border-box; background: #fff; border-radius: 20px; padding: 30px 20px; box-shadow: 0 8px 25px rgba(0,0,0,0.08); text-align: center; }
.atiro-resumen-estadisticas { background: #f8f9fa; border-radius: 8px; padding: 20px; margin: 20px 0; text-align: left; }
.atiro-stat-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px dashed #eee; font-size: 1rem; color: #555; }
.atiro-stat-bad { color: #dc3545; font-weight: bold; }

.atiro-btn-back { width: 100%; padding: 15px; border-radius: 50px; font-weight: 700; background: #e0e0e0; color: #555; border: none; cursor: pointer; text-transform: uppercase; margin-top: 20px; transition: background 0.2s; }
.atiro-btn-back:hover { background: #d0d0d0; }

.atiro-btn-share { width: 100%; padding: 15px; border-radius: 50px; font-weight: 800; background: #25D366; color: #fff; border: none; cursor: pointer; text-transform: uppercase; margin-top: 10px; transition: background 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3); }
.atiro-btn-share:hover { background: #128C7E; }

.atiro-mini-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 99999; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.atiro-mini-modal-box { background: #fff; border-radius: 20px; padding: 25px 20px; width: 85%; max-width: 320px; text-align: center; box-shadow: 0 15px 35px rgba(0,0,0,0.2); animation: popIn 0.3s ease; }
@keyframes popIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.atiro-mini-modal-avatar { width: 70px; height: 70px; object-fit: contain; margin: 0 auto 15px auto; display: block; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1)); }
.atiro-mini-modal-name { font-size: 1.25rem; color: #2d5a27; font-family: 'Crimson Pro', serif; font-weight: 800; margin-bottom: 5px; word-wrap: break-word; }
.atiro-mini-modal-sub { font-size: 0.85rem; color: #666; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; word-wrap: break-word; line-height: 1.4; }