/* Portada común: el espacio vertical acompaña al contenido y no empuja las tarjetas fuera de pantalla. */
.home-page{background:radial-gradient(ellipse at 50% -20%,#e8f2e8,transparent 65%),#faf8f0;color:#203d38}
.home-page .topbar{max-width:1320px;margin:auto}
#home-language{width:auto;max-width:150px;margin-inline-start:auto;background:#fff9}
.home-main{max-width:1240px!important;padding:clamp(12px,3vh,32px) 24px 18px!important}
.home-heading{text-align:center;margin-bottom:clamp(18px,3vh,32px)}
.home-heading h1{font-size:clamp(30px,3.8vw,53px);letter-spacing:-2px;line-height:1.08;white-space:pre-line;margin:10px 0 14px}
.home-heading .lede{font-size:clamp(15px,1.5vw,19px);margin:0 auto}
.area-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px}
.area-card{color:inherit;text-decoration:none;overflow:hidden;border:1px solid #dce5d9;border-radius:26px;background:#fff;box-shadow:0 12px 28px #28463708;transition:transform .2s,box-shadow .2s;display:flex;flex-direction:column}
.area-card:hover{transform:translateY(-5px);box-shadow:0 18px 32px #28463718}
.area-card:focus-visible{outline:3px solid #16736d;outline-offset:4px}
/* La fila respeta la altura disponible: el tamaño natural de la imagen no debe desbordar y recortarse. */
.area-art{grid-template-rows:minmax(0,1fr);grid-template-columns:minmax(0,1fr);position:relative;height:clamp(140px,25vh,240px);display:grid;place-items:center;background:radial-gradient(circle,#dfebc6 0, #eff5de 48%,#f3f7e7 70%);overflow:hidden}
.area-art:before{content:'';position:absolute;width:180px;height:180px;border:1px solid #fff9;border-radius:50%;box-shadow:0 0 0 30px #ffffff35,0 0 0 65px #ffffff25}
.area-art img{min-width:0;min-height:0;position:relative;width:80%;height:90%;object-fit:contain;z-index:1;filter:drop-shadow(0 8px 7px #26403218)}
.area-topics .area-art{background:radial-gradient(circle,#e8cba5,#f5e6cf 70%)}
.area-challenges .area-art{background:radial-gradient(circle,#bcd6dc,#e2eef2 70%)}
.area-orbit{position:absolute;right:24px;top:22px;font-size:40px;color:#fff;transform:rotate(15deg)}
.area-copy{padding:24px;display:flex;flex-direction:column;flex:1;gap:10px}
.area-copy h2{font-size:31px;letter-spacing:-1px;margin:0}.area-copy .eyebrow{font-size:10px;margin:0}
.area-copy p{font-size:16px;line-height:1.55;color:#63726b;margin:0 0 8px}
.area-link{margin-top:auto;padding-top:15px;border-top:1px solid #e6eae2;display:flex;justify-content:space-between;font-size:14px;font-weight:700;color:#267567}
.home-signoff{text-align:center;font-size:12px;color:#708078;margin:20px 0 0}
.home-environment{display:flex;justify-content:center;align-items:center;gap:8px;font-size:12px;margin:18px 0 0}.home-environment input{width:auto}
/* Listado de Temas: filtros siempre próximos a las tarjetas, sin cabecera de altura fija. */
/* Acceso a Temas y Retos: ilustración propia y propósito debajo, sin decoración que tape el texto. */
.intro.section-intro{display:flex;flex-direction:column;align-items:flex-start;gap:16px;min-width:0;padding:0}
.intro.section-intro .intro-badge{margin:0}
.intro.section-intro h1{margin:0;font-size:clamp(34px,4vw,54px)}
.section-intro-figure{width:100%;margin:0;display:flex;flex-direction:column;align-items:center;gap:14px}
.section-intro-figure>img{display:block;width:min(100%,400px);height:clamp(160px,29dvh,267px);object-fit:contain;filter:drop-shadow(0 10px 10px #594b2812)}
.section-intro-figure>figcaption{max-width:44ch;text-align:center;font-size:16px;line-height:1.6;color:#526d65;text-wrap:pretty}
@media(max-width:850px){.intro.section-intro{gap:12px}.section-intro-figure{gap:8px}.section-intro-figure>img{height:150px}.section-intro-figure>figcaption{font-size:14px;line-height:1.5}}
@media(max-height:650px){.section-intro-figure>img{height:120px}.section-intro-figure>figcaption{font-size:14px}}

/* La navegación entre áreas permanece visible incluso si la cabecera necesita otra fila. */
.current-player{display:inline-flex;align-items:center;gap:6px;min-width:0;max-width:100%;padding:6px 10px;border:1px solid #d7e4d9;border-radius:12px;background:#edf4eb;color:#285e51;font-size:13px;font-weight:700;line-height:1.3}
.current-player .ui-icon{width:15px;height:15px;color:#a57930}
.current-player bdi{min-width:0;overflow-wrap:anywhere}
.room-account-line{display:flex;align-items:center;flex-wrap:wrap;gap:4px 10px;min-width:0}
body[data-battle="true"] .room-account-line .current-player{font-size:11px;padding:2px 6px;border-radius:7px}
body[data-battle="true"] .room-account-line .eyebrow{margin:0}
body[data-battle="true"] .room-identity>div{min-width:0}
.topbar:has(.area-home-link){flex-wrap:wrap}
.area-home-link{text-decoration:none;white-space:nowrap}
.area-home-link svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7;flex:none}
/* Iconos de trazo común: siempre acompañados de texto, sin cambiar las acciones originales. */
.ui-icon{width:19px;height:19px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.btn .ui-icon{color:#a97927}.btn-primary .ui-icon{color:#f9dc8d}.btn-danger .ui-icon{color:currentColor}
.area-nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;padding:5px;background:#edeFE7;border:1px solid #e0e5da;border-radius:15px}
.area-tab{display:flex;align-items:center;justify-content:center;gap:8px;padding:10px 16px;border-radius:10px;text-decoration:none;color:#61746b;font-size:13px;font-weight:650;min-height:42px}
.area-tab:hover{background:#ffffffb0;color:#254c41}.area-tab[aria-current=page]{background:#fffdf8;color:#245e4c;box-shadow:0 2px 6px #26473812}
.area-tab-battle .ui-icon{color:#4e8d72}.area-tab-topic .ui-icon{color:#ad7c32}.area-tab-challenge .ui-icon{color:#478c9a}
.topbar:has(.area-nav){gap:18px}.topbar:has(.area-nav) .brand-caption{display:none}
.home-main>.area-nav{max-width:500px;margin:0 auto 20px}
.topics-toolbar{padding:16px;background:#f0f3ea;border:1px solid #e1e7dc;border-radius:18px;gap:12px}
.topics-filter input[type=search]{width:200px}.topics-toolbar>.btn-primary{box-shadow:0 4px 12px #25574220}
.topic-dialog:not(.topic-create-dialog){padding:24px;background:#fffefa}
.topic-dialog .dialog-heading h2{flex:1;min-width:0;overflow-wrap:anywhere}
.topic-dialog-mark{display:grid;place-items:center;width:46px;height:46px;flex:none;border-radius:14px;color:#977035;background:#f4e8ce}
.topic-dialog-mark .ui-icon{width:24px;height:24px}
.topic-dialog:not(.topic-create-dialog) .dialog-heading{padding-bottom:18px;border-bottom:1px solid #e5e9de;align-items:center}
.topic-dialog:not(.topic-create-dialog) label{margin:0;font-size:13px;line-height:1.5}
.topic-dialog:not(.topic-create-dialog) :is(textarea,select,input:not([type=checkbox])){display:block;width:100%;font:inherit;font-size:14px;margin:7px 0 0;padding:11px 13px;min-width:0;border:1px solid #d6dfd3;background:#fff;border-radius:11px;color:#29483c}
.topic-dialog:not(.topic-create-dialog) textarea{min-height:100px;line-height:1.6}
.topic-dialog:not(.topic-create-dialog) [readonly]{background:#f3f5ef}
.topic-dialog:not(.topic-create-dialog) .topic-fields{padding:16px;background:#f1f5ec;border:1px solid #e1e8da;border-radius:16px}
.topic-dialog:not(.topic-create-dialog) .check{padding:11px;background:#fff;border:1px solid #dce5d7;border-radius:11px;justify-content:space-between;gap:12px}
.topic-dialog:not(.topic-create-dialog) input[type=checkbox]{accent-color:#33735b;flex:none}
.topic-dialog:not(.topic-create-dialog) .topic-form-actions{padding-top:17px;border-top:1px solid #e5e9df}
.topic-dialog:not(.topic-create-dialog) .topic-form-actions .btn{font-size:13px;flex:1}
.topic-dialog :is(textarea,select):focus-visible{outline:3px solid #338a7733;outline-offset:2px;border-color:#338a77}
.topic-merge-list{display:grid;gap:10px;margin:18px 0}.topic-merge-list>.btn{justify-content:flex-start;text-align:start;padding:16px;background:#f1f5ec}
/* Selector de tema del reto: búsqueda completa y opciones en una fila, sin heredar la columna de los formularios. */
.topic-dialog form.challenge-topic-filter:not([hidden]){display:grid;grid-template-columns:auto auto minmax(0,1fr);align-items:center;gap:12px;margin-top:18px;width:100%}
.topic-dialog .challenge-topic-filter input[type=search]{grid-column:1/-1;width:100%;min-width:0;box-sizing:border-box}
.topic-dialog .challenge-topic-filter label.check{display:flex;flex-direction:row;justify-content:flex-start;gap:8px;min-width:0;margin:0;padding:10px 12px}
.topic-dialog .challenge-topic-filter input[type=checkbox]{order:-1;flex:0 0 auto;width:16px;height:16px;margin:0}
.topic-dialog .challenge-topic-filter>.btn{justify-self:end;margin:0}
@media(max-width:520px){
  .topic-dialog form.challenge-topic-filter:not([hidden]){grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .topic-dialog .challenge-topic-filter label.check{align-self:stretch;padding:10px 8px}
  .topic-dialog .challenge-topic-filter>.btn{grid-column:1/-1;justify-self:stretch;justify-content:center}
}
/* Retos comparte tarjetas y formularios; el acento azul distingue la actividad en compañía. */
body[data-mode=challenge] .topics-header{padding:20px 24px;border-radius:23px;background:linear-gradient(110deg,#e9f2ed,#e2eef1);border:1px solid #d9e6df}
body[data-mode=challenge] .topics-header img{width:135px;height:135px}
.challenge-toolbar{justify-content:flex-start}.challenge-toolbar>.btn:last-child{margin-inline-start:auto}
.challenge-card{border-top:3px solid #9bbebc}.challenge-facts{display:flex;gap:8px;flex-wrap:wrap;font-size:12px;color:#537773}
.challenge-facts>span{padding:6px 9px;background:#eef4f1;border-radius:8px}
.challenge-status{margin:0;font-size:12px;font-weight:700;color:#4b7954}
.challenge-form-topic{padding:16px 18px;border-radius:15px;background:#eaf2ec;color:#346154;font-size:19px;line-height:1.45;margin:0 0 12px}
.challenge-topic-summary{display:flex;align-items:center;gap:14px;padding:18px;border:1px solid #d7e5da;border-radius:18px;background:linear-gradient(120deg,#eaf3eb,#f8f8ed)}
.challenge-topic-summary>div{min-width:0;flex:1}
.challenge-topic-summary h3{margin:0 0 9px;font-size:21px;line-height:1.35;color:#2c5c4b;overflow-wrap:anywhere}
.challenge-topic-summary .challenge-topic-mark{background:#fff9;width:48px;height:52px}
.topic-dialog .challenge-config-form .topic-fields{gap:14px;align-items:start}
.challenge-config-form .challenge-config-hint{display:block;margin-top:8px;font-size:12px;font-weight:400;line-height:1.55;color:#64776c}
.topic-dialog .challenge-config-form .check{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:0 12px;padding:14px;align-items:center}
.challenge-config-form .check .challenge-config-hint{grid-column:1/-1}
.challenge-config-form .check:has(input:checked){background:#e8f2e8;border-color:#bdd5bd}
@media(max-width:520px){.topic-dialog .challenge-config-form .topic-fields{grid-template-columns:1fr}.challenge-topic-summary{padding:14px}.challenge-topic-summary h3{font-size:19px}}
.challenge-code{margin:0 0 20px;padding:20px;text-align:center;background:#f4edda;border:1px dashed #ceb57e;border-radius:16px;color:#816329;font-size:24px;font-weight:750;letter-spacing:3px;overflow-wrap:anywhere}
.topic-dialog .challenge-code-input{font-size:24px!important;font-weight:700!important;letter-spacing:4px;text-transform:uppercase}
.challenge-players{list-style:none;padding:0;margin:20px 0;display:grid;gap:8px;counter-reset:place}
.challenge-players>li{display:flex;gap:12px;align-items:center;padding:14px;border:1px solid #e0e8dc;border-radius:14px;background:#f3f6ef;counter-increment:place}
.challenge-players>li:before{content:counter(place);font-size:12px;color:#789083;font-variant-numeric:tabular-nums}
.challenge-player-info{min-width:0;flex:1}.challenge-player-info strong{font-size:14px;overflow-wrap:anywhere}.challenge-player-points{color:#346e5b;font-size:20px;font-variant-numeric:tabular-nums}
.challenge-players .btn{font-size:12px;padding:8px}.challenge-players .avatar{background:#e4ede3}
.challenge-player-info progress{display:block;width:100%;height:5px;appearance:none;border:0;margin-top:7px;background:#e1e8db;border-radius:4px;overflow:hidden}
.challenge-player-info progress::-webkit-progress-bar{background:#e1e8db}.challenge-player-info progress::-webkit-progress-value{background:#88b990}.challenge-player-info progress::-moz-progress-bar{background:#88b990}
.topic-dialog [data-body]>:is(.btn,label){margin-block:12px}
@media(max-width:760px){body[data-mode=challenge] .topics-header{padding:17px;gap:10px}body[data-mode=challenge] .topics-header img{width:80px;height:90px}.challenge-toolbar>.btn{flex:1 1 40%}.challenge-toolbar>.btn:last-child{margin-inline-start:0}.challenge-players>li{gap:8px;padding:10px;flex-wrap:wrap}.challenge-players .avatar{width:32px;height:32px}.challenge-players .btn{margin-inline-start:auto}}
@media(max-width:760px){
  .topbar:has(.area-nav){gap:10px}.topbar .area-nav{order:10;flex-basis:100%}
  .topbar:has(.area-nav) .area-home-link{margin-inline-start:auto}
  .area-tab{padding:8px 10px;font-size:13px;gap:7px;min-width:0;overflow-wrap:anywhere}
  .topics-toolbar{padding:12px;gap:8px}.topics-toolbar>.btn{flex:1;font-size:12px;padding:10px}
  .topics-filter{gap:8px}.topics-filter select{max-width:100%}
  .topic-dialog:not(.topic-create-dialog){padding:18px}.topic-dialog:not(.topic-create-dialog) .dialog-heading h2{font-size:20px}
  .topic-dialog:not(.topic-create-dialog) :is(textarea,select,input:not([type=checkbox])){font-size:16px}
  .topic-dialog:not(.topic-create-dialog) .topic-form-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .topic-dialog:not(.topic-create-dialog) .topic-form-actions>.btn-primary{grid-column:1/-1}
}
.topics-header{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:15px 0 22px}.topics-header h1{margin:6px 0;font-size:clamp(28px,4vw,44px);letter-spacing:-1.5px}.topics-header p{margin:0;max-width:670px;line-height:1.5}.topics-header img{width:120px;height:120px;object-fit:contain}
.topics-toolbar,.topics-filter,.topic-actions,.topic-controls{display:flex;align-items:center;flex-wrap:wrap;gap:10px}.topics-toolbar{justify-content:space-between;margin-bottom:18px}.topics-filter{flex:1}.topics-filter input[type=search]{width:240px;max-width:100%}.topics-filter select{width:auto;max-width:210px}.topics-filter label{display:inline-flex;align-items:center;gap:6px;font-size:13px;margin:0}.topics-filter input[type=checkbox]{width:auto}
.topic-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(290px,100%),1fr));gap:18px;margin:18px 0}
.topic-card{border:1px solid #dde5d9;background:#fffefb;border-radius:20px;padding:22px;display:flex;flex-direction:column;gap:12px;box-shadow:0 5px 18px #213b3206;min-width:0}.topic-card h2{font-size:20px;line-height:1.25;margin:0;overflow-wrap:anywhere}.topic-card .eyebrow{margin:0}.topic-meta{font-size:12px;color:#65756b;line-height:1.5;margin:0;white-space:pre-line}.topic-progress{height:7px;border-radius:9px;background:#edf0e9;display:flex;overflow:hidden}.topic-progress span{background:#8cbd6f}.topic-progress .missed{background:#d89279}.topic-actions{margin-top:auto}.topic-actions .btn{font-size:13px;padding:9px 12px;min-height:40px}.topic-actions .icon-only{margin-inline-start:auto;padding:8px;width:40px}
/* Descargas móviles de la portada: ilustración ligera y enlaces completos a cada tienda. */
.home-mobile{display:grid;grid-template-columns:180px minmax(0,1fr);align-items:center;gap:32px;margin-top:28px;padding:32px 40px;border:1px solid #d7e5d3;border-radius:26px;background:linear-gradient(120deg,#edf5e7,#fffaf0);overflow:hidden}
.home-mobile-art{display:flex;justify-content:center;align-items:center;min-height:200px;background:radial-gradient(ellipse,#d5e7c9 0 48%,transparent 49%)}
.home-mobile-phone{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;width:108px;height:180px;border:5px solid #29483c;border-radius:23px;background:#fffdf6;box-shadow:9px 12px 0 #29483c13;transform:rotate(-8deg)}
.home-mobile-speaker{position:absolute;top:8px;width:30px;height:4px;border-radius:4px;background:#29483c}
.home-mobile-phone img{width:78px;height:78px;object-fit:contain}
.home-mobile-stars{color:#b5822e;letter-spacing:5px;font-size:15px}
.home-mobile-copy .eyebrow{color:#607b55;margin:0 0 10px}
.home-mobile h2{font-size:clamp(24px,3vw,32px);line-height:1.15;letter-spacing:-.6px;margin:0 0 12px}
.home-mobile-copy>p:not(.eyebrow){font-size:15px;line-height:1.6;color:#536b61;margin:0;max-width:620px}
.home-mobile-links{display:flex;flex-wrap:wrap;gap:12px;margin-top:22px}
.home-mobile-links .home-store-link{display:flex;align-items:center;justify-content:flex-start;gap:12px;min-width:205px;padding:12px 16px;background:#fffefb;border:1px solid #cedbca;border-radius:14px;color:#29483c;text-decoration:none;text-align:start;white-space:normal}
.home-store-link>svg,.home-store-link>img{width:28px;height:28px;object-fit:contain;flex-shrink:0}
.home-store-link>img{filter:brightness(0)}
.home-store-link small{display:block;font-size:11px;line-height:1.35;font-weight:500}
.home-store-link strong{display:block;font-size:18px;line-height:1.4}
.home-store-arrow{margin-inline-start:auto;color:#71816b}
.home-mobile-links .home-store-link:hover{background:#f3f8ee;border-color:#7b9e6b}
.home-mobile-links .home-store-link:focus-visible{outline:3px solid #237b85;outline-offset:4px}
@media(max-width:600px){.home-mobile{grid-template-columns:1fr;gap:18px;padding:24px;margin-top:20px}.home-mobile-art{min-height:140px}.home-mobile-phone{width:78px;height:130px;border-width:4px;border-radius:18px;gap:6px}.home-mobile-phone img{width:58px;height:58px}.home-mobile-stars{font-size:12px}.home-mobile-links{display:grid;grid-template-columns:1fr}.home-mobile-links .home-store-link{min-width:0;width:100%;box-sizing:border-box}}
/* Identidad del centro educativo, compartida por el acceso y los catálogos de las tres áreas. */
.education-context:not([hidden]){display:flex;align-items:center;gap:18px;margin:0 0 20px;padding:18px 22px;border:1px solid #dce7da;border-radius:18px;background:#f8fcf5}
.education-context img{width:90px;height:70px;object-fit:contain;flex-shrink:0}
.education-context>div{min-width:0;overflow-wrap:anywhere}
.education-context p{margin:6px 0 0;white-space:pre-line;line-height:1.5;color:#536b61}
@media(max-width:520px){.education-context:not([hidden]){gap:12px;padding:14px}.education-context img{width:64px;height:54px}}
/* El bocadillo apunta al personaje; los avisos conservan su texto y acciones localizados. */
.catalog-empty{grid-column:1/-1;display:flex;align-items:flex-start;gap:24px;width:100%;max-width:860px;padding:24px 0}
.catalog-empty-mascot{flex:0 0 150px;width:150px;height:180px;object-fit:contain;align-self:flex-start}
.catalog-empty-copy{position:relative;min-width:0;flex:1;padding:24px 28px;border:1px solid #dce7da;border-radius:22px;background:#f8fcf5;box-shadow:0 5px 18px #213b3206}
.catalog-empty-copy::before{content:'';position:absolute;inset-inline-start:-9px;top:48px;width:16px;height:16px;background:#f8fcf5;border-inline-start:1px solid #dce7da;border-bottom:1px solid #dce7da;transform:rotate(45deg)}
[dir=rtl] .catalog-empty-copy::before{transform:rotate(-45deg)}
.catalog-empty h2{margin:0 0 8px;font-size:18px;line-height:1.25}
.catalog-empty p{margin:0;color:#65756b;white-space:pre-line;font-size:14px;line-height:1.55}
.catalog-empty-copy .btn{margin:18px 0 0;max-width:100%;white-space:normal}
/* En móvil el personaje encabeza el aviso, centrado y reducido. */
@media(max-width:760px){
  .catalog-empty{gap:16px;flex-direction:column;align-items:stretch;padding:18px 0}
  .catalog-empty-mascot{flex-basis:auto;width:90px;height:108px;align-self:center}
  .catalog-empty-copy{padding:20px}
  .catalog-empty-copy::before{inset-inline-start:calc(50% - 9px);top:-9px;border:0;border-inline-start:1px solid #dce7da;border-top:1px solid #dce7da}
  [dir=rtl] .catalog-empty-copy::before{transform:rotate(-45deg)}
  .catalog-empty-copy .btn{margin-inline-start:0}
}
.topic-dialog{max-width:760px}.topic-dialog form{display:flex;flex-direction:column;gap:16px}.topic-dialog textarea{min-height:94px;resize:vertical}.topic-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.topic-fields label{margin:0;min-width:0}.topic-fields .check{display:flex;align-items:center;gap:8px}.topic-fields .check input{width:auto}.topic-dialog fieldset{border:1px solid #dce5d9;border-radius:14px;padding:16px}.topic-dialog legend{font-size:13px;font-weight:650}.topic-dialog .topic-hint{white-space:pre-line;font-size:14px;line-height:1.55}.topic-form-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}.topic-error{color:#a0362b;white-space:pre-line}.topic-controls{flex-shrink:0;justify-content:center;gap:8px}.topic-controls .btn{min-height:38px;font-size:13px;padding:7px 13px}.topic-controls button:last-child{margin-inline-start:auto}
body[data-battle="true"] #battle[data-solo="true"] .battle-layout{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr);grid-template-areas:'question';width:100%;max-width:1180px;margin-inline:auto}
#battle[data-solo="true"] .ranking-panel,#battle[data-solo="true"] .chat-panel,#battle[data-solo="true"] #players-button,#battle[data-solo="true"] #chat-toggle{display:none!important}
@media(max-width:760px){.area-grid{grid-template-columns:1fr;gap:16px}.area-card{flex-direction:row}.area-art{width:35%;height:auto;min-height:200px;flex-shrink:0}.area-art img{width:96%;height:160px}.area-copy{padding:20px}.area-copy h2{font-size:26px}.home-heading h1{letter-spacing:-1px}.area-copy p{font-size:14px}.home-main{padding:16px!important}.topics-header img{width:85px;height:85px}.topics-filter{width:100%;flex-basis:100%}.topics-filter input[type=search]{flex:1;min-width:150px}.topic-fields{grid-template-columns:1fr}.topic-controls .btn{font-size:12px;padding:6px 9px}.topics-header .lede{font-size:14px}}
@media(max-height:700px) and (min-width:761px){.home-heading h1{font-size:36px;margin:8px 0}.home-heading{margin-bottom:16px}.area-art{height:145px}.area-copy{padding:18px}.area-copy p{font-size:14px}.home-heading .eyebrow{margin:0}.home-signoff{margin-top:12px}}
@media(prefers-reduced-motion:reduce){.area-card{transition:none}.area-card:hover{transform:none}}

/* Controles del salón: una barra compacta compartida, con iconos y prioridad para iniciar el reto. */
.topic-controls{align-self:center;max-width:100%;padding:5px;border:1px solid #dce5d9;border-radius:16px;background:#f0f4ec}
.topic-controls .btn{gap:7px;border-radius:11px;min-height:40px}
.topic-controls .btn-secondary:not(:disabled):hover{background:#fffdf7;border-color:#aec5b4}
.topic-controls .btn:disabled .ui-icon{color:currentColor}
@media(max-width:480px){.topic-controls{gap:5px;padding:4px}.topic-controls .btn{gap:5px;padding:6px 8px}.topic-controls .ui-icon{width:17px;height:17px}}

/* El reloj original ocupa la misma fila que las respuestas, con tamaño limitado por el cálculo del salón. */
body[data-battle="true"] .challenge-pause-art{grid-row:3;min-width:0;min-height:0;display:flex;align-items:center;justify-content:center}
.challenge-pause-art img{display:block;width:100%;height:100%;max-width:300px;object-fit:contain}

/* Creador de temas: un lienzo para la idea y un panel de ajustes. El resto de diálogos conserva su diseño. */
.topic-create-dialog{width:min(1080px,calc(100vw - 40px));max-width:1080px;max-height:calc(100dvh - 32px);padding:0;border-radius:26px;background:#fffefa;overflow:hidden;color:#253f3e}
.topic-create-dialog[open]{display:flex;flex-direction:column}
.topic-create-dialog .dialog-heading{flex:none;position:relative;gap:16px;margin:0;padding:15px 28px;border-bottom:1px solid #e5e9de;background:radial-gradient(ellipse at 5% 0,#f4e2bf,transparent 60%),#f8f6ed}
.topic-create-dialog .dialog-heading h2{flex:1;font-size:29px;letter-spacing:-1px;line-height:1.15}
.topic-create-dialog .dialog-heading>.topic-create-mascot{width:68px;height:68px;object-fit:contain;filter:drop-shadow(0 4px 4px #755a291a)}
.topic-create-dialog .dialog-heading>.btn{margin-inline-start:auto;background:#fff9}
.topic-create-dialog>[data-body]{display:flex;flex-direction:column;min-height:0}
.topic-create-dialog .topic-create-form{min-height:0;gap:0}
.topic-create-canvas{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start;gap:28px;padding:24px 28px;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.topic-create-content{display:flex;flex-direction:column;gap:17px;min-width:0;padding:3px 0}
.topic-create-dialog label{margin:0;min-width:0;font-size:12px;font-weight:650;line-height:1.4;color:#49605b}
.topic-create-dialog label>span{display:block}
.topic-create-dialog input:not([type=checkbox]),.topic-create-dialog select,.topic-create-dialog textarea{display:block;width:100%;margin:7px 0 0;border:1px solid #d8e0d9;border-radius:11px;background:#fff;color:#29453f;font:400 14px/1.45 Inter,Segoe UI,Arial,sans-serif;padding:10px 12px;min-width:0;min-height:43px;box-shadow:0 2px 3px #203b3103}
.topic-create-dialog :is(input,select,textarea):focus-visible{outline:3px solid #338a7733;outline-offset:2px;border-color:#338a77}
.topic-create-dialog textarea{min-height:158px;resize:vertical;max-height:40dvh;font-size:16px;line-height:1.6;background:#fffefb;border-color:#b9cfc3;padding:15px}
.topic-create-dialog .topic-prompt>span{font-size:20px;letter-spacing:-.4px;color:#25493e;margin-bottom:12px}
.topic-create-dialog input::placeholder{color:#8b9891;font-size:13px}
.topic-create-settings{min-width:0;padding:20px;border:1px solid #e0e7dd;border-radius:20px;background:#f3f6ef}
.topic-create-settings h3{font-size:16px;margin:0 0 17px;letter-spacing:-.3px;color:#294a40}
.topic-create-settings .topic-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}
.topic-create-settings .topic-field-wide{grid-column:1/-1}
.topic-switches{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:19px 0 14px;padding-top:17px;border-top:1px solid #dce5d7}
.topic-create-dialog .topic-switches .check{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:62px;padding:10px;border:1px solid #dfe5dc;border-radius:12px;background:#fff9;font-size:12px;font-weight:500;cursor:pointer;transition:background .15s,border-color .15s}
.topic-create-dialog .topic-switches .check:has(input:checked){border-color:#b6d3c3;background:#e5f0e7;color:#265740}
.topic-create-dialog .topic-switches input{appearance:none;flex:none;width:32px;height:19px;min-width:32px;border:0;border-radius:20px;margin:0;padding:3px;background:#c6d0c8;cursor:pointer}
.topic-create-dialog .topic-switches input:before{content:'';display:block;width:13px;height:13px;border-radius:50%;background:#fff;box-shadow:0 1px 3px #173e3126;transition:transform .15s}
.topic-create-dialog .topic-switches input:checked{background:#33735b}
.topic-create-dialog .topic-switches input:checked:before{transform:translateX(13px)}
[dir=rtl] .topic-create-dialog .topic-switches input:checked:before{transform:translateX(-13px)}
.topic-create-dialog .topic-time{display:flex;align-items:center;justify-content:space-between;gap:12px}
.topic-create-dialog .topic-time input{width:85px;margin:0}
.topic-source{display:flex;flex-direction:column;gap:9px;padding:14px;border:1px dashed #d0b98e;border-radius:14px;background:#fbf6ea}
.topic-source label{position:relative;padding-inline-start:43px;min-height:35px;display:flex;flex-direction:column;justify-content:center}
.topic-source-badge{position:absolute;inset-inline-start:0;top:2px;display:grid!important;place-items:center;width:32px;height:39px;border:1px solid #d4bd91;border-radius:5px 10px 5px 5px;background:#fffaf0;font-size:9px;font-weight:750;color:#947137;letter-spacing:.5px}
.topic-create-dialog .topic-source input{padding:0;min-height:0;border:0;box-shadow:none;background:transparent;font-size:11px}
.topic-source input::file-selector-button{border:0;border-radius:5px;padding:5px 7px;margin-inline-end:8px;background:#ece1c9;color:#695938;cursor:pointer;font:inherit}
.topic-source>.btn{align-self:flex-start;min-height:32px;font-size:11px;padding:5px 10px;background:#fff8}
.topic-create-dialog .topic-form-actions{flex:none;align-items:center;justify-content:flex-end;padding:15px 28px;border-top:1px solid #e1e7dd;background:#fffefa;box-shadow:0 -6px 20px #26433304}
.topic-create-dialog .topic-form-actions>.btn{font-size:13px}
.topic-create-dialog .topic-form-actions>.btn-primary{min-width:170px;background:#236453;box-shadow:0 4px 10px #235d4320}
.topic-create-dialog>.topic-error:empty{display:none}
.topic-create-dialog>.topic-error:not(:empty){flex:none;margin:0;padding:12px 28px;max-height:90px;overflow:auto;background:#fff0e8;font-size:13px}
.topic-create-content .topic-hint{padding:16px;border-radius:12px;background:#eef4e9;margin:0}
body:has(.topic-create-dialog[open]){overflow:hidden}
.topic-prompt-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.topic-create-dialog .topic-prompt-heading>label{font-size:18px;letter-spacing:-.3px;color:#25493e}
.topic-create-dialog .topic-help-button{display:inline-flex;align-items:center;gap:5px;max-width:48%;padding:7px 8px;font-size:11px;line-height:1.4;text-transform:none;color:#876123;background:#faf1de;border:1px solid #ecd9ad;border-radius:9px;box-shadow:none;white-space:normal;text-align:start}
.topic-help-button svg{width:17px;height:17px;flex:none}
.topic-setting{min-width:0}
.topic-setting-hint{margin:6px 3px 2px;color:#607268;font-size:12px;line-height:1.5;font-weight:400}
.topic-create-dialog .topic-switches{align-items:start}
.topic-create-dialog .topic-field-hint{margin:7px 0 0;color:#62766d;font-size:12px;line-height:1.6;font-weight:400}
.topic-create-content>label+.topic-field-hint{margin-top:-11px}
.topic-create-settings>.topic-field-hint{margin:-8px 0 18px}
.topic-create-dialog textarea::placeholder{color:#89958e;font-size:14px;font-style:italic}
.topic-help-dialog{width:min(680px,calc(100vw - 24px));max-width:680px;max-height:calc(100dvh - 32px);padding:0;border:1px solid #dedfcf;border-radius:24px;background:#fffefa;color:#29483e;box-shadow:0 24px 80px #102d3540;overflow:hidden}
.topic-help-dialog[open]{display:flex;flex-direction:column}
.topic-help-dialog::backdrop{background:#183f4266;backdrop-filter:blur(4px)}
.topic-help-dialog .dialog-heading{display:flex;align-items:center;gap:12px;margin:0;padding:20px 24px;background:linear-gradient(120deg,#f6e9cc,#f8f7ee);border-bottom:1px solid #e7e2d3}
.topic-help-dialog h2{flex:1;min-width:0;margin:0;font-size:20px;line-height:1.3;overflow-wrap:anywhere}
.topic-help-mark{display:grid;place-items:center;flex:none;width:40px;height:40px;border-radius:12px;background:#fff9;color:#a37831}
.topic-help-mark svg{width:24px;height:24px}
.topic-help-dialog .btn{padding:8px;font-size:12px}
.topic-help-copy{padding:24px;white-space:pre-line;overflow-y:auto;overscroll-behavior:contain;font-size:15px;line-height:1.8;overflow-wrap:anywhere}
@media(max-width:600px){.topic-create-dialog .topic-prompt-heading>label{font-size:17px}.topic-create-dialog .topic-help-button{font-size:10px}.topic-help-dialog .dialog-heading{padding:16px;gap:8px}.topic-help-dialog h2{font-size:17px}.topic-help-copy{padding:18px;font-size:14px}}
@media(min-width:761px) and (max-height:800px){
  .topic-create-dialog .dialog-heading{padding-block:10px}
  .topic-create-dialog .dialog-heading>.topic-create-mascot{width:52px;height:52px}
  .topic-create-canvas{padding-block:18px;gap:22px}
  .topic-create-settings{padding:16px}
  .topic-create-settings h3{margin-bottom:12px}
  .topic-switches{margin-top:14px;padding-top:13px}
  .topic-create-dialog .topic-switches .check{min-height:54px}
  .topic-create-dialog textarea{min-height:138px}
  .topic-create-content{gap:13px}
}
@media(max-width:760px){
  .topic-create-dialog{width:calc(100vw - 16px);max-height:calc(100dvh - 16px);border-radius:20px}
  .topic-create-dialog .dialog-heading{padding:12px 17px;gap:10px;align-items:center}
  .topic-create-dialog .dialog-heading h2{font-size:23px}
  .topic-create-dialog .dialog-heading>.topic-create-mascot{width:48px;height:48px}
  .topic-create-canvas{grid-template-columns:1fr;gap:20px;padding:18px 17px}
  .topic-create-dialog textarea{min-height:130px}
  .topic-create-dialog .topic-prompt>span{font-size:19px;margin-bottom:8px}
  .topic-create-settings{padding:16px}
  .topic-create-dialog input:not([type=checkbox]),.topic-create-dialog select,.topic-create-dialog textarea{font-size:16px}
  .topic-create-dialog .topic-source input{font-size:11px}
  .topic-create-dialog .topic-form-actions{padding:12px 17px;gap:8px;flex-wrap:nowrap}
  .topic-create-dialog .topic-form-actions>.btn{font-size:12px;padding:10px;min-width:0}
  .topic-create-dialog .topic-form-actions>.btn-primary{flex-shrink:0;min-width:112px}
}
@media(prefers-reduced-motion:reduce){.topic-create-dialog .topic-switches :is(.check,input:before){transition:none}}
@media(forced-colors:active){.topic-create-dialog .topic-switches input{appearance:auto}}
/* Catálogos compactos: las primeras tarjetas y sus acciones caben también en un portátil. */
/* Títulos largos no alteran la altura de las tarjetas; el nombre completo sigue en los detalles. */
.topic-card h2.topic-card-title{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;overflow-wrap:normal;line-height:1.3}
.topic-card-meta{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.topic-completed-badge{display:inline-flex;align-items:center;gap:5px;flex:none;margin-inline-start:auto;padding:2px 9px 2px 3px;border:1px solid #e6ce86;border-radius:24px;background:linear-gradient(135deg,#fff7d9,#f6ecd0);box-shadow:0 2px 6px #8e692510;color:#426b39}
.topic-completed-badge img{display:block;width:38px;height:38px;object-fit:contain;filter:drop-shadow(0 2px 1px #89651c20)}
.topic-completed-badge>span{font-size:12px;font-weight:800;white-space:nowrap}
.challenge-winner{display:flex;align-items:center;gap:12px;padding:10px 13px;border:1px solid #e6d49b;border-radius:14px;background:linear-gradient(115deg,#fff3cd,#faf8ed);box-shadow:0 3px 10px #94722109}
.challenge-winner-medal{display:grid;place-items:center;flex:none;width:42px;height:42px;border-radius:50%;background:#fff9;color:#a77a24}
.challenge-winner-medal .ui-icon{width:32px;height:32px}
.challenge-winner strong{min-width:0;font-size:16px;font-weight:750;line-height:1.35;color:#655025;overflow-wrap:anywhere}
.challenge-answer-progress{width:100%;margin-top:7px}
/* Selector de temas para retos: título destacado y datos comparables en una segunda línea. */
.topic-merge-list>.challenge-topic-option{display:flex;align-items:center;gap:14px;width:100%;min-width:0;padding:15px;border:1px solid #dce5d7;border-radius:15px;background:#fffefa;white-space:normal}
.challenge-topic-mark{display:grid;place-items:center;flex:none;width:42px;height:46px;border-radius:12px;background:#edf3e7;color:#59824c}
.challenge-topic-content{flex:1;min-width:0;display:flex;flex-direction:column;gap:9px}
.challenge-topic-name{font-size:15px;font-weight:700;line-height:1.4;overflow-wrap:anywhere;color:#29483c}
.challenge-topic-facts{display:flex;align-items:center;flex-wrap:wrap;gap:6px 8px;font-size:11px;font-weight:500;line-height:1.4;color:#617266}
.challenge-topic-facts>span{padding:4px 7px;border-radius:7px;background:#f0f4ec}
.challenge-topic-facts .language-badge{margin:0;font-size:11px}
.challenge-topic-arrow{flex:none;font-size:25px;color:#6c9279;font-weight:400}
[dir=rtl] .challenge-topic-arrow{transform:scaleX(-1)}
.topic-merge-list>.challenge-topic-option:hover{border-color:#94b79c;background:#f5f9f0}
.topic-merge-list>.challenge-topic-option:focus-visible{outline:3px solid #338a7766;outline-offset:3px}
@media(max-width:420px){.topic-merge-list>.challenge-topic-option{padding:12px;gap:10px}.challenge-topic-mark{width:32px;height:38px}.challenge-topic-name{font-size:14px}.challenge-topic-facts{gap:5px}.challenge-topic-facts>span{padding:3px 5px}}
.language-badge{display:inline-flex;align-items:center;gap:7px;min-width:0;padding:5px 8px;border-radius:8px;background:#f1f4ed;color:#536a60;font-size:11px;font-weight:600;line-height:1.25}
.language-badge img{width:24px;height:17px;object-fit:contain;flex:none;filter:drop-shadow(0 1px 1px #26473820)}
.language-badge>span{overflow-wrap:anywhere}
.topic-actions .topic-challenge-action{flex-basis:100%;background:#eaf2ee;border-color:#cbded3;color:#376859}
/* Las tres acciones de Retos comparten fila, incluso en tarjetas estrechas. */
.challenge-card .topic-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;align-items:stretch}
.challenge-card .topic-actions .btn{position:relative;min-width:0;padding:9px 5px;font-size:12px;line-height:1.35;justify-content:center;text-align:center;white-space:nowrap;gap:6px;overflow:hidden}
.challenge-card .topic-actions .ui-icon{display:block;width:16px;height:16px;flex:none}
.challenge-action-label{display:block;flex:none;white-space:nowrap}
.actions-icons-only .challenge-action-label{position:absolute;width:max-content;visibility:hidden;pointer-events:none}
.topic-challenge-action .ui-icon{color:#578d76}
/* Una X con nombre accesible y la misma área táctil en todos los encabezados de modal. */
.battle-dialog .dialog-heading>.modal-close,.salon-drawer .drawer-heading>.modal-close{width:40px;height:40px;min-height:40px;flex:0 0 40px;padding:9px;margin-inline-start:auto;align-self:center;border-radius:11px;color:#6b7971;background:transparent;border-color:transparent}
.battle-dialog .dialog-heading>.modal-close:hover,.salon-drawer .drawer-heading>.modal-close:hover{background:#f6e7df;border-color:#ebd6c9;color:#9a4937;filter:none}
.modal-close .ui-icon{width:21px;height:21px;stroke-width:1.8;color:inherit}
/* La generación se distingue del progreso de aprendizaje, incluso antes del primer porcentaje. */
.topic-card.topic-card-generating{border-color:#ddc58d;background:linear-gradient(150deg,#fff8e5,#fffefb 70%);box-shadow:0 5px 18px #a4792010}
.topic-generation{display:flex;align-items:center;gap:12px;padding:13px;border:1px solid #ead7a7;border-radius:14px;background:#f7ebcc}
.topic-generation>img{width:50px;height:54px;object-fit:contain;flex:none}.topic-generation>div{flex:1;min-width:0}
.topic-generation p{margin:0 0 9px;font-size:12px;font-weight:650;line-height:1.5;color:#785d22;overflow-wrap:anywhere}
.topic-generation progress{display:block;width:100%;height:7px;appearance:none;border:0;border-radius:8px;overflow:hidden;background:#e7d8b2}
.topic-generation progress::-webkit-progress-bar{background:#e7d8b2}.topic-generation progress::-webkit-progress-value{background:#af852d;border-radius:8px}.topic-generation progress::-moz-progress-bar{background:#af852d;border-radius:8px}
body[data-stage=rooms] main{padding-top:18px;padding-bottom:18px}
body[data-stage=rooms] .page-footer{padding-block:12px}
.topics-header{margin-top:0;margin-bottom:16px}.topics-header .lede{font-size:16px}
body[data-mode=challenge] .topics-header{padding:16px 22px}
body[data-mode=challenge] .topics-header img{width:200px;height:134px;flex-shrink:0}body[data-mode=challenge] .topics-header>div{min-width:0}
.topic-error:empty{display:none}.challenge-card .topic-meta{margin:0}.challenge-card{gap:10px;border-top:3px solid #9bbebc}
.challenge-toolbar{justify-content:flex-start}
@media(min-width:761px) and (max-height:800px){.topbar:has(.area-nav){padding-block:15px}.topics-header h1{font-size:34px}.topics-header img{width:90px;height:90px}body[data-mode=challenge] .topics-header img{width:160px;height:107px}.topics-toolbar{padding:12px}.topic-card{padding:18px}}
@media(max-width:760px){body[data-stage=rooms] main{padding-top:14px}.topics-header .lede{font-size:13px}body[data-mode=challenge] .topics-header{padding:16px}body[data-mode=challenge] .topics-header img{width:clamp(90px,27vw,145px);height:auto;aspect-ratio:400/267}}

/* Retos: búsqueda y estado próximos a la lista, con controles completos también en móvil. */
.challenge-filters{display:flex;flex-wrap:wrap;align-items:flex-end;gap:14px;margin:0 0 20px;padding:16px 18px;border:1px solid var(--line);border-radius:18px;background:#fff9}
.challenge-filters label{display:flex;flex-direction:column;gap:7px;margin:0;font-size:12px;font-weight:650;min-width:0}
.challenge-search{flex:1 1 240px}.challenge-search-box{position:relative}.challenge-search-box>.ui-icon{position:absolute;width:19px;height:19px;left:13px;top:50%;transform:translateY(-50%);color:var(--muted);pointer-events:none}
.challenge-search-box input{width:100%;padding-inline-start:42px}.challenge-status-filter{flex:0 1 210px}.challenge-status-filter select{width:100%;min-width:0}.challenge-filter-count{padding:12px 0;color:var(--muted);font-size:13px;font-variant-numeric:tabular-nums}
@media(max-width:560px){.challenge-filters{gap:12px;padding:14px}.challenge-search{flex-basis:100%}.challenge-status-filter{flex:1}.challenge-filter-count{margin-inline-start:auto}}
[dir=rtl] .challenge-search-box>.ui-icon{left:auto;right:13px}

/* Los controles del tema forman una sola fila, incluida la eliminación cuando está permitida. */
body[data-mode="topic"] .topic-controls{flex-wrap:nowrap}
body[data-mode="topic"] .topic-controls .btn{min-width:0;white-space:nowrap}
@media(max-width:560px){
  body[data-mode="topic"] .topic-controls{gap:4px;padding:4px}
  body[data-mode="topic"] .topic-controls .btn{font-size:11px;padding:6px;gap:3px}
  body[data-mode="topic"] .topic-controls .ui-icon{width:15px;height:15px;flex-shrink:0}
  /* En el salón individual, el título y los cinco accesos comparten la cabecera. */
  body[data-mode="topic"][data-battle="true"] .room-heading{flex-wrap:nowrap;gap:6px}
  body[data-mode="topic"][data-battle="true"] .room-identity{flex:1;min-width:0}
  body[data-mode="topic"][data-battle="true"] .room-guide{flex-shrink:0}
  body[data-mode="topic"][data-battle="true"] .room-identity>div{flex:1;overflow:hidden}
  body[data-mode="topic"][data-battle="true"] #battle .battle-actions{width:auto;flex-wrap:nowrap;flex-shrink:0}
  body[data-mode="topic"][data-battle="true"] .current-player bdi{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
}
@media(max-width:359px){
  body[data-mode="topic"] .topic-controls .btn{font-size:10.5px;padding:6px 5px}
}

/* Cabecera de salones compacta: el texto puede crecer sin reservar altura para el mono. */
#lobby .lobby-intro{min-height:0;padding:18px 28px;gap:20px;border-radius:22px}
#lobby .lobby-intro>div{min-width:0}
#lobby .lobby-intro .eyebrow{margin:0 0 8px}
#lobby .lobby-intro h1{font-size:clamp(26px,3vw,36px);line-height:1.12;margin:0 0 10px;overflow-wrap:anywhere}
#lobby .lobby-intro .lede{font-size:15px;line-height:1.45;margin:0}
#lobby .lobby-mascot{width:132px;height:132px;flex-shrink:0;margin:0}
#lobby .lobby-intro::after{font-size:170px;right:170px;top:-18px}
#lobby .lobby-title{margin-top:22px}
@media(max-width:560px){
  #lobby .lobby-intro{padding:16px;gap:10px;border-radius:18px}
  #lobby .lobby-intro h1{font-size:26px;margin-bottom:8px;letter-spacing:-1px}
  #lobby .lobby-intro .eyebrow{font-size:9px;letter-spacing:1.2px;margin-bottom:6px}
  #lobby .lobby-intro .lede{font-size:13px}
  #lobby .lobby-mascot{width:86px;height:100px}
  #lobby .lobby-title{margin-top:18px}
}

/* El catálogo no reserva una segunda columna vacía cuando solo hay un salón. */
#lobby .room-grid{width:100%;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr))}
#lobby .room-card{width:100%;min-width:0}
#lobby .room-card-content{flex:1;min-width:0;overflow-wrap:anywhere}
@media(max-width:760px){
  #lobby .room-grid{grid-template-columns:minmax(0,1fr)}
}

/* Presentación compacta de la web informativa, después de los accesos al juego. */
.home-discover{display:flex;align-items:center;gap:20px;margin-top:22px;padding:16px 22px;border:1px solid #d9e4dc;border-radius:22px;background:linear-gradient(110deg,#eaf3eb,#fff9e9)}
.home-discover>img{width:70px;height:78px;object-fit:contain;flex-shrink:0}
.home-discover>div{flex:1;min-width:0}
.home-discover h2{font-size:20px;line-height:1.2;margin:0 0 7px;letter-spacing:-.4px}
.home-discover p{font-size:14px;line-height:1.5;margin:0;color:#536b61;max-width:680px}
.home-discover>.btn{flex-shrink:0;text-decoration:none;gap:10px;background:#fffdf7}
@media(max-width:760px){
  .home-discover{display:grid;grid-template-columns:52px minmax(0,1fr);gap:12px;padding:16px;margin-top:16px}
  .home-discover>img{width:52px;height:64px}
  .home-discover h2{font-size:18px}
  .home-discover p{font-size:13px}
  .home-discover>.btn{grid-column:1/-1;justify-content:center}
}
/* Celebración compartida: el logro tiene protagonismo sin exceder la altura disponible. */
.completion-dialog{width:min(620px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:0;border:1px solid #dfd9bf;border-radius:30px;background:#fffcf4;color:#253f3e;overflow:auto;overscroll-behavior:contain;box-shadow:0 30px 100px #132e4666}
.completion-dialog::backdrop{background:#132e46a6;backdrop-filter:blur(5px)}
.completion-dialog>.modal-close{position:absolute;right:14px;top:14px;z-index:2;font-size:29px;line-height:1;width:40px;height:40px;background:#ffffffcf}
.completion-art{height:190px;position:relative;display:flex;align-items:end;justify-content:center;overflow:hidden;background:radial-gradient(ellipse at 50% 100%,#ffd975 0, #ffebaf 35%,#f7efda00 72%),linear-gradient(135deg,#e4f1ec,#fff5dd)}
.completion-art:before{content:'';position:absolute;width:230px;height:230px;bottom:-75px;border:1px solid #caac5777;border-radius:50%;box-shadow:0 0 0 24px #fff5,0 0 0 48px #fff3}
.completion-art img{position:relative;width:235px;height:175px;object-fit:contain;filter:drop-shadow(0 8px 8px #76591920);animation:completion-arrive .5s ease-out both}
.completion-art i{position:absolute;left:calc(7% + var(--n)*9%);top:calc(16% + mod(var(--n),3)*18%);color:#c79729;font-style:normal;font-size:17px;animation:completion-spark .8s ease-out both;animation-delay:calc(var(--n)*.035s)}
.completion-copy{text-align:center;padding:20px 30px 0}.completion-copy .eyebrow{color:#8b681e;margin:0 0 8px}.completion-copy h2{font-size:clamp(25px,5vw,36px);line-height:1.12;letter-spacing:-1px;margin:0;text-wrap:balance}.completion-copy h2:focus{outline:none}.completion-topic{font-size:14px;color:#5a7269;margin:12px 0;overflow-wrap:anywhere;max-height:3.6em;overflow:auto}.completion-lead{font-size:16px;line-height:1.6;color:#536960;margin:10px auto 0;max-width:450px;text-wrap:pretty}
.completion-content{padding:20px 28px 0}.completion-mastery{display:flex;gap:14px;justify-content:center;align-items:center;padding:14px;border:1px solid #c9ddc1;border-radius:18px;background:#eaf3df}.completion-mastery strong{font-size:36px;color:#376f4e}.completion-mastery span{font-size:16px;color:#376f4e}
.completion-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.completion-stats>div{display:grid;grid-template-columns:26px auto;align-items:center;justify-content:center;gap:4px 7px;padding:14px 8px;background:#fff;border:1px solid #e8e4d7;border-radius:18px}.completion-stats img{width:26px;height:26px;object-fit:contain}.completion-stats strong{font-size:24px;overflow-wrap:anywhere}.completion-stats span{grid-column:1/-1;text-align:center;font-size:12px;color:#67796e}
.completion-actions{display:flex;gap:10px;justify-content:center;padding:22px 28px 26px;flex-wrap:wrap}.completion-actions .btn{flex:1;justify-content:center;min-height:46px}
.completion-ranking{margin-top:20px;border-top:1px solid #e1ddcf;padding-top:16px}.completion-ranking h3{margin:0;text-align:center;font-size:20px}.completion-standing{text-align:center;color:#287369}.completion-ranking ol{list-style:none;margin:14px 0 0;padding:0;max-height:230px;overflow:auto}.completion-ranking li{display:grid;grid-template-columns:30px minmax(0,1fr) auto;gap:10px;align-items:center;padding:10px;border-bottom:1px solid #e7e4d7}.completion-ranking li strong{overflow-wrap:anywhere}.completion-ranking .is-self{background:#e2efdd;border-radius:12px}.completion-place{background:#eee5ce;border-radius:50%;width:28px;height:28px;display:grid;place-items:center;color:#765716}.completion-score{font-size:13px;font-variant-numeric:tabular-nums}
@keyframes completion-arrive{from{opacity:0;transform:translateY(18px) scale(.94)}to{opacity:1;transform:none}}
@keyframes completion-spark{from{opacity:0;transform:translateY(20px) scale(.3)}to{opacity:1;transform:none}}
@media(max-width:420px){.completion-art{height:155px}.completion-art img{height:145px;width:210px}.completion-copy{padding:18px 18px 0}.completion-content{padding:16px 18px 0}.completion-actions{padding:18px}.completion-stats strong{font-size:21px}}
@media(max-height:550px){.completion-art{height:105px}.completion-art img{height:105px}.completion-copy{padding-top:12px}.completion-lead{font-size:14px}.completion-content{padding-top:12px}.completion-actions{padding-top:14px;padding-bottom:14px}}
@media(prefers-reduced-motion:reduce){.completion-art img,.completion-art i{animation:none}}
