:root {
  --ink: #252321;
  --cream: #f7eddb;
  --paper: #fffaf0;
  --red: #ef5b3f;
  --red-dark: #c8382f;
  --yellow: #f7c84b;
  --green: #4e8c65;
  --teal: #1f6565;
  --muted: #817a70;
  --line: rgba(37, 35, 33, 0.16);
  --shadow: 0 12px 30px rgba(77, 55, 36, 0.12);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 5%, rgba(247, 200, 75, .26), transparent 28%),
    linear-gradient(135deg, #f9f1e3 0%, #efe2cc 100%);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
  overflow-x: hidden;
}

button { font: inherit; }

button:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .035;
  z-index: 20;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

.game-shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 30px 16px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(210px, .65fr) minmax(560px, 1.7fr);
  gap: 22px;
  align-items: center;
  margin-bottom: 22px;
}

.brand { display: flex; flex-direction: column; line-height: 1; }
.brand-kicker { color: var(--red); font-size: 10px; font-weight: 900; letter-spacing: .3em; margin-bottom: 7px; }
.brand-name { font-family: Impact, "Arial Black", sans-serif; font-size: clamp(20px, 2.2vw, 31px); letter-spacing: -.025em; white-space: nowrap; }
.brand-name i { color: var(--red); font-family: Georgia, serif; font-weight: 400; }

.hud {
  display: grid;
  grid-template-columns: 1.2fr 1fr .8fr;
  background: rgba(255,255,255,.58);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 18px;
  box-shadow: 0 5px 18px rgba(65,51,40,.08);
  backdrop-filter: blur(8px);
}

.hud-card { position: relative; min-height: 66px; padding: 10px 19px; display: flex; flex-direction: column; justify-content: center; }
.hud-card + .hud-card::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 1px; background: var(--line); }
.hud-label { font-size: 9px; font-weight: 900; letter-spacing: .16em; color: var(--muted); }
.hud-card strong { font-family: Impact, "Arial Black", "Yu Gothic", sans-serif; font-size: 24px; line-height: 1.15; }
.hud-card strong small { font: 700 11px "Yu Gothic", sans-serif; }
.hud-card > small { font-size: 9px; color: var(--muted); }
.timer-card strong { color: var(--red); }
.time-track { position: absolute; left: 19px; right: 19px; bottom: 8px; height: 3px; overflow: hidden; border-radius: 9px; background: #eadac4; }
.time-track span { display: block; width: 100%; height: 100%; background: var(--red); transition: width .2s linear; }
.streak { align-self: flex-start; padding: 2px 6px; border-radius: 3px; background: var(--yellow); font-size: 8px; font-weight: 900; letter-spacing: .08em; }

.customer-zone {
  min-height: 238px;
  padding: 22px 24px 18px;
  border-radius: 23px 23px 9px 9px;
  background:
    linear-gradient(rgba(23,82,82,.95), rgba(25,95,93,.95)),
    repeating-linear-gradient(45deg, transparent 0 10px, rgba(255,255,255,.04) 10px 11px);
  box-shadow: 0 15px 35px rgba(31,101,101,.2);
  color: white;
  position: relative;
  overflow: hidden;
}

.customer-zone::after {
  content: "";
  position: absolute;
  inset: auto -80px -130px auto;
  width: 310px;
  height: 310px;
  border: 45px solid rgba(255,255,255,.035);
  border-radius: 50%;
}

.section-heading { display: flex; align-items: end; justify-content: space-between; position: relative; z-index: 1; }
.section-heading h1, .panel-title h2 { margin: 0; font-size: 19px; line-height: 1.15; }
.eyebrow, .panel-title > div > span { display: block; color: var(--yellow); font-size: 9px; font-weight: 900; letter-spacing: .19em; margin-bottom: 4px; }
.queue-heading p { margin: 0 0 2px; color: rgba(255,255,255,.72); font-size: 10px; }
.queue-heading kbd { margin-left: 3px; border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.1); color: white; }
.pulse-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #8ddaa6; box-shadow: 0 0 0 4px rgba(141,218,166,.12); margin-right: 6px; }

.customer-queue {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-top: 16px;
}

.customer-card {
  min-width: 0;
  height: 139px;
  padding: 12px;
  border: 2px solid transparent;
  border-radius: 13px;
  background: var(--paper);
  color: var(--ink);
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 7px 0 rgba(19,52,51,.25);
  transition: transform .15s, border-color .15s, box-shadow .15s;
  animation: customer-in .28s cubic-bezier(.2,.9,.3,1.2) both;
  overflow: hidden;
}
.customer-card:hover { transform: translateY(-3px); }
.customer-card.selected { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(247,200,75,.22), 0 8px 0 rgba(19,52,51,.24); transform: translateY(-2px); }
.customer-card.leaving { animation: customer-out .35s ease-in both; }
.customer-card.shake { animation: shake .28s linear; }

@keyframes customer-in { from { opacity: 0; transform: translateY(20px) scale(.95); } }
@keyframes customer-out { to { opacity: 0; transform: translateY(-14px) rotate(2deg); } }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.avatar-wrap { display: flex; flex-direction: column; align-items: center; }
.avatar { width: 44px; height: 44px; border-radius: 50% 50% 45% 45%; display: grid; place-items: center; background: var(--avatar-bg); font-size: 27px; box-shadow: inset 0 -4px rgba(0,0,0,.07); }
.mood { font-size: 15px; line-height: 1; margin-top: 5px; }
.customer-info { min-width: 0; }
.customer-name { display: flex; align-items: center; justify-content: space-between; gap: 4px; font-size: 10px; color: var(--muted); font-weight: 700; }
.customer-name b { color: var(--ink); font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.order-line { display: flex; align-items: center; gap: 5px; margin: 3px 0 5px; min-width: 0; }
.order-name { min-width: 0; font-size: 13px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trait-badge { flex: 0 0 auto; padding: 2px 5px; border-radius: 8px; background: #e7dece; color: #6f675e; font-size: 8px; font-style: normal; font-weight: 900; }
.trait-rush { background: #ffe0d6; color: #b53629; }
.trait-vip { background: #f9dfa0; color: #815d05; }
.trait-chill { background: #dcece4; color: #326b48; }
.recipe-strip { display: flex; flex-wrap: wrap; gap: 8px; min-height: 35px; align-content: flex-start; }
.recipe-chip { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 5px; background: #eee4d1; font-size: 7px; font-weight: 900; text-align: center; line-height: 1; transform: scale(1.25);}
.recipe-chip .mini-layer { width: 17px; }
.patience-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.patience-bar { flex: 1; height: 5px; border-radius: 5px; background: #e8ddca; overflow: hidden; }
.patience-bar span { display: block; height: 100%; width: 100%; background: var(--green); transition: width .1s linear, background .2s; }
.patience-time { width: 25px; font-size: 8px; color: var(--muted); font-weight: 700; }

.empty-counter {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 125px;
  border: 1px dashed rgba(255,255,255,.23);
  border-radius: 14px;
  color: rgba(255,255,255,.55);
  font-size: 12px;
  letter-spacing: .06em;
}

.worktop { display: grid; grid-template-columns: minmax(0, .88fr) minmax(0, 1.45fr); gap: 14px; margin-top: 14px; }
.panel { min-width: 0; background: rgba(255,250,240,.92); border: 1px solid rgba(255,255,255,.9); border-radius: 10px 10px 22px 22px; box-shadow: var(--shadow); padding: 19px 20px; }
.panel-title { display: flex; gap: 11px; align-items: center; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.panel-title > div > span { color: var(--red); }
.step-number { width: 35px; height: 35px; display: grid; place-items: center; background: var(--ink); color: white; border-radius: 7px; font: 14px Impact, "Arial Black", sans-serif; transform: rotate(-2deg); }

.station-list { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 12px; }
.station-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #f4ead9; }
.station-topline { padding: 9px 10px; display: flex; align-items: center; gap: 7px; background: rgba(255,255,255,.35); }
.station-topline div { display: flex; flex-direction: column; min-width: 0; }
.station-topline b { font-size: 12px; }
.station-topline small { font-size: 8px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.station-icon { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--yellow); font-weight: 900; }
.prep-actions { display: grid; gap: 1px; background: rgba(37,35,33,.08); }
.prep-button { position: relative; min-height: 54px; padding: 7px 8px; display: grid; grid-template-columns: 27px 1fr 24px; align-items: center; gap: 7px; border: 0; background: var(--paper); text-align: left; cursor: pointer; overflow: hidden; }
.prep-button:hover { background: white; }
.prep-button.busy { cursor: wait; }
.prep-button > span:nth-child(2) { display: flex; flex-direction: column; position: relative; z-index: 1; }
.prep-button b { font-size: 11px; }
.prep-button small { color: var(--muted); font-size: 8px; }
.prep-button em { position: relative; z-index: 1; width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: #ece1cd; font-style: normal; font-size: 10px; font-weight: 900; }
.prep-progress { position: absolute !important; z-index: 0 !important; inset: 0 auto 0 0; width: 0; background: rgba(247,200,75,.32); transition: width .08s linear; }
.food-visual { position: relative; z-index: 1; display: inline-block; margin: auto; }
.patty-mini { width: 24px; height: 9px; border-radius: 45%; background: #683b28; box-shadow: inset 0 3px rgba(255,255,255,.1); }
.bacon-mini { width: 25px; height: 9px; border-radius: 2px; background: repeating-linear-gradient(90deg, #b54235 0 4px, #f2a08f 4px 7px); transform: rotate(-5deg); }
.lettuce-mini { width: 25px; height: 10px; background: #68a84f; border-radius: 50% 35%; transform: rotate(5deg); }
.tomato-mini { width: 21px; height: 13px; border-radius: 50%; background: #e84d3d; box-shadow: inset 0 0 0 2px #ff7965; }
.station-tip { margin: 8px 2px 0; color: var(--muted); font-size: 9px; }
kbd { border: 1px solid #cfc1aa; border-bottom-width: 2px; padding: 1px 5px; border-radius: 3px; background: white; font: 8px inherit; }

.assembly-content { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.assembly-content > * { min-width: 0; }
.ingredient-rail { display: grid; grid-template-columns: repeat(8, minmax(0,1fr)); gap: 6px; align-content: start; }
.ingredient-button { position: relative; min-width: 0; min-height: 67px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; gap: 0; padding: 7px 4px 4px; cursor: pointer; text-align: center; transition: transform .12s, background .12s, box-shadow .12s; }
.ingredient-button:hover:not(:disabled) { background: white; transform: translateY(-2px); }
.ingredient-button:active:not(:disabled) { transform: translateY(1px); }
.ingredient-button:disabled { opacity: .42; cursor: not-allowed; }
.ingredient-button .ingredient-graphic { height: 23px; display: grid; place-items: center; transform: scale(.72); transform-origin: center; }
.ingredient-button span:nth-child(2) { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.ingredient-button b { font-size: 10px; }
.ingredient-button small { max-width: 100%; color: var(--muted); font-size: 8px; line-height: 1.3; overflow-wrap: anywhere; }
.ingredient-button em { position: absolute; left: 4px; top: 4px; font-style: normal; font-size: 7px; font-weight: 900; padding: 2px 4px; border-radius: 8px; background: #eee3d0; }
.ingredient-key { position: absolute; right: 4px; top: 4px; min-width: 18px; height: 18px; display: grid; place-items: center; border: 1px solid #cfc1aa; border-bottom-width: 2px; border-radius: 3px; background: white; color: var(--ink); font-size: 8px; font-style: normal; font-weight: 900; }

.tray-wrap { border-radius: 10px; background: #eee1ca; padding: 14px 13px 12px; position: relative; display: grid; grid-template-columns: minmax(210px, 1.25fr) minmax(220px, .75fr); grid-template-rows: 1fr auto; gap: 8px 16px; }
.ticket-pin { position: absolute; z-index: 3; left: 12px; top: 10px; max-width: calc(62% - 10px); min-height: 29px; padding: 5px 10px; border-radius: 4px; background: var(--yellow); box-shadow: 0 3px 0 #d8a82d; transform: rotate(-1deg); display: flex; align-items: center; gap: 7px; font-size: 9px; font-weight: 900; white-space: nowrap; overflow: hidden; }
.ticket-pin > b { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ticket-recipe { flex: 0 0 auto; display: flex; gap: 2px; }
.ticket-recipe .mini-layer { width: 14px; }
.tray-stage { grid-column: 1; grid-row: 1 / 3; min-height: 128px; display: flex; flex-direction: column; align-items: center; justify-content: end; position: relative; }
.burger-stack { min-height: 106px; width: 150px; display: flex; flex-direction: column-reverse; align-items: center; justify-content: flex-start; padding-bottom: 13px; position: relative; z-index: 1; }
.burger-stack p { margin: auto; color: #aa9d88; font-size: 10px; text-align: center; line-height: 1.7; }
.tray-shadow { position: absolute; bottom: 8px; width: 155px; height: 18px; border-radius: 50%; background: #c1af93; box-shadow: 0 4px 0 #d8c8ad; }
.burger-layer { position: relative; display: block; margin-bottom: -2px; animation: layer-drop .22s cubic-bezier(.22,.9,.42,1.2) both; flex-shrink: 0; }
@keyframes layer-drop { from { opacity: 0; transform: translateY(-35px) scale(.75); } }
.layer-bottom-bun { width: 105px; height: 15px; border-radius: 5px 5px 25px 25px; background: #e6a842; box-shadow: inset 0 -4px #c98228; }
.layer-top-bun { width: 108px; height: 27px; border-radius: 60px 60px 10px 10px; background: #edae48; box-shadow: inset 0 -5px #d28a2c; }
.layer-top-bun::after { content: "·  ·   ·"; position: absolute; inset: 1px 0 auto; text-align: center; color: #fff0b0; font-size: 12px; font-weight: 900; }
.layer-patty { width: 112px; height: 17px; border-radius: 10px 8px 12px 10px; background: #613523; box-shadow: inset 0 4px #7b4a35, inset 0 -3px #462416; }
.layer-cheese { width: 105px; height: 9px; background: #f4bd28; clip-path: polygon(0 0, 100% 4%, 88% 100%, 52% 55%, 15% 100%); z-index: 2; }
.layer-lettuce { width: 118px; height: 11px; background: #67a84e; clip-path: polygon(0 35%, 10% 0, 20% 45%, 33% 5%, 45% 50%, 58% 0, 70% 44%, 83% 8%, 100% 40%, 94% 100%, 7% 90%); z-index: 3; }
.layer-tomato { width: 107px; height: 11px; border-radius: 7px; background: #e74f3e; box-shadow: inset 0 3px #ff7965; }
.layer-bacon { width: 112px; height: 9px; background: repeating-linear-gradient(100deg, #b84234 0 9px, #efa08c 9px 13px); clip-path: polygon(0 20%, 15% 0, 30% 26%, 45% 0, 60% 27%, 75% 1%, 100% 26%, 98% 100%, 82% 73%, 65% 100%, 48% 72%, 31% 100%, 15% 73%, 1% 100%); z-index: 4; }
.layer-sauce { width: 94px; height: 7px; border-radius: 50%; background: #f3e4c1; box-shadow: inset 0 -2px #d8c298; z-index: 4; }
.mini-layer { display: inline-block; height: 5px; width: 20px; min-height: 4px; border-radius: 2px; }
.mini-layer.layer-top-bun, .mini-layer.layer-bottom-bun { height: 7px; }
.mini-layer.layer-top-bun::after { display: none; }

.build-readout { grid-column: 2; grid-row: 1; align-self: end; display: flex; justify-content: space-between; border-top: 1px solid rgba(37,35,33,.1); padding: 38px 2px 7px; color: var(--muted); font-size: 9px; font-weight: 700; }
.tray-actions { grid-column: 2; grid-row: 2; display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, .9fr) minmax(0, 1.45fr); gap: 7px; }
.tray-actions button { min-width: 0; min-height: 39px; border-radius: 7px; cursor: pointer; font-weight: 900; }
.trash-button, .undo-button { border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 9px; }
.trash-button:hover { color: var(--red-dark); border-color: var(--red); }
.undo-button:hover { color: var(--teal); border-color: var(--teal); }
.trash-button b, .undo-button b { margin-left: 3px; border: 1px solid currentColor; border-bottom-width: 2px; padding: 1px 4px; border-radius: 3px; font-size: 7px; }
.serve-button { border: 0; background: var(--red); color: white; display: flex; align-items: center; justify-content: center; gap: 10px; box-shadow: 0 4px 0 var(--red-dark); transition: transform .1s, box-shadow .1s; }
.serve-button:hover { background: #f4664a; }
.serve-button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--red-dark); }
.serve-button b { font-size: 7px; border: 1px solid rgba(255,255,255,.45); border-bottom-width: 2px; padding: 2px 4px; border-radius: 3px; }
.serve-button.success { background: var(--green); box-shadow: 0 4px 0 #326b48; }

.game-footer { display: flex; justify-content: space-between; align-items: center; min-height: 35px; padding: 8px 5px 0; color: var(--muted); font-size: 9px; }
.game-footer p { margin: 0; }
.legend { display: flex; gap: 13px; }
.legend span { display: flex; align-items: center; gap: 4px; }
.legend i { width: 6px; height: 6px; border-radius: 50%; }
.legend .good { background: var(--green); } .legend .warn { background: var(--yellow); } .legend .bad { background: var(--red); }

.toast-region { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 7px; pointer-events: none; }
.toast { min-width: 220px; padding: 10px 16px; border-radius: 8px; background: var(--ink); color: white; box-shadow: 0 8px 20px rgba(0,0,0,.2); text-align: center; font-size: 11px; font-weight: 700; animation: toast-in .25s ease, toast-out .3s 1.55s ease forwards; }
.toast.good { background: var(--green); } .toast.bad { background: var(--red-dark); } .toast.tip { color: var(--ink); background: var(--yellow); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px); } }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(25,40,37,.72); backdrop-filter: blur(8px); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
.modal-backdrop.visible { opacity: 1; visibility: visible; }
.modal { width: min(480px, 100%); max-height: calc(100vh - 30px); overflow-y: auto; position: relative; padding: 35px 42px 29px; border: 2px solid var(--ink); border-radius: 8px; background: var(--paper); box-shadow: 12px 12px 0 var(--yellow); text-align: center; transform: translateY(18px) scale(.97); transition: transform .3s cubic-bezier(.2,.9,.3,1.15); }
.visible .modal { transform: translateY(0) scale(1); }
.modal::before { content: ""; position: absolute; inset: 8px; pointer-events: none; border: 1px solid #dfd1ba; border-radius: 4px; }
.modal > * { position: relative; z-index: 1; }
.modal-badge { position: absolute; top: 13px; left: -33px; padding: 5px 34px; background: var(--red); color: white; font: 8px Impact, "Arial Black", sans-serif; letter-spacing: .12em; transform: rotate(-42deg); }
.modal-burger { height: 92px; width: 125px; margin: 0 auto 13px; display: flex; flex-direction: column; justify-content: center; align-items: center; filter: drop-shadow(0 8px 4px rgba(70,40,20,.15)); }
.modal-burger span { display: block; margin-bottom: -2px; }
.modal-burger .top { width: 111px; height: 31px; background: #e9a73e; border-radius: 60px 60px 8px 8px; box-shadow: inset 0 -5px #ca7d25; }
.modal-burger .lettuce { width: 123px; height: 11px; background: #67a84e; clip-path: polygon(0 30%,10% 0,20% 50%,30% 0,45% 50%,60% 0,75% 50%,88% 0,100% 45%,95% 100%,5% 90%); }
.modal-burger .cheese { width: 112px; height: 10px; background: var(--yellow); clip-path: polygon(0 0, 100% 4%, 88% 100%, 52% 55%, 15% 100%); }
.modal-burger .patty { width: 119px; height: 17px; background: #613523; border-radius: 8px; box-shadow: inset 0 4px #7c4a35; }
.modal-burger .tomato { width: 111px; height: 10px; border-radius: 5px; background: var(--red); }
.modal-burger .bottom { width: 108px; height: 15px; background: #e9a73e; border-radius: 3px 3px 20px 20px; box-shadow: inset 0 -4px #ca7d25; }
.modal .eyebrow { color: var(--red); }
.modal h2 { margin: 8px 0 11px; font-size: clamp(27px, 5vw, 40px); line-height: 1.2; font-weight: 900; letter-spacing: -.04em; }
.modal > p { margin: 0 auto; max-width: 385px; color: var(--muted); font-size: 11px; line-height: 1.9; }
.how-to { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 21px 0; }
.how-to > div { min-width: 0; min-height: 78px; padding: 8px 4px; border-radius: 6px; background: #f1e5d1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; text-align: center; }
.how-to b { flex: 0 0 auto; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--yellow); font: 10px Impact, "Arial Black", sans-serif; }
.how-to span { min-width: 0; display: flex; flex-direction: column; align-items: center; }
.how-to strong { font-size: 11px; line-height: 1.35; }
.how-to small { max-width: 100%; color: var(--muted); font-size: 9px; line-height: 1.5; white-space: normal; }
.primary-button { width: 100%; min-height: 49px; border: 0; border-radius: 7px; padding: 0 20px; background: var(--red); color: white; font-weight: 900; cursor: pointer; box-shadow: 0 5px 0 var(--red-dark); transition: transform .1s, box-shadow .1s; }
.primary-button:hover { background: #f86b4d; }
.primary-button:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--red-dark); }
.primary-button span { float: right; font-size: 20px; }
.keyboard-note { display: block; margin-top: 13px; color: #a99b86; font-size: 9px; }
.strategy-intro, .eco-intro { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 10px; border-radius: 6px; }
.strategy-intro { margin: -8px 0 7px; border: 1px dashed #d5a931; background: #fff4cf; color: #755a11; }
.strategy-intro p { margin: 0; font-size: 9px; line-height: 1.55; }
.eco-intro { margin: 0 0 18px; border: 1px dashed #7eaa84; background: #eef4e8; color: #326b48; }
.eco-intro span { flex: 0 0 auto; font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.eco-intro p { margin: 0; font-size: 9px; line-height: 1.55; }

.result-modal { width: min(430px, 100%); padding-top: 29px; }
.result-mobile-break { display: none; }
.result-message span { display: block; }
.result-message span + span { margin-top: 4px; }
.result-message .result-detail { color: #615a51; font-weight: 700; }
.result-message .next-grade { color: var(--red-dark); font-weight: 900; }
.result-stamp { position: absolute; right: 35px; top: 25px; width: 53px; height: 53px; display: grid; place-items: center; border: 4px double var(--red); border-radius: 50%; color: var(--red); font: 25px Impact, "Arial Black", sans-serif; transform: rotate(10deg); }
.result-stamp.grade-s { color: var(--red); border-color: var(--red); }
.result-stamp.grade-ss { color: #70519b; border-color: #8d70b5; background: #f1e9fa; font-size: 22px; }
.result-stamp.grade-sss { color: #926206; border-color: #d4a629; background: #fff2b9; box-shadow: 0 0 0 4px rgba(247,200,75,.2); font-size: 18px; }
.result-modal h2 { font-size: 30px; }
.result-profit { margin: 18px 0 12px; padding: 11px; background: var(--ink); color: white; display: flex; align-items: center; justify-content: center; gap: 18px; transform: rotate(-1deg); }
.result-profit span { font-size: 10px; letter-spacing: .12em; }
.result-profit strong { color: var(--yellow); font: 25px Impact, "Arial Black", sans-serif; }
.eco-result { margin: -4px 0 12px; min-height: 42px; padding: 7px 11px; display: grid; grid-template-columns: 1fr auto; align-items: center; border: 1px solid #9cbd9f; border-radius: 6px; background: #edf5e8; color: #326b48; text-align: left; }
.eco-result > span { font-size: 9px; font-weight: 900; letter-spacing: .1em; }
.eco-result strong { grid-row: 1 / 3; grid-column: 2; font-size: 18px; }
.eco-result small { font-size: 9px; color: #65806b; }
.eco-result.no-bonus { filter: grayscale(1); opacity: .7; }
.result-grid { display: grid; grid-template-columns: repeat(3,1fr); border: 1px solid var(--line); margin-bottom: 18px; }
.result-grid div { min-height: 55px; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.result-grid div:nth-child(3n) { border-right: 0; }
.result-grid div:nth-child(n+4) { border-bottom: 0; }
.result-grid span { color: var(--muted); font-size: 9px; }
.result-grid b { font-size: 12px; }

@media (max-width: 1050px) {
  .game-shell { padding: 18px; }
  .topbar { grid-template-columns: 180px 1fr; gap: 12px; }
  .customer-queue { grid-template-columns: repeat(2, 1fr); }
  .customer-zone { min-height: 385px; }
  .worktop { grid-template-columns: minmax(0, 1fr); }
  .prep-area .station-list { grid-template-columns: 1fr 1fr; }
  .assembly-content { grid-template-columns: minmax(0, 1fr); }
  .ingredient-rail { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .game-shell { padding: 12px; }
  .topbar { grid-template-columns: 1fr; }
  .brand { grid-column: 1; }
  .hud { grid-column: 1 / -1; grid-row: 2; }
  .hud-card { padding: 9px 11px; min-height: 62px; }
  .hud-card strong { font-size: 19px; }
  .time-track { left: 11px; right: 11px; }
  .customer-zone { min-height: 0; padding: 18px 12px; }
  .customer-queue { grid-template-columns: 1fr 1fr; gap: 8px; }
  .customer-card { grid-template-columns: 43px 1fr; padding: 9px; }
  .avatar { width: 38px; height: 38px; font-size: 23px; }
  .queue-heading p { display: none; }
  .panel { padding: 15px 12px; }
  .assembly-content { grid-template-columns: 1fr; }
  .ingredient-button { min-height: 67px; grid-template-columns: 1fr; place-items: center; text-align: center; gap: 0; padding: 4px 2px; }
  .ingredient-button span:nth-child(2) { align-items: center; }
  .ingredient-button em { position: absolute; left: 3px; top: 3px; margin: 0; }
  .ingredient-key { right: 3px; top: 3px; margin: 0; }
  .ingredient-button .ingredient-graphic { transform: scale(.66); transform-origin: center; }
  .tray-wrap { display: block; padding-top: 16px; }
  .ticket-pin { position: relative; left: auto; top: auto; width: max-content; max-width: calc(100% - 18px); margin: -23px auto 3px; }
  .tray-stage { min-height: 144px; }
  .build-readout { padding-top: 7px; }
  .game-footer { display: none; }
  .modal { padding: 30px 24px 24px; }
}

@media (max-width: 480px) {
  .customer-queue { grid-template-columns: 1fr; }
  .customer-card { height: 130px; }
  .station-list { grid-template-columns: 1fr !important; }
  .ingredient-rail { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .modal-burger { height: 68px; margin-bottom: 7px; transform: scale(.82); }
  .modal h2 { margin: 6px 0 9px; }
  .modal > p { line-height: 1.65; }
  .how-to { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 14px 0; }
  .how-to > div { min-height: 72px; padding: 6px 2px; }
  .strategy-intro, .eco-intro { gap: 6px; padding: 6px; }
  .result-grid { grid-template-columns: repeat(2,1fr); }
  .result-grid div:nth-child(3n) { border-right: 1px solid var(--line); }
  .result-grid div:nth-child(2n) { border-right: 0; }
  .result-grid div:nth-child(n+4) { border-bottom: 1px solid var(--line); }
  .result-grid div:nth-child(n+5) { border-bottom: 0; }
}

@media (max-width: 360px) {
  .result-mobile-break { display: inline; }
  .result-modal h2 { padding-right: 45px; font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
