#app[data-game="lunch"]{--tray-height:clamp(94px,16dvh,138px);--board-height:max(200px,calc(100dvh - 222px - var(--tray-height)));height:100dvh;min-height:0;padding:0;overflow:hidden;font-family:Nunito,'Trebuchet MS',sans-serif;color:#70472e;background:radial-gradient(ellipse at top,#f6e8d1,#d5af85)}
#app[data-game="lunch"]>header,#app[data-game="lunch"]>.village-nav{display:none}
#app[data-game="lunch"]>main{width:min(100vw,calc(var(--board-height)*.8 + 32px));max-width:560px;height:min(100dvh,calc((min(100vw,560px) - 32px)*1.25 + 350px));padding:8px 16px 12px;margin:auto;display:flex;flex-direction:column;overflow:hidden;border:0;border-radius:24px;background:repeating-linear-gradient(0deg,transparent 0 43px,#bb89531a 44px,#fff3dd25 46px,transparent 48px 83px),linear-gradient(110deg,#f1d4ad,#eac599 65%,#dcb180);box-shadow:0 0 50px #7d4b2920}
.lunch-top{flex:0 0 64px;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 0 6px}
.lunch-top h1{font:1000 clamp(19px,3dvh,28px)/1.1 Nunito,sans-serif;letter-spacing:-.8px;color:#64321f;margin:0;text-align:center;paint-order:stroke fill;-webkit-text-stroke:3px #fff3dc;text-shadow:0 2px 0 #bd865a77}
.lunch-top p{font-size:12px;font-weight:900;margin:5px 0 0;text-align:center;color:#855d3f}
.lunch-nav{width:48px;min-height:51px;flex-shrink:0;border:2px solid #fff9eb;border-radius:14px;background:linear-gradient(#fffbed,#f2dec0);box-shadow:0 3px 0 #c69e70,0 5px 10px #88552622;color:#68452c;font-size:25px;line-height:1}
.lunch-nav small{display:block;font:900 10px Nunito,sans-serif;margin-top:3px}
.lunch-layout{position:relative;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:32px minmax(0,1fr) var(--tray-height) 16px 48px;gap:8px;flex:1;min-width:0;min-height:0;max-width:none;margin:0!important;--frame-x:0%;--tray-y:0%;--liner:#e1979c}
.lunch-layout[data-box-color="pink"]{--frame-x:100%;--tray-y:100%;--liner:#e597a3}
.lunch-layout #game-status{grid-row:1;position:relative;min-height:0;padding:0 2px}
.lunch-layout .status-row{font:800 9px Nunito,sans-serif;margin:0 0 4px;color:#906641}
.lunch-layout .progress{height:14px;overflow:hidden;border:3px solid #fff3d9;background:#d5c6a8;border-radius:24px;box-shadow:0 2px 0 #a98454}
.lunch-layout .progress div{background:linear-gradient(#b5f184,#53ab43);box-shadow:inset 0 2px 2px #efffcba0}
.lunch-stars{position:absolute;right:5px;bottom:1px;font-size:25px;line-height:1;font-weight:1000;color:#ffcc52;paint-order:stroke fill;-webkit-text-stroke:2px #fff4d3;text-shadow:0 2px 1px #9d6e2e}
.box-colors{position:absolute;top:-24px;right:calc(50% - 75px);display:flex;gap:4px;height:20px}
.box-colors button{width:17px;height:17px;min-height:0;border:2px solid #fff4df;border-radius:50%;padding:0;background:#71bbd8;box-shadow:0 1px 2px #66452244}
.box-colors button[data-lunch-theme="pink"]{background:#eea9be}.box-colors button[aria-pressed="true"]{outline:1px solid #9b7148;outline-offset:1px}
.lunch-layout #play-area{container-type:size;grid-row:2;min-width:0;min-height:0;display:flex;align-items:center;justify-content:center;position:relative}
.lunch-mat{container-type:size;height:100%;width:100%;min-height:0;min-width:0;display:flex;justify-content:center;align-items:center;border-radius:13px;background:repeating-linear-gradient(0deg,transparent 0 22px,#e6a4a660 23px 44px),repeating-linear-gradient(90deg,#fff7eac9 0 22px,#f2c9c5ae 23px 44px)}
.bento-shell{position:relative;height:min(100cqh,125cqw);width:min(80cqh,100cqw);max-width:100%;aspect-ratio:.8;border:0;padding:0;border-radius:0;background-image:url('assets/lunchbox-shells.png');background-size:200% 100%;background-position:var(--frame-x) 0;background-repeat:no-repeat;filter:drop-shadow(0 5px 3px #6d3c2a33);isolation:isolate}
.bento-shell:before,.bento-shell:after{display:none}
.lunch-board.board{position:absolute;inset:11% 14% 16%;display:grid;width:auto;height:auto;aspect-ratio:auto;padding:0;gap:0!important;border:0;border-radius:19px;grid-template-rows:repeat(6,minmax(0,1fr));background:var(--liner);box-shadow:inset 0 4px 10px #8b3d5050;overflow:hidden;isolation:isolate}
.lunch-cell.cell{position:relative;min-width:0;min-height:0;aspect-ratio:auto;border:0;box-shadow:none;background:none;padding:0;overflow:visible;border-radius:0;touch-action:manipulation;z-index:2}
.lunch-cell.food-space{margin:5%;border:1px dashed #ffe9d6bf;border-radius:8px;background:linear-gradient(135deg,#bf758455,#f0adb555);box-shadow:inset 0 3px 4px #97455935}
.lunch-cell.food-space:hover{background:#f4b3bbaa;outline:2px solid #fff3d6}
.lunch-cell.selected{outline:3px solid #ffeda8;outline-offset:-3px;background:#fff1ac66;z-index:6}
.food-sprite{display:block;background-image:url('assets/lunch-foods-single.png');background-size:400% 200%;background-repeat:no-repeat;pointer-events:none;filter:drop-shadow(0 3px 2px #713a2a44)}
.food-sprite.extra-food{background-image:url('assets/lunch-foods-extra-single.png')}
.lunch-cell>.food-sprite{position:absolute;left:-22%;top:50%;width:144%;height:auto;aspect-ratio:1;transform:translateY(-50%) rotate(var(--food-angle,0deg));z-index:2}
.lunch-cell:nth-child(4n+1){--food-angle:-2deg}.lunch-cell:nth-child(4n+2){--food-angle:2deg}
.compartment-beds,.compartment-rims{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible}.compartment-beds{z-index:0}.compartment-rims{z-index:5;filter:drop-shadow(0 2px 1px #9e465c66)}
.lunch-board.board.grid-free{gap:0;border:0;background:#d78c96;box-shadow:none}.lunch-board.grid-free .cell{margin:0;border:0;border-radius:0;background:none;box-shadow:none;outline:0;cursor:default}.grid-free .compartment-beds,.grid-free .compartment-rims{display:none}
.lunch-tray.tray{grid-row:3;display:flex;align-items:stretch;flex-wrap:nowrap;justify-content:flex-start;gap:10px;min-height:0;margin:0!important;padding:13px 15px 19px;border:0;border-radius:19px;box-shadow:none;background-image:url('assets/lunch-serving-trays.png');background-size:100% 200%;background-position:0 var(--tray-y);background-repeat:no-repeat;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:#a4794899 transparent}
.lunch-tray.tray.empty{display:none}
.lunch-piece.piece{position:relative;display:flex;align-items:center;justify-content:center;flex:0 0 calc((100% - 20px)/3);min-width:0;max-width:none;min-height:0;padding:3px;border:0;border-radius:13px;background:transparent;box-shadow:none;scroll-snap-align:start;touch-action:pan-x;isolation:isolate}
.lunch-piece.piece.selected{background:#ffefb126;box-shadow:inset 0 0 0 3px #fff5c9,0 0 0 2px #c9a15b}
.food-piece-art{display:block;width:100%;height:100%;overflow:visible;pointer-events:none;filter:drop-shadow(0 4px 2px #6e452a44)}
.lunch-piece small{display:none}
.lunch-layout .hint-note{grid-row:4;margin:0;min-height:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center;font:800 9px/16px Nunito,sans-serif;color:#916845}
.lunch-layout .tools{grid-row:5;display:flex;align-items:stretch;justify-content:center;gap:8px;margin:0;min-height:0;flex-wrap:nowrap}
.lunch-layout .tools .quiet{flex:1;min-width:0;min-height:44px;max-width:140px;padding:6px 8px;border:2px solid #fff9e9;border-radius:15px;background:linear-gradient(#fffbed,#f0dbbb);box-shadow:0 3px 0 #b98e5c,0 5px 9px #77421d22;color:#765030;font:1000 14px Nunito,sans-serif}
.lunch-layout .tools .primary{min-height:44px;flex:1;justify-content:center;padding:7px 10px;border:3px solid #fff5db;border-radius:15px;background:linear-gradient(#ffd387,#e89d42);box-shadow:0 3px 0 #aa742c;color:#fff8e7;font:1000 14px Nunito,sans-serif;text-shadow:0 1px 1px #9c6226}
.lunch-finish{position:relative;min-height:0;height:min(100cqh,125cqw);width:min(80cqh,100cqw);aspect-ratio:.8;max-width:100%;border:4px solid #fff0d8;border-radius:25px;overflow:hidden;box-shadow:0 5px 0 #b58a5e,0 9px 18px #74442633;animation:lunch-reveal .65s ease-out both;background:#e5b88e}
.lunch-finish img{display:block;width:100%;height:100%;object-fit:cover}
.lunch-ready{position:absolute;bottom:10px;left:50%;transform:translateX(-50%);padding:7px 12px;border:2px solid #fff9e9;border-radius:25px;background:#fff3dce8;color:#8c603a;box-shadow:0 3px 7px #754a2a33;font:1000 14px Nunito,sans-serif;white-space:nowrap}.lunch-ready span{color:#d58693}
.lunch-layout:has(.lunch-finish),.lunch-layout:has(.grid-free){grid-template-rows:32px minmax(0,1fr) 0 22px 52px}
@keyframes lunch-reveal{from{opacity:0;transform:scale(.97)}to{opacity:1;transform:scale(1)}}
@media(max-width:380px){#app[data-game="lunch"]>main{padding-left:10px;padding-right:10px}.lunch-top h1{font-size:20px}.lunch-nav{width:43px;min-height:48px}.lunch-layout{gap:6px}.lunch-tray.tray{padding:11px 11px 16px;gap:7px}.lunch-piece.piece{flex-basis:calc((100% - 14px)/3)}.lunch-layout .tools .quiet{font-size:12px}.lunch-layout .hint-note{font-size:8px}}
@media(orientation:landscape) and (max-height:560px){#app[data-game="lunch"]>main{width:min(100vw,900px);max-width:900px}.lunch-top{flex-basis:54px}.lunch-layout{grid-template-columns:minmax(0,1fr) 200px;grid-template-rows:28px minmax(0,1fr) 46px;gap:6px 12px}.lunch-layout #play-area{grid-column:1;grid-row:1/4}.lunch-layout #game-status{grid-column:2;grid-row:1}.lunch-layout .lunch-tray{grid-column:2;grid-row:2;flex-wrap:wrap;overflow-y:auto;background-size:100% 200%;padding:12px}.lunch-layout .lunch-piece{flex-basis:calc(50% - 5px);min-height:65px}.lunch-layout .hint-note{display:none}.lunch-layout .tools{grid-column:2;grid-row:3}.lunch-layout .tools .quiet{font-size:11px;padding:4px}.lunch-layout .box-colors{top:22px;right:0;z-index:10}.lunch-layout:has(.lunch-finish),.lunch-layout:has(.grid-free){grid-template-rows:28px minmax(0,1fr) 46px}}
@media(prefers-reduced-motion:reduce){.lunch-finish{animation:none}}

.compartment-rims{filter:none}.lunch-cell>.food-sprite{left:-8%;width:116%}.food-piece-art{filter:drop-shadow(0 2px 1px #7d4d3233)}/* Molded liner sits below the physical cream lip; food sits inside recessed wells. */
.lunch-board.board{inset:13% 16% 18%;border-radius:26px;background:transparent;box-shadow:inset 0 6px 9px #6d293c44}
.compartment-beds,.compartment-rims{display:none}
.lunch-cell.cell,.lunch-cell.food-space,.lunch-cell.food-filled{margin:0;border:0;border-radius:0;background:none;box-shadow:none;overflow:visible}
.lunch-cell.cell:before{content:'';position:absolute;inset:1.5%;border:1px solid #eda5ae;border-radius:9px;background:linear-gradient(155deg,#b86a7b 0%,#cf8291 35%,#df98a2 85%);box-shadow:inset 0 5px 7px #76304666,inset 3px 0 5px #863b4b38,inset 0 -2px 1px #ffd4d4b3,0 1px 0 #ffd2d1b3;pointer-events:none;z-index:0}
.lunch-cell.food-space:after{content:'';position:absolute;inset:11% 8%;border:1px dashed #ffdad17a;border-radius:5px;pointer-events:none}
.lunch-cell>.food-sprite{left:-14%;width:128%;filter:drop-shadow(0 4px 2px #5e2b314d)}
.lunch-cell.selected:before{border-color:#fff3aa;box-shadow:inset 0 5px 7px #76304655,0 0 0 2px #ffe99e}
.lunch-board.grid-free .cell:before,.lunch-board.grid-free .cell:after{display:none}
.lunch-board.grid-free{background:transparent!important;box-shadow:none!important}
.lunch-layout[data-box-color="pink"]{--tray-y:0%}.lunch-cell.cell:before{inset:1%;border-radius:5px;border-color:#e99ba8;background:linear-gradient(165deg,#a95870,#c97e90 48%,#df98a4);box-shadow:inset 0 8px 9px #64223880,inset 4px 0 5px #79304544,inset 0 -2px 1px #ffcbd0c9,0 1px 0 #ffd1d4a3}.lunch-cell.food-space:after{border-radius:3px;inset:12% 7%}.lunch-board.board{border-radius:20px}.lunch-cell.food-filled:after{content:"";position:absolute;inset:1%;border:1px solid #e8a0ad;border-radius:5px;pointer-events:none;z-index:3}.lunch-board.grid-free .cell:after{display:none}
/* Flat white selection tray; every food sprite paints above every grid edge. */
.lunch-tray.tray{background-image:none!important;background:#fffdf8!important;border:2px solid #fff;border-radius:17px;box-shadow:0 3px 7px #865c3329;padding:10px 13px;scrollbar-color:#c6b49e transparent}
.lunch-piece.piece{background:transparent!important;box-shadow:none;border:0}
.lunch-piece.piece.selected{box-shadow:inset 0 0 0 2px #e7c577;background:#fff7d83b!important}
.lunch-cell.cell,.lunch-cell.food-filled,.lunch-cell.food-space{z-index:auto;isolation:auto}
.lunch-cell.cell:before,.lunch-cell.food-filled:after{z-index:0}
.lunch-cell.food-space:after{z-index:1}
.lunch-cell>.food-sprite{z-index:4}

.food-sprite.food-14{clip-path:inset(0 0 0 7%)}
.lunch-tray.tray{background:linear-gradient(175deg,#fffefa,#f3eee4)!important;border:6px solid #fffdf7;border-top-color:#fff;border-bottom-color:#e4dccc;border-radius:20px;box-shadow:inset 0 2px 4px #9d8e7333,inset 0 -2px 2px #fff,0 3px 0 #c9bca7,0 6px 9px #70472e33;padding:8px 10px}
.lunch-layout .tools{gap:5px}.lunch-layout .tools .quiet{padding-left:9px;padding-right:9px}

/* Clip each atlas tile and keep previews within their own tray buttons. */
.food-piece-art,.food-piece-art svg{overflow:hidden}
.lunch-tray.tray{gap:16px;align-items:stretch}
.lunch-tray .lunch-piece.piece{flex:0 0 112px;min-width:112px;max-width:112px;overflow:hidden;padding:7px;touch-action:pan-x}
.lunch-piece .food-piece-art{min-width:0;max-width:100%;max-height:100%}
@media(orientation:landscape) and (max-height:560px){.lunch-layout .lunch-tray{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden}.lunch-layout .lunch-tray .lunch-piece{flex-basis:112px;min-width:112px}}

/* Show only dashed plot guides beneath the food. */
.lunch-board.board{box-shadow:none}
.lunch-cell.cell:before{display:none}
.lunch-cell.cell:after,.lunch-cell.food-space:after,.lunch-cell.food-filled:after{content:"";position:absolute;inset:5%;border:1px dashed #ffdad1b3;border-radius:3px;background:none;box-shadow:none;pointer-events:none;z-index:0}
.lunch-board.grid-free .cell:after{display:none}
