/* Cormac's Kitchen ------------------------------------------------------- */

:root {
  --tomato: #e23e2e;
  --tomato-dark: #b82c1f;
  --butter: #ffd23f;
  --sky: #4a7bc8;
  --pickle: #2e9e5b;
  --pickle-deep: #1f7a44;
  --cream: #fff6e5;
  --paper: #fffdf7;
  --ink: #24303f;
  --ink-soft: #5c6b7d;

  --edge: 4px solid var(--ink);
  --pop: 0 6px 0 var(--ink);
  --pop-sm: 0 4px 0 var(--ink);
  --round: 22px;

  --display: "Baloo 2", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --body: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.05;
  margin: 0;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.4rem, 7vw, 4.2rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); }

img { display: block; max-width: 100%; }

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

:focus-visible {
  outline: 4px solid var(--sky);
  outline-offset: 3px;
}

.hide { display: none !important; }

.wrap {
  width: min(1180px, 100% - 2rem);
  margin-inline: auto;
}

/* Gingham tablecloth, used only on the sign-in screen. ------------------- */
.cloth {
  background-color: var(--cream);
  background-image:
    linear-gradient(rgba(226, 62, 46, 0.14) 50%, transparent 50%),
    linear-gradient(90deg, rgba(226, 62, 46, 0.14) 50%, transparent 50%);
  background-size: 64px 64px, 64px 64px;
}

/* Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.6rem;
  border: var(--edge);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--pop-sm);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.btn:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 var(--ink);
}

.btn-send {
  background: var(--tomato);
  color: #fff;
  font-size: 1.4rem;
  padding: 1rem 2rem;
  box-shadow: var(--pop);
}

.btn-done {
  background: var(--pickle);
  color: #fff;
  width: 100%;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  padding: 1.1rem;
  border-radius: 18px;
  box-shadow: var(--pop);
}

.btn-quiet {
  background: transparent;
  box-shadow: none;
  border-width: 3px;
  font-size: 1rem;
  padding: 0.5rem 1.1rem;
}

/* Sign-in ---------------------------------------------------------------- */
.signin {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem 3.5rem;
  text-align: center;
}

.sign-lead {
  font-size: 1.2rem;
  color: var(--ink-soft);
  margin: 0.6rem 0 0;
}

.marquee {
  display: inline-block;
  background: var(--paper);
  border: var(--edge);
  border-radius: var(--round);
  box-shadow: var(--pop);
  padding: 1.6rem 2.4rem 1.9rem;
  max-width: 34rem;
}

.marquee h1 { color: var(--tomato); }

.people {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.4rem;
  margin-top: 2.6rem;
  padding: 0;
  list-style: none;
}

.person-btn {
  display: grid;
  justify-items: center;
  gap: 0.7rem;
  padding: 1.1rem 1rem 1.3rem;
  width: 10.5rem;
  background: var(--paper);
  border: var(--edge);
  border-radius: var(--round);
  box-shadow: var(--pop);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.person-btn:active {
  transform: translateY(5px);
  box-shadow: 0 1px 0 var(--ink);
}

.person-btn .face {
  width: 7rem;
  height: 7rem;
}

.person-btn .who {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.5rem;
}

.person-btn .job {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-top: -0.4rem;
}

.face {
  border-radius: 50%;
  border: var(--edge);
  object-fit: cover;
  background: var(--cream);
}

/* PIN gate */
.pin-form {
  display: flex;
  gap: 0.7rem;
  justify-content: center;
  margin-top: 1.6rem;
}

.pin-form input {
  font: 700 1.6rem var(--display);
  width: 8rem;
  text-align: center;
  padding: 0.6rem;
  border: var(--edge);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  letter-spacing: 0.3em;
}

.notice {
  margin-top: 1rem;
  color: var(--tomato-dark);
  font-weight: 700;
  min-height: 1.5rem;
}

/* Top bar (order + kitchen screens) -------------------------------------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1.1rem;
  background: var(--paper);
  border-bottom: var(--edge);
}

.bar .face { width: 3.2rem; height: 3.2rem; border-width: 3px; }

.bar-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.45rem;
  line-height: 1.1;
}

.bar-sub {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.bar-spacer { margin-left: auto; }

/* Menu grid -------------------------------------------------------------- */
.menu-section { margin: 2rem 0 0; }

.menu-section h2 {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--ink);
}

.menu-section h2::after {
  content: "";
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: repeating-linear-gradient(
    90deg, var(--butter) 0 14px, transparent 14px 26px
  );
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 1rem;
  margin-top: 1rem;
  padding: 0;
  list-style: none;
}

.dish {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  width: 100%;
  padding: 0.9rem 0.5rem 1rem;
  background: var(--paper);
  border: var(--edge);
  border-radius: var(--round);
  box-shadow: var(--pop-sm);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.dish img { width: 5.2rem; height: 5.2rem; }

.dish .label {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.1rem;
}

.dish:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }

.dish.picked {
  background: var(--butter);
}

.dish .count {
  position: absolute;
  top: -0.7rem;
  right: -0.5rem;
  min-width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  padding: 0 0.4rem;
  background: var(--tomato);
  color: #fff;
  border: 3px solid var(--ink);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.2rem;
}

/* Tray ------------------------------------------------------------------- */
.tray {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1.1rem calc(0.8rem + env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: var(--edge);
  transform: translateY(110%);
  transition: transform 0.2s ease;
}

.tray.up { transform: translateY(0); }

.tray-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  flex: 1;
  min-width: 0;
}

.tray-chip {
  position: relative;
  width: 3.4rem;
  height: 3.4rem;
  padding: 0.25rem;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--cream);
}

.tray-chip .count {
  top: -0.6rem;
  right: -0.6rem;
  min-width: 1.7rem;
  height: 1.7rem;
  font-size: 0.95rem;
  border-width: 2px;
}

.tray-pad { height: 7rem; }

/* Order status strips ---------------------------------------------------- */
.tickets { display: grid; gap: 1rem; margin-top: 1.4rem; padding: 0; list-style: none; }

.strip {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  background: var(--paper);
  border: var(--edge);
  border-radius: var(--round);
  box-shadow: var(--pop-sm);
}

.strip.served { background: #e7f6ec; }

.strip-foods { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.strip-foods img { width: 2.8rem; height: 2.8rem; }

.strip-text { font-family: var(--display); font-weight: 700; font-size: 1.15rem; }
.strip-when { font-size: 0.9rem; color: var(--ink-soft); }

/* Kitchen ---------------------------------------------------------------- */
.kitchen-start {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1.6rem;
  text-align: center;
  padding: 2rem 1rem;
}

.kitchen-start .face { width: 9rem; height: 9rem; }

.rail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
  gap: 1.3rem;
  margin: 1.4rem 0 3rem;
  padding: 0;
  list-style: none;
}

.ticket {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.1rem;
  background: var(--paper);
  border: var(--edge);
  border-radius: var(--round);
  box-shadow: var(--pop);
}

.ticket-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.ticket-head .face { width: 5.4rem; height: 5.4rem; }

.ticket-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  line-height: 1;
}

.ticket-when { font-size: 0.95rem; color: var(--ink-soft); }

.ticket-foods {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.food-slot {
  position: relative;
  width: 5.6rem;
  height: 5.6rem;
  padding: 0.35rem;
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 16px;
}

.food-slot .count {
  top: -0.7rem;
  right: -0.7rem;
}

.ticket.new-order {
  animation: pop-in 0.35s ease-out both;
}

@keyframes pop-in {
  from { transform: scale(0.9) translateY(10px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.empty {
  display: grid;
  justify-items: center;
  gap: 0.8rem;
  text-align: center;
  padding: 4rem 1rem;
  color: var(--ink-soft);
}

.empty img { width: 7rem; height: 7rem; opacity: 0.75; }
.empty p { margin: 0; font-size: 1.2rem; }

/* Tap the chef's own face to be greeted by name -------------------------- */
.chef-badge {
  display: block;
  padding: 0;
  border: none;
  background: none;
  border-radius: 50%;
  transition: transform 0.1s ease;
}

.chef-badge:active { transform: scale(0.92); }

/* Star jar --------------------------------------------------------------- */
.jar {
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  padding: 0.4rem 0.7rem 0.5rem;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: var(--cream);
}

.jar-stars {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.15rem;
}

.star svg {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
  fill: #e8e0cd;
  stroke: var(--ink);
  stroke-width: 1.4;
  stroke-linejoin: round;
}

.star.on svg { fill: var(--butter); }

.jar-total {
  font-size: 0.75rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* Jar-full celebration --------------------------------------------------- */
.party {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(36, 48, 63, 0.55);
}

.party-card {
  display: grid;
  justify-items: center;
  gap: 1rem;
  padding: 2rem 2.4rem 2.4rem;
  text-align: center;
  background: var(--paper);
  border: var(--edge);
  border-radius: var(--round);
  box-shadow: var(--pop);
}

.party-card h1 { color: var(--tomato); }

.party-stars {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem;
  max-width: 22rem;
}

.party-stars .star svg {
  width: 2.8rem;
  height: 2.8rem;
  stroke-width: 1.1;
}

.party-stars .star {
  animation: star-drop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

@keyframes star-drop {
  from { transform: translateY(-1.5rem) scale(0.4) rotate(-25deg); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* Thank-you notes -------------------------------------------------------- */
.notes {
  position: fixed;
  top: 5.5rem;
  right: 1rem;
  z-index: 55;
  display: grid;
  gap: 0.6rem;
  justify-items: end;
  pointer-events: none;
}

.note {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 1rem 0.6rem 0.6rem;
  background: var(--paper);
  border: var(--edge);
  border-radius: 999px;
  box-shadow: var(--pop-sm);
  animation: note-in 0.35s ease-out both;
}

.note .face { width: 3rem; height: 3rem; border-width: 3px; }
.note-glyph { font-size: 1.8rem; line-height: 1; }
.note-text { font-family: var(--display); font-weight: 700; font-size: 1.1rem; }

@keyframes note-in {
  from { transform: translateX(1.5rem); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* A written note needs room to breathe */
.note-long {
  border-radius: var(--round);
  align-items: flex-start;
  max-width: min(24rem, 80vw);
  padding: 0.8rem 1.1rem;
}

.note-long .note-text { white-space: normal; }
.note-from { font-family: var(--display); font-weight: 800; font-size: 1rem; }
.note-said { font-size: 1.05rem; line-height: 1.3; }

/* Read-aloud button on a ticket ------------------------------------------ */
.btn-speak {
  margin-left: auto;
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  flex: none;
  color: var(--ink);
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 50%;
}

.btn-speak svg { width: 1.5rem; height: 1.5rem; }
.btn-speak:active { background: var(--butter); }

/* Reaction buttons on the customer screen -------------------------------- */
.reactions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 0.5rem 0 0 1rem;
}

.reaction {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.9rem 0.4rem 0.6rem;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--pop-sm);
}

.reaction:active { transform: translateY(3px); box-shadow: none; }
.reaction-glyph { font-size: 1.4rem; line-height: 1; }
.reaction-label { font-family: var(--display); font-weight: 700; }

/* Writing a message to Cormac */
.quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  width: 100%;
}

.chip {
  padding: 0.35rem 0.8rem;
  background: var(--butter);
  border: 3px solid var(--ink);
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
}

.chip:active { transform: translateY(2px); }

.compose-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.4rem;
}

.compose-field {
  flex: 1 1 12rem;
  min-width: 0;
  padding: 0.6rem 0.9rem;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 14px;
}

.compose-row .btn-send { font-size: 1.1rem; padding: 0.55rem 1.4rem; }

.reactions-done {
  font-family: var(--display);
  font-weight: 700;
  color: var(--pickle-deep);
}

/* The 30-second alarm ---------------------------------------------------- */
#flash {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  background: var(--butter);
  box-shadow: inset 0 0 0 16px var(--tomato);
}

body.alarm #flash {
  animation: flash 0.75s steps(1, end) infinite;
}

@keyframes flash {
  0%, 49%  { opacity: 0.55; background: var(--butter); }
  50%, 100% { opacity: 0.22; background: var(--tomato); }
}

body.alarm .bar { background: var(--butter); }

@media (prefers-reduced-motion: reduce) {
  body.alarm #flash { animation: soft-pulse 2.4s ease-in-out infinite; }
  .ticket.new-order { animation: none; }
  .party-stars .star, .note { animation: none; }
  .btn, .dish, .person-btn, .tray { transition: none; }
  @keyframes soft-pulse {
    0%, 100% { opacity: 0.1; }
    50%      { opacity: 0.32; }
  }
}

/* Small screens ---------------------------------------------------------- */
@media (max-width: 34rem) {
  .person-btn { width: 8.6rem; }
  .person-btn .face { width: 5.6rem; height: 5.6rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(6.6rem, 1fr)); }
  .dish img { width: 4.1rem; height: 4.1rem; }
  .dish .label { font-size: 0.95rem; }
  .bar-sub { display: none; }
  .jar-total { display: none; }
  .star svg { width: 0.95rem; height: 0.95rem; }
  .notes { top: 4.6rem; left: 1rem; justify-items: center; }
  .note-text { font-size: 0.95rem; }
}
