:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #101522;
  color: #fff7ed;
}

* {
  box-sizing: border-box;
}

html,
body,
#gameRoot {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  min-width: 320px;
  min-height: 100vh;
  background: #101522;
  touch-action: none;
  user-select: none;
}

#gameRoot {
  position: relative;
  isolation: isolate;
}

#gameCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  outline: none;
  background: #101522;
}

#hud {
  position: fixed;
  z-index: 3;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  top: max(12px, env(safe-area-inset-top));
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}

.brand-lockup,
.meter {
  border: 1px solid rgba(45, 212, 191, 0.42);
  background: rgba(16, 21, 34, 0.76);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(250, 204, 21, 0.08);
  backdrop-filter: blur(8px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(548px, 45vw);
  padding: 12px 16px;
  border-radius: 8px;
}

.mark {
  position: relative;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border: 2px solid #2dd4bf;
  background: #fff7ed;
  box-shadow: 0 0 22px rgba(45, 212, 191, 0.35);
}

.mark::before,
.mark::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  height: 10px;
  background: #fb923c;
}

.mark::before {
  top: 12px;
  box-shadow: 0 10px 0 #86efac, 0 20px 0 #facc15;
}

.mark::after {
  left: 12px;
  right: 12px;
  bottom: 4px;
  background: #ef4444;
}

h1,
h2,
p {
  margin: 0;
}

.brand-lockup h1 {
  font-size: clamp(1.16rem, 2vw, 1.92rem);
  line-height: 1;
  letter-spacing: 0;
}

.brand-lockup p {
  margin-top: 5px;
  color: rgba(255, 247, 237, 0.84);
  font-weight: 750;
  line-height: 1.25;
}

.meter-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(96px, 1fr));
  gap: 10px;
  min-width: min(520px, 52vw);
}

.meter {
  position: relative;
  min-height: 56px;
  padding: 9px 12px 13px;
  border-radius: 8px;
  overflow: hidden;
}

.meter span {
  display: block;
  color: rgba(255, 247, 237, 0.7);
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.meter b {
  display: block;
  margin-top: 3px;
  color: #fff7ed;
  font-size: 1.3rem;
  line-height: 1.05;
}

.meter i {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  width: var(--fill, 100%);
  background: #2dd4bf;
  box-shadow: 0 0 14px currentColor;
}

.meter.score i {
  background: #facc15;
}

.meter.served i {
  background: #86efac;
}

.meter.combo i {
  background: #fb7185;
}

.meter.time i {
  background: #2563eb;
}

#touchControls {
  position: fixed;
  z-index: 4;
  left: 0;
  right: 0;
  bottom: max(12px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  pointer-events: none;
}

.food-button,
.serve-button,
.rush-button,
#modalPrimary {
  border: 0;
  border-radius: 8px;
  min-width: 116px;
  min-height: 64px;
  color: #101522;
  font: inherit;
  font-weight: 950;
  letter-spacing: 0;
  cursor: pointer;
  touch-action: manipulation;
  pointer-events: auto;
  box-shadow: 0 10px 0 rgba(0, 0, 0, 0.28), inset 0 -4px 0 rgba(0, 0, 0, 0.18), inset 0 2px 0 rgba(255, 255, 255, 0.36);
}

.burger {
  background: linear-gradient(180deg, #fff1c7, #facc15);
}

.noodle {
  background: linear-gradient(180deg, #fed7aa, #fb923c);
}

.shake {
  background: linear-gradient(180deg, #fbcfe8, #fb7185);
}

.serve-button {
  background: linear-gradient(180deg, #86efac, #2dd4bf);
}

.rush-button {
  background: linear-gradient(180deg, #60a5fa, #2563eb);
  color: #fff7ed;
}

.food-button:active,
.serve-button:active,
.rush-button:active,
#modalPrimary:active {
  transform: translateY(5px);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.3), inset 0 -2px 0 rgba(0, 0, 0, 0.18);
}

#modal {
  position: fixed;
  z-index: 8;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(circle at center, rgba(45, 212, 191, 0.18), rgba(16, 21, 34, 0.76) 45%, rgba(16, 21, 34, 0.92));
}

#modal.hidden {
  display: none;
}

.modal-frame {
  width: min(580px, calc(100vw - 36px));
  border: 2px solid rgba(250, 204, 21, 0.72);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(31, 41, 55, 0.98), rgba(16, 21, 34, 0.98));
  padding: 22px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5), 0 0 38px rgba(45, 212, 191, 0.24);
}

.titleplate {
  display: grid;
  grid-template-columns: 58px 1fr;
  grid-template-areas: "icon eyebrow" "icon title";
  gap: 2px 14px;
  align-items: center;
}

.diner-emblem {
  grid-area: icon;
  width: 58px;
  height: 58px;
  background: #fff7ed;
  border: 2px solid #2dd4bf;
  box-shadow: inset 0 -16px 0 #ef4444, 0 0 22px rgba(45, 212, 191, 0.36);
}

.titleplate p {
  color: #2dd4bf;
  font-weight: 950;
  text-transform: uppercase;
}

.titleplate h2 {
  color: #fff7ed;
  font-size: clamp(2rem, 5vw, 3.65rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.brief {
  margin-top: 18px;
  color: rgba(255, 247, 237, 0.86);
  font-size: 1.04rem;
  font-weight: 750;
  line-height: 1.45;
}

.brief-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0 22px;
}

.brief-grid span {
  border: 1px solid rgba(45, 212, 191, 0.32);
  border-radius: 8px;
  padding: 10px 8px;
  color: #facc15;
  background: rgba(16, 21, 34, 0.72);
  font-size: 0.88rem;
  font-weight: 900;
  text-align: center;
}

#modalPrimary {
  width: 100%;
  background: linear-gradient(180deg, #facc15, #fb923c);
  font-size: 1.04rem;
}

@media (max-width: 820px) {
  #hud {
    gap: 8px;
    align-items: stretch;
  }

  .brand-lockup {
    max-width: 50vw;
    padding: 9px;
  }

  .mark {
    width: 34px;
    height: 34px;
  }

  .brand-lockup h1 {
    font-size: 1rem;
  }

  .brand-lockup p {
    display: none;
  }

  .meter-row {
    grid-template-columns: repeat(2, minmax(74px, 1fr));
    min-width: 45vw;
    gap: 7px;
  }

  .meter {
    min-height: 48px;
    padding: 8px 9px 12px;
  }

  .meter b {
    font-size: 1.04rem;
  }

  #touchControls {
    display: grid;
    grid-template-columns: repeat(5, minmax(56px, 1fr));
    padding: 0 10px;
    gap: 7px;
  }

  .food-button,
  .serve-button,
  .rush-button {
    min-width: 0;
    min-height: 58px;
    font-size: 0.72rem;
    padding: 0 4px;
  }
}
