*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Poppins", sans-serif; background: radial-gradient(circle at top, #0f172a 0, #000 100%); color: #e5e7eb; height: 100vh; overflow: hidden; }

/* BOTONES LIMPIOS (SIN MUCHO BRILLO) */
.btn-main { border-radius: 12px; padding: 14px 20px; font-weight: 700; font-size: 1rem; transition: transform 0.1s; border: none; cursor: pointer; }
.btn-main:active { transform: scale(0.98); }
.btn-primary { background: #dc2626; color: #fff; box-shadow: 0 4px 0 #991b1b; } /* Rojo plano */
.btn-primary:hover { background: #ef4444; }
.btn-secondary { background: #1e293b; color: #cbd5e1; border: 1px solid #334155; }
.btn-secondary:hover { border-color: #94a3b8; color: #fff; }
.btn-big { width: 100%; font-size: 1.1rem; padding: 16px; display: block; }

/* HOME */
.screen-wrapper-home { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; width: 100%; padding: 20px; }
.big-logo-container { margin-bottom: 30px; text-align: center; }
.logo-img-home { width: 320px; max-width: 90vw; filter: drop-shadow(0 0 10px rgba(220,38,38,0.2)); }
.home-card-buttons { background: rgba(30, 41, 59, 0.6); backdrop-filter: blur(10px); padding: 25px; border-radius: 24px; border: 1px solid rgba(255,255,255,0.05); width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 15px; }

/* PANTALLAS */
.lobby-overlay { position: fixed; inset: 0; z-index: 50; background: #020617; display: flex; align-items: center; justify-content: center; }
.screen { background: #0f172a; border-radius: 24px; padding: 25px; width: 90%; max-width: 450px; border: 1px solid #1e293b; max-height: 90vh; overflow-y: auto; display: flex; flex-direction: column; }
.screen-header { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; }
.screen-header h2 { margin: 0; font-size: 1.2rem; }

/* FLECHA VOLVER */
.btn-icon-back { background: #334155; border-radius: 50%; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border: none; cursor: pointer; }
.arrow-icon-img { width: 20px; height: 20px; filter: invert(1); }
.btn-exit-game { background: #1e293b; color: #f87171; border: 1px solid #7f1d1d; padding: 6px 12px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; font-size: 0.8rem; }
.btn-exit-arrow { width: 12px; height: 12px; filter: invert(1); opacity: 0.7; margin-right: 5px; }

/* CONTADORES */
.config-counters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 15px; }
.mini-card { background: #1e293b; border-radius: 12px; padding: 10px; text-align: center; border: 1px solid #334155; }
.mini-label { font-size: 0.65rem; color: #94a3b8; font-weight: 700; text-transform: uppercase; margin-bottom: 5px; display: block; }
.mini-controls { display: flex; align-items: center; justify-content: center; gap: 5px; margin-bottom: 5px; }
.btn-circle { width: 24px; height: 24px; border-radius: 50%; background: #0f172a; border: 1px solid #475569; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.value-display { font-weight: 700; font-size: 1.1rem; width: 30px; }
.mini-hint-simple { font-size: 0.6rem; color: #64748b; }

/* CATEGORIAS */
.categories-grid { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.category-pill { padding: 8px 12px; border-radius: 20px; border: 1px solid #475569; background: #1e293b; color: #cbd5e1; font-size: 0.85rem; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.category-pill:hover { background: #334155; }
.category-pill.active { background: #2563eb; border-color: #3b82f6; color: #fff; }

/* TOGGLE */
.toggle-wrapper { position: relative; width: 44px; height: 24px; }
.toggle-wrapper input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: #334155; border-radius: 34px; transition: .3s; cursor: pointer; }
.toggle-slider:before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: .3s; }
input:checked + .toggle-slider { background: #dc2626; }
input:checked + .toggle-slider:before { transform: translateX(20px); }

/* JUEGO */
.main-layout { max-width: 1200px; margin: 0 auto; height: 100%; display: flex; flex-direction: column; padding: 10px; }
.top-bar { display: flex; justify-content: space-between; align-items: center; background: #1e293b; padding: 10px 15px; border-radius: 12px; margin-bottom: 15px; }
.room-code-display { font-family: monospace; font-size: 1.2rem; color: #ef4444; font-weight: 800; letter-spacing: 2px; margin: 0 10px; }
.copy-btn-icon { background: none; border: none; color: #94a3b8; cursor: pointer; width: 24px; height: 24px; display: flex; align-items: center; }
.copy-btn-icon svg { width: 18px; height: 18px; }

.main-grid { display: grid; grid-template-columns: 1fr 280px; gap: 15px; flex: 1; overflow: hidden; }
.view-panel { background: rgba(30,41,59,0.5); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.view-card { width: 100%; max-width: 500px; }

/* CARTA */
.secret-card-container { perspective: 1000px; width: 280px; height: 180px; margin: 20px auto; cursor: pointer; }
.secret-card-inner { position: relative; width: 100%; height: 100%; text-align: center; transition: transform 0.6s; transform-style: preserve-3d; }
.secret-card-inner.flipped { transform: rotateY(180deg); }
.secret-card-face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 16px; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 15px; border: 1px solid #475569; }
.front { background: #0f172a; }
.back { background: #1e293b; transform: rotateY(180deg); }
.secret-word-reveal { font-size: 1.8rem; font-weight: 800; color: #fff; margin: 10px 0; }
.role-badge { background: #334155; padding: 4px 8px; border-radius: 4px; font-size: 0.8rem; text-transform: uppercase; }

/* UTILS */
.app-card { background: #1e293b; padding: 15px; border-radius: 12px; margin-bottom: 10px; border: 1px solid #334155; }
.input-modern { width: 100%; background: #020617; border: 1px solid #475569; padding: 10px; border-radius: 8px; color: #fff; outline: none; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.stats-row { display: flex; justify-content: center; gap: 30px; margin: 20px 0; }
.stat-item { display: flex; flex-direction: column; align-items: center; }
.stat-value { font-size: 1.8rem; font-weight: 800; }
.stat-label { font-size: 0.7rem; color: #94a3b8; text-transform: uppercase; }

/* RESULTADOS */
.full-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.9); display: flex; align-items: center; justify-content: center; z-index: 100; }
.result-card, .howto-card { background: #1e293b; padding: 30px; border-radius: 20px; text-align: center; max-width: 400px; width: 90%; border: 1px solid #334155; }
.result-title { font-size: 2.5rem; margin: 10px 0; }
.result-row { display: flex; justify-content: space-between; padding: 5px 0; color: #cbd5e1; }
.result-value { font-weight: bold; color: #fff; }
.highlight { color: #f87171; }

.timer-display-sidebar { font-size: 2rem; font-weight: 800; text-align: center; }
.players-list { display: flex; flex-direction: column; gap: 5px; overflow-y: auto; max-height: 300px; }
.player-row { padding: 8px; background: #0f172a; border-radius: 8px; font-size: 0.9rem; display: flex; align-items: center; gap: 10px; }

@media (max-width: 768px) { .main-grid { grid-template-columns: 1fr; } .logo-img-home { width: 260px; } }