@import url('https://fonts.googleapis.com/css2?family=Jua&family=Nunito:wght@500;600;700;800;900;1000&display=swap');

:root{font-family:'Nunito','Apple SD Gothic Neo','Malgun Gothic',sans-serif;color:#293b45;background:#f7f7ef;font-synthesis:none;--ink:#293b45;--muted:#89908d;--coral:#ff8c78;--mint:#8ed8bc;--blue:#8bbbe9;--yellow:#f4d17e;--line:#e8e9df;--board-width:286px}
*{box-sizing:border-box}body{margin:0;min-width:320px}button,a,input{-webkit-tap-highlight-color:transparent}button{font:inherit;color:inherit;cursor:pointer}button:disabled{opacity:.35;cursor:default}button:focus-visible,a:focus-visible{outline:3px solid #429580;outline-offset:4px}button{transition:transform .16s,background .16s,box-shadow .16s}button:active:not(:disabled){transform:translateY(2px)}svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.svg-definitions{position:absolute;width:0;height:0;overflow:hidden}.page-shell{max-width:1200px;margin:auto;padding:0 42px}.site-header{height:90px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--ink);font-size:29px;font-weight:900;letter-spacing:-1.8px}.brand-dot{color:var(--coral)}.brand-mark{display:grid;grid-template-columns:13px 13px;gap:3px;transform:rotate(-8deg)}.brand-mark i{height:13px;border-radius:5px;background:var(--coral)}.brand-mark i:nth-child(2){background:var(--mint)}.brand-mark i:nth-child(3){background:var(--blue)}.brand-mark i:nth-child(4){background:var(--yellow)}.header-note{font-size:12px;color:#939990;letter-spacing:.7px;margin-left:48px}.header-actions{display:flex;gap:10px}.icon-button{display:grid;place-items:center;background:transparent;border:1px solid #e1e4d9;border-radius:50%;width:38px;height:38px}.icon-button:hover{background:#ebece2}.intro{text-align:center;padding:36px 0 30px}.eyebrow{display:inline-flex;align-items:center;gap:7px;font-size:9px;letter-spacing:2px;font-weight:900;color:#658575}.eyebrow>span{height:5px;width:5px;background:#85b9a1;border-radius:50%}h1{position:relative;margin:12px 0 10px;font-size:32px;letter-spacing:-1.8px;line-height:1.4;font-weight:800}h1>span:first-child{position:relative;z-index:0}h1>span:first-child:after{content:'';position:absolute;inset:auto -3px 0;height:12px;background:#f7d784;z-index:-1;transform:rotate(-2deg);border-radius:4px}.title-spark{display:inline-block;color:#e7b65b;font-size:28px;margin-left:14px;vertical-align:top;transform:rotate(12deg)}.intro p{font-size:12px;color:#8b9188;margin:0;letter-spacing:.1px}.game-layout{display:grid;grid-template-columns:206px var(--board-width) 206px;gap:35px;justify-content:center;align-items:start}.left-column{padding-top:44px}.right-column{padding-top:44px}.card{background:#fffefa;border:1px solid #e8e9df;border-radius:19px}.score-card{padding:23px 23px 19px}.card-kicker{display:flex;align-items:center;gap:6px;font-size:8px;letter-spacing:1.2px;font-weight:900;color:#829486}.status-dot{width:5px;height:5px;background:#8fbc9e;border-radius:50%}.score-main h2{font-size:12px;color:#8a9289;margin:22px 0 1px;font-weight:600}.score-value{font-size:45px;font-weight:900;line-height:1.2;letter-spacing:-2px;overflow-wrap:anywhere}.score-details{margin-top:20px;display:grid;gap:14px;font-size:11px}.score-details>div{display:flex;align-items:center;justify-content:space-between}.score-details span{display:flex;align-items:center;gap:5px;color:#92988f}.score-details svg{width:13px;height:13px;color:#d6ac59}.score-details strong{font-size:12px;font-weight:900}.level-track{height:5px;background:#eef0e7;border-radius:10px;margin-top:12px;overflow:hidden}.level-track span{display:block;height:100%;width:0;background:var(--mint);transition:width .3s}.level-note{font-size:8px;color:#a4a99e;margin:9px 0 0}.tip-card{padding:24px 22px;margin-top:19px;background:#eeefe2;border-radius:18px;transform:rotate(-1.5deg)}.tiny-label{font-size:8px;letter-spacing:1.4px;font-weight:900;color:#899284}.mini-combo{display:flex;align-items:center;gap:2px;margin:17px 0 12px}.mini-blob{display:block;width:25px;height:26px;border-radius:10px;background:var(--coral);position:relative;border-bottom:3px solid #e67b67}.mini-blob:after{content:'';width:3px;height:4px;background:var(--ink);position:absolute;left:7px;top:8px;border-radius:2px;box-shadow:7px 0 var(--ink)}.mini-combo b{color:#d4ad57;font-size:23px;margin-left:5px}.tip-card h2{font-size:15px;margin:0 0 9px;letter-spacing:-.5px}.tip-card p{color:#909688;font-size:11px;line-height:1.8;margin:0}.tip-card strong{color:#6b8374;font-weight:700}.tip-divider{width:22px;border-top:1px solid #d8ddce;margin:15px 0}.session-stats{display:flex;justify-content:space-between;gap:5px;font-size:9px;color:#a1a799;margin:24px 2px}.session-stats strong{color:#7c8d7c;margin-left:5px;font-size:11px}.board-toolbar{height:44px;display:flex;align-items:center;justify-content:space-between;padding:0 5px 9px}.board-toolbar>span{display:flex;gap:7px;align-items:center;font-size:9px;letter-spacing:1.8px;font-weight:900;color:#728374}.live-dot{width:6px;height:6px;background:var(--mint);border-radius:50%;box-shadow:0 0 0 3px #e8eee3}.board-toolbar>div{display:flex;gap:7px}.small{width:28px;height:28px;border-color:#e3e5da}.small svg{width:14px;height:14px}.board-frame{padding:10px 10px 0;border:1px solid #dfe4d9;border-radius:23px;background:#fffefa;box-shadow:0 7px 0 #dbe2d7,0 14px 25px #3a4e3710;position:relative}.board-surface{position:relative;aspect-ratio:1/2;background:#edf0e8;border:1px solid #e1e7dc;border-radius:13px;overflow:hidden;touch-action:none}#game-canvas{width:100%;height:100%;display:block}.board-label{height:23px;display:flex;align-items:center;justify-content:space-between;font-size:6px;letter-spacing:1px;color:#a6aea0;padding:0 4px}.board-label>span:last-child{font-size:13px}.game-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#edf0e8a6;backdrop-filter:blur(3px);padding:18px;z-index:3}.game-overlay[hidden]{display:none}.overlay-content{text-align:center;width:100%;padding:24px 12px 21px;background:#fffef9f5;border:1px solid #fefefe;border-radius:18px;box-shadow:0 8px 32px #314b3010}.overlay-sticker{display:grid;place-items:center;width:49px;height:49px;margin:0 auto 15px;border-radius:18px;transform:rotate(-8deg);background:#f8d785;color:#6e6347;font-size:30px}.overlay-content .tiny-label{font-size:6px;letter-spacing:1px}.overlay-content h2{font-size:20px;letter-spacing:-1.1px;margin:9px 0 10px}.overlay-content p{font-size:10px;line-height:1.9;color:#93998b;margin:0 0 20px}.primary-button{border:0;background:var(--ink);color:#fffdf4;border-radius:12px;display:flex;align-items:center;justify-content:center;gap:7px;padding:14px 18px;font-size:12px;font-weight:800;box-shadow:0 3px 0 #182a31}.primary-button:hover{background:#405660}.primary-button svg{width:15px;height:15px;fill:currentColor}.overlay-content .primary-button{width:100%}.overlay-hint{display:block;margin-top:15px;font-size:8px;color:#a2a89b}.chain-toast{position:absolute;left:50%;top:32%;transform:translate(-50%,-50%) rotate(-6deg) scale(.6);opacity:0;pointer-events:none;text-align:center;z-index:2;color:#fff;filter:drop-shadow(0 3px 0 #385443);text-shadow:2px 2px 0 #385443,-2px -2px 0 #385443,2px -2px 0 #385443,-2px 2px 0 #385443;transition:opacity .15s,transform .2s;white-space:nowrap}.chain-toast.show{opacity:1;transform:translate(-50%,-50%) rotate(-6deg) scale(1)}.chain-toast strong{font-size:70px;font-weight:1000;line-height:1}.chain-toast span{display:block;font-size:20px;letter-spacing:3px;font-weight:1000}.touch-controls{display:flex;gap:6px;margin-top:20px}.control-button{min-width:0;flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;padding:9px 0 7px;background:#fffdf6;border:1px solid #dde2d6;border-bottom:3px solid #d9ded1;border-radius:10px;touch-action:none;user-select:none;-webkit-user-select:none}.control-button svg{width:19px;height:19px}.control-button span{font-size:7px;color:#8a9486}.control-button.rotate{background:#e3eddb}.control-button.drop{flex:1.25;background:#f8e7ba;border-color:#e7d6aa}.control-button:hover{filter:brightness(.97)}.board-caption{display:flex;align-items:center;justify-content:center;gap:5px;font-size:8px;color:#a7ad9f;margin:17px -12px 0}.board-caption>span{width:4px;height:4px;background:#a7b59d;border-radius:50%}.next-card{padding:21px 21px 14px}.next-card h2{font-size:12px;margin:0;display:flex;justify-content:space-between;align-items:center}.next-card h2>span{font-size:7px;letter-spacing:1.5px;color:#a0a797}.next-pairs{display:flex;justify-content:space-evenly;gap:14px;margin-top:16px}.next-pairs>div{display:flex;flex-direction:column;align-items:center;gap:6px;background:#f6f6ed;border-radius:12px;padding:8px 9px 7px}.next-pairs canvas{height:82px;width:45px;display:block}.next-pairs span{font-size:8px;color:#a8afa1;letter-spacing:1px}.next-pairs>div:nth-child(2){opacity:.66}.friends-card{padding:22px 20px 0;margin-top:19px}.friends-card h2{font-size:14px;margin:7px 0 15px;letter-spacing:-.3px}.friend-line{display:flex;gap:4px}.friend-line canvas{width:36px;height:36px;flex:1;min-width:0}.friends-card p{font-size:10px;color:#999f92;line-height:1.8;margin:12px 0 15px}.text-button{display:flex;align-items:center;gap:6px;background:none;border:0;border-top:1px solid var(--line);width:100%;font-size:10px;padding:14px 0;color:#667f6e;font-weight:700}.text-button svg{width:14px;height:14px}.text-button span{margin-left:auto}.keyboard-card{padding:25px 6px 0}.keyboard-card h2{font-size:10px;margin:0 0 15px;color:#778575;display:flex;align-items:center;justify-content:space-between}.keyboard-card h2>span{font-size:6px;letter-spacing:1px;color:#aab0a1}.keyboard-card>div{display:flex;align-items:center;justify-content:space-between;margin:8px 0;color:#9ca391;font-size:9px}.keyboard-card>div>span:last-child{display:flex;gap:3px}kbd{font-family:inherit;font-size:9px;display:inline-flex;align-items:center;justify-content:center;min-width:21px;height:20px;border:1px solid #e2e5d8;border-bottom-width:2px;border-radius:5px;background:#fafaf3;color:#879581}.space-key{padding:0 8px;font-size:7px;letter-spacing:.7px}footer{display:flex;justify-content:space-between;align-items:center;border-top:1px solid var(--line);margin-top:43px;padding:22px 0 24px;font-size:9px;color:#a9ae9f}footer>span:last-child{font-size:7px;letter-spacing:1.2px}footer b{font-size:15px;margin-left:8px;color:#b1bf9d}.modal{width:min(440px,calc(100% - 32px));border:1px solid #e3e5d9;border-radius:24px;padding:34px;background:#fffef8;color:var(--ink);box-shadow:0 20px 80px #20312430;max-height:calc(100dvh - 40px);overflow:auto}.modal::backdrop{background:#273f3e66;backdrop-filter:blur(5px)}.modal-close{position:absolute;right:15px;top:15px;width:30px;height:30px}.modal-close svg{width:16px;height:16px}.modal h2{font-size:25px;letter-spacing:-1px;margin:12px 0 18px}.how-to{padding-left:23px;margin:0}.how-to li{padding-left:5px;margin:20px 0;font-size:14px}.how-to li::marker{color:#72ad91;font-weight:900}.how-to p,.modal-intro{font-size:12px;line-height:1.8;color:#8b9689;margin:6px 0 0}.modal-note{font-size:10px;line-height:1.8;color:#929e8b;margin:20px 0}.modal>.primary-button{width:100%;margin-top:25px}.asset-slots{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-top:24px}.asset-slot{padding:7px 4px 11px;display:flex;flex-direction:column;align-items:center;gap:7px;background:#f3f5ec;border:1px dashed #d6ddcc;border-radius:14px;min-width:0}.asset-slot:hover{background:#e9efdf}.asset-slot canvas{width:100%;height:auto;aspect-ratio:1}.asset-slot span{font-size:9px;color:#7d907a}.modal-actions{display:flex;gap:10px}.modal-actions>button{flex:1;font-size:11px}.secondary-button{border:1px solid #dce3d4;background:transparent;border-radius:12px;padding:12px}.sr-only{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
@media(min-width:1100px) and (min-height:1000px){:root{--board-width:320px}.intro{padding:43px 0 36px}.game-layout{gap:42px}.score-card{padding-top:27px}.tip-card{padding-top:28px;padding-bottom:28px}}
@media(max-width:900px){.page-shell{padding:0 24px}.game-layout{grid-template-columns:170px 270px 170px;gap:20px}.score-card{padding:18px}.tip-card{padding:20px 17px}.next-card{padding:18px 14px 13px}.next-pairs{gap:6px}.friends-card{padding:20px 14px 0}.header-note{display:none}.intro{padding:28px 0 23px}h1{font-size:29px}.score-value{font-size:39px}}
@media(max-width:730px){.page-shell{max-width:500px;padding:0 18px}.site-header{height:64px}.brand{font-size:26px}.brand-mark{grid-template-columns:11px 11px;gap:2px}.brand-mark i{height:11px;border-radius:4px}.icon-button{width:34px;height:34px}.header-actions{gap:7px}.intro{padding:20px 0 13px}.intro .eyebrow{font-size:7px;letter-spacing:1.5px}h1{font-size:24px;margin:7px 0}.title-spark{font-size:22px;margin-left:8px}.intro p{font-size:10px}.game-layout{display:grid;grid-template-columns:minmax(0,1fr) 74px;gap:12px;max-width:360px;margin:0 auto}.left-column{grid-column:1/-1;padding:0}.score-card{display:flex;align-items:center;justify-content:space-between;padding:11px 17px;border-radius:13px}.card-kicker,.level-track,.level-note{display:none}.score-main{display:flex;align-items:center;gap:12px}.score-main h2{font-size:10px;margin:0}.score-value{font-size:27px;letter-spacing:-1px;line-height:1}.score-details{display:flex;gap:17px;font-size:8px;margin:0}.score-details>div{display:flex;flex-direction:column;gap:3px;align-items:flex-end}.score-details svg{width:10px;height:10px}.score-details strong{font-size:12px}.tip-card,.session-stats,.keyboard-card{display:none}.play-column{min-width:0}.board-toolbar{height:32px;padding:0 3px 7px}.board-toolbar>span{font-size:7px;letter-spacing:1.3px}.small{width:23px;height:23px}.small svg{width:12px;height:12px}.board-frame{padding:7px 7px 0;border-radius:17px;box-shadow:0 5px 0 #dbe2d7,0 10px 20px #3a4e3710}.board-surface{border-radius:10px}.board-label{height:20px;font-size:5px;letter-spacing:.5px;padding:0 2px}.board-label>span:last-child{font-size:11px}.right-column{padding-top:32px;min-width:0}.next-card{padding:12px 7px 10px;border-radius:13px}.next-card h2{font-size:9px;display:block;text-align:center}.next-card h2>span{display:block;font-size:6px;margin-top:4px}.next-pairs{flex-direction:column;gap:9px;margin-top:10px}.next-pairs>div{padding:5px 0;gap:3px;border-radius:9px}.next-pairs canvas{width:35px;height:64px}.next-pairs span{font-size:6px}.friends-card{padding:11px 5px 0;border-radius:13px;margin-top:12px}.friends-card>.tiny-label,.friends-card p{display:none}.friends-card h2{font-size:8px;text-align:center;margin:0 0 8px;letter-spacing:-.4px}.friend-line{display:grid;grid-template-columns:1fr 1fr;gap:1px}.friend-line canvas{width:100%;height:auto;aspect-ratio:1}.text-button{font-size:8px;line-height:1.6;padding:9px 0;justify-content:center;margin-top:8px;gap:2px;flex-wrap:wrap}.text-button svg{width:11px;height:11px}.text-button>span{display:none}.touch-controls{width:calc(100% + 86px);gap:7px;margin-top:16px}.control-button{padding:10px 0 8px;border-radius:11px}.control-button svg{width:21px;height:21px}.control-button span{font-size:8px}.board-caption{width:calc(100% + 86px);font-size:8px;margin:14px 0 0}.game-overlay{padding:12px}.overlay-content{padding:20px 10px 17px;border-radius:13px}.overlay-content h2{font-size:18px}.overlay-content p{font-size:9px}.overlay-content .tiny-label{font-size:5px}.overlay-sticker{width:42px;height:42px;font-size:26px;margin-bottom:11px}.primary-button{padding:12px 10px;font-size:11px}.overlay-hint{font-size:7px}.overlay-content p{margin-bottom:15px}footer{margin-top:25px;padding:19px 0;font-size:8px}footer>span:last-child{font-size:5px;letter-spacing:.7px}.modal{padding:28px 24px}.modal h2{font-size:23px}}
@media(max-width:730px) and (max-height:850px){.intro{padding:12px 0 10px}.intro .eyebrow,.intro p{display:none}h1{font-size:21px;margin:0}.title-spark{font-size:20px}.game-layout{max-width:min(360px,calc((100dvh - 255px)/2 + 102px))}.score-card{padding:9px 12px}.score-details{gap:11px}.score-value{font-size:24px}.score-main{gap:8px}.board-caption{margin-top:12px}footer{margin-top:19px;padding-top:15px}.overlay-sticker{width:34px;height:34px;font-size:23px}.overlay-content{padding:16px 7px}.overlay-content h2{font-size:16px}.overlay-content .tiny-label{display:none}.overlay-content p{font-size:8px;line-height:1.7}.touch-controls{gap:5px}.control-button{padding:8px 0 6px}}
@media(max-width:730px) and (max-height:680px){.page-shell{padding:0 14px}.site-header{height:52px}.intro{padding:8px 0}h1{font-size:18px}.game-layout{max-width:calc((100dvh - 223px)/2 + 102px);min-width:265px;gap:9px}.score-main h2{font-size:8px}.score-details{gap:8px}.score-card{padding:8px 10px}.score-value{font-size:22px}.board-caption,footer{display:none}.touch-controls{margin-top:13px;width:calc(100% + 83px)}.overlay-content h2{font-size:14px}.overlay-content p{font-size:7px}.overlay-hint{font-size:6px}.overlay-sticker{margin-bottom:9px}.next-pairs canvas{height:53px;width:29px}.friends-card{margin-top:9px}.board-label{font-size:4px}}
@media(max-height:550px) and (min-width:731px){.site-header{height:60px}.intro{padding:12px 0}.intro .eyebrow,.intro p{display:none}h1{font-size:24px;margin:0}.game-layout{grid-template-columns:180px 210px 180px}.left-column,.right-column{padding-top:32px}.board-toolbar{height:32px}.tip-card{padding:15px}.next-pairs canvas{height:70px;width:38px}.keyboard-card{display:none}footer{margin-top:25px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important;animation:none!important;scroll-behavior:auto!important}}

/* Keep the complete playing area and touch controls inside typical viewports. */
@media(min-width:731px) and (min-height:551px) and (max-height:999px){
  :root{--board-width:clamp(218px,calc((100dvh - 350px)/2),286px)}
  .site-header{height:72px}.intro{padding:20px 0 18px}
  .game-layout{grid-template-columns:206px var(--board-width) 206px}
  .overlay-content{padding:20px 10px}.overlay-content h2{font-size:18px}
}
@media(min-width:731px) and (max-width:900px) and (min-height:551px){.game-layout{grid-template-columns:170px var(--board-width) 170px}}
@media(max-width:730px) and (max-height:850px){
  .game-layout{max-width:min(360px,calc((100dvh - 340px)/2 + 102px))}
  footer{display:none}
}
@media(max-width:730px) and (max-height:680px){
  .game-layout{max-width:calc((100dvh - 290px)/2 + 99px);min-width:252px}
  .score-details{gap:7px}.score-details>div>span{font-size:7px}
  .overlay-content{padding:13px 7px}.overlay-content p{margin-bottom:10px}
}
@media(min-width:731px) and (max-height:550px){
  .site-header{height:48px}.intro{padding:7px 0}.intro h1{font-size:19px;line-height:1.3}
  .game-layout{grid-template-columns:170px clamp(140px,calc((100dvh - 140px)/2),205px) 170px;gap:30px}
  .board-toolbar{height:28px}.left-column,.right-column{padding-top:28px}
  .board-frame{padding:6px 6px 0;border-radius:14px}.board-label{height:17px;font-size:4px;letter-spacing:.3px}
  .touch-controls{position:absolute;left:-200px;top:160px;width:170px;flex-wrap:wrap;margin:0}
  .control-button{flex-basis:25%;min-height:40px;padding:5px 0}.control-button.drop{flex-basis:70%}
  .play-column{position:relative}.board-caption,.tip-card,.session-stats,footer,.friends-card p{display:none}
  .score-card{padding:14px}.score-card .card-kicker,.score-card .level-track,.score-card .level-note{display:none}.score-main h2{margin-top:0}.score-value{font-size:32px}.score-details{margin-top:12px;gap:8px}
  .next-pairs canvas{height:52px;width:29px}.next-pairs{margin-top:9px}.next-card{padding:12px}
  .friends-card{margin-top:10px;padding:10px 12px 0}.friends-card>.tiny-label{display:none}.friends-card h2{margin:0 0 7px;font-size:11px}.friend-line canvas{width:28px;height:28px}.text-button{padding:8px 0;font-size:9px}
  .overlay-content{padding:12px 7px}.overlay-content .tiny-label,.overlay-hint,.overlay-sticker{display:none}.overlay-content h2{font-size:13px}.overlay-content p{font-size:8px;margin-bottom:12px}.overlay-content .primary-button{padding:10px 5px;font-size:10px}
}
#game-canvas:focus-visible{outline:3px solid #70a48b;outline-offset:-4px}
@supports(padding:env(safe-area-inset-bottom)){.page-shell{padding-bottom:env(safe-area-inset-bottom)}}
@media(max-width:730px) and (max-height:600px){
  .site-header{height:44px}.intro{padding:5px 0}.intro h1{font-size:17px;line-height:1.25}
  .control-button{min-height:44px;padding:6px 0 4px}
}
@media(min-width:731px) and (max-height:420px){
  .game-layout{grid-template-columns:170px 132px 170px}.board-toolbar>span{font-size:6px;letter-spacing:.4px;white-space:nowrap}
  .board-toolbar>div{gap:3px}.board-toolbar .small{width:23px;height:23px}
  .overlay-content p{display:none}.overlay-content h2{font-size:11px;line-height:1.5;margin-bottom:14px}
}
@media(orientation:landscape) and (min-width:560px) and (max-width:730px) and (max-height:550px){
  .page-shell{max-width:none;padding:0 18px}.site-header{height:44px}.intro{display:none}
  .game-layout{grid-template-columns:145px minmax(130px,calc((100dvh - 115px)/2)) 145px;gap:20px;max-width:none;min-width:0;width:max-content;margin:0 auto}
  .left-column{grid-column:auto;padding-top:28px}.score-card{display:block;padding:14px}.score-main{display:block}.score-main h2{font-size:10px}.score-value{font-size:30px;margin-top:6px}
  .score-details{display:grid;margin-top:15px;gap:10px}.score-details>div{flex-direction:row;align-items:center}.score-details>div>span{font-size:9px}
  .play-column{position:relative}.board-toolbar{height:28px}.board-toolbar>span{font-size:6px;letter-spacing:.3px;white-space:nowrap}.board-toolbar>div{gap:3px}
  .board-frame{padding:6px 6px 0;border-radius:14px}.board-label{height:17px;font-size:4px;letter-spacing:.2px}
  .touch-controls{position:absolute;left:-165px;top:180px;width:145px;flex-wrap:wrap;margin:0}.control-button{flex-basis:25%;padding:5px 0;min-height:40px}.control-button.drop{flex-basis:70%}
  .right-column{padding-top:28px}.next-card{padding:12px}.next-card h2{display:flex;font-size:10px}.next-card h2>span{margin:0}.next-pairs{flex-direction:row;gap:6px}.next-pairs>div{padding:6px}.next-pairs canvas{height:55px;width:30px}
  .friends-card{padding:12px 8px 0}.friends-card h2{font-size:10px}.friend-line{display:flex}.friend-line canvas{width:29px;height:29px}.text-button{font-size:9px}
  .board-caption,.overlay-sticker,.overlay-hint{display:none}.overlay-content p{display:none}.overlay-content h2{font-size:12px;line-height:1.5;margin-bottom:15px}.game-overlay{padding:8px}.overlay-content{padding:16px 6px}.overlay-content .primary-button{font-size:10px;padding:10px 5px}
}

/* Optional play focus mode; keep the existing page layout when it is off. */
.board-toolbar > .focus-hud{display:none}
.board-toolbar .toolbar-label{min-width:0;white-space:nowrap}
.board-toolbar .focus-toggle{display:flex;align-items:center;justify-content:center;gap:4px;flex:none;width:auto;height:28px;padding:0 7px;border:1px solid #dbe2d4;border-radius:9px;background:#eaf0e2;font-size:9px;font-weight:800;white-space:nowrap}
.board-toolbar .focus-toggle svg{width:13px;height:13px;flex:none}
@media(max-width:730px),(max-height:550px){
  body:not(.play-focus) .board-toolbar > .toolbar-label{display:none}
  body:not(.play-focus) .board-toolbar > div:not(.focus-hud){width:100%;justify-content:flex-end;gap:3px}
  body:not(.play-focus) .board-toolbar .focus-toggle{height:23px;padding:0 5px;margin-left:auto;font-size:8px;border-radius:7px}
  body:not(.play-focus) .board-toolbar .focus-toggle svg{width:12px;height:12px}
}

body.play-focus{
  --focus-top:max(8px,env(safe-area-inset-top,0px));
  --focus-bottom:max(8px,env(safe-area-inset-bottom,0px));
  --focus-left:max(12px,env(safe-area-inset-left,0px));
  --focus-right:max(12px,env(safe-area-inset-right,0px));
  /* 48 toolbar + 56 controls + 16 gaps + 14 frame = 134px. */
  --focus-board-width:min(calc(100vw - var(--focus-left) - var(--focus-right) - 14px),calc((var(--play-viewport-height,100dvh) - var(--focus-top) - var(--focus-bottom) - 134px)/2));
  min-width:0;
  height:var(--play-viewport-height,100dvh);
  overflow:hidden;
  overscroll-behavior:none;
}
body.play-focus .page-shell{
  position:fixed;
  inset:0;
  z-index:10;
  display:grid;
  place-items:center;
  width:100%;
  height:var(--play-viewport-height,100dvh);
  max-width:none;
  margin:0;
  padding:var(--focus-top) var(--focus-right) var(--focus-bottom) var(--focus-left);
  overflow:hidden;
  background:#f7f7ef;
}
body.play-focus .site-header,
body.play-focus .intro,
body.play-focus footer,
body.play-focus .left-column,
body.play-focus .right-column,
body.play-focus .board-label,
body.play-focus .board-caption,
body.play-focus .board-toolbar > .toolbar-label{display:none}
body.play-focus main{width:100%;min-width:0;min-height:0}
body.play-focus .game-layout{
  display:block;
  grid-template-columns:none;
  width:min(500px,100%);
  max-width:none;
  min-width:0;
  margin:0 auto;
  gap:0;
}
body.play-focus .play-column{
  position:static;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  width:100%;
  min-width:0;
  padding:0;
  margin:0;
}
body.play-focus .board-toolbar{
  flex:none;
  width:100%;
  height:48px;
  padding:0;
  gap:8px;
}
body.play-focus .board-toolbar > .focus-hud{display:flex;align-items:center;gap:6px;flex:1;min-width:0}
body.play-focus .focus-score-block{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}
body.play-focus .focus-score-block > :first-child{font-size:9px;line-height:1.2;color:#7a8b7a;white-space:nowrap}
body.play-focus #focus-score{display:block;font-size:clamp(14px,3vw,18px);line-height:1.1;letter-spacing:-.5px;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.play-focus .focus-next-block{display:flex;flex:none;flex-direction:column;align-items:center;gap:2px;width:56px}
body.play-focus .focus-next-block > span{font-size:7px;line-height:1.2;font-weight:800;letter-spacing:.7px;color:#7a8b7a}
body.play-focus #focus-next{display:block;flex:none;width:56px;height:28px;background:#edf1e5;border-radius:8px}
body.play-focus .board-toolbar > div:not(.focus-hud){display:flex;align-items:center;justify-content:flex-end;flex:none;width:auto;gap:4px}
body.play-focus .board-toolbar .icon-button{flex:none;min-width:44px;width:44px;min-height:44px;height:44px;border-radius:12px}
body.play-focus .board-toolbar .icon-button svg{width:19px;height:19px}
body.play-focus .board-toolbar .focus-toggle{width:84px;min-width:84px;min-height:44px;height:44px;padding:0 6px;margin:0;font-size:10px;border-radius:12px}
body.play-focus .board-toolbar .focus-toggle svg{width:16px;height:16px}
body.play-focus .board-frame{
  flex:none;
  width:calc(var(--focus-board-width) + 14px);
  padding:6px;
  border:1px solid #dfe4d9;
  border-radius:16px;
  box-shadow:0 4px 0 #dbe2d7;
}
body.play-focus .board-surface{width:100%;height:auto;aspect-ratio:1/2;border:0;border-radius:10px}
body.play-focus #game-canvas{display:block;width:100%;height:100%}
body.play-focus .touch-controls{
  position:static;
  inset:auto;
  display:flex;
  flex:none;
  flex-wrap:nowrap;
  align-items:stretch;
  gap:6px;
  width:100%;
  height:56px;
  padding:0;
  margin:0;
}
body.play-focus .control-button,
body.play-focus .control-button.drop{flex:1 1 0;flex-basis:0;min-width:44px;min-height:44px;height:56px;padding:5px 0 4px;justify-content:center;gap:3px;border-radius:12px}
body.play-focus .control-button svg{width:22px;height:22px}
body.play-focus .control-button span{font-size:9px;line-height:1.2}
body.play-focus .game-overlay{padding:clamp(5px,calc(var(--focus-board-width)*.04),16px)}
body.play-focus .overlay-content{padding:clamp(8px,calc(var(--focus-board-width)*.05),22px) clamp(5px,calc(var(--focus-board-width)*.035),12px);border-radius:12px}
body.play-focus .overlay-content h2{font-size:clamp(12px,calc(var(--focus-board-width)*.065),24px);line-height:1.4;margin:4px 0 12px;letter-spacing:-.6px}
body.play-focus .overlay-content p{display:block;font-size:clamp(9px,calc(var(--focus-board-width)*.035),12px);line-height:1.7;margin:0 0 14px}
body.play-focus .overlay-content .primary-button{min-height:44px;padding:10px 5px;font-size:clamp(10px,calc(var(--focus-board-width)*.04),13px);gap:4px}
body.play-focus .overlay-content .primary-button svg{flex:none;width:13px;height:13px}
body.play-focus .overlay-sticker,
body.play-focus .overlay-hint,
body.play-focus .overlay-content .tiny-label{display:none}
@media(max-height:550px){
  body.play-focus .overlay-content p{display:none}
  body.play-focus .overlay-content h2{margin-bottom:10px}
}

/* Compact desktop boards need the whole toolbar width for the three actions. */
@media(min-width:731px) and (max-height:900px){
  body:not(.play-focus) .board-toolbar > .toolbar-label{display:none}
  body:not(.play-focus) .board-toolbar > div:not(.focus-hud){width:100%;justify-content:flex-end}
  body:not(.play-focus) .board-toolbar .focus-toggle{margin-left:auto}
}

/* In short landscape viewports, put controls beside the full-height board. */
@media(orientation:landscape) and (min-width:560px) and (max-height:550px){
  body.play-focus{
    --focus-landscape-width:min(650px,calc(100vw - var(--focus-left) - var(--focus-right)));
    /* Two 120px side columns, two 16px gaps, and 14px of board frame. */
    --focus-board-width:min(calc((var(--play-viewport-height,100dvh) - var(--focus-top) - var(--focus-bottom) - 14px)/2),calc(var(--focus-landscape-width) - 286px));
  }
  body.play-focus .game-layout{width:var(--focus-landscape-width)}
  body.play-focus .play-column{
    display:grid;
    grid-template-columns:minmax(120px,1fr) calc(var(--focus-board-width) + 14px) minmax(120px,1fr);
    align-items:center;
    gap:16px;
  }
  body.play-focus .board-toolbar{
    grid-column:1;
    grid-row:1;
    align-self:center;
    justify-self:center;
    display:flex;
    flex-direction:column;
    align-items:stretch;
    justify-content:center;
    width:min(160px,100%);
    height:auto;
    gap:16px;
  }
  body.play-focus .board-toolbar > .focus-hud{width:100%;flex:none}
  body.play-focus .board-toolbar > div:not(.focus-hud){
    display:grid;
    grid-template-columns:44px 44px;
    width:max-content;
    margin:0 auto;
    gap:8px;
  }
  body.play-focus .board-toolbar .focus-toggle{grid-column:1/-1;width:100%;min-width:0;margin:0}
  body.play-focus .board-frame{grid-column:2;grid-row:1}
  body.play-focus .touch-controls{
    grid-column:3;
    grid-row:1;
    align-self:center;
    justify-self:center;
    display:grid;
    grid-template-columns:repeat(2,minmax(44px,1fr));
    grid-auto-rows:56px;
    width:min(156px,100%);
    height:auto;
    gap:8px;
  }
  body.play-focus .control-button.drop{grid-column:1/-1}
}

/* Rounded, readable type: Nunito Latin with Jua for Korean glyphs. */
:root{font-family:'Nunito','Jua','Apple SD Gothic Neo','Malgun Gothic',sans-serif;--muted:#62725f}
body{font-size:14px;line-height:1.45}
button,select,input{font-family:inherit}
.header-note{font-size:13px;color:#667760;letter-spacing:.2px}
.eyebrow,.tiny-label{font-size:11px;line-height:1.3;letter-spacing:1.2px;color:#526f5d}
.intro p{font-size:14px;line-height:1.6;color:#5f735e}
.card-kicker{font-size:11px;line-height:1.3;letter-spacing:.5px;color:#526f5d}
.score-main h2{font-size:14px;color:#5e725d}
.score-details{font-size:13px;gap:12px}
.score-details span{color:#5e725d}
.score-details strong{font-size:15px}
.level-note{font-size:12px;line-height:1.45;color:#62735f}
.tip-card h2{font-size:18px}
.tip-card p{font-size:14px;line-height:1.7;color:#60705b}
.tip-card strong{color:#446b50}
.session-stats{font-size:12px;line-height:1.4;color:#60725b;flex-wrap:wrap;row-gap:8px}
.session-stats strong{font-size:14px;color:#3f6249}
.board-toolbar > .toolbar-label{font-size:11px;letter-spacing:.7px;color:#526f5d}
.board-label{font-size:11px;line-height:1.2;letter-spacing:.2px;color:#64765e;gap:8px}
.board-label > span:first-child{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.board-caption{font-size:12px;line-height:1.45;color:#60725b;text-align:center}
.overlay-content .tiny-label{font-size:11px;line-height:1.3;letter-spacing:.5px}
.overlay-content h2{font-size:22px;line-height:1.4}
.overlay-content p{font-size:14px;line-height:1.6;color:#60705b}
.overlay-hint{font-size:12px;line-height:1.45;color:#62735f}
.primary-button,.secondary-button{font-size:14px;line-height:1.35;min-height:44px}
.touch-controls .control-button{min-height:56px;height:56px;padding:1px 2px;gap:2px;justify-content:center}
.touch-controls .control-button svg{width:20px;height:20px;flex:none}
.touch-controls .control-button span{font-size:12px;line-height:1.1;color:#52684c;text-align:center}
.next-card h2{font-size:14px;line-height:1.35}
.next-card h2 > span,.next-pairs span{font-size:11px;line-height:1.2;letter-spacing:.4px;color:#60745b}
.friends-card h2{font-size:16px;line-height:1.4}
.friends-card p{font-size:13px;line-height:1.6;color:#62735e}
.text-button{font-size:13px;line-height:1.4;color:#466b50;min-height:44px}
.keyboard-card h2{font-size:14px;color:#526c54}
.keyboard-card h2 > span{font-size:11px;letter-spacing:.3px;color:#62745e}
.keyboard-card > div{font-size:13px;color:#5e7258;gap:8px}
kbd{font-size:12px;min-width:24px;height:25px;color:#516d51}
.space-key{font-size:11px}
footer{font-size:12px;line-height:1.45;color:#62745a}
footer > span:last-child{font-size:11px;letter-spacing:.4px}
.modal{font-size:14px;line-height:1.5;max-height:calc(var(--play-viewport-height,100dvh) - 24px)}
.modal h2{font-size:28px;line-height:1.25}
.modal .eyebrow{font-size:11px}
.modal-close{width:44px;height:44px;top:10px;right:10px;background:#f2f4e9}
.modal-close svg{width:20px;height:20px}
.how-to li{font-size:16px;line-height:1.4}
.how-to p,.modal-intro{font-size:14px;line-height:1.65;color:#5e715a}
.modal-note{font-size:13px;line-height:1.6;color:#60735a}
.asset-slot span{font-size:12px;line-height:1.3;color:#506e4f}
.asset-slots{gap:8px}
.modal-actions > button{font-size:14px}
.board-toolbar .focus-toggle{font-size:12px;line-height:1.2;min-height:28px;padding:0 7px}
.board-toolbar .focus-toggle svg{display:none}
body:not(.play-focus) #focus-ranking-button{display:none}

/* Language and ranking actions remain usable when the header wraps. */
.site-header{gap:12px}
.header-actions{align-items:center;gap:8px}
.header-actions .icon-button{flex:none;width:44px;height:44px}
#language-select{max-width:100%;min-height:44px;padding:0 8px;border:1px solid #d7dfce;border-radius:12px;background:#fffef9;color:#365640;font-size:13px;line-height:1.3;cursor:pointer}
#language-select:focus-visible,#nickname-input:focus-visible{outline:3px solid #429580;outline-offset:3px}
.ranking-open{display:flex;align-items:center;justify-content:center;gap:5px;min-height:44px;padding:0 12px;border:1px solid #ddcca4;border-radius:12px;background:#f8e8bc;color:#65532e;font-size:14px;font-weight:800;line-height:1.3;white-space:nowrap}
.ranking-open svg{width:19px;height:19px;flex:none}
.ranking-open:hover{background:#f3dda1}

/* A fixed dialog header and a scrolling table keep long rankings navigable. */
.ranking-modal{width:min(560px,calc(100% - 24px));padding:26px}
.ranking-modal[open]{display:flex;flex-direction:column;gap:12px;height:min(700px,calc(var(--play-viewport-height,100dvh) - 24px));max-height:calc(var(--play-viewport-height,100dvh) - 24px);overflow:hidden}
.ranking-modal > *{flex:none}
.ranking-modal h2{margin:0 42px 0 0;font-size:27px;line-height:1.3}
.ranking-tabs{display:flex;gap:6px;padding:4px;background:#edf1e4;border-radius:14px}
.ranking-tabs button{flex:1;min-width:0;min-height:44px;padding:8px 12px;border:0;border-radius:10px;background:transparent;color:#526d50;font-size:14px;font-weight:800;line-height:1.3}
.ranking-tabs button[aria-selected="true"],.ranking-tabs button[aria-pressed="true"],.ranking-tabs button.active{background:#fffef9;color:#304c39;box-shadow:0 2px 6px #334e3412}
.ranking-countdown{display:flex;align-items:center;justify-content:space-between;gap:8px;color:#526d50;font-size:13px;line-height:1.4}
.ranking-countdown strong{font-size:17px;line-height:1.3;letter-spacing:.5px;color:#354f3c;font-variant-numeric:tabular-nums;white-space:nowrap}
.ranking-reset-note,.ranking-status{margin:0;color:#5b7054;font-size:12px;line-height:1.5}
.ranking-status{min-height:18px}
.ranking-list{flex:1;min-height:90px;overflow:auto;overscroll-behavior:contain;width:100%;border:1px solid #dfe5d5;border-radius:14px;background:#fffef9;scrollbar-color:#becbb2 #eff3e8;scrollbar-width:thin}
.ranking-table{width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed;font-size:13px;line-height:1.4}
.ranking-table th{position:sticky;top:0;z-index:1;background:#eaf0e1;color:#4c684b;font-size:12px;font-weight:800;text-align:left}
.ranking-table th,.ranking-table td{height:46px;padding:10px 8px;vertical-align:middle;border-bottom:1px solid #e8ecdf;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ranking-table th:first-child,.ranking-table td:first-child{width:44px;text-align:center}
.ranking-table th:nth-child(3),.ranking-table td:nth-child(3){width:70px;text-align:center}
.ranking-table th:last-child,.ranking-table td:last-child{width:91px;text-align:right;font-variant-numeric:tabular-nums}
.ranking-table tbody tr:nth-child(even){background:#f5f7ed}
.ranking-table tbody tr:last-child td{border-bottom:0}
.ranking-table tbody tr.is-you,.ranking-table tbody tr[data-self="true"]{background:#e3f1dc;color:#2f5734;font-weight:800}
.ranking-you{margin:0;padding:10px 12px;border:1px solid #d5e4c9;border-radius:12px;background:#eaf3e2;color:#385d3c;font-size:13px;line-height:1.5}

#nickname-dialog{width:min(420px,calc(100% - 24px))}
#nickname-dialog h2{padding-right:30px}
#nickname-form{display:grid;gap:14px}
#nickname-form label{font-size:14px;color:#465f42}
#nickname-input{display:block;width:100%;min-width:0;min-height:48px;padding:10px 12px;border:2px solid #cbdcbd;border-radius:12px;background:#fffefb;color:#2d4435;font-size:16px;line-height:1.4}
#nickname-input::placeholder{color:#74866c;opacity:1}
.nickname-country{margin:0;padding:10px 12px;border-radius:11px;background:#edf2e5;color:#476341;font-size:14px;line-height:1.5}
.nickname-note{margin:0;color:#5d7256;font-size:13px;line-height:1.6}
#nickname-form .primary-button{width:100%;min-height:48px;margin-top:2px}

@media(max-width:730px){
  .site-header{height:auto;min-height:64px;padding:10px 0;flex-wrap:wrap;gap:8px}
  .brand{font-size:20px;gap:6px;letter-spacing:-1px}
  .brand-mark{grid-template-columns:10px 10px;gap:2px}
  .brand-mark i{height:10px}
  .header-actions{margin-left:auto;gap:6px;flex:none}
  #language-select{width:84px;padding:0 5px;font-size:12px}
  .ranking-open{padding:0 7px;font-size:12px;gap:4px;min-width:62px}
  .ranking-open svg{width:16px;height:16px}
  .intro .eyebrow{font-size:11px;letter-spacing:.8px}
  .intro p{font-size:12px}
  .score-card{padding:10px 12px;gap:10px}
  .score-main{gap:7px}
  .score-main h2{font-size:12px;line-height:1.25}
  .score-value{font-size:27px}
  .score-details{gap:12px;font-size:12px}
  .score-details > div > span{font-size:12px;line-height:1.2}
  .score-details strong{font-size:14px}
  .score-details svg{display:none}
  .next-card h2{font-size:12px;line-height:1.35;word-break:keep-all}
  .next-card h2 > span,.next-pairs span{font-size:11px;letter-spacing:0}
  .friends-card h2{font-size:12px;line-height:1.4;word-break:keep-all;letter-spacing:-.2px}
  .text-button{font-size:12px;line-height:1.35;gap:4px}
  .text-button svg{width:14px;height:14px}
  .board-label{font-size:11px}
  .board-caption{font-size:12px}
  .overlay-content .tiny-label{display:none}
  .overlay-content h2{font-size:18px;line-height:1.35}
  .overlay-content p{font-size:12px;line-height:1.5}
  .overlay-hint{font-size:12px;line-height:1.4}
  .overlay-content .primary-button{min-height:44px;font-size:13px;padding:8px 5px}
  .overlay-sticker{display:none}
  body:not(.play-focus) .board-toolbar .focus-toggle{height:28px;min-height:28px;font-size:12px;padding:0 6px}
  footer,footer > span:last-child{font-size:11px}
  .modal{padding:26px 20px}
  .modal h2{font-size:25px}
  .modal-actions{gap:8px}
  .modal-actions > button{font-size:13px;padding:10px 8px}
  .asset-slot span{font-size:12px}
  .ranking-modal{padding:20px 16px}
  .ranking-modal[open]{gap:10px}
  .ranking-modal h2{font-size:25px}
  .ranking-table{font-size:12px}
  .ranking-table th,.ranking-table td{padding:9px 5px}
  .ranking-table th:first-child,.ranking-table td:first-child{width:46px;padding-left:4px;padding-right:4px}
  .ranking-table th:nth-child(3),.ranking-table td:nth-child(3){width:56px}
  .ranking-table th:last-child,.ranking-table td:last-child{width:76px}
  .ranking-countdown{font-size:12px}
  .ranking-countdown strong{font-size:15px;letter-spacing:0}
}
@media(max-height:550px){
  body:not(.play-focus) .overlay-content .tiny-label,
  body:not(.play-focus) .overlay-hint,
  body:not(.play-focus) .overlay-sticker{display:none}
  body:not(.play-focus) .overlay-content h2{font-size:14px;line-height:1.3}
  body:not(.play-focus) .overlay-content p{display:none}
  body:not(.play-focus) .overlay-content .primary-button{min-height:44px;font-size:12px;padding:8px 3px;gap:3px}
  body:not(.play-focus) .overlay-content .primary-button svg{display:none}
  .ranking-modal[open]{gap:8px;padding-top:16px;padding-bottom:16px;overflow:auto}
  .ranking-modal h2{font-size:23px}
  .ranking-reset-note{font-size:12px;line-height:1.35}
  .ranking-list{flex:none;height:180px;min-height:180px}
}

/* Keep the focus-mode geometry while increasing all meaningful labels. */
body.play-focus .focus-score-block > :first-child{font-size:12px;line-height:1.2;color:#526d4e}
body.play-focus #focus-score{font-size:18px;line-height:1.15}
body.play-focus .focus-next-block > span{font-size:11px;line-height:1.1;color:#526d4e;letter-spacing:.3px}
body.play-focus .board-toolbar .focus-toggle{width:72px;min-width:72px;font-size:12px;line-height:1.2;padding:0 5px}
body.play-focus .board-toolbar .focus-toggle svg{display:none}
body.play-focus .control-button,
body.play-focus .control-button.drop{height:56px;min-height:56px;padding:1px 2px;gap:2px}
body.play-focus .control-button svg{width:20px;height:20px}
body.play-focus .control-button span{font-size:12px;line-height:1.1;color:#52684c}
body.play-focus .overlay-content h2{font-size:clamp(16px,calc(var(--focus-board-width)*.065),24px)}
body.play-focus .overlay-content p{font-size:14px;line-height:1.6;color:#60705b}
body.play-focus .overlay-content .primary-button{font-size:14px;min-height:44px}
@media(max-width:380px){
  body.play-focus{--focus-board-width:min(calc(100vw - var(--focus-left) - var(--focus-right) - 14px),calc((var(--play-viewport-height,100dvh) - var(--focus-top) - var(--focus-bottom) - 178px)/2))}
  body.play-focus .board-toolbar{display:flex;flex-direction:column;align-items:stretch;height:92px;gap:6px}
  body.play-focus .board-toolbar > .focus-hud{width:100%;height:42px;min-height:42px;flex:none}
  body.play-focus .board-toolbar > div:not(.focus-hud){height:44px;width:100%;justify-content:flex-end;gap:6px}
  body.play-focus .board-toolbar .focus-toggle{margin-left:auto}
}
@media(orientation:landscape) and (min-width:560px) and (max-height:550px){
  body.play-focus .board-toolbar > div:not(.focus-hud){grid-template-columns:60px 60px;gap:8px}
  body.play-focus .board-toolbar .icon-button{justify-self:center}
  body.play-focus .board-toolbar .focus-toggle{grid-column:auto;width:60px;min-width:60px;min-height:44px;padding:2px;font-size:12px}
  body.play-focus .board-toolbar .focus-toggle span{max-width:54px;white-space:normal;line-height:1.2}
  body.play-focus .overlay-content h2{font-size:16px;line-height:1.3}
  body.play-focus .overlay-content .primary-button{font-size:12px}
  body.play-focus .overlay-content .primary-button svg{display:none}
}

/* Translation spans carry text, so they must not inherit decorative-dot styles. */
.eyebrow > span[data-i18n]{width:auto;height:auto;border-radius:0;background:none}
h1 > .intro-leading:after{content:none}
h1 > span[data-i18n="intro.brand"]{position:relative;z-index:0}
h1 > span[data-i18n="intro.brand"]:after{content:'';position:absolute;inset:auto -3px 0;height:12px;background:#f7d784;z-index:-1;transform:rotate(-2deg);border-radius:4px}
.board-caption > span[data-i18n]{width:auto;height:auto;background:none}
.next-card h2 > .next-title,.keyboard-card h2 > .keyboard-title{font-size:inherit;line-height:inherit;color:inherit;letter-spacing:inherit;margin-top:0}
.text-button > span[data-i18n]{display:inline;margin-left:0}
#assets-button > span[data-i18n="friends.change"]{display:block;flex:1 1 42px;min-width:0;margin:0;font-size:12px;line-height:1.35;white-space:normal;overflow-wrap:anywhere}
.language-picker{display:block;flex:none;line-height:1}
.nickname-error,.submission-status{margin:0;font-size:13px;line-height:1.5;color:#a44738}
.nickname-error:empty,.submission-status:empty,.ranking-status:empty,.ranking-you:empty{display:none}
.ranking-modal > .modal-note{margin:0;font-size:12px;line-height:1.5}
.ranking-modal .modal-actions .text-button{justify-content:center;padding:8px 6px;border:1px solid #dce3d4;border-radius:12px}
@media(max-height:650px){
  .ranking-modal[open]{overflow:auto}
  .ranking-list{flex:none;height:220px;min-height:220px}
}

/* Put mobile controls in their own grid row below both board and sidebar. */
@media(max-width:730px) and (orientation:portrait),(max-width:559px){
  body:not(.play-focus) .game-layout{row-gap:0}
  body:not(.play-focus) .left-column{grid-column:1/-1;grid-row:1;margin-bottom:12px}
  body:not(.play-focus) .play-column{display:contents}
  body:not(.play-focus) .board-toolbar{grid-column:1;grid-row:2;width:100%;margin:0}
  body:not(.play-focus) .board-frame{grid-column:1;grid-row:3;align-self:start;width:100%;min-width:0}
  body:not(.play-focus) .right-column{grid-column:2;grid-row:3;align-self:start;padding-top:0;margin:0}
  body:not(.play-focus) .touch-controls{grid-column:1/-1;grid-row:4;position:static;inset:auto;width:100%;margin:16px 0 0}
  body:not(.play-focus) .board-caption{grid-column:1/-1;grid-row:5;width:100%;margin:12px 0 0}
}

/* Give both language variants the same compact mobile header. */
.language-short{display:none}
@media(max-width:730px){
  .site-header{height:64px;min-height:64px;padding:0;flex-wrap:nowrap;gap:8px}
  .site-header .brand{flex:none;white-space:nowrap;line-height:1.2}
  .header-actions{display:grid;grid-template-columns:repeat(4,44px);gap:4px;flex:none;margin-left:auto}
  .language-picker{position:relative;display:flex;align-items:center;justify-content:flex-start;width:44px;height:44px;padding-left:7px;border:1px solid #d7dfce;border-radius:12px;background:#fffef9}
  .language-short{display:block;font-size:13px;font-weight:800;line-height:1;color:#365640;pointer-events:none}
  .language-picker::after{content:'';position:absolute;right:6px;top:17px;width:5px;height:5px;border-right:1.5px solid #365640;border-bottom:1.5px solid #365640;transform:rotate(45deg);pointer-events:none}
  .language-picker:focus-within{outline:3px solid #429580;outline-offset:3px}
  #language-select{position:absolute;inset:-1px;width:44px;max-width:none;height:44px;min-height:44px;padding:0;opacity:0;cursor:pointer}
  .header-actions .ranking-open{width:44px;height:44px;min-width:44px;min-height:44px;padding:0;gap:0}
  .header-actions .ranking-open > span{display:none}
  .header-actions .ranking-open svg{width:20px;height:20px}
}
@media(max-width:399px){.page-shell{padding-left:12px;padding-right:12px}}
@media(max-width:359px){.site-header .brand > span:last-child{display:none}}

/* Block zoom across the focused play area, including its toolbar and gaps.
   Dialogs still permit one-finger vertical scrolling. */
html.focus-zoom-locked,html.focus-zoom-locked body{touch-action:pan-y;overscroll-behavior:none}
body.play-focus .page-shell,body.play-focus .page-shell *{touch-action:none}
body.play-focus .modal,body.play-focus .modal *{touch-action:pan-y}
