:root {
  --bg: #17110b;
  --bg-soft: #261a10;
  --panel: rgba(52, 34, 20, 0.92);
  --panel-strong: rgba(74, 43, 23, 0.96);
  --text: #fff4df;
  --muted: #d8b98b;
  --gold: #ffbd42;
  --gold-dark: #b66d14;
  --danger: #ff705a;
  --good: #77e38b;
  --shadow: rgba(0, 0, 0, 0.38);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-rounded, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at top, #4b2a16 0%, var(--bg) 58%, #090604 100%);
  color: var(--text);
  overflow: hidden;
  touch-action: manipulation;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
  color: inherit;
}

.app-shell {
  position: fixed;
  inset: 0;
  min-width: 320px;
  min-height: 568px;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  padding: calc(18px + var(--safe-top)) 18px calc(18px + var(--safe-bottom));
}

.screen-active {
  display: flex;
}

.splash-screen,
.menu-screen,
.settings-screen,
.howto-screen {
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.splash-screen {
  animation: splashFade 1.35s ease forwards;
}

.brand-card,
.hero-panel,
.panel,
.stat-strip,
.game-hud,
.tray,
.ingredient-bar {
  border: 1px solid rgba(255, 189, 66, 0.22);
  background: linear-gradient(145deg, rgba(88, 51, 25, 0.92), rgba(35, 22, 13, 0.94));
  box-shadow: 0 18px 45px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
}

.brand-card {
  width: min(86vw, 420px);
  border-radius: 30px;
  padding: 36px 24px;
  text-align: center;
}

.brand-badge {
  width: 96px;
  height: 96px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe3a1, #d96f19 58%, #5c2610 100%);
  font-size: 50px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.28);
}

.brand-card h1,
.hero-panel h2,
.panel h2 {
  margin: 0 0 8px;
  line-height: 1.05;
}

.brand-card p,
.hero-panel p,
.panel p {
  margin: 0;
  color: var(--muted);
}

.menu-screen {
  justify-content: space-between;
  gap: 18px;
}

.top-bar {
  width: min(100%, 720px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.top-bar strong {
  display: block;
  font-size: 18px;
}

.top-bar span {
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.icon-button,
.small-button {
  min-width: 44px;
  min-height: 44px;
  border-radius: 14px;
  background: rgba(255, 189, 66, 0.15);
  border: 1px solid rgba(255, 189, 66, 0.25);
}

.hero-panel {
  width: min(100%, 720px);
  border-radius: 32px;
  padding: 28px;
  text-align: center;
}

.burger-mark {
  width: 190px;
  height: 142px;
  margin: 0 auto 22px;
  position: relative;
  filter: drop-shadow(0 20px 28px rgba(0, 0, 0, 0.32));
}

.burger-mark span {
  position: absolute;
  left: 0;
  right: 0;
  margin: auto;
  border-radius: 999px;
}

.burger-mark span:nth-child(1) {
  top: 0;
  width: 180px;
  height: 58px;
  background: linear-gradient(#ffc36b, #d98229);
}

.burger-mark span:nth-child(2) {
  top: 52px;
  width: 190px;
  height: 30px;
  background: linear-gradient(90deg, #4ac66d, #b4e05b, #4ac66d);
}

.burger-mark span:nth-child(3) {
  top: 75px;
  width: 178px;
  height: 38px;
  background: linear-gradient(#7b3a21, #3b170c);
}

.burger-mark span:nth-child(4) {
  bottom: 0;
  width: 176px;
  height: 48px;
  background: linear-gradient(#e49a3a, #b75a18);
}

.menu-actions {
  width: min(100%, 520px);
  display: grid;
  gap: 12px;
}

.primary-button,
.secondary-button {
  min-height: 56px;
  border-radius: 18px;
  padding: 0 20px;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.primary-button {
  background: linear-gradient(180deg, #ffd36e, #f08a1c 58%, #a84f10);
  color: #2a1206;
}

.secondary-button {
  background: rgba(255, 244, 223, 0.08);
  border: 1px solid rgba(255, 244, 223, 0.16);
  color: var(--text);
}

.compact {
  min-height: 46px;
  border-radius: 14px;
}

.stat-strip {
  width: min(100%, 520px);
  border-radius: 22px;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  text-align: center;
}

.stat-strip span,
.game-hud strong {
  display: block;
  font-size: 22px;
  color: var(--gold);
}

.stat-strip small,
.game-hud small {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.narrow-panel {
  width: min(92vw, 430px);
  border-radius: 28px;
  padding: 24px;
}

.toggle-row {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 244, 223, 0.09);
}

.toggle-row input {
  width: 52px;
  height: 28px;
  accent-color: var(--gold);
}

.game-screen {
  flex-direction: column;
  gap: 12px;
}

.game-hud {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 8px;
  align-items: center;
  border-radius: 20px;
  padding: 10px;
  text-align: center;
}

.game-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 12px;
}

.customer-lane {
  position: relative;
  min-height: 210px;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255, 244, 223, 0.08), rgba(0, 0, 0, 0.1));
  overflow: hidden;
}

.customer-lane::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36%;
  background: linear-gradient(180deg, rgba(74, 42, 23, 0), rgba(74, 42, 23, 0.8));
}

.customer {
  position: absolute;
  left: 28px;
  bottom: 28px;
  width: 82px;
  height: 138px;
  transform-origin: bottom center;
}

.customer-entering {
  animation: customerIn 0.55s ease-out both, customerIdle 1.7s ease-in-out 0.55s infinite;
}

.customer-head {
  width: 62px;
  height: 62px;
  margin: 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #ffe0bb, #c98150 80%);
  border: 4px solid rgba(48, 25, 14, 0.6);
}

.customer-body {
  width: 82px;
  height: 78px;
  margin-top: -4px;
  border-radius: 24px 24px 18px 18px;
  background: linear-gradient(135deg, #4b89ff, #27458d);
  border: 4px solid rgba(48, 25, 14, 0.6);
}

.order-bubble {
  position: absolute;
  right: 16px;
  top: 16px;
  width: min(58vw, 310px);
  min-height: 140px;
  padding: 16px;
  border-radius: 24px 24px 24px 8px;
  background: rgba(255, 244, 223, 0.94);
  color: #2a1206;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.24);
}

.order-bubble strong {
  display: block;
  margin-bottom: 8px;
  color: #763a12;
}

.order-bubble ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 5px;
}

.order-bubble li {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
}

.counter-area {
  display: grid;
  gap: 10px;
}

.tray {
  min-height: 170px;
  border-radius: 28px;
  padding: 14px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
}

.tray > span {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
}

.burger-stack {
  align-self: end;
  min-height: 110px;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
}

.stack-item {
  width: var(--w, 190px);
  height: var(--h, 24px);
  border-radius: 999px;
  background: var(--c, #ccc);
  border: 2px solid rgba(0, 0, 0, 0.18);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.22);
  animation: stackPop 0.16s ease-out both;
}

.serve-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.25fr;
  gap: 8px;
}

.feedback {
  min-height: 22px;
  margin: 0;
  text-align: center;
  font-weight: 800;
}

.feedback.good {
  color: var(--good);
}

.feedback.bad {
  color: var(--danger);
}

.ingredient-bar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border-radius: 24px;
  padding: 10px;
}

.ingredient-button {
  min-height: 58px;
  border-radius: 18px;
  background: rgba(255, 244, 223, 0.08);
  border: 1px solid rgba(255, 244, 223, 0.14);
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px;
  text-align: left;
}

.ingredient-preview {
  width: 42px;
  height: 28px;
  border-radius: 999px;
  background: var(--c, #ccc);
  border: 2px solid rgba(0, 0, 0, 0.18);
}

.ingredient-button span:last-child {
  font-weight: 800;
  font-size: 13px;
}

@keyframes splashFade {
  0%, 78% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes customerIn {
  from { transform: translateX(-120px) scale(0.95); opacity: 0; }
  to { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes customerIdle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes stackPop {
  from { transform: translateY(-12px) scale(0.9); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@media (min-width: 760px) {
  .game-stage {
    grid-template-columns: 1.1fr 0.9fr;
    grid-template-rows: 1fr;
  }

  .ingredient-bar {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
