/* Illustrated spaces, readable cards and a calm, persistent game surface. */
body[data-game=memory]{background:#f8f3e9;color:#314f48}
body[data-game=memory] main{max-width:1190px;padding:12px 24px 30px;padding-top:10px!important}
body[data-game=memory] .quality-toolbar{margin:0 0 7px}.quality-label{letter-spacing:.1em}
.memory-header{margin:0 0 16px;gap:18px}.memory-header h1{font-size:clamp(25px,3vw,32px)!important;font-family:'Yu Mincho','Georgia',serif;margin:3px 0}.memory-header p{font-size:13px;margin:4px 0;color:#63796e}
.memory-top-controls button{background:#fffdf7;border-color:#d7dfcf;font-size:12px!important;min-height:43px}
.memory-worlds h2{margin:7px 0;font-weight:700;letter-spacing:.07em}
.memory-theme-tabs{gap:11px}.memory-theme-tabs button{position:relative;overflow:hidden;display:grid;grid-template-columns:92px 1fr;grid-template-rows:1fr 1fr;text-align:left;gap:0 12px;border:1px solid #d5ddce!important;border-radius:16px;padding:0 12px 0 0!important;min-height:70px;background:#fffdf7!important}
.memory-theme-tabs img{grid-row:1/3;width:92px;height:70px;object-fit:cover;pointer-events:none}.memory-theme-tabs span{align-self:end;font-size:13px;line-height:1.4;padding-bottom:3px}.memory-theme-tabs small{font-size:11px;color:#718375;align-self:start}
.memory-theme-tabs button[aria-pressed=true]{border:2px solid #6a927b!important;box-shadow:0 0 0 2px #dce8d6;padding:0 11px 0 0!important;background:#edf3e5!important}.memory-theme-tabs button[aria-pressed=true] img{height:68px;width:91px}
.memory-difficulty{margin:14px 0}.memory-difficulty>span{font-weight:700}.memory-difficulty button{min-height:38px!important;background:#fffdf7}
.memory-play-layout{grid-template-columns:minmax(0,1fr) 236px;gap:18px}
.memory-table{position:relative;isolation:isolate;overflow:hidden;border:1px solid #d0d9c8;border-radius:24px;padding:0;background:#d8dec5;box-shadow:0 12px 32px #324d4115}
.memory-scene-art{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:-2;pointer-events:none}.memory-table:before{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(180deg,#f8f2e5cb,transparent 21%,#fffdf328)}
.memory-scene-heading{padding:18px 22px 12px;min-height:88px}.memory-scene-heading>span{font-size:9px;letter-spacing:.16em;color:#58745f;display:block;font-weight:700}.memory-scene-heading h2{font-family:'Yu Mincho','Georgia',serif;font-size:19px;margin:6px 0;color:#365441;text-shadow:0 1px #fffdf8}
.memory-game-surface{position:relative;border:1px solid #fff7e7e6;border-radius:19px;background:#fffbeddd;box-shadow:0 10px 25px #3b452c25;margin:0 18px 18px;padding:15px 18px 17px;backdrop-filter:blur(3px)}
.memory-status{font-size:13px;min-height:32px;gap:9px}.memory-status strong{font-size:12px;padding:4px 9px;border:1px solid #dce3cf}
.memory-game-surface>progress{appearance:none;display:block;width:100%;height:6px;border:0;background:#dfe5d2;border-radius:9px;overflow:hidden;margin:9px 0 15px}.memory-game-surface>progress::-webkit-progress-bar{background:#dfe5d2}.memory-game-surface>progress::-webkit-progress-value{background:#779e73;border-radius:9px}
.board{max-width:630px!important;margin:auto!important;gap:12px}.memory-card{aspect-ratio:1.15!important;max-height:176px}
.card-back,.card-front{border-radius:16px;border-width:3px}.card-back{background:#46694f;display:block}.card-back:before{inset:6px;border-radius:10px;border-color:#efefd5b0;z-index:2;pointer-events:none}
.card-back>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.card-back:after{display:none}.card-number{z-index:3;background:#fffbeded;color:#41624c;border:1px solid #d9dbba;left:8px;top:7px;border-radius:50%;height:21px;width:21px;display:grid;place-items:center;font-size:10px;opacity:1}
.card-front{padding:6px;background:radial-gradient(ellipse,#f4f1df,#fffdf6 76%)}.card-front img{height:78%;width:89%}.card-name{font-size:12px}.card-front .pair-check{background:#5f946a}
body[data-memory-back=sea]{--back-tone:#82c9d3}body[data-memory-back=berry]{--back-tone:#ecc2d2}body[data-memory-back=gold]{--back-tone:#ecd790}
body[data-memory-back=sea] .card-back{background:#396d80}body[data-memory-back=berry] .card-back{background:#8e5167}body[data-memory-back=gold] .card-back{background:#967336}
.memory-play-controls{margin-top:15px;gap:8px}.memory-play-controls button{min-height:43px;font-size:12px!important;border-color:#b9ceb4;background:#f9fff0}.memory-play-controls #nextPair{background:#5d8069;color:#fff}
.memory-sidebar{gap:12px}.memory-panel{background:#fffdf7;border:1px solid #dbe0d1;padding:16px;border-radius:19px}.memory-panel h2{font-size:13px}.memory-panel p{font-size:11px;margin:8px 0 0;line-height:1.75}.turn-panel{padding:14px 15px;text-align:left;display:grid;grid-template-columns:38px 1fr;gap:5px 9px}.turn-panel #turnBadge{height:36px;width:36px;font-size:17px;grid-row:1/3;border-width:2px}.turn-panel>strong{margin:0;font-size:12px;line-height:1.6}.turn-panel p{grid-column:2;margin:0;font-size:10px}
.pair-gallery{gap:7px}.pair-gallery>button{display:grid;place-items:center;min-width:0!important;padding:3px!important;background:#f2f5e6!important;border:1px solid #d6e0c6!important;aspect-ratio:1;min-height:0!important;border-radius:11px!important}.pair-gallery>button img{width:100%;height:100%;object-fit:contain}.pair-gallery>span{background:#f1f1e5;border-style:dashed}.empty-pair>span{width:17px;height:17px;border-radius:50%;border:1px solid #c9d5b9;background:#e2e9d6}
.journey-invitation{background:linear-gradient(135deg,#f3efdc,#fffdf7);border-color:#ddd3b4}.journey-invitation>span{font-size:9px;letter-spacing:.12em;font-weight:700;color:#8d7c51}.journey-invitation h2{font-size:13px;line-height:1.6;margin:7px 0}.journey-invitation progress{width:100%;height:7px;accent-color:#a69158}.journey-invitation button{margin-top:12px;width:100%;min-height:42px!important;font-size:12px!important;background:#577f65!important;color:#fff!important}
.memory-win{padding:17px;margin-top:16px;border-width:1px;background:linear-gradient(135deg,#fff7d7,#e6efd8);position:relative}.memory-win h2{font-size:21px;margin:7px 0}.memory-win button{margin:3px;min-height:44px!important;font-size:12px!important}.memory-win #winJourney{background:#9b7741!important}.win-seal{display:grid;place-items:center;width:36px;height:36px;margin:auto;border-radius:50%;color:#fff;background:#88a56c;border:3px double #fff5d2;font-size:17px;box-shadow:0 0 0 3px #d0d7b3}
.memory-book{background:#fffdf6;padding:18px 22px;box-shadow:0 5px 14px #45533807}.memory-book summary{font-size:15px;line-height:1.7}.memory-book>p{font-size:12px;line-height:1.8}.memory-book summary strong{font-size:12px}.memory-collection-row{gap:12px}.collection-card{min-height:112px!important;font-size:12px!important;border-radius:15px!important;min-width:0;padding:8px!important}.collection-card.earned:hover{border-color:#b59761;background:#f8f2db!important}.collection-card img,.collection-card .unknown{height:78px;width:90%;max-width:100px}.collection-card .unknown{font-family:Georgia,serif;background:radial-gradient(ellipse,#e7edda,transparent);color:#bcc7a9}.memory-book h3{color:#57725b}
.journey-pages{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:19px}.journey-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.journey-card{min-width:0;padding:7px!important;display:flex;flex-direction:column;gap:5px;align-items:center;background:#f8f6e9!important;font-size:11px!important}.journey-card img,.empty-stamp{width:100%;aspect-ratio:1.2;height:auto;object-fit:cover;border-radius:8px}.journey-card small{font-size:10px;color:#7c8c70}.journey-card.earned{background:#f3edce!important;border-color:#c1b06e!important}.journey-card.earned small{color:#7c6a38}.empty-stamp{display:block;position:relative;border:1px dashed #cbd5bc;background:radial-gradient(ellipse,#eceddc,transparent)}.empty-stamp:before{content:'';position:absolute;inset:20%;border:3px double #d2dbc1;border-radius:50%}
.card-back-choices{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px;max-width:680px}.back-choice{min-width:0;display:flex;align-items:center;flex-direction:column;gap:7px;padding:10px!important;line-height:1.6;font-size:12px!important}.back-choice small{font-size:10px;color:#7f8b6d}.back-choice[aria-pressed=true]{border:2px solid #728e67!important;box-shadow:0 0 0 2px #e0e8d3}.back-preview{display:block;width:80%;aspect-ratio:.9;position:relative;border-radius:10px;overflow:hidden;background:#c2d9b6;border:2px solid #eee1b5}.back-preview img{width:100%;height:100%;object-fit:cover}.back-preview:after{content:'';position:absolute;inset:0;mix-blend-mode:multiply;opacity:.65;background:#bad8b7}.sea .back-preview:after{background:#82c9d3}.berry .back-preview:after{background:#ecc2d2}.gold .back-preview:after{background:#ecd790}.back-preview.locked{background:#eef0e0;display:grid;place-items:center;font-family:Georgia,serif;font-size:35px;color:#b3bd9f;border-style:dashed}.back-preview.locked:after{display:none}.back-choice:disabled{background:#f7f7ed!important;cursor:default}
.memory-observation{max-width:460px;width:calc(100% - 28px);border:1px solid #d5dcc8;border-radius:25px;padding:20px 24px 24px;background:#fffaf0;color:#3c594a;text-align:center;box-shadow:0 25px 100px #263e4d60}.memory-observation::backdrop{background:#173a4070;backdrop-filter:blur(6px)}.detail-close{min-height:45px!important;font-size:12px!important;margin:0 0 12px!important;background:#e6eddb!important}.observation-picture{height:245px;border-radius:19px;background:radial-gradient(ellipse,#e9eedb,#fff9ed 75%);padding:12px}.observation-picture img{width:100%;height:100%;object-fit:contain}.memory-observation h2{font-family:'Yu Mincho','Georgia',serif;margin:15px 0 5px;font-size:24px}.memory-observation p{font-size:13px;line-height:1.8}.memory-observation #detailFact{font-size:11px;color:#7f8d72}
.back-preview:after{display:none}
.journey-invitation progress{appearance:none;border:0;border-radius:8px;overflow:hidden;background:#e6dfc8;height:8px}.journey-invitation progress::-webkit-progress-bar{background:#e6dfc8}.journey-invitation progress::-webkit-progress-value{background:linear-gradient(90deg,#c5a95e,#af8640);border-radius:8px}
@media(min-width:901px){.memory-game-surface{margin-right:156px}}
@media(max-width:900px){.memory-play-layout{grid-template-columns:minmax(0,1fr) 205px}.memory-scene-heading{padding:16px 16px 11px}.memory-game-surface{margin:0 12px 12px;padding:13px}.card-name{font-size:11px}.memory-theme-tabs button{grid-template-columns:70px 1fr;gap:0 8px}.memory-theme-tabs img{width:70px}.memory-theme-tabs button[aria-pressed=true] img{width:69px}.memory-theme-tabs span{font-size:11px}.memory-theme-tabs small{font-size:10px}.journey-pages{gap:12px}}
@media(max-width:760px){body[data-game=memory] main{padding:10px 12px 28px}.memory-play-layout{grid-template-columns:1fr}.memory-sidebar{grid-template-columns:1fr 1fr;align-items:start}.journey-invitation{grid-column:1/3;display:grid;grid-template-columns:1fr 150px;gap:0 12px}.journey-invitation>span,.journey-invitation h2,.journey-invitation progress,.journey-invitation p{grid-column:1}.journey-invitation button{grid-column:2;grid-row:1/5;align-self:center;margin:0}.pair-gallery{grid-template-columns:repeat(3,1fr)}.pair-gallery>button,.pair-gallery>span{max-height:55px}.memory-scene-heading h2{font-size:18px}.memory-collection-row{grid-template-columns:repeat(6,minmax(0,1fr));gap:6px}.collection-card{font-size:10px!important;min-height:96px!important}.collection-card img,.collection-card .unknown{height:62px}.journey-pages{grid-template-columns:1fr}.journey-row{max-width:460px}.journey-card img,.empty-stamp{aspect-ratio:1.7}.memory-worlds{margin-top:7px}.memory-header{margin-bottom:10px}.memory-top-controls{flex-direction:row}.board{max-width:630px!important}}
@media(max-width:500px){body[data-game=memory] main{padding-left:10px;padding-right:10px}.memory-header{display:flex;align-items:start;gap:7px}.memory-header h1{font-size:23px!important}.memory-header p{font-size:11px;max-width:250px;line-height:1.6}.memory-top-controls{flex-direction:column;margin-top:2px;gap:5px}.memory-top-controls button{padding:7px 9px!important;font-size:10px!important;min-height:37px!important}.memory-theme-tabs{gap:6px}.memory-theme-tabs button{display:flex;flex-direction:column;align-items:stretch;gap:0;padding:0 0 7px!important;border-radius:13px}.memory-theme-tabs button[aria-pressed=true]{padding:0 0 6px!important}.memory-theme-tabs img,.memory-theme-tabs button[aria-pressed=true] img{width:100%;height:49px}.memory-theme-tabs span{font-size:10px;align-self:center;padding:6px 3px 2px;text-align:center;min-height:21px}.memory-theme-tabs small{font-size:8px;text-align:center}.memory-difficulty{margin:11px 0;gap:5px}.memory-difficulty>span{font-size:10px}.memory-difficulty button{min-width:55px!important;padding:7px 9px!important;min-height:34px!important;font-size:11px!important}.memory-difficulty>div{gap:5px}.memory-scene-heading{padding:12px 13px 11px;min-height:72px}.memory-scene-heading>span{font-size:8px}.memory-scene-heading h2{font-size:15px}.memory-game-surface{margin:0 9px 9px;padding:11px 9px;border-radius:15px}.memory-status{font-size:11px;min-height:39px}.memory-status strong{font-size:10px;padding:4px 6px}.memory-game-surface>progress{margin:7px 0 12px}.board{gap:8px}.memory-card{aspect-ratio:.99!important}.card-name{font-size:11px}.board[data-pairs="4"] .card-name,.board[data-pairs="6"] .card-name{font-size:9px}.card-back,.card-front{border-radius:12px;border-width:2px}.card-number{height:18px;width:18px;font-size:9px;top:5px;left:5px}.memory-play-controls{margin-top:12px}.memory-play-controls button{min-width:122px!important;min-height:42px!important;font-size:11px!important}.memory-sidebar{gap:9px}.memory-panel{padding:12px}.turn-panel{grid-template-columns:29px 1fr;gap:4px 6px}.turn-panel #turnBadge{width:29px;height:29px;font-size:14px}.turn-panel>strong{font-size:10px}.turn-panel p{font-size:9px}.memory-friends-panel h2{margin-bottom:8px;font-size:11px}.memory-friends-panel p{font-size:9px}.pair-gallery{gap:4px}.pair-gallery>button,.pair-gallery>span{max-height:42px}.journey-invitation{grid-template-columns:1fr 115px}.journey-invitation h2{font-size:11px}.journey-invitation button{font-size:10px!important;padding:8px!important}.memory-book{padding:16px 13px;margin-top:18px}.memory-book summary{font-size:13px}.memory-book summary strong{font-size:11px;padding:2px 8px}.memory-collection-row{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.collection-card{font-size:11px!important;min-height:111px!important}.collection-card img,.collection-card .unknown{height:75px}.card-back-choices{gap:6px}.back-choice{padding:7px 4px!important;font-size:10px!important}.back-choice small{font-size:8px}.back-preview{width:95%;border-radius:7px}.memory-book h3{font-size:12px}.album-reset>button{font-size:11px!important;min-height:45px}.album-reset section{padding:10px}.album-reset section button{font-size:11px!important;margin:4px}.memory-observation{padding:15px 18px}.observation-picture{height:205px}.memory-observation p{font-size:12px}body[data-game=memory] footer{font-size:10px}}
@media(prefers-reduced-motion:reduce){.memory-card.last-match .card-front img{animation:none}.card-inner{transition:none}.memory-observation::backdrop{backdrop-filter:none}}
