/* CLUB ADVENTURES — Explorer Memory (scoped) */
.ca-memory{--mem-green:#0d4d38;--mem-deep:#082f26;--mem-gold:#e9b84e;--mem-paper:#fff2c9;--mem-wood:#74401e;position:relative;min-height:100vh;padding:132px clamp(12px,3vw,42px) 70px;overflow:hidden;background:radial-gradient(circle at 50% 10%,rgba(78,154,91,.6),transparent 34%),linear-gradient(160deg,#163d2c,#071e19 72%);color:#35200f;font-family:Trebuchet MS,Arial,sans-serif}.ca-memory__forest{position:absolute;inset:0;pointer-events:none;opacity:.35;background:linear-gradient(rgba(6,34,25,.35),rgba(6,34,25,.8)),url('../images/club-adventures-forest-light-4k.jpg') center/cover fixed}.ca-memory button,.ca-memory a{font:inherit}.ca-memory button:focus-visible,.ca-memory a:focus-visible{outline:4px solid #fff;outline-offset:4px}.ca-memory__topline{position:relative;z-index:3;max-width:1240px;margin:0 auto 16px;display:flex;justify-content:space-between;align-items:center;gap:12px}.ca-memory__back,.ca-memory__audio{border:2px solid #d7a947;border-radius:999px;background:rgba(7,48,37,.92);color:#fff5d4;text-decoration:none;padding:10px 16px;font-weight:900;box-shadow:0 5px 14px rgba(0,0,0,.3)}.ca-memory__audio{cursor:pointer}.ca-memory__screen{position:relative;z-index:2;width:min(1180px,100%);min-height:520px;margin:auto;padding:clamp(22px,4vw,48px);text-align:center;background:linear-gradient(135deg,rgba(255,248,217,.98),rgba(241,214,155,.96));border:5px solid #815025;border-radius:28px;box-shadow:0 24px 70px rgba(0,0,0,.5),inset 0 0 0 3px #e8bf65}.ca-memory__screen[hidden]{display:none}.ca-memory__screen.is-active{animation:memEnter .28s ease-out}.ca-memory__logo{display:block;width:min(620px,88%);height:auto;max-height:390px;object-fit:contain;margin:-22px auto -25px;mix-blend-mode:multiply}.ca-memory__tagline{font-weight:1000;letter-spacing:.12em;color:#0b533d}.ca-memory__intro{font:700 clamp(1.05rem,2vw,1.35rem)/1.5 Georgia,serif}.ca-memory__actions,.ca-memory__dialog-actions{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:12px;margin-top:25px}.ca-memory__actions button,.ca-memory__dialog-actions button,.ca-memory__dialog-actions a,.ca-memory__primary,.ca-memory__text{min-height:48px;border:3px solid #73431e;border-radius:14px;padding:11px 22px;background:#fff0bd;color:#34200e;text-decoration:none;font-weight:1000;cursor:pointer;box-shadow:0 5px 0 #653616}.ca-memory__actions .ca-memory__primary,.ca-memory__primary{background:linear-gradient(#16805c,#0b563e);color:white;border-color:#063b2b;box-shadow:0 6px 0 #052d22}.ca-memory__text{display:block;margin:26px auto 0;background:transparent;box-shadow:none;border:0;color:#174f3c;text-decoration:underline}.ca-memory__eyebrow{margin:0;color:#8a511f;font-weight:1000;letter-spacing:.13em}.ca-memory h2{margin:.2em 0;color:#164b38;font:1000 clamp(2rem,5vw,3.5rem)/1 Georgia,serif}.ca-memory__choices{display:grid;gap:16px;margin:28px auto;max-width:980px}.ca-memory__collections{grid-template-columns:repeat(auto-fit,minmax(170px,1fr))}.ca-memory__difficulties{grid-template-columns:repeat(auto-fit,minmax(165px,1fr))}.ca-memory__choices button{position:relative;min-height:145px;padding:20px 14px;border:3px solid #865225;border-radius:20px;background:linear-gradient(#fff8db,#efd08e);color:#35200f;cursor:pointer;box-shadow:0 8px 0 #75421e,0 12px 18px rgba(70,38,16,.22);transition:transform .18s,filter .18s}.ca-memory__choices button:hover:not(:disabled){transform:translateY(-5px);filter:saturate(1.12)}.ca-memory__choices button>span{display:block;font-size:2.4rem}.ca-memory__choices button b,.ca-memory__choices button small{display:block}.ca-memory__choices button b{margin:8px 0 5px;text-transform:uppercase}.ca-memory__choices button:disabled{filter:grayscale(1);opacity:.52;cursor:not-allowed;box-shadow:none}.ca-memory__status{position:fixed;z-index:1200;left:50%;top:116px;transform:translateX(-50%);max-width:min(620px,92vw);margin:0;padding:0;color:white;text-align:center;font-weight:1000;pointer-events:none}.ca-memory__status:not(:empty){padding:12px 20px;border:3px solid #f8d36e;border-radius:999px;background:#0a5a41;box-shadow:0 9px 25px rgba(0,0,0,.38);animation:memToast .3s ease-out}.ca-memory__status[data-kind=discovery]{background:#7a3d8a}.ca-memory__game{width:min(1380px,100%);padding:clamp(12px,2vw,24px);background:linear-gradient(rgba(9,57,43,.94),rgba(5,34,27,.97));border-color:#d1a145}.ca-memory__hud{display:grid;grid-template-columns:1.5fr repeat(3,1fr) auto;gap:8px;align-items:stretch;margin-bottom:18px;color:#fff}.ca-memory__hud>div,.ca-memory__hud>button{display:flex;flex-direction:column;justify-content:center;min-height:60px;padding:8px 12px;border:2px solid #c69239;border-radius:13px;background:rgba(0,0,0,.24);color:#fff}.ca-memory__hud small{font-size:.68rem;letter-spacing:.1em}.ca-memory__hud strong{font-size:1.15rem}.ca-memory__hud button{cursor:pointer;font-weight:900}.ca-memory__board{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:clamp(7px,1.2vw,15px);max-width:1100px;margin:auto}.ca-memory__board.cards-24,.ca-memory__board.cards-30{grid-template-columns:repeat(6,minmax(0,1fr));max-width:1260px}.ca-memory-card{position:relative;aspect-ratio:3/4;padding:0;border:0;background:transparent;perspective:900px;cursor:pointer}.ca-memory-card__inner{position:absolute;inset:0;display:block;transform-style:preserve-3d;transition:transform .38s cubic-bezier(.2,.75,.25,1)}.ca-memory-card.is-flipped .ca-memory-card__inner,.ca-memory-card.is-matched .ca-memory-card__inner{transform:rotateY(180deg)}.ca-memory-card__front,.ca-memory-card__back{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;overflow:hidden;border:clamp(2px,.35vw,5px) solid #e7bc5a;border-radius:clamp(9px,1.2vw,18px);backface-visibility:hidden;box-shadow:0 8px 13px rgba(0,0,0,.38)}.ca-memory-card__back{background:radial-gradient(circle,#11664b 0 18%,transparent 19%),repeating-linear-gradient(90deg,#0c4838 0 8px,#0a3e31 8px 16px);color:#ffdf7b;text-shadow:0 2px 2px #000}.ca-memory-card__back i{font-size:clamp(1.6rem,4vw,3.5rem);font-style:normal}.ca-memory-card__back b{font-size:clamp(.52rem,1.25vw,.95rem);letter-spacing:.06em}.ca-memory-card__front{transform:rotateY(180deg);background:#fff0c3}.ca-memory-card__front img{width:100%;height:100%;object-fit:cover}.ca-memory-card__fallback{display:flex;flex-direction:column;gap:8px;font-size:clamp(1.2rem,3vw,2.5rem);padding:8px}.ca-memory-card__fallback b{font-size:clamp(.6rem,1.5vw,1rem)}.ca-memory-card.is-matched .ca-memory-card__front{box-shadow:0 0 0 4px #fff,0 0 26px 9px #ffe96d;animation:memMatch .55s ease}.ca-memory-card:disabled{cursor:default}.ca-memory__dialog{width:min(720px,calc(100vw - 24px));max-height:calc(100vh - 30px);overflow:auto;padding:clamp(24px,4vw,42px);border:5px solid #7c491f;border-radius:24px;background:linear-gradient(#fff7d9,#edcd88);color:#35200f;text-align:center;box-shadow:0 30px 80px rgba(0,0,0,.6)}.ca-memory__dialog::backdrop{background:rgba(3,23,18,.8);backdrop-filter:blur(5px)}.ca-memory__dialog ol{text-align:left;font-size:1.08rem;line-height:1.7}.ca-memory__close{position:absolute;right:12px;top:10px;width:44px;height:44px;border:0;background:transparent;font-size:2rem;cursor:pointer}.ca-memory__celebration{font-size:2.5rem}.ca-memory__results{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.ca-memory__results span{padding:12px 8px;border:2px solid #bf8736;border-radius:13px;background:#fff7dc}.ca-memory__results small,.ca-memory__results strong{display:block}.ca-memory__results small{font-size:.65rem}.ca-memory__results strong{font-size:1.5rem;color:#0f5a40}.ca-memory__praise{font:700 1.35rem Georgia,serif;color:#703d18}.ca-memory__discoveries>div>section{margin:28px 0;text-align:left}.ca-memory__discoveries h3{display:flex;align-items:center;gap:9px;margin-bottom:12px;color:#164b38}.ca-memory__discoveries h3 small{margin-left:auto}.ca-memory__collection-complete{padding:8px 12px;border-radius:10px;background:#e9c85b;font-weight:900;text-align:center}.ca-memory__discovery-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}.ca-memory__discovery-grid article{min-width:0;overflow:hidden;border:2px solid #9b692f;border-radius:12px;background:#fff7dc;text-align:center}.ca-memory__discovery-grid img,.ca-memory__discovery-grid article>span{display:flex;width:100%;aspect-ratio:1/1;align-items:center;justify-content:center;object-fit:cover;background:#17493a;font-size:2rem;color:#f6d268}.ca-memory__discovery-grid article.is-locked{filter:grayscale(.7);opacity:.66}.ca-memory__discovery-grid b{display:block;padding:7px 3px;font-size:clamp(.65rem,1.4vw,.9rem)}.ca-memory__counter{display:flex;flex-direction:column;gap:5px}.ca-memory__counter strong{font-size:1.35rem;color:#0d5a40}.ca-memory__counter span{font-size:.82rem}
@keyframes memEnter{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}@keyframes memToast{from{opacity:0;transform:translate(-50%,-12px)}to{opacity:1;transform:translate(-50%,0)}}@keyframes memMatch{50%{transform:scale(1.05)}}
@media(max-width:900px){.ca-memory{padding-top:105px}.ca-memory__board.cards-24,.ca-memory__board.cards-30{grid-template-columns:repeat(5,minmax(0,1fr))}.ca-memory__discovery-grid{grid-template-columns:repeat(4,1fr)}.ca-memory__status{top:84px}}
@media(max-width:620px){.ca-memory{padding:86px 7px 35px}.ca-memory__topline{padding:0 5px}.ca-memory__back,.ca-memory__audio{padding:8px 10px;font-size:.72rem}.ca-memory__screen{min-height:430px;padding:18px 10px;border-width:3px;border-radius:18px}.ca-memory__logo{width:100%;margin:-15px auto -8px}.ca-memory__tagline{font-size:.72rem}.ca-memory__intro{font-size:1rem}.ca-memory__actions{display:grid}.ca-memory__actions button{width:100%}.ca-memory__choices{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.ca-memory__choices button{min-height:120px;padding:12px 7px}.ca-memory__choices button>span{font-size:2rem}.ca-memory__choices button b{font-size:.78rem}.ca-memory__hud{grid-template-columns:repeat(3,1fr);gap:5px}.ca-memory__hud>div:first-child{grid-column:1/-1}.ca-memory__hud>button{grid-column:1/-1;min-height:38px}.ca-memory__board,.ca-memory__board.cards-24,.ca-memory__board.cards-30{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}.ca-memory__board.cards-12{grid-template-columns:repeat(3,minmax(0,1fr))}.ca-memory-card__back b{display:none}.ca-memory__results{grid-template-columns:repeat(2,1fr)}.ca-memory__discovery-grid{grid-template-columns:repeat(3,1fr)}.ca-memory__status{top:74px;font-size:.78rem}.ca-memory__dialog-actions{display:grid}.ca-memory__dialog-actions>*{width:100%}}
@media(max-width:380px){.ca-memory__board.cards-24,.ca-memory__board.cards-30{grid-template-columns:repeat(4,minmax(0,1fr))}.ca-memory__discovery-grid{grid-template-columns:repeat(2,1fr)}}
@media(orientation:landscape) and (max-height:620px){.ca-memory{padding-top:82px}.ca-memory__screen{min-height:0}.ca-memory__logo{max-height:260px;width:min(470px,65%)}.ca-memory-card{aspect-ratio:4/5}.ca-memory__board.cards-12{grid-template-columns:repeat(6,1fr)}}
@media(prefers-reduced-motion:reduce){.ca-memory *{scroll-behavior:auto!important}.ca-memory__screen.is-active,.ca-memory__status:not(:empty),.ca-memory-card.is-matched .ca-memory-card__front{animation:none!important}.ca-memory-card__inner{transition-duration:.01ms!important}}

/* v27.4 — partita realmente fullscreen e carte adattate alla viewport */
.ca-memory.is-game-active{position:fixed;z-index:100000;inset:0;width:100vw;height:100dvh;min-height:100dvh;padding:8px 12px;overflow:auto;overscroll-behavior:contain}
.ca-memory.is-game-active .ca-memory__topline{max-width:1800px;margin-bottom:8px}
.ca-memory.is-game-active .ca-memory__status{top:68px}
.ca-memory__game{width:min(1800px,100%);min-height:0;padding:clamp(10px,1.2vw,16px)}
.ca-memory__game .ca-memory__hud{margin-bottom:clamp(8px,1.2vh,14px)}
.ca-memory__game .ca-memory__hud>div,.ca-memory__game .ca-memory__hud>button{min-height:clamp(48px,6vh,60px);padding:6px 10px}
.ca-memory__board,.ca-memory__board.cards-12,.ca-memory__board.cards-24,.ca-memory__board.cards-30{grid-template-columns:repeat(var(--memory-columns,4),var(--memory-card-width,minmax(0,1fr)));justify-content:center;gap:var(--memory-gap,10px);width:100%;max-width:1760px}
.ca-memory-card{width:var(--memory-card-width,auto);max-width:100%;aspect-ratio:3/4}
@media(max-width:620px){.ca-memory.is-game-active{padding:5px}.ca-memory.is-game-active .ca-memory__topline{margin-bottom:5px}.ca-memory.is-game-active .ca-memory__status{top:58px}}

/* v27.5 — Memory locale da uno a cinque giocatori */
.ca-memory__players{grid-template-columns:repeat(5,minmax(0,1fr));max-width:1100px}
.ca-memory__players button>span{font-size:clamp(.85rem,1.5vw,1.35rem);white-space:nowrap}
.ca-memory__players button.is-selected{outline:5px solid #16805c;outline-offset:3px}
.ca-memory__turn-rule{max-width:720px;margin:18px auto;padding:10px 16px;border-radius:12px;background:#fff7d9;font-weight:900;color:#0d4d38}
.ca-memory__scores{display:flex;justify-content:center;flex-wrap:wrap;gap:7px;margin:-5px 0 10px;color:#fff}
.ca-memory__scores span{display:flex;align-items:center;gap:8px;min-width:120px;padding:6px 10px;border:2px solid var(--player-color);border-radius:999px;background:rgba(0,0,0,.3)}
.ca-memory__scores span::before{content:"";width:10px;height:10px;border-radius:50%;background:var(--player-color)}
.ca-memory__scores span.is-current{background:var(--player-color);color:#10251d;box-shadow:0 0 0 3px #fff;transform:translateY(-2px)}
.ca-memory__scores strong{margin-left:auto;font-size:1.15rem}
.ca-memory__final-scores{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:8px;margin:18px 0}
.ca-memory__final-scores span{padding:10px;border:3px solid var(--player-color);border-radius:13px;background:#fff8de}
.ca-memory__final-scores span.is-winner{background:linear-gradient(#fff5a6,#efc957);box-shadow:0 0 0 3px #fff,0 0 18px #e3ad2e}
.ca-memory__final-scores b,.ca-memory__final-scores strong{display:block}
@media(max-width:760px){.ca-memory__players{grid-template-columns:repeat(2,minmax(0,1fr))}.ca-memory__players button:last-child{grid-column:1/-1}.ca-memory__scores{gap:4px}.ca-memory__scores span{min-width:0;padding:5px 7px;font-size:.7rem}.ca-memory__scores span::before{display:none}}
