/* El Caldero Compartido (web/caldero.html). Usa también estilo.css y troll.css para la ficha y las salas. */
.c-pagina { background: radial-gradient(ellipse at 50% 0%, #1d3a3a, var(--noche) 62%); }
.c-juego { position: relative; max-width: 980px; margin: 8px auto 0; }

.c-marcador { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border: 1px solid #3a6b5a; border-radius: 10px; background: rgba(8, 20, 22, .7); }
.c-dato { display: flex; flex-direction: column; align-items: center; min-width: 74px; }
.c-dato small { font: 700 12px var(--rotulo); letter-spacing: .12em; text-transform: uppercase; color: var(--texto-2); }
.c-dato b { font: 900 30px/1 var(--titulo); color: var(--oro-claro); }
.c-dato b.c-prisa { color: #ff6b6b; animation: c-late .6s ease-in-out infinite; }
.c-barra { flex: 1; height: 12px; border-radius: 8px; background: #102624; overflow: hidden; }
.c-barra i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #4fd1a5, #e3bd60); transition: width .25s linear; }

.c-equipo { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.c-equipo li { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 8px; border: 1px solid #3a3570; border-left: 5px solid var(--c); border-radius: 8px; background: rgba(255, 255, 255, .05); }
.c-equipo li.c-lee { box-shadow: 0 0 0 2px var(--oro-claro), 0 0 18px rgba(246, 214, 128, .5); }
.c-equipo svg { flex: none; width: 38px; height: 40px; }
.c-equipo span { display: flex; flex-direction: column; min-width: 0; }
.c-equipo b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-equipo small { font-size: 13px; color: var(--texto-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.c-mesa { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: 'centro receta' 'mio mio'; gap: 12px; margin-top: 12px; }
.c-centro { grid-area: centro; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 250px; }
.c-receta-caja { grid-area: receta; }
.c-mio { grid-area: mio; }
.c-nombre { margin: 0; font: 800 20px var(--rotulo); color: var(--oro-claro); text-align: center; }

.c-caldero { --liquido: #4a5d8a; position: relative; width: min(260px, 70vw); }
.c-caldero svg { display: block; width: 100%; height: auto; }
.c-liquido { fill: var(--liquido); transition: fill .6s; }
.c-burbujas circle { fill: var(--liquido); filter: brightness(1.5); animation: c-burbuja 1.8s ease-in infinite; transform-box: fill-box; }
.c-burbujas circle:nth-child(2) { animation-delay: .5s; }
.c-burbujas circle:nth-child(3) { animation-delay: 1s; }
.c-burbujas circle:nth-child(4) { animation-delay: 1.3s; }
.c-llamas path { transform-origin: center bottom; transform-box: fill-box; animation: c-llama .5s ease-in-out infinite alternate; }
.c-llamas path:nth-child(2) { animation-delay: .2s; }
.c-humo { position: absolute; left: 0; right: 0; top: 10%; height: 40%; pointer-events: none; }
.c-humo i { position: absolute; left: 50%; width: 46px; height: 46px; border-radius: 50%; background: var(--liquido); opacity: 0; filter: blur(8px); }
.c-puf .c-humo i { animation: c-humo .9s ease-out; background: #666; }
.c-puf .c-humo i:nth-child(1) { margin-left: -60px; }
.c-puf .c-humo i:nth-child(3) { margin-left: 30px; }
.c-puf svg { animation: c-tiembla .4s; }
.c-brillo svg { animation: c-brilla .7s; }

/* termómetro del fuego: verde en medio, rojo en los extremos (se sale por debajo del 5 % o por encima del 95 %) */
.c-calor { display: flex; align-items: center; gap: 6px; width: min(260px, 100%); margin-top: 6px; font-size: 16px; }
.c-calor-barra { position: relative; flex: 1; height: 14px; border-radius: 8px; border: 2px solid #0e0c14;
  background: linear-gradient(90deg, #56a8e8 0 5%, #2d4f6b 5% 25%, #3fae6a 25% 75%, #7a3a1c 75% 95%, #e0462b 95%); }
.c-calor-barra i { position: absolute; top: -5px; width: 6px; height: 20px; margin-left: -3px; border-radius: 3px; background: #fff; box-shadow: 0 0 6px rgba(0, 0, 0, .8); transition: left .2s linear; }
.c-calor.c-peligro .c-calor-barra { animation: c-late .5s ease-in-out infinite; box-shadow: 0 0 10px #ff6b6b; }
.c-aviso { position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); width: max-content; max-width: 100%; margin: 0; padding: 8px 14px; border-radius: 14px; background: var(--papel); color: var(--tinta); font: 700 16px/1.3 var(--cuerpo); text-align: center; box-shadow: 0 6px 18px rgba(0, 0, 0, .5); animation: c-entra .25s ease-out; }
.c-aviso-aviso { background: #fff3c6; border: 3px solid var(--oro); font-size: 19px; }
.c-aviso-mal { background: #ffd6d6; color: #7a0d1c; }
.c-aviso-pocion { background: #d7f7e3; color: #0d4f2c; font-size: 19px; }

.c-papel { padding: 14px 16px; border-radius: 10px; background: var(--papel); color: var(--tinta); }
.c-papel h2 { margin: 0 0 8px; font: 900 20px var(--rotulo); color: var(--tinta); }
.c-receta { margin: 0; padding: 0; list-style: none; display: flex !important; flex-direction: column; gap: 4px; }
.c-receta li { display: block; width: auto; }
.c-receta li { padding: 5px 8px; border-radius: 6px; font-size: 17px; line-height: 1.3; }
.c-receta li.c-hecho { color: #3d6b3a; text-decoration: line-through; opacity: .7; }
.c-receta li.c-ahora { background: #fff7e3; box-shadow: inset 4px 0 0 #8d2030; font-weight: 600; }
.c-receta li.c-mio:not(.c-hecho) { color: #5a1d86; }
.c-oculto { color: var(--tinta-2); font-style: italic; }

.c-tarea { min-height: 1.4em; margin: 0 0 8px; font: 700 18px var(--cuerpo); color: #8d2030; }
.c-avisar { display: block; width: 100%; margin: 0 0 12px; padding: 14px; border: 3px solid #2a1806; border-radius: 12px; background: linear-gradient(#f6d680, #cf9f42); color: #2a1a06; font: 800 18px var(--rotulo); cursor: pointer; box-shadow: 0 5px 0 #2a1806; animation: c-late 1s ease-in-out infinite; }
.c-avisar:active { transform: translateY(3px); box-shadow: 0 2px 0 #2a1806; }

.c-estante { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.c-ing { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border: 2px solid #b89a63; border-bottom: 5px solid var(--c); border-radius: 10px; background: #f8eed6; color: var(--tinta); cursor: pointer; font: inherit; touch-action: manipulation; }
.c-ing span { font-size: 34px; line-height: 1.1; }
.c-ing small { font-size: 14px; line-height: 1.15; text-align: center; }
.c-ing:hover { background: #fff7e3; }
.c-ing:active { transform: scale(.95); }
.c-nada { margin: 0; color: var(--tinta-2); font-style: italic; }

.c-herramientas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.c-grupo { display: flex; flex-direction: column; gap: 4px; }
.c-grupo > small { font: 700 13px var(--rotulo); color: var(--tinta-2); text-transform: uppercase; letter-spacing: .08em; }
.c-grupo > span { display: flex; gap: 8px; }
.c-herr { display: flex; flex-direction: column; align-items: center; min-width: 88px; padding: 8px 12px; border: 2px solid #6b5432; border-radius: 10px; background: #e9dcc0; color: var(--tinta); font: 900 26px/1.1 var(--cuerpo); cursor: pointer; touch-action: manipulation; }
.c-herr small { font: 700 13px var(--rotulo); }
.c-herr:active { transform: scale(.95); }
.c-sube { background: #ffd9b8; }
.c-baja { background: #d4ecff; }

.c-capa { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 20px; border-radius: 12px; background: rgba(8, 7, 24, .88); text-align: center; }
.c-capa[hidden] { display: none; }
#c-cuenta-n { font: 900 110px/1 var(--titulo); color: var(--oro-claro); }
.c-capa h2 { margin: 0; font: 900 clamp(26px, 5vw, 44px)/1.15 var(--titulo); color: var(--oro-claro); overflow-wrap: anywhere; }
.c-capa p { margin: 0; max-width: 34em; }
#c-fin-datos { font-size: 20px; line-height: 1.4; }
#c-fin-datos b { font: 900 1.5em var(--titulo); color: var(--oro-claro); white-space: nowrap; }
.c-fin-nota { color: var(--texto-2); }

.c-reglas { margin-top: 14px; padding: 10px 14px; border: 1px solid #3a3570; border-radius: 10px; background: rgba(255, 255, 255, .04); }
.c-reglas summary { cursor: pointer; font: 700 16px var(--rotulo); color: var(--oro-claro); }
.c-reglas ul { margin: 8px 0 0; padding-left: 20px; font-size: 17px; }
.c-salir { display: block; margin: 14px auto 0; }

@keyframes c-burbuja { 0% { transform: translateY(0) scale(.4); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-26px) scale(1); opacity: 0; } }
@keyframes c-llama { from { transform: scaleY(.85); } to { transform: scaleY(1.1); } }
@keyframes c-humo { 0% { opacity: .9; transform: translateY(0) scale(.5); } 100% { opacity: 0; transform: translateY(-60px) scale(2.2); } }
@keyframes c-tiembla { 25% { transform: translateX(-6px) rotate(-2deg); } 50% { transform: translateX(6px) rotate(2deg); } 75% { transform: translateX(-3px); } }
@keyframes c-brilla { 50% { filter: drop-shadow(0 0 22px var(--liquido)) brightness(1.3); } }
@keyframes c-late { 50% { transform: scale(1.03); } }
@keyframes c-entra { from { opacity: 0; transform: translate(-50%, 8px); } }

/* Durante la partida sobra la cabecera: todo tiene que caber en la pantalla del móvil */
.c-jugando .t-cabeza { display: none; }
.c-jugando .t-main { padding-top: 8px; }

@media (max-width: 680px) {
  .t-main { padding-left: 10px; padding-right: 10px; }
  .c-marcador { position: sticky; top: 0; z-index: 4; padding: 6px 10px; gap: 10px; }
  .c-dato { min-width: 58px; }
  .c-dato b { font-size: 24px; }
  .c-equipo { gap: 5px; margin-top: 6px; }
  .c-equipo li { padding: 4px 6px; border-left-width: 4px; }
  .c-equipo svg { display: none; }
  .c-equipo b { font-size: 13px; }
  .c-equipo small { font-size: 12px; }
  /* caldero pequeño a la izquierda y la receta al lado; debajo, lo tuyo */
  .c-mesa { grid-template-columns: 112px 1fr; grid-template-areas: 'centro receta' 'mio mio'; gap: 8px; margin-top: 8px; }
  .c-centro { min-height: 0; justify-content: flex-start; }
  .c-caldero { width: 112px; }
  .c-nombre { font-size: 13px; line-height: 1.2; }
  .c-calor { gap: 2px; font-size: 11px; }
  .c-calor-barra { height: 12px; }
  .c-papel { padding: 10px 12px; }
  .c-papel h2 { font-size: 16px; margin-bottom: 4px; }
  .c-receta li { padding: 3px 6px; font-size: 14px; }
  /* el aviso flota arriba, encima de todo, para que se lea sin bajar */
  .c-aviso { position: fixed; top: 64px; bottom: auto; left: 50%; z-index: 30; max-width: calc(100vw - 24px); font-size: 15px; }
  .c-aviso-aviso, .c-aviso-pocion { font-size: 17px; }
  .c-tarea { font-size: 15px; margin-bottom: 6px; }
  .c-avisar { padding: 11px; font-size: 16px; margin-bottom: 8px; }
  .c-estante { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .c-ing { flex-direction: row; justify-content: flex-start; gap: 6px; padding: 8px; text-align: left; }
  .c-ing span { font-size: 26px; }
  .c-ing small { font-size: 13px; text-align: left; }
  .c-herramientas { gap: 8px; margin-top: 8px; }
  .c-herr { min-width: 64px; padding: 6px 8px; font-size: 22px; }
  .c-reglas { font-size: 15px; }
  /* en el móvil, el final ocupa toda la pantalla y tapa la partida de debajo */
  .c-capa { position: fixed; z-index: 50; border-radius: 0; padding: 24px 16px; background: rgba(5, 4, 13, .97); overflow: auto; }
  #c-fin-datos { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } }

/* Ranking de equipos (src/web/caldero.ts, servidor/caldero.py) */
.c-ranking { max-width: 900px; margin: 30px auto 0; padding: 22px clamp(14px, 3vw, 28px) 26px; border: 1px solid #8a6c2e; border-radius: 3px; background: rgba(18, 16, 25, .85); box-shadow: inset 0 0 0 4px rgba(12, 11, 18, .9), inset 0 0 0 5px rgba(201, 164, 90, .35); text-align: center; }
.c-ranking h2 { margin: 0 0 6px; }
.c-rk-nota { margin: 0; color: var(--texto-2); }
.c-rk-resumen { margin: 8px 0 14px; font: 600 13px var(--rotulo); letter-spacing: .14em; text-transform: uppercase; color: #c9a45a; }
.c-rk-buscar { display: flex; gap: 8px; max-width: 460px; margin: 0 auto 16px; }
.c-rk-buscar input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid #8a6c2e; border-radius: 2px; background: #0e0d14; color: var(--texto); font: inherit; }
.c-rk-buscar button { padding: 0 16px; border: 1px solid #5a4418; border-radius: 2px; background: linear-gradient(#f0d590, #c9a45a); color: #1a1206; font: 700 13px var(--rotulo); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
#c-rk-mios { margin-bottom: 16px; text-align: left; }
#c-rk-mios p { margin: 0 0 6px; color: var(--texto-2); }
.c-rk { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; text-align: left; }
.c-rk li { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid rgba(201, 164, 90, .2); border-radius: 3px; background: rgba(255, 255, 255, .03); }
.c-rk li.c-rk-premio { border-color: rgba(201, 164, 90, .45); }
.c-rk-puesto { font: 700 18px var(--rotulo); color: #f0d590; }
.c-rk-equipo { display: flex; flex-wrap: wrap; gap: 4px 10px; min-width: 0; }
.c-rk-alumno { padding-left: 8px; border-left: 3px solid var(--c); font-size: 16px; overflow-wrap: anywhere; }
.c-rk-pociones { text-align: right; font-size: 15px; color: var(--texto-2); white-space: nowrap; }
.c-rk-pociones b { font: 700 22px var(--rotulo); color: #f0d590; }
.c-rk-pociones small { display: block; font-size: 13px; }
@media (max-width: 560px) { .c-rk li { grid-template-columns: 40px 1fr auto; padding: 8px; } .c-rk-alumno { font-size: 14px; } }
