/* Pinturillo Pokémon — estilos de la sala. Paleta del sitio: fondo #1a1f2e, acento #ffd34d, primario #c03634. */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: system-ui, -apple-system, sans-serif; background: #1a1f2e; color: #fff; overflow: hidden; }

.pantalla { display: none; height: 100vh; height: 100dvh; }
.pantalla.activa { display: flex; flex-direction: column; }
.caja { max-width: 480px; margin: auto; padding: 32px 24px; text-align: center; }
.caja h1 { margin-bottom: 14px; }
.caja p { margin: 10px 0; opacity: .9; }

.btn { display: inline-block; border: 0; border-radius: 10px; padding: 11px 20px; font-size: 15px; font-weight: 700;
       cursor: pointer; background: #2c3448; color: #fff; text-decoration: none; margin: 4px; }
.btn:hover { filter: brightness(1.15); }
.btn-primario { background: #c03634; }
.btn-peligro { background: transparent; border: 1px solid #c03634; color: #ff8a88; padding: 7px 14px; font-size: 13px; white-space: nowrap; }
.btn-volver { background: transparent; border: 1px solid #3a4460; color: #cfd6e4; padding: 7px 10px; font-size: 13px; line-height: 1; }
.error-inline { color: #ff8a88; min-height: 1.2em; font-size: 14px; }

.spinner { width: 42px; height: 42px; border: 4px solid #2c3448; border-top-color: #ffd34d; border-radius: 50%;
           margin: 0 auto 16px; animation: girar 0.9s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

#input-nick, #chat-input { width: 100%; padding: 11px 14px; border-radius: 10px; border: 1px solid #3a4460;
    background: #232a3d; color: #fff; font-size: 15px; }

/* Lobby */
.panel-lobby { max-width: 520px; margin: auto; padding: 28px 20px; text-align: center; width: 100%; }
#lobby-codigo { color: #ffd34d; letter-spacing: 4px; }
.compartir { margin: 14px 0 20px; }
#lobby-web { display: inline-block; color: #8b93a8; font-size: 13px; text-decoration: none; margin-bottom: 10px; }
#lobby-web:hover { color: #cfd6e4; text-decoration: underline; }
#lobby-web i { margin-right: 4px; }
#lista-jugadores { list-style: none; margin: 12px 0 20px; }
#lista-jugadores li { display: flex; align-items: center; gap: 10px; background: #232a3d; border-radius: 10px;
    padding: 9px 14px; margin-bottom: 7px; text-align: left; }
#lista-jugadores img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
#lista-jugadores .host-tag { color: #ffd34d; font-size: 12px; }
#lista-jugadores .desconectado { opacity: .45; }
#lista-jugadores .btn-kick { margin-left: auto; background: none; border: 0; cursor: pointer; color: #ff8a88; font-size: 15px; }
#config-sala { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 8px 0 14px; }
#config-sala label { font-size: 13px; opacity: .9; }
#config-sala select { margin-left: 6px; background: #232a3d; color: #fff; border: 1px solid #3a4460; border-radius: 8px; padding: 5px 8px; }

/* Juego: grid  marcador | lienzo | chat */
#p-juego.activa { display: grid; grid-template-rows: auto 1fr; }
#cabecera { display: flex; align-items: center; gap: 14px; padding: 8px 14px; background: #141926; }
#pista { font-family: monospace; font-size: 22px; letter-spacing: 5px; color: #ffd34d; flex: 1; min-height: 1.2em; }
#timer-barra { width: 180px; height: 10px; background: #2c3448; border-radius: 6px; overflow: hidden; }
#timer-progreso { height: 100%; width: 100%; background: #22b14c; transition: width 0.25s linear; }
#zona-juego { display: grid; grid-template-columns: 190px 1fr 260px; gap: 10px; padding: 10px; min-height: 0; }
#lateral-izq, #lateral-der { display: flex; flex-direction: column; min-height: 0; }
#marcador { list-style: none; overflow-y: auto; }
#marcador li { display: flex; gap: 8px; align-items: center; background: #232a3d; border-radius: 8px; padding: 7px 10px; margin-bottom: 6px; font-size: 14px; }
#marcador .puntos { margin-left: auto; font-weight: 800; color: #ffd34d; }
#marcador .dibujando i.fa-paintbrush { color: #ffd34d; margin-right: 4px; }
#marcador .acerto { outline: 2px solid #22b14c; }
#marcador .btn-reportar { background: none; border: 0; cursor: pointer; opacity: .5; font-size: 12px; }
#ref-dibujante { margin-top: 10px; background: #232a3d; border-radius: 10px; padding: 10px; text-align: center; }
#ref-dibujante img { max-width: 100%; border-radius: 8px; margin-top: 6px; }

#zona-lienzo { display: flex; flex-direction: column; min-height: 0; }
#lienzo { background: #fff; border-radius: 10px; width: 100%; flex: 1; min-height: 0; touch-action: none; cursor: crosshair; }
#toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-top: 8px; }
#herramientas button, #paleta .color, #grosores .grosor { border: 2px solid transparent; border-radius: 8px; cursor: pointer; }
#herramientas button { background: #232a3d; font-size: 17px; padding: 6px 9px; }
#herramientas button.activa { border-color: #ffd34d; }
#paleta { display: grid; grid-template-columns: repeat(10, 20px); gap: 4px; }
#paleta .color { width: 20px; height: 20px; padding: 0; }
#paleta .color.activa { border-color: #ffd34d; transform: scale(1.15); }
#grosores { display: flex; gap: 6px; align-items: center; }
#grosores .grosor { background: #232a3d; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; }
#grosores .grosor span { background: #fff; border-radius: 50%; display: block; }
#grosores .grosor.activa { border-color: #ffd34d; }

#chat-lista { list-style: none; flex: 1; overflow-y: auto; background: #141926; border-radius: 10px; padding: 8px; margin-bottom: 8px; font-size: 14px; }
#chat-lista li { padding: 3px 4px; word-wrap: break-word; }
#chat-lista .acierto { color: #22b14c; font-weight: 700; }
#chat-lista .casi { color: #ffd34d; font-style: italic; }
#chat-lista .privado { opacity: .55; font-style: italic; }
#chat-lista .sistema { opacity: .6; font-size: 13px; }

/* Overlays */
.overlay { position: fixed; inset: 0; background: rgba(10, 13, 22, 0.86); display: flex; z-index: 10; }
.overlay[hidden] { display: none; }
#ruleta-nombres { list-style: none; margin-top: 14px; }
#ruleta-nombres li { padding: 8px 22px; border-radius: 8px; font-size: 19px; margin: 4px 0; transition: background 0.1s; }
#ruleta-nombres li.marcado { background: #c03634; font-weight: 800; }
#elegir-cartas { display: flex; gap: 12px; justify-content: center; margin: 16px 0; }
#elegir-cartas .carta { background: #232a3d; border: 2px solid transparent; border-radius: 12px; padding: 12px; cursor: pointer; width: 130px; }
#elegir-cartas .carta:hover { border-color: #ffd34d; }
#elegir-cartas .carta img { width: 100%; }
#elegir-cartas .carta p { font-size: 14px; margin-top: 6px; }
#elegir-barra { height: 8px; background: #2c3448; border-radius: 5px; overflow: hidden; }
#elegir-barra div { height: 100%; background: #ffd34d; width: 100%; }
.comparativa { display: flex; gap: 14px; justify-content: center; margin: 14px 0; }
.comparativa img { width: 170px; height: 170px; object-fit: contain; background: #fff; border-radius: 10px; }
#ft-puntos { list-style: none; margin-bottom: 12px; font-size: 14px; }

/* Podio */
#podio-lista { list-style: none; margin: 18px 0; }
#podio-lista li { background: #232a3d; border-radius: 10px; padding: 12px 18px; margin-bottom: 8px; font-size: 17px; display: flex; gap: 10px; }
#podio-lista .pts { margin-left: auto; color: #ffd34d; font-weight: 800; }
.medalla-1 { color: #ffd34d; }
.medalla-2 { color: #c0c0c0; }
.medalla-3 { color: #cd7f32; }

/* Móvil: columna lienzo arriba, chat abajo */
@media (max-width: 800px) {
    #zona-juego { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; overflow-y: auto; }
    #lateral-izq { flex-direction: row; gap: 8px; overflow-x: auto; order: 1; }
    #marcador { display: flex; gap: 6px; overflow-x: auto; }
    #marcador li { min-width: 110px; font-size: 12px; }
    #ref-dibujante { margin-top: 0; min-width: 110px; }
    #ref-dibujante img { max-width: 70px; }
    #zona-lienzo { order: 2; }
    #lienzo { aspect-ratio: 4 / 3; flex: none; }
    #lateral-der { order: 3; min-height: 180px; }
    #paleta { grid-template-columns: repeat(20, 20px); overflow-x: auto; }
    .comparativa img { width: 120px; height: 120px; }
}
