:root{--bg:#f8f6ef;--ink:#253d35;--muted:#5c675a;--green:#2d5548;--line:#dedfd2;--yellow:#f0c853;--pink:#e5a995;--blue:#b6cbd3}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:Arial,'Hiragino Kaku Gothic ProN','Noto Sans JP',sans-serif;font-size:15px}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer}a{color:inherit;text-decoration:none}button:focus-visible,a:focus-visible{outline:3px solid #d48037;outline-offset:4px}header{max-width:1180px;margin:auto;display:flex;align-items:center;justify-content:space-between;padding:28px 32px;border-bottom:1px solid var(--line)}.brand{font-weight:800;font-size:21px;display:flex;align-items:center;gap:10px;letter-spacing:.03em}.brand-mark{background:var(--green);color:var(--bg);width:37px;height:37px;border-radius:12px;display:grid;place-items:center;font-size:28px}.brand-en{font-size:10px;letter-spacing:.12em;font-weight:500;margin-left:12px;color:var(--muted)}.header-link{font-size:12px}.header-link span{margin-left:16px;font-size:20px}main{max-width:1180px;padding:0 32px;margin:auto;min-height:75vh}.hero{display:grid;grid-template-columns:1.12fr 1fr;align-items:center;gap:50px;padding:64px 0 52px}.eyebrow{font-size:11px;letter-spacing:.18em;display:flex;align-items:center;gap:10px;font-weight:700}.eyebrow:before{content:'';width:7px;height:7px;background:#c78d52;border-radius:50%}h1{font-size:clamp(34px,4.2vw,54px);font-weight:800;letter-spacing:.02em;line-height:1.5;margin:20px 0}h1 em{font-style:normal;background:linear-gradient(transparent 64%,#e8cf7f 64%,#e8cf7f 88%,transparent 88%)}.hero p{color:var(--muted);line-height:2;font-size:14px;margin:20px 0}.pills{display:flex;gap:8px;margin-top:26px;flex-wrap:wrap}.pill{border:1px solid var(--line);border-radius:20px;padding:7px 12px;font-size:11px;color:#5c685b}.hero-art{height:316px;border-radius:46% 46% 20% 20%;background:#e8eadc;position:relative;display:grid;place-items:center;overflow:hidden}.art-grid{display:grid;grid-template-columns:repeat(2,88px);gap:10px;transform:rotate(-9deg);background:#faf9f2;padding:15px;border-radius:20px;box-shadow:10px 13px 0 #c9cfb9}.art-grid span{height:88px;display:grid;place-items:center;font-size:33px;border-radius:12px;background:#e4b39b;font-weight:800}.art-grid span:nth-child(2){background:#f1d065}.art-grid span:nth-child(3){background:#c2d3d7}.art-grid span:nth-child(4){background:#3a6051;color:#fff}.spark{position:absolute;font-size:55px;left:33px;top:28px;color:#a6b597}.art-tag{position:absolute;bottom:21px;right:13px;background:#fffdf6;border:1px solid #d7dacc;transform:rotate(7deg);padding:12px 17px;border-radius:6px;font-size:12px;box-shadow:2px 4px 0 #d4d8c5}.collection-head{display:flex;align-items:end;justify-content:space-between;margin:20px 0 23px}.section-title{font-size:22px;margin:0}.section-title span{font-size:11px;color:var(--muted);margin-left:14px;font-weight:400}.collection-head p{font-size:11px;color:var(--muted);margin:0}.cards{display:grid;grid-template-columns:repeat(3,1fr);gap:20px}.card{border:1px solid var(--line);border-radius:18px;padding:13px;background:#fffdf7;transition:transform .18s,box-shadow .18s}.card:hover{transform:translateY(-4px);box-shadow:0 8px 20px #3445320c}.card-art{height:176px;border-radius:10px;display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden}.card-art.merge{background:#eee1b7}.card-art.memory{background:#e6d5cb}.card-art.mines{background:#dbe3df}.mini-tiles{display:flex;gap:8px;transform:rotate(-9deg)}.mini-tiles b{width:64px;height:64px;display:grid;place-items:center;border-radius:9px;font-size:28px;background:#fff9e8;color:#745b27;box-shadow:0 4px #c4ac73}.mini-tiles b:nth-child(2){background:#e8b74e;transform:translateY(-15px)}.mini-tiles b:nth-child(3){background:#d6874d;color:white}.pair-demo{display:flex;gap:12px;transform:rotate(8deg)}.pair-demo b{display:grid;place-items:center;width:70px;height:83px;background:#fff7e9;border-radius:9px;font-size:35px;color:#b36a50;box-shadow:0 5px #c9aa98}.pair-demo b:first-child{transform:rotate(-15deg) translateY(-8px)}.mine-demo{display:grid;grid-template-columns:repeat(3,40px);gap:5px;transform:rotate(-8deg)}.mine-demo b{height:40px;border-radius:5px;background:#7c9a8a;color:white;display:grid;place-items:center;font-size:19px}.mine-demo b:nth-child(2n){background:#f3f2df;color:#52765e}.card-copy{padding:21px 11px 10px}.card-meta{font-size:10px;letter-spacing:.1em;color:var(--muted);display:flex;justify-content:space-between}.card h3{font-size:21px;margin:11px 0 9px}.card p{font-size:12px;line-height:1.8;color:var(--muted);min-height:44px;margin-bottom:18px}.card-bottom{border-top:1px solid var(--line);padding-top:16px;display:flex;justify-content:space-between;align-items:center;font-size:12px;font-weight:700}.round-arrow{height:29px;width:29px;border-radius:50%;background:var(--green);color:white;display:grid;place-items:center}.note{margin:30px 0 44px;color:var(--muted);font-size:11px;display:flex;gap:9px;align-items:center}.note i{width:6px;height:6px;background:#7f9875;border-radius:50%}footer{max-width:1116px;margin:0 auto;padding:25px 0;display:flex;align-items:center;gap:25px;border-top:1px solid var(--line);font-size:10px;color:var(--muted)}footer .small{font-size:13px;color:var(--ink)}.text-button{border:0;background:none;color:var(--muted);font-size:11px;padding:10px;margin-left:auto}.game-layout{max-width:900px;margin:35px auto 55px}.back{display:inline-block;font-size:12px;color:var(--muted);margin-bottom:27px}.game-top{display:flex;align-items:center;justify-content:space-between;gap:20px}.game-top h1{font-size:30px;line-height:1.3;margin:10px 0}.game-top p{font-size:12px;color:var(--muted)}.game-content{display:grid;grid-template-columns:minmax(0,460px) 1fr;gap:40px;margin-top:25px;align-items:start}.play-area{min-width:0}.stats{display:flex;gap:8px;margin-bottom:14px}.stat{flex:1;background:#eeeee3;border:1px solid var(--line);border-radius:10px;padding:10px 13px}.stat small{display:block;font-size:10px;color:var(--muted);margin-bottom:4px}.stat strong{font-size:22px;font-variant-numeric:tabular-nums}.board{display:grid;gap:9px;padding:12px;border-radius:17px;background:#d7dac9;aspect-ratio:1;touch-action:none;user-select:none}.merge-board{grid-template-columns:repeat(4,1fr)}.tile{background:#e6e7da;display:grid;place-items:center;border-radius:10px;font-size:clamp(24px,4vw,40px);font-weight:800;min-width:0}.tile[data-v="2"]{background:#fcf8e7;color:#7a765f}.tile[data-v="4"]{background:#f1e3ba;color:#7a683c}.tile[data-v="8"]{background:#edc665;color:#705528}.tile[data-v="16"]{background:#e8aa5d;color:#53391f}.tile[data-v="32"]{background:#d88c65;color:#482b1d}.tile[data-v="64"]{background:#be6d56;color:white}.tile.high{background:#3c6c55;color:#fff4d7;font-size:30px}.game-message{min-height:45px;line-height:1.7;font-size:12px;padding:12px 3px;color:var(--green)}.controls{display:flex;gap:8px;flex-wrap:wrap}.primary,.secondary{border-radius:9px;padding:12px 18px;border:1px solid var(--green);font-size:12px;font-weight:700}.primary{background:var(--green);color:#fff}.secondary{background:transparent;color:var(--green)}.secondary[aria-pressed="true"]{background:#e9ce7c}.howto{padding:23px;border:1px solid var(--line);border-radius:15px;background:#f0f0e6}.howto h2{font-size:15px;margin:0 0 17px}.howto p,.howto li{font-size:12px;line-height:1.95;color:#626e5c}.howto ol{padding-left:17px;margin:0}.howto .tip{margin-top:22px;padding-top:17px;border-top:1px solid var(--line)}.direction-controls{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;max-width:160px;margin:15px auto}.direction-controls button{height:35px;border:1px solid #cdd2c2;border-radius:8px;background:#eeeee3;color:var(--ink)}.direction-controls button:first-child{grid-column:2}.direction-controls button:nth-child(2){grid-column:1}.memory-board{grid-template-columns:repeat(4,1fr);gap:10px;background:#eaded4}.memory-card{border:0;border-radius:9px;background:#a76750;color:#f8e8d7;font-size:30px;box-shadow:0 3px #87513f;aspect-ratio:1;transition:transform .15s}.memory-card.face{background:#fffaf0;color:#9d573d;transform:rotate(0);box-shadow:0 3px #cbb6a7}.memory-card.matched{background:#d0ddbd;color:#496647;box-shadow:none}.mines-board{grid-template-columns:repeat(8,1fr);gap:4px;padding:9px;background:#d4ded1}.mine-cell{aspect-ratio:1;border:0;border-radius:5px;background:#7c9882;color:#fff;box-shadow:0 2px #5b7863;font-size:18px;font-weight:800;min-width:0;padding:0}.mine-cell.open{background:#f4f2e4;color:#326879;box-shadow:none}.mine-cell[data-near="2"]{color:#627d3c}.mine-cell[data-near="3"]{color:#ae6046}.mine-cell.boom{background:#d9a18b;color:#692e21}.paused{display:grid;place-items:center;background:#e2e4d6;border-radius:17px;aspect-ratio:1;color:var(--muted)}dialog{max-width:460px;width:calc(100% - 36px);padding:30px;border:1px solid var(--line);border-radius:18px;background:var(--bg);color:var(--ink)}dialog::backdrop{background:#18302777}dialog p{font-size:13px;line-height:1.9}dialog h2{font-size:20px}.close{float:right;background:none;border:0;font-size:25px}.status-label{font-size:11px;letter-spacing:.06em;color:var(--muted)}@media(max-width:760px){header{padding:20px}.brand-en{display:none}.brand{font-size:18px}.header-link{font-size:10px}main{padding:0 20px}.hero{padding:34px 0;gap:18px;grid-template-columns:1fr}.hero-art{height:210px;max-width:480px;width:100%;margin:auto;border-radius:80px 80px 35px 35px}.art-grid{grid-template-columns:repeat(2,62px);padding:12px;gap:8px}.art-grid span{height:62px;font-size:25px}.spark{font-size:40px}.hero h1{font-size:35px;margin:14px 0}.hero p{font-size:12px;margin:12px 0}.pills{margin-top:17px}.cards{grid-template-columns:1fr}.card{display:grid;grid-template-columns:110px 1fr;padding:10px;gap:10px}.card-art{height:100%;min-height:170px}.card-copy{padding:7px 6px}.card h3{font-size:18px;margin:9px 0}.card p{font-size:11px;min-height:0;margin:8px 0 12px}.mini-tiles{gap:4px;flex-direction:column;transform:rotate(-12deg)}.mini-tiles b{height:40px;width:40px;font-size:20px}.mini-tiles b:nth-child(2){transform:translateX(18px)}.pair-demo{flex-direction:column;gap:0}.pair-demo b{width:48px;height:57px;font-size:25px}.mine-demo{grid-template-columns:repeat(3,25px);gap:3px}.mine-demo b{height:25px;font-size:12px}.collection-head p{display:none}.section-title{font-size:19px}.section-title span{font-size:10px}.collection-head{margin:10px 0 18px}.note{font-size:10px;margin:23px 0 30px}footer{margin:0 20px;padding:20px 0;gap:15px;flex-wrap:wrap}footer>span{display:none}.game-content{grid-template-columns:1fr;gap:26px}.game-layout{margin-top:25px}.game-top h1{font-size:27px}.game-top{align-items:start}.game-top .status-label{display:none}.howto{padding:20px}.game-content{margin-top:20px}.board{max-width:460px;margin:auto}.stat strong{font-size:20px}.tile{font-size:30px}.tile.high{font-size:25px}.game-top p{line-height:1.7}.back{margin-bottom:17px}.mine-cell{font-size:17px}}@media(prefers-reduced-motion:reduce){*{transition:none!important}}

.language-link{margin-left:auto;margin-right:25px;font-size:12px;border:1px solid var(--line);border-radius:20px;padding:7px 12px}.mode-tabs{display:flex;gap:8px;margin:0 0 14px}.mode-tabs button{flex:1}.challenge-head{background:#ece2bd;border-radius:12px;padding:13px 16px;margin-bottom:12px;font-size:12px;line-height:1.8}.challenge-progress{height:6px;background:#ded2a5;border-radius:9px;overflow:hidden;margin-top:9px}.challenge-progress>span{display:block;height:100%;background:#41664c}.tile[data-v="-1"]{background:#8e9b8c;color:#eff0e7;font-size:28px}.challenge-day{font-size:10px;color:var(--muted)}@media(max-width:760px){.language-link{margin-right:12px;padding:6px 9px}.header-link{font-size:9px}}

@media(max-width:400px){.header-link{display:none}.language-link{margin-right:0}.brand{font-size:16px}}

.merge-board,.memory-board{grid-template-rows:repeat(4,minmax(0,1fr))}.mines-board{grid-template-rows:repeat(8,minmax(0,1fr))}

.mode-tabs a{flex:1;text-align:center}.direction-controls button{min-height:44px}.direction-controls button:disabled{opacity:.45;cursor:default}

/* Keep the goal, board and input controls together in the play viewport. */
.merge-game .play-area{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:10px;align-items:start}
.merge-game .play-area>.mode-tabs,.merge-game .play-area>.stats,.merge-game #board-wrap,.merge-game #message{grid-column:1/-1}
.merge-game #controls{grid-column:1}
.merge-game #extra{grid-column:2;align-self:center}
.merge-game .direction-controls{display:flex;gap:6px;max-width:220px;margin:0 0 0 auto}
.merge-game .direction-controls button{flex:1;min-width:40px;height:44px;padding:0}
.challenge-head{padding:8px 12px;margin-bottom:10px}
.challenge-day{font-size:11px;line-height:1.5;color:#52614d}
.challenge-progress{margin-top:6px}
@media(min-width:761px){
 body.is-playing header{padding-top:16px;padding-bottom:16px}
 .is-playing .game-layout{margin-top:16px;margin-bottom:30px}
 .is-playing .back{margin-bottom:12px}
 .is-playing .game-top h1{font-size:28px;margin:6px 0}
 .is-playing .game-top p{margin:0;line-height:1.6}
 .is-playing .game-content{margin-top:16px;gap:30px}
 .merge-game .game-content{grid-template-columns:minmax(350px,min(460px,calc(100svh - 420px))) minmax(0,1fr)}
 .merge-game .mode-tabs{margin-bottom:8px}
 .merge-game .stats{margin-bottom:10px}
 .merge-game .stat{padding:8px 12px}
 .merge-game .stat strong{font-size:20px}
 .merge-game .primary,.merge-game .secondary{padding:11px 12px;min-height:44px}
 .merge-game .game-message{padding:8px 3px;min-height:40px}
}
@media(max-width:360px){.merge-game .play-area{column-gap:6px}.merge-game #controls .secondary{padding:12px 10px}.merge-game .direction-controls{gap:4px}.merge-game .direction-controls button{min-width:36px}}

.memory-board,.mines-board{touch-action:manipulation}
@media(max-width:480px){.merge-game #controls,.merge-game #extra{grid-column:1/-1}.merge-game #extra{margin-top:10px}.merge-game .direction-controls{margin:0 auto}.merge-game .direction-controls button{min-width:44px}}

.stat{position:relative}.score-gain{display:inline-block;margin-left:8px;padding:3px 6px;border-radius:6px;background:#d8e5c8;color:#2d5548;font-size:13px;font-weight:700;animation:score-arrive .3s ease-out;vertical-align:middle}
@keyframes score-arrive{from{transform:translateY(4px);opacity:.3}to{transform:translateY(0);opacity:1}}
.game-message.result-panel{border:1px solid #a8b8a0;border-radius:12px;padding:12px 14px;margin:8px 0 12px;background:#e8eddb;font-size:13px;font-weight:700;line-height:1.6}
.result-panel[data-outcome="lost"]{background:#f2e4ce;border-color:#ccb38c;color:#654728}.result-retry{display:block;margin-top:9px;background:#fffdf7}
.storage-unavailable{display:block!important;border:1px solid #c7a572;border-radius:9px;padding:10px 12px;color:#654728!important;background:#f6ead3;font-size:12px!important;line-height:1.7!important}
@media(prefers-reduced-motion:reduce){.score-gain{animation:none}}

.merge-game .game-top>.status-label{display:none}.merge-game .game-top>div{min-width:0}.merge-game .game-top>.mode-tabs{flex-shrink:0;margin:0}
@media(min-width:761px){
 .merge-game .game-top>.mode-tabs{min-width:260px;margin-left:12px}
 .merge-game .challenge-head{padding:0;background:none;margin-bottom:8px}
 .merge-game #controls,.merge-game #extra{grid-row:3}
 .merge-game #message{grid-row:4}
 .memory-game .game-content{grid-template-columns:minmax(350px,min(460px,calc(100svh - 420px))) minmax(0,1fr)}
}
@media(max-width:760px){.merge-game .game-top{flex-wrap:wrap;gap:12px}.merge-game .game-top>.mode-tabs{width:100%}}

/* Useful discovery content is present in the HTML, even before the app loads. */
.discovery{max-width:1052px;margin:36px auto 52px;padding:32px 0;border-top:1px solid var(--line);line-height:1.95;font-size:15px}.discovery h2{font-size:24px;line-height:1.5;margin:30px 0 14px}.discovery h3{font-size:19px;line-height:1.6;margin:0 0 12px}.discovery p{margin:12px 0;color:#43564a}.discovery a:not(.secondary){text-decoration:underline;text-underline-offset:4px}.discovery li{margin:9px 0}.discovery-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin:25px 0}.discovery-grid article{padding:24px;border:1px solid var(--line);border-radius:16px;background:#fffdf7}.discovery-grid .secondary{display:inline-block;margin-top:10px}.game-guide{max-width:900px}.worked-example{padding:20px 24px;background:#eee4bf;border-left:4px solid var(--green);border-radius:4px;margin:22px 0}.worked-example p{margin-bottom:0}.guide-links{display:flex;flex-wrap:wrap;gap:12px 22px}.host-note{font-size:13px}.share-page{border-top:1px solid var(--line);margin-top:28px;padding-top:8px}.share-page h2{font-size:19px}.share-page p{font-size:13px}.share-page input{display:block;width:100%;max-width:760px;font:inherit;font-size:13px;padding:12px;border:1px solid #7b8a7e;border-radius:6px;background:#fffdf7;color:var(--ink)}.share-page label{font-size:12px;display:block;margin:16px 0 4px}.share-page button{min-height:44px}@media(max-width:1150px){.discovery{margin-left:32px;margin-right:32px}}@media(max-width:760px){.discovery{margin:28px 20px 36px;padding-top:18px}.discovery-grid{grid-template-columns:1fr}.discovery h2{font-size:22px}.discovery-grid article{padding:20px}.game-guide{font-size:14px}.game-guide .worked-example{padding:16px 18px}}

/* Four-language navigation and text expansion, including 320px viewports. */
header{flex-wrap:wrap;gap:12px}.language-nav{display:flex;flex-wrap:wrap;gap:6px;margin-left:auto;max-width:100%;align-items:center}.language-nav .language-link{display:inline-flex;align-items:center;justify-content:center;min-height:44px;margin:0;padding:7px 10px;line-height:1.4}.language-link[aria-current="true"]{background:var(--green);color:var(--bg)}.card-meta{gap:8px;flex-wrap:wrap}.card-copy,.game-top>div,.howto{min-width:0}.game-top h1,.card h3,.game-message,.discovery h2,.discovery h3{overflow-wrap:anywhere}.mode-tabs a{min-width:0;white-space:normal}.stat{min-width:0}.stat small{overflow-wrap:anywhere}.paused{text-align:center;padding:20px}input:focus-visible{outline:3px solid #d48037;outline-offset:3px}
@media(max-width:760px){header>.brand{flex-basis:100%}.language-nav{margin-left:0;flex:1}.language-nav .language-link{font-size:11px}.collection-head .section-title span{display:block;margin:8px 0 0}.game-top h1{font-size:clamp(23px,6vw,27px)}}

/* Keep translated restart labels inside a narrow desktop play column. */
.merge-game .play-area{grid-template-columns:minmax(0,1fr) minmax(178px,1fr)}
.merge-game #controls{min-width:0}
.merge-game #controls .secondary{max-width:100%;white-space:normal;overflow-wrap:anywhere}

/* Daily sharing stays outside the compact game controls; no motion or tracking. */
#daily-summary{grid-column:1/-1;min-width:0;margin-top:12px;padding-top:12px;border-top:1px solid var(--line,#ddd)}
#daily-summary[hidden],#daily-share-fallback[hidden]{display:none}
#daily-share-summary{white-space:pre-line;font-size:14px;line-height:1.6;margin:0 0 10px}
#daily-share{min-height:44px;max-width:100%;white-space:normal;overflow-wrap:anywhere}
.daily-share-note,#daily-share-status{font-size:12px;line-height:1.6;margin:8px 0}
#daily-share-status:empty{display:none}
#daily-share-fallback{box-sizing:border-box;width:100%;min-height:140px;padding:10px;font:inherit;font-size:14px;resize:vertical}

#daily-share-fallback:focus-visible{outline:3px solid #d48037;outline-offset:3px}
