*{box-sizing:border-box}body{margin:0;background:#f5efdf;color:#302d25;font-family:system-ui,sans-serif}button,a,input{-webkit-tap-highlight-color:transparent}button{cursor:pointer;font:inherit}button:focus-visible,a:focus-visible,input:focus-visible{outline:4px solid #e7a52b;outline-offset:3px}button:disabled{cursor:default}main{max-width:1380px;margin:auto;padding:24px}header,.heading,.status{display:flex;align-items:center;justify-content:space-between;gap:16px}header a{color:#385d4a;text-decoration:none;font-weight:700}.eyebrow{font-size:11px;letter-spacing:2px;font-weight:800;color:#6d7967}header button,.status button{border:1px solid #c5cabb;border-radius:20px;background:#fff9ed;padding:8px 15px}.heading{margin:24px 0}h1{font-size:clamp(28px,4vw,48px);letter-spacing:-2px;margin:0}h1 span{margin-left:14px}.heading p{color:#767568;margin:8px 0}.register{background:#234e40;color:#fff9df;border:5px solid #d5dfc9;border-radius:18px;padding:12px 24px;min-width:210px}.register small{display:block;font-size:10px;letter-spacing:3px}.register strong{display:block;font-size:29px;font-variant-numeric:tabular-nums}.layout{display:grid;grid-template-columns:minmax(0,1fr) 260px;gap:24px}.kitchen{position:relative;overflow:hidden;border:1px solid #d5d4be;border-radius:24px;background:repeating-conic-gradient(#e7eadb 0% 25%,#edf0e3 0% 50%) 0/48px 48px;padding:16px 22px}.status{font-size:12px;font-weight:800;margin-bottom:14px;color:#4d6251}.tables{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;padding:0 35px}.table{position:relative;display:flex;flex-direction:column;align-items:center;border:5px solid #b9834b;border-bottom-width:9px;border-radius:18px;background:repeating-linear-gradient(0deg,#e6bb82 0 18px,#eac28e 19px 38px);min-height:153px;padding:8px;color:#563920;box-shadow:0 5px 0 #0001;isolation:isolate}.table svg{width:100px;height:100px}.table .label{font-size:12px;font-weight:800}.table .amount{position:absolute;right:5px;top:5px;border-radius:6px;background:#fff8e9;padding:3px 5px;font-weight:800}.table.blocked{filter:grayscale(1);opacity:.6}.table.blocked:after{content:'LUKKET';position:absolute;top:65px;font-weight:900;background:#eee;padding:8px;transform:rotate(-12deg)}.production{display:flex;align-items:center;height:145px;margin:10px -10px}.machine{z-index:2;flex:0 0 85px;height:125px;border-radius:15px;background:#cf5840;border:5px solid #a13b2a;text-align:center;color:#fff4d7;box-shadow:4px 5px 0 #0002}.machine span{font-size:12px;letter-spacing:2px;font-weight:900}.machine div{font-size:40px}.machine i{display:block;margin:auto;width:54px;height:20px;background:#482c23;border-radius:15px 15px 0 0}#belt{position:relative;height:102px;flex:1;border-top:9px solid #66756c;border-bottom:9px solid #66756c;background:repeating-linear-gradient(90deg,#34463f 0 23px,#485a52 24px 27px);box-shadow:0 6px 0 #c1c5ae}.floor{width:30px;text-align:center;font-size:26px;color:#94543d}.floor small{font-size:8px;display:block}.piece{position:absolute;top:3px;width:68px;height:78px;background:#fff4d9;border:2px solid #ecd7a7;border-radius:12px;padding:0;touch-action:none;user-select:none;box-shadow:0 3px 6px #0003}.piece svg{width:51px;height:51px;display:block;margin:auto}.piece b{font-size:14px}.piece.selected{outline:4px solid #f3ba37;transform:translateY(-8px)}.piece.falling{animation:fall .6s forwards;pointer-events:none}.tray{position:absolute;inset:10px;border:7px solid #b9925d;background:#f4d5a5;z-index:-1;border-radius:8px;animation:pack .35s both}.sale{position:absolute;top:25px;font-size:44px;color:#267846;font-weight:900;text-shadow:0 2px white;animation:cash .8s both}.broken .tray{background:linear-gradient(120deg,#f4d5a5 45%,#594938 46% 50%,#f4d5a5 51%);animation:crack .5s both}.broken{animation:shake .4s}#feedback{text-align:center;min-height:20px;font-size:13px;font-weight:600;margin:17px 0 0}aside section{background:#fffcf3;border:1px solid #dfdfce;border-radius:18px;padding:20px;margin-bottom:16px}aside h2{font-size:19px;margin:5px 0 18px}ol{padding-left:23px;margin:0}li{padding:8px 0;border-bottom:1px solid #eae5d8;font-size:13px}li span{display:flex;justify-content:space-between;gap:10px}#connection{font-size:12px;color:#767568}.tip{padding:20px;background:#e2e8d5;border-radius:16px}.tip p{font-size:25px;margin:8px 0}.tip small{line-height:1.6}.overlay{position:absolute;inset:0;background:#213d32b8;backdrop-filter:blur(5px);display:grid;place-items:center;padding:20px;z-index:5}.overlay[hidden]{display:none}.dialog{max-width:500px;background:#fff9eb;padding:30px;border-radius:22px;text-align:center;box-shadow:0 20px 50px #0003}.dialog h2{font-size:32px;margin:12px 0}.dialog p{line-height:1.6;font-size:14px}#instructions{color:#757668;font-size:12px}.primary,#save{border:0;border-radius:12px;background:#cf583a;color:white;font-weight:800;padding:13px 22px}#scoreForm{margin:16px 0}#scoreForm label{display:block;font-size:12px;margin:8px}input{width:95px;font-size:20px;text-transform:uppercase;border:2px solid #bdc4ac;border-radius:8px;padding:8px}#saveStatus{font-size:12px}.dragging{position:fixed;z-index:10;pointer-events:none;opacity:.85}@keyframes pack{from{transform:scale(1.5);opacity:0}to{transform:scale(1);opacity:1}}@keyframes crack{to{transform:rotate(8deg);opacity:.8}}@keyframes cash{from{transform:translateY(20px);opacity:0}to{transform:translateY(-30px);opacity:1}}@keyframes fall{to{transform:translateY(100px) rotate(80deg);opacity:0}}@keyframes shake{25%,75%{transform:translateX(-5px)}50%{transform:translateX(5px)}}@media(max-width:1000px){.layout{grid-template-columns:1fr}aside{display:grid;grid-template-columns:1fr 1fr;gap:12px}aside section{margin:0}.tip{display:none}}@media(max-width:600px){main{padding:10px}header>.eyebrow{display:none}.heading{gap:8px;margin:18px 0}.heading p{font-size:12px}.register{min-width:130px;padding:10px}.register strong{font-size:20px}h1{font-size:27px}h1 span{display:none}.kitchen{padding:10px}.tables{padding:0;gap:8px}.table{min-height:128px;padding:4px;border-width:3px}.table svg{width:80px;height:80px}.table .amount{font-size:12px}.production{margin:8px -6px;height:125px}.machine{flex-basis:48px;height:100px;border-width:3px}.machine span{font-size:8px}.machine i{width:30px}.machine div{font-size:33px}.floor{width:18px}.piece{width:58px}.dialog{padding:20px}.dialog h2{font-size:26px}aside section{padding:13px}aside h2{font-size:16px}}

.machine{height:140px;transform-origin:50% 90%}.machine .size-controls{display:flex;gap:3px;justify-content:center;margin:7px 2px;font-size:11px}.size-controls button{padding:5px 3px;border:1px solid #802e21;border-radius:5px;color:#ffe8cf;background:#963e2c;font-size:11px;font-weight:800;min-height:30px}.size-controls button[aria-pressed="true"]{background:#ffe1a0;color:#64341c;box-shadow:0 0 0 2px #fff5c5}.tip p{font-size:20px}.tip small{display:block;margin-top:8px}@media(max-width:600px){.machine{flex-basis:62px;height:120px}.machine .size-controls{gap:3px;margin:6px 0}.size-controls button{font-size:10px;padding:4px 2px}.machine i{height:14px}.machine div:not(.size-controls){font-size:28px}}

/* Keep the cash register and all controls inside the kitchen. */
.playing aside{display:none}.playing .layout{grid-template-columns:minmax(0,1fr)}
.game-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.status .register{min-width:155px;padding:7px 12px;border-width:3px}.status .register strong{font-size:23px}.status .register small{font-size:9px}
main:fullscreen{max-width:none;width:100%;height:100%;overflow:auto;background:#f5efdf;padding:12px}
main:fullscreen .heading{display:none}main:fullscreen header{margin-bottom:10px}
.playing .heading{margin:12px 0}.playing .heading p{display:none}
.overlay{overflow:auto}.dialog{margin:auto}
@media(max-width:600px){.status{gap:7px;flex-wrap:wrap}.status .register{min-width:130px}.status .register strong{font-size:20px}.status>span{font-size:10px}.game-actions{width:100%;justify-content:flex-end}.status button{padding:6px 10px}.playing .heading{margin:8px 0}.playing h1{font-size:22px}}
@media(max-height:650px) and (min-width:601px){.playing main{padding:8px}.playing header{font-size:12px}.playing .heading{display:none}.playing .kitchen{padding:8px 16px}.playing .status{margin-bottom:5px}.playing .table{min-height:95px;padding:2px}.playing .table svg{width:65px;height:65px}.playing .production{height:120px;margin:3px -8px}.playing .machine{height:117px}.playing .machine div:not(.size-controls){font-size:23px}.playing #feedback{margin:6px 0 0}.playing .status .register{padding:3px 10px}}

/* Highscores belong to the start/end card, just like Formelgraver. */
.layout{grid-template-columns:minmax(0,1fr)}
.dialog{width:min(530px,100%);max-width:530px;max-height:100%;overflow:auto;padding:22px 26px}
.overlay{display:flex;align-items:center;justify-content:center;padding:14px}
.records{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:9px;margin-top:16px;text-align:left}
.records section{min-width:0;padding:10px;margin:0;background:#fffdf5;border:2px solid #e3cd9f;border-radius:11px}
.records h3{margin:0 0 8px;font-size:9px;letter-spacing:1px;color:#876a48;text-align:center}
.records ol{padding-left:20px}.records li{font-size:12px;padding:4px 0}.records li span{gap:5px}.records li span span{white-space:nowrap}
.dialog #connection{font-size:10px;margin:8px 0 0}
@media(max-width:600px){.dialog{padding:16px}.records section{padding:8px 5px}.records li{font-size:11px}.records h3{font-size:8px;letter-spacing:.6px}.dialog h2{font-size:26px}.dialog #dialogText{font-size:13px}.dialog #instructions{font-size:11px}}

/* One self-contained game surface at every screen size. */
html,body{width:100%;height:100%;overflow:hidden}
body{background:#234237}
body main,body.playing main,body main:fullscreen{width:100%;max-width:none;height:100dvh;margin:0;padding:0;overflow:hidden;background:#234237}
.layout{height:100%;gap:0}
.kitchen,.playing .kitchen{height:100%;padding:10px 18px;border:0;border-radius:0;display:grid;grid-template-rows:auto auto minmax(0,1fr) 145px minmax(0,1fr) auto;gap:8px}
.topbar{position:relative;z-index:6;background:#234e40;color:#fff9df;border-radius:12px;padding:7px 12px;min-height:45px}
.topbar a{color:#fff9df;font-size:30px;line-height:1;text-align:center;min-width:30px}
.topbar h1,.playing .topbar h1{font-size:clamp(17px,2.5vw,26px);letter-spacing:-.5px;margin:0}
.topbar button{font-size:12px;padding:6px 10px}
.status,.playing .status{margin:0;gap:8px}.status .game-actions{width:auto}
.tables{min-height:0;padding:0 35px}
.table,.playing .table{min-height:0;justify-content:center;padding:3px}
.table svg,.playing .table svg{height:calc(100% - 20px);max-height:135px;width:auto;max-width:100%;min-height:0}
.production,.playing .production{height:100%;margin:0 -8px}
#feedback,.playing #feedback{margin:0;font-size:12px;min-height:18px}
.overlay{top:64px}
main:fullscreen header{margin-bottom:0}
@media(max-width:600px){.kitchen,.playing .kitchen{padding:6px;gap:6px;grid-template-rows:auto auto minmax(0,1fr) 125px minmax(0,1fr) auto}.tables{padding:0;gap:8px}.status{flex-wrap:wrap}.status .register{min-width:110px;padding:4px 8px}.status .register strong{font-size:18px}.status .game-actions{margin-left:auto}.overlay{top:57px;padding:8px}.topbar{padding:5px 8px}.status>span{font-size:10px}}
@media(max-height:500px){.kitchen,.playing .kitchen{padding:4px 8px;gap:3px;grid-template-rows:38px 42px minmax(0,1fr) 96px minmax(0,1fr) 16px}.topbar{min-height:0}.status .register strong{font-size:17px}.status .register small{font-size:7px}.status .register{padding:2px 8px}.machine,.playing .machine{height:94px}.machine div:not(.size-controls),.playing .machine div:not(.size-controls){font-size:15px}.machine i{height:8px}.machine .size-controls{margin-top:3px}#belt{height:86px}.table,.playing .table{border-width:2px}.table .label{font-size:10px}.overlay{top:45px}}

.clear-table{position:absolute;bottom:7px;right:7px;border:2px solid #ffdad3;border-radius:9px;padding:6px 9px;background:#c72828;color:white;font-size:12px;font-weight:800;z-index:2;animation:clear-pulse 1.1s ease-in-out infinite}.table{cursor:pointer}.discarded-pizza{position:absolute;inset:15px;pointer-events:none;z-index:3}.discarded-pizza svg{width:100%;height:100%;overflow:visible}#closeShop{background:#a73c2f;color:white;font-size:12px}@keyframes clear-pulse{50%{background:#f64d3a;box-shadow:0 0 0 4px #ff6a5944}}@media(prefers-reduced-motion:reduce){.clear-table{animation:none}}@media(max-height:500px){.status .game-actions{flex-wrap:nowrap}#closeShop{font-size:10px;padding:5px}.clear-table{font-size:10px;bottom:2px;right:2px;padding:3px}}
