/* Memory: compact controls and readable navy-and-gold cards. */
#memory-panel .memory-heading{margin-bottom:18px;align-items:center}
.memory-heading-main{display:flex;align-items:center;gap:18px;min-width:0}
.memory-heading-icon{width:66px;height:66px;flex-shrink:0}
#memory-panel .memory-heading h1{font-size:clamp(2rem,3.6vw,2.75rem);line-height:1.15;margin:6px 0 8px}
.memory-how-to{font-size:.875rem;line-height:1.6;color:#536074;margin:0}
#memory-topic-nav{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 16px;margin-bottom:20px;border-radius:12px;background:#fff;border-color:#dfd4b8}
#memory-topic-nav .topic-index-link{margin:0;flex-shrink:0;font-size:.8125rem}
#memory-topic-nav .topic-resource-links{gap:8px;flex-wrap:wrap}
#memory-topic-nav .topic-resource-links a{min-height:40px;padding:9px 12px;font-size:.8125rem;border-radius:9px}
#memory-stage{display:flex!important;flex-direction:column!important;gap:16px!important;padding:22px!important;border:1px solid #dacda9;border-top:3px solid #d7b15a;border-radius:18px;background:#fff;box-shadow:0 8px 28px #10223d09;color:#10223d}
#memory-stage .memory-settings{display:grid;grid-template-columns:minmax(210px,280px) minmax(0,580px);justify-content:space-between;align-items:center;gap:24px;margin:0}
#memory-stage .memory-settings>label{font-size:.8125rem;font-weight:600;color:#10223d;min-width:0}
#memory-stage .memory-settings select{width:100%;max-width:100%;margin-top:9px;min-height:46px;padding:11px 12px;font-size:.875rem;color:#10223d;border:1px solid #c9cfda;border-radius:10px;background:#faf8f1}
#memory-stage .memory-difficulties.memory-scroll-grid{width:100%;max-width:580px!important;gap:12px!important;align-items:stretch!important;margin:0!important}
#memory-stage .memory-difficulties.memory-scroll-grid button.memory-difficulty-scroll{min-height:156px!important;padding:12px 10px 10px!important;border-radius:12px!important;box-shadow:0 3px 10px #10223d0a!important}
#memory-stage .difficulty-scroll-illustration{gap:6px!important}
#memory-stage .difficulty-scroll .difficulty-gem{width:28px!important;height:28px!important}
#memory-stage .difficulty-scroll-label{gap:2px!important}
#memory-stage .difficulty-scroll .difficulty-scroll-label>strong{font-size:18px!important;line-height:1.2!important}
#memory-stage .difficulty-scroll .difficulty-scroll-label>small{font-size:12px!important;line-height:1.3!important}
#memory-stage .memory-difficulty-data{flex-direction:row!important;gap:8px!important;min-height:18px!important;margin:8px 0!important}
#memory-stage .memory-difficulty-data strong{font-size:11px!important;line-height:1.4!important}
#memory-stage .memory-difficulty-scroll .difficulty-scroll-play{min-height:34px!important;padding:7px 6px!important;font-size:11px!important;line-height:1.3!important;border-radius:7px!important}
#memory-stage .memory-difficulties.memory-scroll-grid button.memory-difficulty-scroll[aria-pressed=true]{outline-width:2px!important;outline-offset:3px!important}
#memory-stage .memory-game-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;border-top:1px solid #e7e0cd;padding-top:16px}
#memory-stage .memory-status{display:flex;align-items:center;flex-wrap:wrap;gap:10px;color:#10223d;margin:0;font-size:.8125rem}
#memory-stage .memory-status>span{display:inline-flex;align-items:center;min-height:36px;padding:7px 11px;border:1px solid #e2d8bb;background:#faf6e9;border-radius:9px;box-sizing:border-box}
#memory-progress{width:94px;max-width:100%;height:8px;appearance:none;-webkit-appearance:none;border:0;border-radius:99px;background:#e6e0d0;overflow:hidden;accent-color:#ac832f}
#memory-progress::-webkit-progress-bar{background:#e6e0d0;border-radius:99px}
#memory-progress::-webkit-progress-value{background:#ac832f;border-radius:99px;transition:width .2s}
#memory-progress::-moz-progress-bar{background:#ac832f;border-radius:99px}
#memory-stage .memory-status button{margin:0;min-height:44px;padding:10px 13px;border-radius:9px;font-size:.75rem;background:#fff;color:#10223d;border-color:#cbb783}
#memory-stage .memory-topline{margin:0;gap:0}
#memory-stage .memory-tools{gap:8px}
#memory-stage .memory-tools button{width:auto;min-width:44px;min-height:44px;border-radius:9px;padding:10px 12px;background:#10223d;color:#f6dfa0;font-size:.75rem;border:1px solid #10223d}
#memory-stage .memory-tools button span{display:inline}
#memory-stage #memory-music[aria-pressed=true]{background:#d7b15a;color:#10223d;border-color:#d7b15a}
#memory-stage .memory-feedback-wrap{display:block;min-height:48px;margin:0;padding:13px 16px;background:#f4f6f9;border:1px solid #d9e0e9;border-left:3px solid #a2acba;border-radius:10px;box-sizing:border-box}
#memory-stage .memory-feedback{font-size:.875rem;line-height:1.55;color:#46546b;margin:0}
#memory-stage .memory-feedback.success{color:#256340}
#memory-stage .memory-feedback.error{color:#934050}
#memory-stage .memory-board{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:minmax(170px,auto);gap:14px;max-width:920px;width:100%;margin:0 auto;min-width:0}
#memory-stage .memory-card{position:relative;min-height:170px;padding:32px 18px 22px;box-sizing:border-box;border:1px solid #b89956;border-radius:13px;background:#10223d;color:#f5dfa2;box-shadow:0 4px 12px #10223d0c;filter:none;transition:background-color .18s,border-color .18s}
#memory-stage .memory-card:not(.is-open):not(.is-matched){border:1px solid #b89956;border-radius:13px;background:linear-gradient(145deg,#173451,#10223d);color:#f5dfa2;filter:none;box-shadow:0 4px 12px #10223d0c}
#memory-stage .memory-card:not(.is-open):not(.is-matched)::before{content:"";position:absolute;inset:7px;border:1px solid #d7b15a36;border-radius:8px;pointer-events:none}
#memory-stage .memory-card:hover:not(:disabled):not(.is-open):not(.is-matched){background:#1b3b5f;filter:none;border-color:#d7b15a}
#memory-stage .memory-card img{width:43px;height:43px;filter:none}
#memory-stage .memory-card .memory-wordmark{font-size:.625rem;letter-spacing:.16em;margin-top:9px;color:#f1d99f}
#memory-stage .memory-card .memory-number{left:13px;top:11px;display:flex;align-items:center;justify-content:center;width:22px;height:22px;border:1px solid #d7b15a55;border-radius:50%;font-size:.625rem;color:#e9d39b}
#memory-stage .memory-card.is-open,#memory-stage .memory-card.is-matched{background:#fffdf7;color:#10223d;font-family:"Public Sans",Arial,sans-serif;font-size:clamp(1rem,1.5vw,1.125rem);font-weight:600;line-height:1.5;text-align:center;overflow-wrap:break-word}
#memory-stage .memory-card.is-open .memory-number,#memory-stage .memory-card.is-matched .memory-number{color:#647189;border-color:#d5cbaa;background:#f8f4e7}
#memory-stage .memory-card.is-matched{border:2px solid #91b29d;background:#f1f7f2;color:#194c32;box-shadow:none}
#memory-stage .memory-card.is-wrong{border:2px solid #c47c87;background:#fcf1f3;color:#8b3242}
#memory-stage .memory-card .memory-check{top:11px;right:13px;width:22px;height:22px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#dcecdf;color:#226541;font-size:.8125rem}
#memory-stage .memory-clue{min-height:170px;min-width:0;border:2px solid #d7b15a!important;border-radius:13px;background:#f4ead0!important;box-shadow:none;overflow:visible}
#memory-stage .memory-clue-front,#memory-stage .memory-clue-back{border-radius:11px;min-height:170px;box-sizing:border-box;overflow:visible}
#memory-stage .memory-clue-front{background:#f4ead0!important;color:#10223d;gap:8px;padding:18px 14px}
#memory-stage .memory-clue:hover .memory-clue-front{background:#f0e1b9!important;filter:none}
#memory-stage .memory-clue-front img{width:46px;height:46px;filter:none}
#memory-stage .memory-clue-front strong{font-size:.8125rem;letter-spacing:.14em;color:#10223d}
#memory-stage .memory-clue-front small{font-size:.75rem;letter-spacing:0;color:#79612e}
#memory-stage .memory-clue-back{background:#10223d!important;color:#fff!important;padding:18px 14px!important;gap:7px;font-family:"Public Sans",Arial,sans-serif!important;font-size:.875rem!important;font-weight:600;line-height:1.45!important;overflow-wrap:break-word}
#memory-stage .memory-clue-back>span:not(.memory-clue-note){line-height:1.4}
#memory-stage .memory-clue-back b{font-size:1rem!important}
#memory-stage .memory-clue-back-label{font-size:.5625rem!important;padding:4px 8px!important;letter-spacing:.1em}
#memory-stage .memory-clue-note{font-size:.75rem!important;line-height:1.5!important;margin:3px 0 0!important;padding:9px 0 0!important;color:#dbe5f1!important;font-weight:400!important}
#memory-stage :is(.memory-card,.memory-clue,select,.memory-tools button,.memory-status button):focus-visible{outline:3px solid #a98029;outline-offset:4px}
#memory-stage:is(:fullscreen,.is-fullscreen-fallback){display:flex!important;min-height:100dvh;height:auto!important;max-height:100dvh;overflow:auto;padding:24px max(20px,calc((100vw - 1120px)/2))!important;border-radius:0;box-sizing:border-box;gap:16px!important}
#memory-stage:is(:fullscreen,.is-fullscreen-fallback) .memory-board{flex:none;max-width:1000px;min-height:0;grid-auto-rows:minmax(170px,auto)}
#memory-stage:is(:fullscreen,.is-fullscreen-fallback) .memory-card{min-height:170px;font-size:1.125rem}
@media(max-width:900px){#memory-stage .memory-settings{grid-template-columns:1fr;gap:16px}#memory-stage .memory-settings>label{max-width:none}#memory-stage .memory-difficulties.memory-scroll-grid{max-width:none!important}#memory-stage .memory-game-toolbar{align-items:start;flex-wrap:wrap}#memory-stage .memory-topline{margin-left:auto}}
@media(max-width:760px){.memory-heading-main{gap:12px}.memory-heading-icon{width:52px;height:52px}#memory-panel .memory-heading h1{font-size:1.85rem}.memory-how-to{font-size:.8125rem}#memory-topic-nav{display:grid;padding:12px;gap:10px}#memory-topic-nav .topic-resource-links{gap:6px}#memory-topic-nav .topic-resource-links a{padding:9px 10px;font-size:.75rem}#memory-stage{padding:16px!important;gap:14px!important}#memory-stage .memory-settings select{font-size:1rem}#memory-stage .memory-card{padding:32px 13px 20px}#memory-stage .memory-board{gap:10px}#memory-stage .memory-status{gap:8px}}
@media(max-width:560px){#memory-panel .memory-heading{align-items:start}#memory-panel .preview-library{display:inline-flex;font-size:.75rem;padding-top:5px}.memory-heading-main{align-items:start}.memory-heading-icon{width:42px;height:42px;margin-top:4px}#memory-panel .memory-heading h1{font-size:1.6rem}.memory-how-to{font-size:.75rem}#memory-stage .memory-difficulties.memory-scroll-grid{gap:8px!important}#memory-stage .memory-difficulties.memory-scroll-grid button.memory-difficulty-scroll{padding:11px 5px 8px!important;min-height:154px!important}#memory-stage .difficulty-scroll .difficulty-scroll-label>strong{font-size:16px!important}#memory-stage .difficulty-scroll .difficulty-scroll-label>small{font-size:11px!important}#memory-stage .memory-difficulty-data{flex-direction:column!important;gap:2px!important;margin:6px 0!important}#memory-stage .memory-difficulty-data strong{font-size:10px!important}#memory-stage .memory-board{grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(145px,auto)}#memory-stage .memory-card{min-height:145px;font-size:1rem;padding:32px 12px 20px}#memory-stage .memory-clue{grid-column:1/-1;min-height:138px}#memory-stage .memory-clue-front,#memory-stage .memory-clue-back{min-height:138px}#memory-stage .memory-clue-front{gap:6px;padding:14px}#memory-stage .memory-clue-front img{width:38px;height:38px}#memory-stage .memory-clue-back{padding:16px!important;gap:6px;font-size:.875rem!important}#memory-stage .memory-clue-note{font-size:.75rem!important}#memory-progress{width:70px}#memory-stage .memory-status>span{font-size:.75rem;padding:7px 9px}#memory-stage .memory-game-toolbar{gap:10px}#memory-stage .memory-tools button{padding:10px 11px}#memory-stage .memory-topline{margin-left:0}#memory-stage .memory-feedback-wrap{padding:11px 12px}#memory-stage .memory-feedback{font-size:.8125rem}}
@media(prefers-reduced-motion:reduce){#memory-stage .memory-card,#memory-progress::-webkit-progress-value{transition:none}}
