:root{--bg:#20130f;--panel:#302019;--panel2:#3e291e;--ink:#fff4dd;--muted:#d1ae91;--lime:#e4af71;--line:#79523e;--gold:#ffd597;--tile:#e8ca98;--tile-border:#946b50;--tshadow:#9a633f;--cell:#bc8c5f;--cell-dark:#a8754b}
*{box-sizing:border-box}
html{background:var(--bg)} body{margin:0;color:var(--ink);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace;-webkit-font-smoothing:antialiased;min-height:100vh}
button,input{font:inherit} button{cursor:pointer;touch-action:manipulation} button:focus-visible,input:focus-visible{outline:3px solid var(--gold);outline-offset:2px} button:disabled{opacity:.45;cursor:not-allowed}
.shell{max-width:670px;margin:auto;padding:20px clamp(14px,4vw,28px) 38px}
.header{display:flex;justify-content:space-between;align-items:center;padding-bottom:20px;border-bottom:1px solid var(--line)}
.brand{display:flex;gap:11px;align-items:center}.logo{display:grid;place-items:center;width:47px;height:47px;background:var(--lime);color:#234331;border:3px solid #102523;box-shadow:4px 4px 0 #557450;font-size:35px;line-height:1}.eyebrow{font-size:10px;letter-spacing:2px;color:var(--muted)}h1{font-size:clamp(19px,5vw,26px);line-height:1.25;letter-spacing:-1px;margin:2px 0 0}h1 span{color:var(--lime)}.edition{font-size:10px;letter-spacing:.5px;color:var(--muted);white-space:nowrap}.edition b{color:var(--lime)}
.welcome{padding:26px 0 20px}.welcome h2{font-family:Georgia,serif;font-weight:700;font-size:clamp(34px,8.6vw,53px);line-height:.99;letter-spacing:-1.6px;margin:0 0 15px}.welcome h2 em{font-style:italic;color:var(--lime)}.welcome p{font-size:12px;max-width:440px;line-height:1.75;color:var(--muted);margin:0}.welcome strong{color:var(--ink)}
.modes{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:14px}.mode{border:1px solid var(--line);background:var(--panel);color:var(--muted);padding:13px 5px;font-size:11px;font-weight:800;letter-spacing:.15px}.mode.active{background:var(--lime);color:#1a3830;border-color:var(--lime);box-shadow:0 4px 0 #718b52}
.room-panel{background:var(--panel);border:1px solid var(--line);padding:14px;margin-bottom:16px}.room-lobby{display:grid;gap:12px}.primary{background:var(--lime);color:#173329;border:0;padding:13px;font-size:12px;font-weight:900}.full{width:100%}.secondary{background:var(--panel2);color:var(--ink);border:1px solid var(--line);padding:12px;font-size:11px;font-weight:800}.join-line{display:flex;gap:8px}.join-line input{width:100%;min-width:0;flex:1;background:#112925;color:var(--ink);border:1px solid var(--line);padding:12px;text-transform:uppercase;letter-spacing:2px}.join-line input::placeholder{letter-spacing:0;color:#a9b9ac}.room-active{display:flex;align-items:center;justify-content:space-between;gap:10px}.room-active small{display:block;color:var(--muted);letter-spacing:1px;font-size:10px}.room-active strong{display:block;font-size:24px;color:var(--lime);letter-spacing:4px;margin-top:4px}
.scoreboard{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px;margin:10px 0 19px}.stat{min-width:0;background:var(--panel);border:1px solid var(--line);padding:12px 13px;min-height:82px}.stat span{display:block;color:var(--muted);font-size:9px;letter-spacing:.8px;white-space:nowrap}.stat strong{display:block;font-size:clamp(19px,5vw,27px);letter-spacing:1px;margin-top:8px}.next-stat{display:flex;justify-content:space-between;align-items:center;gap:3px}.next-piece{width:44px;height:44px;border:2px solid #6b866b;background:#b8c996;display:grid;place-items:center;flex-shrink:0}.next-piece img{width:39px;height:39px;image-rendering:pixelated}
.play-area{border:2px solid #688c73;background:#243f37;padding:10px;box-shadow:6px 6px 0 #0e2221}.board-header{display:flex;justify-content:space-between;align-items:center;gap:5px;margin:0 2px 10px}.board-title{font-size:11px;color:var(--ink);font-weight:900;letter-spacing:1px}.board-title span{font-size:10px;font-weight:400;color:var(--muted)}.turn-indicator{font-size:9px;padding:5px 7px;background:#3d584a;color:var(--lime);white-space:nowrap}
.board{display:grid;grid-template-columns:repeat(6,1fr);gap:5px;padding:6px;background:#72835c;border:3px solid #9a8f64;width:100%;aspect-ratio:1;max-width:550px;margin:auto}.cell{position:relative;min-width:0;min-height:0;aspect-ratio:1;background:var(--cell);border:0;border-bottom:4px solid #8d9c71;display:grid;place-items:center;padding:0;overflow:hidden}.cell:nth-child(3n+2){background:var(--cell-dark)}.cell.filled{background:#d9ceaa;border-bottom-color:#b6a67c;cursor:default}.cell:not(.filled):not(:disabled):active{background:#dceda9}.cell:disabled{opacity:1;cursor:not-allowed}.cell img{width:80%;height:80%;image-rendering:pixelated;pointer-events:none;filter:drop-shadow(1px 3px 0 #827c6388)}.cell .hover-mark{font-size:18px;color:#587151;opacity:.36}.cell:disabled .hover-mark{opacity:.15}.board-foot{margin:11px 2px 2px;display:flex;justify-content:space-between;align-items:center;gap:10px;font-size:9px;line-height:1.4;color:var(--muted);min-height:26px}.board-foot>span:last-child{text-align:right}.pulse{color:var(--lime)}
.action-row{display:flex;gap:8px;margin:17px 0 23px}.action-row>*{flex:1}.restart{border-color:#768e69;color:var(--lime)}.how-panel{padding:14px 16px;background:#203b37;border:1px solid var(--line);margin-bottom:20px;font-size:11px;line-height:1.7;color:var(--muted)}.how-panel strong{color:var(--lime)}.how-panel p{margin:7px 0}
.evolution{border-top:1px solid var(--line);padding-top:21px}.evo-title{display:flex;justify-content:space-between;gap:5px;font-size:11px;font-weight:900;letter-spacing:.3px}.evo-title span{font-size:9px;color:var(--muted);font-weight:400}.evo-tiles{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px;margin-top:14px}.evo-tile{text-align:center;min-width:0}.evo-art{background:#2b4a3e;border:1px solid var(--line);padding:6px 1px;display:grid;place-items:center;min-height:43px}.evo-art img{width:32px;height:32px;image-rendering:pixelated}.evo-tile small{display:block;margin-top:7px;font-size:8px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
footer{text-align:center;font-size:9px;letter-spacing:1.8px;color:#78978a;margin-top:35px}footer span{color:var(--lime)}.toast{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);width:max-content;max-width:90vw;background:#fff4d4;color:#203d31;border:3px solid #172e28;padding:12px 16px;font-size:12px;font-weight:bold;z-index:5;box-shadow:5px 5px 0 #0b1c1b}.hidden{display:none!important}
@media(max-width:390px){.shell{padding-left:12px;padding-right:12px}.edition{display:none}.board{gap:3px;padding:4px}.cell{border-bottom-width:3px}.scoreboard{gap:5px}.stat{padding:11px 7px}.stat span{font-size:8px}.next-piece{width:37px;height:37px}.next-piece img{width:33px;height:33px}}

/* Ágora Pixel Brew: tactile café palette and original PNG artwork. */
html {background:#20130f}
body {background:radial-gradient(circle at 50% 0%,#463025 0%,#20130f 55%);}
.header {border-bottom-color:#79513b}
.brand {min-width:0}
.logo {background:#492e1e;border:2px solid #e4ad71;box-shadow:3px 3px 0 #130b09;flex-shrink:0}
.logo img {width:42px;height:42px;object-fit:contain;image-rendering:pixelated}
.edition {color:#cba381}
.welcome {display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:177px}
.welcome-copy {flex:1;min-width:0}
.welcome h2 {font-family:Georgia,serif}
.welcome h2 em {color:#eda75d}
.welcome p {max-width:385px}
.hero-art {width:min(29%,150px);height:auto;max-height:166px;object-fit:contain;image-rendering:pixelated;filter:drop-shadow(5px 7px 0 #170d09)}
.mode {border-color:#815940}
.mode.active {background:#e9b574;color:#261710;border-color:#e9b574;box-shadow:0 4px 0 #8d5637}
.primary {background:#e9b574;color:#28190f}
.join-line input {background:#271811}
.room-panel,.stat {background:#38251b}
.next-piece {border-color:#986845;background:#b88b65}
.play-area {background:#473024;border-color:#a8704d;box-shadow:6px 6px 0 #140b07}
.board {background:#7d533a;border-color:#b68156;gap:4px;padding:6px}
.cell,.cell:nth-child(3n+2),.cell.filled {background:#b88154 url('/static/assets/sprites/madera-tablero-128.png') center/cover;border-bottom:3px solid #58331f}
.cell:not(.filled):not(:disabled):active {filter:brightness(1.25)}
.cell img {width:90%;height:90%;object-fit:contain;image-rendering:pixelated;filter:drop-shadow(0 2px 0 #40251c66)}
.cell .hover-mark {color:#fae0a4;opacity:.4}
.board-header .turn-indicator {background:#704731;color:#ffe0a8}
.restart {border-color:#b17a50;color:#f3bf80}
.evo-art {background:#483125;border-color:#79513b;min-height:50px}
.evo-art img {width:40px;height:40px;object-fit:contain}
.evo-tile small {color:#e0bd9b}
.evolution {border-top-color:#79513b}
.collectibles {margin-top:30px;padding-top:22px;border-top:1px solid var(--line)}
.collectible-row {display:flex;justify-content:space-around;gap:6px;padding:14px 9px;margin:14px 0;background:#362219;border:1px solid #79513b}
.collectible-row img {width:min(17%,66px);aspect-ratio:1;object-fit:contain;image-rendering:pixelated}
.collectibles p {font-size:11px;color:var(--muted);margin:7px 0 14px}
.gallery-link {display:inline-block;background:#e6ae70;color:#25150d;padding:12px 14px;text-decoration:none;font-size:11px;font-weight:800}
footer {color:#b48c6d}
@media (max-width:420px){.hero-art{width:27%}.welcome{min-height:160px}.welcome h2{font-size:clamp(30px,8.3vw,45px)}.evo-art img{width:32px;height:32px}.evo-title{font-size:10px}.evo-tile small{font-size:7px}}

/* v1.1 — Reduce visual noise: empty slots are quiet; occupied slots have no wood texture. */
.board {background:#80543e;border-color:#ac7953;gap:5px;padding:6px}
.cell,.cell:nth-child(3n+2) {
  background:#654535;
  border:1px solid #845c44;
  border-bottom:2px solid #45291f;
  box-shadow:inset 0 1px 0 #966d4a55;
}
.cell.filled,.cell:nth-child(3n+2).filled {
  background:#3e2b24;
  border:1px solid #704833;
  border-bottom:2px solid #251713;
  box-shadow:inset 0 1px 5px #1c110d66;
}
@media (hover:hover) and (pointer:fine) {.cell:not(.filled):not(:disabled):hover {background:#856148;outline:1px solid #d69a60;outline-offset:-2px}}
.cell:not(.filled):not(:disabled):active {background:#987052;filter:none}
.cell img {width:85%;height:85%;filter:none;z-index:1}
.special-guide {display:flex;gap:10px;align-items:center;padding:9px 10px;margin:12px 0 2px;border:1px solid #6a4936;background:#34231b;color:#eed4b6;font-size:10px;line-height:1.5}
.special-guide img {width:38px;height:38px;flex:0 0 38px;image-rendering:pixelated}
.special-guide strong {color:#ffcf76}
@media (max-width:420px) {
  .board{gap:3px;padding:4px}
  .special-guide{font-size:9px}
}

/* v1.4 — La variante especial (4+) cambia solo el sprite, sin marco ni fondo adicional. */
.cell.fused img {animation:fusion-appear 240ms ease-out}
@keyframes fusion-appear {from {transform:scale(.88)} to {transform:scale(1)}}
@media(prefers-reduced-motion:reduce){.cell.fused img{animation:none}}
.variant-toggle{display:flex;align-items:center;gap:5px;margin:14px 0 4px}
.variant-toggle button{padding:7px 12px;background:#39251b;border:1px solid #906043;color:#d8ad88;letter-spacing:.7px;font:700 10px ui-monospace,monospace;cursor:pointer}
.variant-toggle button.selected{background:#b47a46;border-color:#e6ad6a;color:#1b120d;box-shadow:inset 0 0 0 1px #f1c78b}
.variant-toggle button:focus-visible{outline:2px solid #f9cf82;outline-offset:3px}

/* Phoenix LiveView edition: retain the 1.4 palette and minimal tile backgrounds. */
.mode {display:flex;align-items:center;justify-content:center;text-decoration:none}
.button-link {display:inline-flex;margin-top:9px;text-decoration:none;align-items:center;justify-content:center}
.room-status {font-size:10px;line-height:1.6;color:var(--muted);margin:10px 0 0}
.room-panel p:first-child {font-size:12px;line-height:1.6}
.join-line {margin:0}
.play-area {isolation:isolate}
.cell,.cell:nth-child(3n+2) {background:#654535;background-image:none}
.cell.filled,.cell:nth-child(3n+2).filled {background:#3e2b24;background-image:none}
.cell.fused {outline:0;box-shadow:inset 0 1px 5px #1c110d66}
.cell.fused img {animation:fusion-appear 240ms ease-out}
@media(max-width:380px) {
 .mode{font-size:9px}
 .room-active strong{font-size:21px}
 .board-title{font-size:10px}
 .board-foot{font-size:8px}
}
