/* Independent Fraisy Pop layout. Safe insets also apply in iOS home-screen mode. */
:root{--safe-top:env(safe-area-inset-top,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px);--safe-right:env(safe-area-inset-right,0px)}
.shell{padding-top:var(--safe-top);padding-bottom:var(--safe-bottom)}
.game-layout{grid-template-areas:"board powers" "input powers";row-gap:0}
.board-panel{grid-area:board;border-bottom:0;border-radius:25px 25px 0 0;box-shadow:none;padding-bottom:0;min-width:0}
.power-panel{grid-area:powers;min-width:0}
.input-panel{grid-area:input;background:#ffffffc9;border:1px solid var(--line);border-top:0;border-radius:0 0 25px 25px;padding:0 24px 24px;min-width:0;box-shadow:var(--shadow)}
.board-meta>.hint-card{margin:0 0 17px;padding:10px 14px}
.board-meta>.hint-card p{margin:0}
.board-meta>.hint-card .text-button{padding:0;min-height:32px}
#category:empty{display:none}
.grid-scroll{padding:5px;min-height:0;scrollbar-width:thin}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
dialog{max-height:calc(100dvh - var(--safe-top) - var(--safe-bottom) - 32px);overscroll-behavior:contain}
.setting select{font-size:16px}
@media(max-width:1100px),(pointer:coarse){
 .shell{padding-left:max(20px,var(--safe-left));padding-right:max(20px,var(--safe-right))}
 .header{height:76px}
 .icon-button{width:44px;height:44px;flex-shrink:0}
 #home{padding-top:30px;gap:16px}
 .hero-art{min-width:0;transform:scale(.85)}
 .hero-copy h1{font-size:clamp(40px,5.6vw,60px)}
 body[data-screen="game"] .shell{height:100vh;height:100dvh;display:flex;flex-direction:column;padding-bottom:max(10px,var(--safe-bottom))}
 body[data-screen="game"] .header{flex:0 0 64px}
 body[data-screen="game"] main{min-height:0;flex:1;display:flex;flex-direction:column}
 body[data-screen="game"] footer{display:none}
 #storage-warning{flex-shrink:0;max-height:75px;overflow:auto;margin:4px 0;padding:6px 10px;font-size:11px}
 #game{min-height:0;flex:1;display:flex;flex-direction:column}
 .game-heading{flex-shrink:0;margin:2px 0;min-height:44px}
 .game-heading #back{min-height:44px}
 .game-layout{flex:1;min-height:0;grid-template-columns:minmax(0,1fr) 240px;grid-template-rows:minmax(0,1fr) auto;grid-template-areas:"board powers" "input input";gap:12px;align-items:stretch}
 .board-panel{display:flex;flex-direction:column;min-height:0;border:1px solid var(--line);border-radius:22px;padding:16px}
 .board-meta{flex-shrink:0}
 .board-heading h1{font-size:21px}
 #category{margin:5px 0 8px}
 .board-meta>.hint-card{padding:5px 10px;margin-bottom:7px;border-radius:12px}
 .board-meta>.hint-card .text-button{min-height:36px}
 .board-meta>.hint-card p{line-height:1.4}
 .grid-scroll{flex:1;min-height:42px;overflow-y:auto;overscroll-behavior-y:contain}
 .grid{height:100%;min-height:min-content;justify-content:center;gap:7px}
 .guess-row{flex:1 0 36px;min-height:36px;max-height:58px;margin:0 auto;max-width:calc(var(--letters) * 62px)}
 .tile{aspect-ratio:auto;height:100%;font-size:24px}
 .game-legend{flex-shrink:0;margin-top:9px;font-size:10px;gap:10px}
 .pop-card{padding:16px}
 .powers{grid-template-columns:1fr}
 .power{min-height:70px}
 .input-panel{border:1px solid var(--line);border-radius:20px;padding:4px 20px 12px;box-shadow:none}
 .message{min-height:20px;margin:3px 0 7px;font-size:12px;line-height:1.4}
 #keyboard-wrap{max-width:720px;margin:auto}
 .keyboard-row{gap:6px;margin-bottom:7px}
 .key{height:54px;max-width:64px;font-size:18px}
 .key.erase{max-width:86px}
 .validate{min-height:48px;margin-top:2px}
 body[data-game-state="won"] .game-layout,body[data-game-state="lost"] .game-layout{display:block;overflow-y:auto}
 body[data-game-state="won"] .input-panel,body[data-game-state="lost"] .input-panel,body[data-game-state="won"] .power-panel,body[data-game-state="lost"] .power-panel{display:none}
 body[data-game-state="won"] .grid-scroll,body[data-game-state="lost"] .grid-scroll{flex:none;overflow:visible}
 body[data-game-state="won"] .guess-row,body[data-game-state="lost"] .guess-row{height:44px;flex:none}
 .result{padding-bottom:14px}
}
@media(max-width:650px){
 .shell{padding-left:max(10px,var(--safe-left));padding-right:max(10px,var(--safe-right))}
 .header,body[data-screen="game"] .header{height:58px;flex-basis:58px}
 .brand{gap:4px}.brand>span{font-size:25px}.brand img{width:30px;height:33px}nav{gap:5px}
 #home{padding-top:14px;gap:0}
 .hero-copy h1{font-size:40px;margin:10px 0}
 .hero-copy .eyebrow{margin:5px 0}
 .intro{margin-bottom:14px;font-size:14px;line-height:1.5}
 .difficulty{margin-bottom:14px}.difficulty legend{margin-bottom:7px}
 .home-actions{gap:10px}.daily-description{margin:10px auto}
 .hero-art{height:120px;min-height:120px;margin-top:0;transform:none}
 .hero-berry{margin-top:0;margin-left:-110px}.hero-berry img{width:95px}
 .orbit-one{width:200px;height:200px;top:-30px;left:calc(50% - 100px)}
 .orbit-two{width:160px;height:160px;top:-10px;left:calc(50% - 80px)}
 .demo-tiles{bottom:15px;left:calc(50% - 45px)}
 .demo-tiles>span{width:34px;height:40px;font-size:20px;border-radius:10px}
 .pop-sticker{font-size:14px;top:5px;padding:8px;right:calc(50% - 95px)}
 .spark-one{top:75px}.spark-two{top:30px}
 .home-bottom{padding-top:12px}
 .game-heading{gap:8px;min-height:40px;margin:0}
 .game-heading #back{min-height:40px}
 .game-heading .eyebrow{font-size:9px;letter-spacing:.4px}
 .game-layout{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto auto;grid-template-areas:"board" "powers" "input";gap:7px}
 .board-panel{padding:9px 10px 7px;border-radius:16px}
 .board-heading h1{font-size:18px}.board-heading>span{font-size:11px}
 #category{font-size:11px;margin:3px 0}
 .board-meta>.hint-card{display:flex;align-items:center;padding:0 8px;margin:4px 0 3px;gap:6px}
 .hint-card>span{font-size:20px}
 .board-meta>.hint-card>div{display:flex;align-items:center;gap:8px;min-width:0}
 .board-meta>.hint-card .text-button{flex-shrink:0;min-height:44px;font-size:12px}
 .board-meta>.hint-card p{font-size:11px;line-height:1.3}
 .grid{gap:5px;max-width:365px}
 .guess-row{flex-basis:32px;min-height:32px;max-height:46px;gap:5px;max-width:calc(var(--letters) * 53px)}
 .tile{font-size:22px;border-radius:8px}.tile small{height:9px;font-size:9px}
 .game-legend{margin-top:5px;gap:8px;font-size:9px}.game-legend>span{gap:3px}
 .power-panel{display:block}
 .pop-card{padding:7px 9px;display:grid;grid-template-columns:auto 1fr;column-gap:12px;border-radius:15px}
 .pop-heading h2{font-size:13px}.pop-heading img{width:22px;height:24px}.pop-heading{gap:5px}
 .pop-card>p[data-i18n="popDescription"]{display:none}
 .gauge-caption{grid-column:2;grid-row:1;align-items:center;justify-content:flex-end;font-size:10px}
 .gauge{grid-column:1/-1;height:7px;padding:1px;margin:4px 0 6px}
 .powers{grid-column:1/-1;grid-template-columns:repeat(3,minmax(0,1fr));margin:0;gap:5px}
 .power{min-height:52px;padding:5px 3px;justify-content:center;gap:0}
 .power-icon,.power-cost{display:none}
 .power strong{font-size:11px}.power small{font-size:10px;line-height:1.25;margin-top:3px}
 .pop-card .power-info{grid-column:1/-1;margin:4px 0 0;font-size:11px;line-height:1.3}
 .input-panel{padding:0 0 5px;background:transparent;border:0;border-radius:0}
 .message{margin:0 0 5px;min-height:18px;font-size:11px}
 .keyboard-row{gap:4px;margin-bottom:5px}
 .key{height:46px;max-width:48px;font-size:16px;border-radius:7px}
 .key.erase{max-width:66px}
 .validate{min-height:46px;margin-top:1px}
 dialog{padding:18px}.dialog-top{position:sticky;top:-18px;background:var(--paper);padding:5px 0;z-index:1}
}
@media(max-width:650px) and (max-height:700px){
 body[data-screen="game"] .header{flex-basis:48px;height:48px}
 .game-heading{min-height:36px}.game-heading #back{min-height:36px}
 .board-panel{padding:6px 8px}.board-heading h1{font-size:16px}
 .game-legend{display:none}.guess-row{min-height:32px}
 .game-layout{gap:5px}.key{height:44px}.validate{min-height:44px}
 #category{display:none}
 .board-meta>.hint-card .text-button{min-height:36px}
 .board-meta>.hint-card p{font-size:10px;max-height:39px;overflow:auto}
 .pop-heading img{display:none}.pop-heading h2{font-size:11px}.power{min-height:44px}.power small{display:none}.pop-card{padding:5px 7px}
 .pop-heading{display:none}.gauge-caption{grid-column:1/-1;justify-content:space-between}
 .message{font-size:10px;max-height:28px;overflow-y:auto}
}
@media(min-width:651px) and (max-height:550px){
 body[data-screen="game"] .header{flex-basis:48px;height:48px}
 .game-heading{min-height:36px}.game-heading #back{min-height:36px}
 .game-layout{grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);grid-template-rows:auto minmax(0,1fr);grid-template-areas:"board input" "board powers";gap:6px 12px}
 .board-panel{padding:8px}.board-heading h1{font-size:17px}.game-legend{display:none}
 .board-meta>.hint-card{padding:0 8px;margin:3px 0}.hint-card p{font-size:11px}
 .input-panel{padding:0;background:none;border:0}.key{height:44px;font-size:15px}.keyboard-row{gap:4px;margin-bottom:4px}.validate{min-height:44px;padding:6px}.message{font-size:11px;margin:0 0 3px}
 .pop-card{padding:5px 8px;display:grid;grid-template-columns:auto 1fr;gap:3px 10px;border-radius:13px}
 .pop-heading h2{font-size:12px}.pop-heading img,.pop-card>p[data-i18n="popDescription"],.power-icon,.power-cost{display:none}
 .gauge-caption{grid-column:2;grid-row:1;justify-content:flex-end;font-size:10px;align-items:center}
 .gauge{grid-column:1/-1;margin:0;height:5px;padding:1px}.powers{grid-column:1/-1;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;margin:2px 0 0}
 .power{min-height:44px;padding:4px;justify-content:center;text-align:center}.power strong{font-size:10px}.power small{font-size:9px;margin-top:1px}
 .pop-card .power-info{grid-column:1/-1;font-size:10px;line-height:1.1;margin:0}
}

@media(max-width:360px){.brand>span{font-size:22px}.brand img{width:27px;height:30px}}

/* On phones the brand already provides the return to home. Reuse the
   category row for the mode so the entire navigation row goes to the grid. */
.mobile-game-mode{display:none}
@media(max-width:650px),(max-width:1100px) and (max-height:550px){
 .game-heading{display:none}
 #game{padding-top:6px}
 .board-meta{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:8px;align-items:center}
 .board-heading{display:contents}
 .board-heading h1{grid-column:1;grid-row:1}
 #attempts{grid-column:2;grid-row:1;text-align:right}
 #category{grid-column:1;grid-row:2;margin:3px 0;min-width:0}
 .mobile-game-mode{display:block;grid-column:2;grid-row:2;max-width:165px;margin:3px 0;text-align:right;font-size:10px;line-height:1.3;color:var(--muted)}
 .board-meta>.hint-card{grid-column:1/-1;grid-row:3}
}

/* Native dialog focus trapping with the visual identity of Fraisy Pop. */
.notice-dialog{width:min(440px,calc(100% - 32px));padding:24px;border-color:#e8d7dc;background:linear-gradient(145deg,#fff7f8,var(--paper) 70%)}
.notice-top{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.notice-fruit{display:flex;align-items:center;justify-content:center;width:72px;height:72px;border-radius:24px;background:#ffe6ed;transform:rotate(-6deg)}
.notice-fruit img{object-fit:contain}
.notice-dialog h2{font-size:25px;line-height:1.2;letter-spacing:-.5px;margin:20px 0 10px}
.notice-dialog>p{color:var(--muted);margin:0;line-height:1.65}
.notice-actions{display:flex;gap:12px;margin-top:24px;padding-bottom:4px}
.notice-actions button{flex:1;min-height:48px;font-size:14px;padding:12px 14px}
.notice-dialog[open]{animation:notice-enter .18s ease-out}
@keyframes notice-enter{from{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}
@media(max-width:380px){.notice-dialog{padding:20px}.notice-actions{flex-direction:column-reverse;gap:10px}.notice-dialog h2{font-size:23px}}
@media(max-height:550px){.notice-dialog{padding:16px 20px}.notice-fruit{width:48px;height:48px;border-radius:16px}.notice-fruit img{width:32px;height:35px}.notice-dialog h2{margin:10px 0 7px;font-size:21px}.notice-actions{margin-top:14px}.notice-dialog>p{font-size:13px;line-height:1.5}}
