/* Both orientations: layout follows the available viewport, not a device model. */
.home .tutorial-invite{flex:0 0 auto;background:#fffdf5;border:1px solid var(--line);border-radius:14px;padding:10px;margin-top:8px;font-size:12px;text-align:center}
.tutorial-invite p{margin:0 0 7px;line-height:1.4}
.tutorial-invite>div{display:flex;gap:8px;justify-content:center}
.tutorial-invite button{padding:7px 12px;border-radius:9px;background:var(--accent,var(--blue));color:white;font-size:12px;font-weight:700}
.tutorial-invite button[data-action="tutorial-later"]{background:#eee9dd;color:var(--ink)}
@media(orientation:landscape){.home .tutorial-invite{grid-column:1;grid-row:2;align-self:start;margin:0}.home:has(.tutorial-invite) .hero.original-cards{grid-row:3/6}}
.settings-menu .setting-row .toggle{grid-column:4;justify-self:end}
@media(orientation:portrait){
 .settings-menu header{display:grid;grid-template-columns:minmax(0,1fr) 36px;gap:10px;align-items:center}
 .settings-menu .settings-mark{grid-column:1;grid-row:1;white-space:nowrap}
 .settings-menu .settings-close{grid-column:2;grid-row:1;width:36px;height:36px;padding:0}
 .settings-menu .settings-language-pills{grid-column:1/-1;grid-row:2;margin:0;justify-self:stretch;display:grid;grid-template-columns:1fr 1fr}
 .settings-menu .setting-row{grid-template-columns:28px minmax(0,.9fr) minmax(0,1fr) 46px;gap:6px;padding:8px}
 .settings-menu .setting-icon{width:28px}
 .settings-menu .setting-label{min-width:0;overflow-wrap:break-word;font-size:12px}
 .settings-menu .volume-slider{width:100%;min-width:0;margin:0}
}
.settings-language-pills{display:flex;gap:3px;margin-left:auto;margin-right:10px;padding:4px;border:1px solid var(--line);border-radius:14px;background:#eee9dd}
.settings-language-pills button{min-width:62px;min-height:32px;margin:0;padding:5px 9px;border-radius:10px;background:transparent;color:var(--muted);font-size:12px;font-weight:800}
.settings-language-pills button[aria-pressed="true"]{background:var(--accent,var(--blue));color:white;box-shadow:0 2px 5px #20324720}
.home .home-game-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:100%;flex:0 0 auto;margin:0 0 8px}
.home .home-game-actions>button{width:100%;min-width:0;min-height:44px;margin:0;padding:10px 6px;border-radius:14px;font-size:13px}
.home .home-game-actions>button:only-child{grid-column:1/-1}
.home .home-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;gap:8px;justify-self:stretch}
.home .home-links .text-btn{width:100%;min-width:0;margin:0}
@media(orientation:landscape){
 .home .settings .language-setting{grid-column:2;grid-row:3}
 .home .home-game-actions{grid-column:2;grid-row:3;margin:0}
 .home .home-game-actions>button{min-height:38px;padding:7px 6px}
 .home{width:100%;max-width:1100px;height:100dvh;min-height:0;padding:max(10px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);grid-template-rows:auto minmax(0,1fr) auto auto auto;gap:8px 20px;overflow:auto}
 .home h1.brand{font-size:clamp(30px,5vw,56px);white-space:nowrap;margin:0;line-height:1.1}
 .home .hero.original-cards{grid-column:1;grid-row:2/6;min-height:80px;height:100%;max-height:none;container-type:size;margin:0;transform:none;align-self:stretch}
 .home .original-cards>img{width:min(34cqw,56cqh)}
 .home .original-cards>img:nth-child(1){transform:translateX(-80%) rotate(-15deg)}
 .home .original-cards>img:nth-child(3){transform:translateX(80%) rotate(16deg)}
 .home .study-invite{grid-column:1;grid-row:3/5;font-size:12px;margin:0;align-self:center}
 .home .home-links{grid-column:2;grid-row:5;justify-self:stretch;align-self:stretch;margin:0}
 .home .home-links .text-btn{min-height:38px;padding:7px 6px;font-size:13px;border-radius:14px}
 .home .settings{grid-column:2;grid-row:1/3;padding:10px;margin:0;gap:7px 10px;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(3,auto);align-content:center;min-width:0}
 .home .settings>div{min-width:0}.home .settings label{font-size:11px;margin:0 0 3px;line-height:1.2}
 .home .id-setting{grid-area:1/1}.home .players-setting{grid-area:1/2}.home .category-setting{grid-area:2/1}.home .level-setting{grid-area:2/2}.home .settings .colors{grid-area:3/1;grid-template-columns:repeat(4,25px);gap:4px}.home .language-setting{grid-area:3/2}
 .home .settings select,.home .character-current{width:100%;min-height:34px;height:34px;padding:3px 7px;font-size:12px}.home .character-current img{width:25px;height:25px}
 .home>.resume{grid-area:3/2}.home>.primary{grid-area:4/2}.home>.multiplayer-entry{grid-area:4/2}
 .home>.resume,.home>.primary,.home>.multiplayer-entry{min-height:38px;padding:7px 10px;margin:0!important;font-size:13px}
 .game{height:100dvh;grid-template-columns:minmax(0,1fr) clamp(200px,30vw,330px)}
 .game .board{grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(92px,1fr);overflow-y:auto;align-content:start}
 .game .word-card{display:grid;grid-template-columns:44px minmax(0,1fr);gap:5px;align-items:center;padding:6px;min-width:0}
 .game .picture-row{height:44px;margin:0}.game .picture-button{width:44px;height:44px}.game .word-label{display:none}
 .game .slots{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:3px;padding:0}.game .slot{height:36px;font-size:20px;min-width:0}
 .game .hand-panel{height:100dvh;overflow-y:auto;padding:10px 8px;min-height:0}.game .hand-panel-top{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:space-between;gap:5px;margin-bottom:8px}.game .hand-panel-controls{display:flex;align-items:center;gap:5px;white-space:nowrap}.game .hand-title{display:none}
 .game .hand-panel-top .attempts{display:flex;align-items:center;gap:4px;margin:0;white-space:nowrap;font-size:clamp(10px,1.4vw,13px)}
 .game .hand-panel-top .attempt-dots{display:flex;gap:3px}.game .hand-panel-top .attempt-dots i{width:11px;height:11px;flex:0 0 11px}
 .game .hand-panel-controls .round{font-size:clamp(10px,1.3vw,12px);letter-spacing:0}
 .game .hand-panel-controls .settings-btn{width:36px;min-width:36px;height:36px;padding:0;flex-shrink:0}
 .game .hand{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.game .hand-card,.game .hand-gap{height:clamp(56px,18dvh,95px)}
 .game .hand-card .corner{display:none}
 .game .hand-card.special{position:relative;overflow:hidden}
 .game .hand-card.special .main{display:block;transform:none;font-size:27px;line-height:1;margin-bottom:10px}
 .game .hand-card.special .special-name{position:absolute;left:2px;right:2px;bottom:5px;font-size:7px;line-height:1;font-weight:950;letter-spacing:-.15px;text-align:center;color:currentColor}
 .game .actions{display:flex;flex-direction:row;flex-wrap:wrap;gap:6px;margin-top:10px}.game .actions button{flex:1 1 40%;min-height:40px;padding:6px;font-size:12px}
 .study{max-width:1000px;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:44px 5px minmax(0,1fr) auto auto;gap:10px 20px}
 .study-header,.study progress{grid-column:1/-1}.study-picture{grid-column:1;grid-row:3/6;min-height:0;height:100%}.study-slots{grid-column:2;align-self:center;justify-content:center;grid-template-columns:repeat(5,minmax(0,58px))}.study-feedback,.study-choices{grid-column:2}.study-choices button{min-height:48px}.study-slots>span{height:44px}
 .modal{max-height:calc(100dvh - 20px);overflow-y:auto}
 .modal:has(.settings-menu){width:min(680px,calc(100vw - 24px));max-width:680px;padding:12px 16px}
 .settings-menu{display:grid;gap:8px}
 .settings-menu header{display:flex;align-items:center;justify-content:space-between;min-height:36px}
 .settings-mark{font-size:20px;font-weight:900;color:var(--ink)}
 .settings-close{display:grid;place-items:center;width:36px;height:36px;padding:0;border-radius:50%;border:1px solid var(--line);background:#fffdf5;font-size:26px;line-height:1}
 .settings-list{display:grid;gap:6px}
 .setting-row{display:grid;grid-template-columns:30px minmax(100px,.8fr) minmax(70px,1fr) 46px;align-items:center;gap:10px;min-height:43px;padding:4px 10px;border:1px solid var(--line);border-radius:12px;background:#fffdf7}
 .setting-icon{display:grid;place-items:center;width:28px;height:28px;border-radius:9px;background:#eef3fb;color:var(--blue);font-size:17px}
 .setting-label{font-size:13px;font-weight:800}
 .volume-slider{width:100%;height:30px;min-width:0;margin:0;accent-color:var(--accent)}
 .setting-row .toggle{grid-column:4;justify-self:end}
 .toggle{position:relative;width:46px;height:28px;padding:0;border-radius:999px;background:#c7cbd0}
 .toggle i{position:absolute;width:22px;height:22px;left:3px;top:3px;border-radius:50%;background:white;box-shadow:0 2px 5px #0003}
 .toggle.on{background:var(--accent)}.toggle.on i{transform:translateX(18px)}
 .settings-links{display:grid;grid-template-columns:1fr 1fr;gap:8px}
 .settings-links button{margin:0!important;min-height:38px;padding:6px 10px!important;font-size:13px}
}
@media(orientation:landscape) and (max-width:700px){
 .game .board{grid-template-columns:minmax(0,1fr);grid-auto-rows:minmax(100px,auto)}
 .game .word-card{grid-template-columns:60px minmax(0,1fr)}
 .game .picture-row,.game .picture-button{width:60px;height:60px}
 .game .slot{height:40px}
}
