/* Copia adaptada y aislada de la composición de la pantalla de juego Original. */
:root{--ink:#281b13;--paper:#fff8ec;--green:#405044;--red:#931d30;--line:#d8b48c;--serif:Georgia,'Times New Roman',serif;--sans:Arial,Helvetica,sans-serif;--board-top:max(116px,16dvh);color-scheme:light}
*{box-sizing:border-box}html,body{width:100%;height:100%;margin:0;overflow:hidden}body{height:100dvh;color:var(--ink);font:14px/1.4 var(--sans);background:#8d6849 url('assets/fondo-reliquias-tecnologicas.webp') center center/cover no-repeat}button,a,input{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer}button:disabled{cursor:default;opacity:.36}[hidden]{display:none!important}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #2677be;outline-offset:3px}.skip-link{position:absolute;top:-80px;left:10px;z-index:40;padding:12px;background:var(--paper);color:var(--ink)}.skip-link:focus{top:10px}
/* Cabecera: título, adorno y contador idénticos a Original. */
.game-header{position:absolute;inset:0;z-index:10;pointer-events:none}.title-band{position:absolute;top:max(env(safe-area-inset-top),1.6dvh);left:50%;display:flex;flex-direction:column;justify-content:center;width:min(calc(64vw + 100px),1120px,calc(100vw - 128px));min-height:58px;padding:min(.5dvh,6px) clamp(44px,5vw,68px) min(.7dvh,8px);transform:translateX(-50%);background:linear-gradient(90deg,#f8e9cf00,#f8e9cff0 8%,#f7ead5 50%,#f8e9cff0 92%,#f8e9cf00);text-align:center}.title-band :is(h1,h2){min-width:0;max-width:100%;margin:0;overflow:hidden;white-space:nowrap;text-transform:uppercase;color:#100d09;font:700 max(16px,min(4.15vw,6.2dvh,66px))/1 'Times New Roman',Times,serif}.game-ornament{display:flex;align-items:center;gap:3px;margin-top:.15dvh;color:#940d2d;font:12px/1 Georgia,serif;letter-spacing:3px}.game-ornament::before,.game-ornament::after{flex:1;height:1px;background:currentColor;opacity:.76;content:''}.timer{position:absolute;top:calc(100% + 6px);left:50%;margin:0;padding:4px 12px;transform:translateX(-50%) translateY(2px);border:1px solid var(--line);border-radius:6px;background:#fff8eceb;box-shadow:0 2px 8px #0002;color:var(--ink);font:600 clamp(12px,1.5vw,18px)/1.2 Arial,sans-serif;font-variant-numeric:tabular-nums}
.icon-button{display:grid;place-items:center;width:44px;height:44px;padding:8px;border:1px solid #c3a17b;border-radius:7px;background:var(--paper);color:var(--ink);text-decoration:none;pointer-events:auto}.icon-button svg,.icon-button img{display:block;width:24px;height:24px}.back-button{position:absolute;z-index:1;top:max(12px,env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left))}.back-button:hover{background:var(--paper);color:var(--ink)}
/* Herramientas Pintar: medidas y estados copiados de Original. */
.paint-controls{position:absolute;z-index:11;top:max(12px,env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right));display:flex;flex-direction:column;align-items:flex-end;gap:8px;color:var(--ink);font:14px Arial,sans-serif;pointer-events:auto}#paintToggle{padding:8px;box-shadow:none}#paintToggle img{filter:brightness(0) saturate(100%) invert(12%) sepia(17%) saturate(936%) hue-rotate(345deg) brightness(91%) contrast(93%)}#paintToggle[aria-expanded=true]{background:#940d2d;color:white}#paintToggle[aria-expanded=true] img{filter:brightness(0) invert(1)}.paint-tools{position:relative;width:min(276px,calc(100vw - 32px));padding:11px;border:1px solid var(--line);border-radius:7px;background:#fff9ed;box-shadow:0 6px 20px #24100759;color:var(--ink);font:13px/1.3 var(--sans)}.paint-close{display:none}.paint-width{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:8px}.paint-width input{min-width:0;width:100%;accent-color:var(--red)}.paint-width output{font-variant-numeric:tabular-nums}.paint-colors{display:flex;gap:7px;margin-top:10px}.paint-color{flex:0 0 23px;width:23px;height:23px;padding:0;border:2px solid #fff9ed;border-radius:50%;background:var(--paint-color);box-shadow:0 0 0 1px #91775b}.paint-color[aria-pressed=true]{box-shadow:0 0 0 2px var(--red)}.paint-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}.paint-actions button{min-height:0;padding:6px 8px;border:1px solid #a78b6d;border-radius:4px;background:#fff9ed;color:var(--ink);font:600 12px/1.2 var(--sans)}.paint-actions button:hover,.paint-actions button[aria-pressed=true]{border-color:var(--red);background:var(--red);color:#fff9ed}.paint-actions button:focus-visible,.paint-color:focus-visible{outline:3px solid #f1cd94;outline-offset:2px}
/* Escena de una pantalla: objetos | tablero | pistas. */
.game-layout{position:absolute;inset:0;min-width:0;pointer-events:none}.panel{position:absolute;z-index:4;top:var(--board-top);bottom:max(116px,16dvh);width:min(calc(25vw - 32px),43dvh,390px);padding:min(1.2vw,1.8dvh);overflow:auto;border:2px solid var(--line);border-radius:9px;background:linear-gradient(115deg,#fff9ed,#f7ead8);box-shadow:0 8px 26px #24100766;pointer-events:auto;scrollbar-width:thin;scrollbar-color:#aa8058 #eee0ce}.objects-panel{left:max(12px,1.2vw);display:flex;flex-direction:column}.clues-panel{right:max(12px,1.2vw);display:flex;flex-direction:column;touch-action:pan-y;overscroll-behavior-y:contain}.panel h2{flex:none;position:relative;margin:0 0 min(1.1vw,1.5dvh);padding-right:23px;color:#23180f;font:700 min(1.65vw,2.9dvh,25px)/1.1 'Times New Roman',Times,serif;text-align:center;text-transform:uppercase}.panel-heading h2{padding:0}.objects-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));flex:1;min-height:0;align-content:center;gap:min(1vw,1.4dvh) min(.7vw,1dvh)}.object-button{display:flex;flex-direction:column;align-items:center;min-width:0;min-height:0;padding:0;border:0;background:none;color:#243448;cursor:grab;touch-action:none;user-select:none}.object-button img{display:block;width:100%;height:auto;aspect-ratio:1;object-fit:contain;pointer-events:none}.object-button span{display:block;width:100%;overflow:hidden;margin-top:4px;color:#243448;font:clamp(12px,min(1.3vw,2dvh),14px)/1.15 Arial,sans-serif;text-align:center;text-overflow:ellipsis;white-space:nowrap}.object-button[aria-pressed=true]{outline:3px solid #940d2d;outline-offset:3px}.object-button.is-placed{opacity:.36}
.clues-panel ol{display:flex;flex:1;flex-direction:column;justify-content:space-around;gap:min(1.8vw,2.8dvh);margin:0;padding:0;list-style:none;counter-reset:clue}.clues-panel li{position:relative;display:block;padding-left:calc(min(1.1vw,1.8dvh,17px) + 6px + min(.65vw,1dvh));color:#243448;font:clamp(12px,min(1.3vw,2dvh),14px)/1.2 Arial,sans-serif;counter-increment:clue}.clues-panel li::before{position:absolute;top:1px;left:0;display:grid;place-items:center;width:calc(min(1.1vw,1.8dvh,17px) + 6px);aspect-ratio:1;border-radius:50%;background:#940d2d;color:#fff9ed;content:counter(clue);font:700 min(.9vw,1.45dvh,13px)/1 Arial,sans-serif}
.board-area{position:absolute;inset:0;min-width:0;pointer-events:none}.board-frame{position:absolute;top:var(--board-top);left:50%;width:min(48vw,calc(100dvh - var(--board-top) - 110px),780px);aspect-ratio:1;transform:translateX(-50%);pointer-events:auto}.board-frame>img{display:block;width:100%;height:100%;user-select:none;pointer-events:none}.category-names,.slots{position:absolute;inset:0;pointer-events:none}.category-name{position:absolute;display:flex;align-items:center;justify-content:center;overflow:hidden;padding:0 3px;color:#36281c;font:700 24px/1 var(--serif);text-align:center;white-space:nowrap;pointer-events:none}.slot{position:absolute;display:grid;place-items:center;padding:0;border:2px solid transparent;border-radius:4px;background:transparent;pointer-events:auto;touch-action:none;user-select:none}.slot img{position:absolute;left:10%;top:10%;width:80%;height:80%;object-fit:contain;pointer-events:none;filter:drop-shadow(0 4px 2px #38200d55)}.slot:hover,.slot.is-drop-target{border-color:#fff8ec;background:#931d302e;box-shadow:inset 0 0 0 2px #931d3061}.slot[aria-pressed=true]{outline:3px solid #940d2d;outline-offset:1px}.paint-canvas{position:absolute;z-index:5;inset:0;width:100%;height:100%;pointer-events:none;touch-action:none}.board-frame.is-painting .paint-canvas{pointer-events:auto;cursor:crosshair}.board-frame.is-painting .slots{pointer-events:none}.drag-ghost{position:fixed;z-index:50;width:76px;height:76px;pointer-events:none;transform:translate(-50%,-50%)}.drag-ghost img{width:100%;height:100%;object-fit:contain}
/* Ayuda, comprobación e instrucciones conservan la posición de Original. */
.game-actions{position:absolute;z-index:9;bottom:54px;left:50%;display:flex;justify-content:center;gap:10px;width:max-content;max-width:calc(100% - 24px);margin:0;transform:translateX(-50%);pointer-events:auto}.primary-button,.secondary-button{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:10px 18px;border:1px solid var(--green);border-radius:6px;box-shadow:0 2px 10px #140c0759;font:600 15px/1.2 var(--sans);cursor:pointer}.primary-button{background:var(--green);color:white}.primary-button:hover:not(:disabled){background:#334339}.primary-button:disabled{opacity:1;border-color:#8c8478;background:#8c8478;color:#f3efe5;cursor:not-allowed}.secondary-button{background:var(--paper);color:var(--green)}.secondary-button:hover{background:#e7eee9}.instructions-button{position:absolute;z-index:10;bottom:max(16px,env(safe-area-inset-bottom));left:50%;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:28px;margin:0;padding:5px 8px;transform:translateX(-50%);border:1px solid #c3a17b;border-radius:5px;background:var(--paper);color:#71351f;font:700 12px/1 Arial,sans-serif;pointer-events:auto}.instructions-icon{display:grid;place-items:center;width:16px;height:16px;border:1px solid currentColor;border-radius:50%;font:700 11px/1 Georgia,serif}.instructions-button:hover{border-color:var(--red);background:white;color:var(--red)}
.game-dialog{width:min(520px,calc(100% - 28px));max-height:calc(100dvh - 32px);overflow:auto;margin:auto;padding:28px;border:2px solid var(--line);border-radius:9px;background:linear-gradient(115deg,#fff9ed,#f7ead8);color:var(--ink);box-shadow:0 10px 50px #20100855}.game-dialog::backdrop{background:#100907a6}.game-dialog h2{margin:0 0 15px;font:700 28px/1.15 var(--serif)}.game-dialog p{line-height:1.55}.dialog-kicker{margin:0 0 9px;text-transform:uppercase;color:#765f48;font-size:12px;letter-spacing:.09em}.dialog-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:9px;margin-top:22px}.feedback-icon{display:block;margin-bottom:12px;color:var(--green);font:700 40px/1 var(--sans)}.is-error .feedback-icon{color:var(--red)}.noscript{position:absolute;z-index:20;padding:20px;background:var(--paper)}
@media(orientation:portrait) and (max-width:900px), (min-height:600px) and (max-width:900px){
 :root{--board-top:100px;--panel-height:37dvh;--dock-height:60px}
 .title-band{top:max(4px,env(safe-area-inset-top));width:min(72vw,calc(100vw - 120px));min-height:58px;padding:2px clamp(20px,3vw,32px)}.title-band :is(h1,h2){font-size:max(16px,min(3.5vw,3dvh,28px))}.game-ornament{margin-top:2px;font-size:9px;letter-spacing:2px}.timer{top:calc(100% + 2px);padding:2px 8px;font-size:11px}
 .paint-controls{top:8px;right:8px}#paintToggle{width:42px;height:42px}.paint-tools{max-height:calc(100dvh - 64px);overflow:auto}
 .board-frame{width:min(calc(100vw - 32px),calc(63dvh - 180px),780px)}
 .panel{top:auto;bottom:var(--dock-height);width:calc(50% - 14px);height:var(--panel-height);max-width:none;max-height:none;margin:0;padding:clamp(7px,1.5vw,12px)}.objects-panel{left:8px}.clues-panel{right:8px}.panel h2{margin-bottom:8px;font-size:clamp(11px,2.6vw,20px);line-height:1.15}.objects-grid{grid-template-rows:repeat(3,minmax(0,1fr));align-content:stretch;gap:6px 5px}.object-button{display:grid;grid-template-rows:minmax(0,1fr) auto;justify-items:center;gap:3px}.object-button img{width:100%;height:100%;min-height:0;max-height:100%}.object-button span{margin:0;font-size:clamp(12px,1.9vw,14px)}.clues-panel ol{display:block;flex:none;column-count:2;column-gap:8px}.clues-panel li{break-inside:avoid;margin-bottom:10px;padding-left:22px;font-size:clamp(12px,1.9vw,14px);line-height:1.25}.clues-panel li::before{width:17px;font-size:10px}.clues-panel li:nth-child(4){break-before:column}
 .game-actions{right:0;bottom:0;left:0;width:auto;max-width:none;height:var(--dock-height);padding:8px max(12px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));transform:none;border-top:1px solid var(--line);background:linear-gradient(115deg,#fff9ed,#f7ead8)}.game-actions button{flex:1;box-shadow:none}
 .instructions-button{right:10px;bottom:calc(var(--dock-height) + var(--panel-height) + 10px);left:auto;width:28px;height:28px;min-height:0;padding:0;transform:none;border-radius:50%}.instructions-label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
}
@media(orientation:portrait) and (max-width:900px), (min-height:600px) and (max-width:900px){
 :root{--board-top:68px;--panel-height:39dvh;--gallery-height:clamp(112px,21dvh,154px)}
 .title-band{top:0;left:0;width:100%;max-width:none;height:58px;min-height:58px;gap:3px;padding:4px 58px;transform:none;background:linear-gradient(90deg,#f8e9cf,#f7ead5,#f8e9cf)}.title-band :is(h1,h2){width:100%;font-size:max(16px,min(3.5vw,3dvh,28px))}.game-ornament{display:none}.timer{position:static;margin:0;padding:0;border:0;border-radius:0;background:none;box-shadow:none;transform:none;font-size:11px}.back-button{top:8px;left:8px;width:42px;height:42px}
 .paint-tools{padding-top:42px}.paint-close{position:absolute;top:7px;right:7px;display:grid;place-items:center;width:34px;height:34px;padding:0;border:0;border-radius:50%;background:var(--red);color:var(--paper);font:700 27px/1 Arial,sans-serif}
 .board-frame{width:min(calc(100vw - 12px),calc(61dvh - 140px))}
 .panel{right:0;left:0;width:100%;padding:7px 9px;border:0;border-radius:0;background:linear-gradient(115deg,#fff9ed,#f7ead8);box-shadow:none}.objects-panel{bottom:calc(var(--dock-height) + var(--panel-height) - var(--gallery-height));height:var(--gallery-height);overflow:hidden;border-top:1px solid var(--line)}.clues-panel{bottom:var(--dock-height);height:calc(var(--panel-height) - var(--gallery-height));border-top:1px solid var(--line)}.panel h2{margin-bottom:5px;font-size:13px}.objects-grid{display:flex;flex:1;align-items:stretch;gap:10px;overflow-x:auto;overflow-y:hidden;padding-bottom:4px;scroll-snap-type:x proximity;touch-action:pan-x;scrollbar-width:thin;scrollbar-color:#aa8058 #eee0ce}.object-button{display:grid;flex:0 0 65px;grid-template-rows:minmax(0,1fr) auto;gap:2px;touch-action:pan-x}.object-button img{width:100%;height:100%;max-height:100%}.object-button span{margin-top:2px;font-size:12px}.clues-panel ol{column-gap:12px}.clues-panel li{margin-bottom:9px;font-size:12px}.game-actions{gap:8px}.game-actions button{padding:10px 12px;font-size:14px}
}
@media(orientation:landscape) and (max-height:700px){.panel{top:104px;bottom:108px}.panel h2{font-size:12px;line-height:1.1}.clues-panel li{font-size:12px}.objects-grid{gap:6px 5px}}
@media(orientation:landscape) and (max-width:620px){.title-band{top:0;left:0;width:100%;height:58px;min-height:58px;gap:3px;padding:4px 58px;transform:none}.title-band :is(h1,h2){font-size:max(16px,min(3.5vw,3dvh,28px))}.game-ornament{display:none}.timer{position:static;padding:0;border:0;background:none;box-shadow:none;transform:none;font-size:11px}.objects-grid{display:flex;flex-direction:column;justify-content:flex-start;overflow-y:auto;align-content:normal;touch-action:pan-y}.object-button{flex:0 0 auto}.object-button img{width:min(76px,100%);height:auto}.object-button span{font-size:12px}.panel{padding:7px}.board-frame{width:min(48vw,calc(100dvh - 220px))}}
@media(prefers-reduced-motion:no-preference){.slot{transition:background .15s}.game-dialog[open]{animation:arrive .18s ease-out}@keyframes arrive{from{opacity:.3;transform:translateY(8px)}to{opacity:1;transform:none}}}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.objects-panel .objects-heading{position:relative;padding:0 27px;margin-bottom:18px}
.panel-info{position:absolute;top:2px;right:0;display:grid;place-items:center;width:23px;height:23px;padding:0;border:1px solid #d8b48c;border-radius:50%;background:#fff;color:#71351f;font:700 16px/1 Georgia,serif;cursor:help}
.panel-info::before{position:absolute;inset:-10px;content:""}
.panel-info:hover{background:#fff;color:#71351f}
.panel-info:focus-visible{outline:2px solid var(--red);outline-offset:2px}
.objects-info{position:fixed;z-index:20;width:min(310px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;padding:12px 14px;border:1px solid var(--line);border-radius:6px;background:#fff9ed;box-shadow:0 6px 20px #24100752;color:#281b13;font:14px/1.4 var(--sans)}
.objects-info p{margin:0 0 10px}.objects-info p:last-child{margin-bottom:0}

.game-dialog.is-won{width:min(380px,calc(100vw - 32px));padding:20px 20px 14px;border:1px solid #d8b48c;border-radius:8px;background:#fff9ed;box-shadow:0 10px 32px #100b0866;text-align:center}
.game-dialog.is-won h2{margin:0 0 6px;color:#931d30;font:400 26px/1.15 var(--serif)}
.game-dialog.is-won p{margin:0 0 14px;color:#3b2f25;font:400 14.5px/1.45 var(--sans);text-wrap:pretty}
.game-dialog.is-won .closing-question{padding:0;border:0}
.game-dialog.is-won .share-result{flex-direction:column;gap:2px;margin:0 0 6px}
.game-dialog.is-won .result-next{display:inline-block;margin-top:2px;padding:8px 6px;color:var(--green);font:600 13.5px/1.2 var(--sans);text-underline-offset:3px}
.game-dialog.is-won .dialog-actions{align-items:center;justify-content:center;gap:4px 14px;margin-top:6px;padding-top:6px;border-top:1px solid #765f4833}
.game-dialog.is-won .dialog-actions button,.game-dialog.is-won .result-exit{display:inline-flex;align-items:center;justify-content:center;min-height:36px;padding:8px 6px;border:0;border-radius:0;background:none;box-shadow:none;color:#765f48;font:500 13px/1.2 var(--sans);text-decoration:underline;text-decoration-color:#40504466;text-underline-offset:3px}
.game-dialog.is-won .dialog-actions button:hover,.game-dialog.is-won .result-exit:hover{background:none;color:var(--red);text-decoration-color:currentColor}
@media(pointer:coarse){.game-dialog.is-won .dialog-actions button,.game-dialog.is-won .result-exit{min-height:44px}}
.objects-panel .objects-heading{padding:0 23px 0 0;margin-bottom:min(1.1vw,1.5dvh)}
@media(orientation:portrait) and (max-width:900px), (min-height:600px) and (max-width:900px){.objects-panel .objects-heading{margin-bottom:8px}}
@media(orientation:portrait) and (max-width:900px), (min-height:600px) and (max-width:900px){.objects-panel .objects-heading{margin-bottom:5px}}

/* Espaciado común de los paneles: cabeceras y contenido alineados al margen interior. */
@media(orientation:landscape){
 .panel{padding:clamp(12px,1.4vw,22px)}
 .panel h2{margin:0;padding:0}
 .objects-panel .objects-heading{margin:0 0 18px;padding:0 29px}
 .panel-info{top:0}
 .objects-grid{flex:0 0 auto;align-content:start;gap:16px 10px}
 .clues-panel h2{margin-bottom:22px}
 .clues-panel ol{flex:0 0 auto;justify-content:flex-start;gap:20px}
}
@media(orientation:portrait) and (max-width:900px), (min-height:600px) and (max-width:900px){
 .panel h2{padding:0}
 .objects-panel .objects-heading h2{margin:0}
 .objects-panel .objects-heading{padding:0 27px}
}
@media(orientation:landscape) and (max-height:700px){
 .panel{padding:10px}
 .objects-panel .objects-heading{margin-bottom:12px}
 .objects-grid{gap:8px 6px}
 .clues-panel h2{margin-bottom:14px}
 .clues-panel ol{gap:14px}
}

/* En escritorio, la tarjeta termina tras su contenido; solo limita su altura para permitir scroll. */
@media(orientation:landscape){
 .panel{bottom:auto;height:auto;max-height:calc(100dvh - var(--board-top) - max(116px,16dvh))}
}
@media(orientation:landscape) and (max-height:700px){
 .panel{max-height:calc(100dvh - 212px)}
}

/* Tablet horizontal comparte la composición móvil sin los paneles laterales de escritorio. */
@media(orientation:landscape) and (min-height:600px) and (max-width:900px){
 .panel{top:auto;max-height:none;padding:7px 9px}
 .objects-panel{bottom:calc(var(--dock-height) + var(--panel-height) - var(--gallery-height));height:var(--gallery-height)}
 .clues-panel{bottom:var(--dock-height);height:calc(var(--panel-height) - var(--gallery-height))}
 .objects-panel .objects-heading{margin-bottom:5px;padding:0 27px}
 .panel h2{font-size:13px;margin-bottom:5px}
 .objects-grid{flex:1;gap:10px}
 .clues-panel ol{display:block;column-count:2;column-gap:12px}
 .board-frame{width:min(calc(100vw - 12px),calc(61dvh - 140px))}
}

/* Galería táctil: centrada cuando cabe y desplazable desde el primer objeto cuando no cabe. */
@media(orientation:portrait) and (max-width:900px), (min-height:600px) and (max-width:900px){
 .objects-grid{justify-content:safe center;gap:clamp(10px,1.6vw,20px);padding-inline:6px}
 .object-button{flex-basis:clamp(65px,8vw,88px)}
 .object-button img{max-width:88px;justify-self:center}
}

@media(min-width:600px) and (orientation:portrait) and (max-width:900px), (min-width:600px) and (min-height:600px) and (max-width:900px){
 .panel h2{font-size:15px;line-height:1.2}
 .objects-panel .objects-heading{margin-bottom:8px}
 .object-button span{font-size:13px}
 .clues-panel h2{margin-bottom:12px}
 .clues-panel ol{column-gap:28px}
 .clues-panel li{margin-bottom:12px;padding-left:25px;font-size:14px;line-height:1.35}
 .clues-panel li::before{top:2px;width:18px;font-size:11px}
 .game-actions button{font-size:15px}
}

/* Los paneles laterales se ajustan al contenido también en pantallas verticales amplias. */
@media(orientation:portrait) and (min-width:901px){
 .panel{bottom:auto;height:auto;max-height:calc(100dvh - var(--board-top) - max(116px,16dvh));padding:clamp(12px,1.4vw,22px)}
 .panel h2{margin:0;padding:0}
 .objects-panel .objects-heading{margin:0 0 18px;padding:0 29px}
 .objects-grid{flex:0 0 auto;align-content:start;gap:16px 10px}
 .clues-panel h2{margin-bottom:22px}
 .clues-panel ol{flex:0 0 auto;justify-content:flex-start;gap:20px}
}

/* En la composición móvil los paneles siguen al tablero, sin anclarse al pie. */
@media(orientation:portrait) and (max-width:900px), (min-height:600px) and (max-width:900px){
 :root{--mobile-board-size:min(calc(100vw - 12px),calc(61dvh - 140px));--gallery-top:calc(var(--board-top) + var(--mobile-board-size) + 12px)}
 .objects-panel{top:var(--gallery-top);bottom:auto;height:var(--gallery-height)}
 .clues-panel{top:calc(var(--gallery-top) + var(--gallery-height));bottom:auto;height:auto;max-height:calc(100dvh - var(--gallery-top) - var(--gallery-height) - var(--dock-height));min-height:0}
 .instructions-button{top:calc(var(--gallery-top) - 38px);bottom:auto}
}

/* Cuadrícula completa en pantallas con paneles inferiores; desplazamiento solo vertical de la página. */
@media(orientation:portrait) and (max-width:900px), (min-height:600px) and (max-width:900px){
 :root{--mobile-board-size:min(calc(100vw - 12px),calc(70dvh - 100px))}
 html{height:100%;overflow-x:hidden;overflow-y:auto}
 body{height:auto;min-height:100dvh;overflow:visible;background-attachment:fixed}
 .game-layout{position:relative;display:flex;flex-direction:column;gap:0;padding-top:var(--board-top);padding-bottom:calc(var(--dock-height) + 16px);min-height:100dvh}
 .board-area{position:relative;inset:auto;order:0;flex:none;width:var(--mobile-board-size);height:var(--mobile-board-size);margin:0 auto 12px}
 .board-frame{position:relative;top:auto;left:auto;width:100%;transform:none}
 .objects-panel,.clues-panel{position:relative;inset:auto;flex:none;width:100%;height:auto;max-height:none;overflow:visible}
 .objects-panel{order:1;padding:12px}
 .clues-panel{order:2;padding:12px}
 .objects-grid{display:grid;flex:none;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:none;justify-content:center;align-content:start;gap:12px;overflow:visible;padding:0;scroll-snap-type:none;touch-action:pan-y}
 .object-button{display:flex;flex-direction:column;justify-content:flex-start;align-items:center;min-height:88px;gap:4px;touch-action:none}
 .object-button img{width:100%;height:clamp(56px,17vw,82px);max-width:100%;aspect-ratio:auto;object-fit:contain}
 .object-button span{width:100%;margin:0;overflow:visible;white-space:normal;text-overflow:clip;font-size:12px;line-height:1.2;overflow-wrap:break-word}
 .objects-panel .objects-heading{margin-bottom:12px}
 .game-actions{position:fixed}
 .instructions-button{top:calc(var(--board-top) + var(--mobile-board-size) - 28px);bottom:auto}
 .clues-panel ol{display:block;column-count:2}
}
@media(min-width:600px) and (max-width:900px) and (min-height:600px){
 .objects-grid{grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:14px 12px}
 .object-button span{font-size:13px}
}
@media(max-width:359px) and (orientation:portrait){
 .clues-panel ol{column-count:1}
 .clues-panel li:nth-child(4){break-before:auto}
}

@media(orientation:portrait) and (max-width:900px), (min-height:600px) and (max-width:900px){
 .board-area{width:min(calc(100% - 12px),calc(70dvh - 100px));height:auto;aspect-ratio:1}
 .instructions-button{top:calc(100% - 28px);right:0}
}

@media(min-width:600px) and (max-width:900px) and (min-height:600px){
 .board-area{width:min(calc(100% - 12px),calc(61dvh - 140px))}
}

/* Pistas reutilizables: dos columnas solo con anchura y longitud legibles. */
@media(orientation:portrait) and (max-width:900px), (min-height:600px) and (max-width:900px){
 .clues-panel ol{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-count:auto;gap:12px 24px}
 .clues-panel ol.single-column{grid-template-columns:minmax(0,1fr)}
 .clues-panel li{margin:0;break-before:auto}
 .clues-panel li:nth-child(4){break-before:auto}
 .game-layout{padding-bottom:calc(var(--dock-height) + env(safe-area-inset-bottom) + 20px)}
}
@media(max-width:599px) and (orientation:portrait){
 :root{--board-top:62px}
 .title-band{height:54px;min-height:54px;padding-top:3px;padding-bottom:3px}
}

/* Proporciones compactas como Original, conservando los nueve objetos sin carrusel. */
@media(orientation:portrait) and (max-width:900px), (min-height:600px) and (max-width:900px){
 .board-area{width:min(calc(100% - 12px),calc(61dvh - 140px))}
 .objects-panel,.clues-panel{padding:9px 12px}
 .objects-panel .objects-heading{margin-bottom:8px}
 .objects-grid{gap:8px 10px}
 .object-button{min-height:70px;gap:3px}
 .object-button img{height:clamp(48px,13vw,64px)}
 .object-button span{font-size:12px;line-height:1.15}
 .clues-panel h2{margin-bottom:8px}
 .clues-panel ol{gap:9px 20px}
}
@media(min-width:600px) and (max-width:900px) and (min-height:600px){
 .objects-grid{grid-template-columns:repeat(auto-fit,minmax(125px,1fr));gap:10px 12px}
 .object-button{min-height:84px}
 .object-button img{height:64px}
 .object-button span{font-size:13px}
}

/* Móvil: escena fija como Original, galería horizontal y pistas siempre a la vista. */
@media(orientation:portrait) and (max-width:900px), (min-height:600px) and (max-width:900px){
 :root{--board-top:58px;--dock-height:60px;--mobile-bottom-height:clamp(240px,39dvh,330px);--gallery-height:clamp(102px,17dvh,132px)}
 html,body{height:100%;overflow:hidden}
 body{height:100dvh;min-height:0}
 .game-layout{position:absolute;inset:0;display:block;min-height:0;padding:0}
 .board-area{position:absolute;top:var(--board-top);left:50%;width:min(calc(100% - 12px),calc(100dvh - var(--board-top) - var(--mobile-bottom-height) - var(--dock-height) - 10px));height:auto;aspect-ratio:1;margin:0;transform:translateX(-50%)}
 .objects-panel{position:absolute;top:auto;right:0;bottom:calc(var(--dock-height) + var(--mobile-bottom-height) - var(--gallery-height));left:0;width:100%;height:var(--gallery-height);padding:7px 9px;overflow:hidden}
 .objects-panel .objects-heading{margin-bottom:5px}
 .objects-grid{display:flex;flex:1;justify-content:safe center;align-items:stretch;gap:10px;overflow-x:auto;overflow-y:hidden;padding:0 6px 4px;touch-action:pan-x;scroll-snap-type:x proximity}
 .object-button{display:grid;flex:0 0 65px;grid-template-rows:minmax(0,1fr) auto;min-height:0;gap:2px;touch-action:pan-x}
 .object-button img{width:100%;height:100%;max-height:100%;object-fit:contain}
 .object-button span{margin:0;font-size:12px;line-height:1.15}
 .clues-panel{position:absolute;top:auto;right:0;bottom:var(--dock-height);left:0;width:100%;height:calc(var(--mobile-bottom-height) - var(--gallery-height));max-height:none;padding:7px 9px;overflow-y:auto;touch-action:pan-y}
 .clues-panel h2{margin-bottom:6px}
 .clues-panel ol,.clues-panel ol.single-column{display:block;column-count:2;column-gap:12px}
 .clues-panel li{margin:0 0 9px;font-size:12px;line-height:1.25;break-inside:avoid}
 .clues-panel li:nth-child(4){break-before:column}
 .instructions-button{top:auto;right:0;bottom:0}
 .game-actions{position:fixed}
}
@media(orientation:portrait) and (max-width:900px), (min-height:600px) and (max-width:900px){
 .board-area{left:0;right:0;margin:0 auto;transform:none}
 .game-actions{right:0;bottom:0;left:0}
}

/* Prioridad al tablero: las pistas absorben la falta de altura con su propio scroll. */
@media(orientation:portrait) and (max-width:900px), (min-height:600px) and (max-width:900px){
 :root{--play-board-size:min(calc(100vw - 12px),calc(100dvh - var(--board-top) - var(--dock-height) - var(--gallery-height) - 110px));--clues-top:calc(var(--board-top) + var(--play-board-size) + 12px + var(--gallery-height))}
 .board-area{width:var(--play-board-size)}
 .objects-panel{top:calc(var(--board-top) + var(--play-board-size) + 12px);bottom:auto}
 .clues-panel{top:var(--clues-top);bottom:var(--dock-height);height:auto;min-height:0;overflow-y:auto;overscroll-behavior-y:contain}
}

/* Nombres completos de las reliquias, sin truncar las etiquetas del nuevo reto. */
.object-button span{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:break-word}
@media(orientation:portrait) and (max-width:900px), (min-height:600px) and (max-width:900px){
 .objects-grid .object-button{flex-basis:90px}
}
