:root {
  --ink: #141824;
  --muted: #647084;
  --line: #dbe2ec;
  --bg: #edf3f7;
  --card: #ffffff;
  --blue: #2563eb;
  --green: #119267;
  --red: #d94343;
  --yellow: #f0a920;
  --shadow: 0 18px 45px rgba(31, 46, 74, .13);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
}

button { font: inherit; cursor: pointer; }
.hidden { display: none !important; }

.phone-app {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: 18px;
  padding-bottom: 104px;
}

.phone-app.single-step {
  padding-bottom: 18px;
}

.hero, .seat-hero {
  color: white;
  border-radius: 26px;
  padding: 28px;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background:
    linear-gradient(180deg, rgba(10, 16, 28, .18), rgba(10, 16, 28, .85)),
    url("https://images.unsplash.com/photo-1504674900247-0877df9cc836?auto=format&fit=crop&w=1200&q=80") center/cover;
  box-shadow: var(--shadow);
}

.seat-hero {
  min-height: 190px;
  background:
    linear-gradient(135deg, rgba(20, 24, 36, .95), rgba(37, 99, 235, .82)),
    url("https://images.unsplash.com/photo-1517248135467-4c7edcad34c4?auto=format&fit=crop&w=1200&q=80") center/cover;
}

.hero span, .seat-hero span, .step, .qr-card span {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.hero h1, .seat-hero h1 {
  margin: 8px 0;
  font-size: clamp(34px, 10vw, 64px);
  line-height: .98;
}

.hero p, .seat-hero p {
  max-width: 520px;
  margin: 0;
  color: #e5edf6;
}

.card, .ready-card, .qr-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 20px;
  margin-top: 18px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 3px 0 0;
  font-size: 26px;
}

.section-head strong {
  padding: 9px 12px;
  border-radius: 8px;
  background: #e9f0ff;
  color: var(--blue);
}

.classroom-map {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.classroom-photo-map {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #10151e;
}

.classroom-photo-map img {
  display: block;
  width: 100%;
  height: auto;
}

.photo-seat {
  position: absolute;
  transform: translate(-50%, -50%);
  width: clamp(24px, 3.7vw, 42px);
  height: clamp(24px, 3.7vw, 42px);
  border-radius: 999px;
  border: 2px solid white;
  color: white;
  font-size: clamp(12px, 1.7vw, 17px);
  font-weight: 900;
  box-shadow: 0 5px 16px rgba(0, 0, 0, .35);
}

.photo-seat.free {
  background: rgba(17, 146, 103, .90);
}

.photo-seat.busy {
  background: rgba(217, 67, 67, .92);
  cursor: not-allowed;
}

.photo-seat.selected {
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, .25), 0 8px 24px rgba(0, 0, 0, .35);
}

.class-table {
  border: 1px solid var(--line);
  background: #f8fbff;
  border-radius: 18px;
  padding: 16px;
}

.class-table h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 22px;
}

.class-table p {
  margin: 0 0 12px;
  color: var(--muted);
}

.seat {
  width: 100%;
  min-height: 86px;
  border: 2px solid #b9c7da;
  border-radius: 16px;
  background: #fff;
  font-weight: 900;
  font-size: 24px;
}

.seat.selected {
  border-color: var(--blue);
  background: #eaf1ff;
  color: var(--blue);
}

.seat.busy {
  border-color: #efb7b7;
  background: #fff0f0;
  color: var(--red);
  cursor: not-allowed;
}

.tabs {
  display: flex;
  overflow-x: auto;
  gap: 9px;
  padding-bottom: 8px;
}

.tabs button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 10px 13px;
  background: #eef3f8;
  color: var(--muted);
  font-weight: 800;
}

.tabs button.active {
  color: white;
  background: var(--ink);
}

.food-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.food-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
}

.food-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.food-body {
  padding: 14px;
  display: grid;
  gap: 8px;
}

.food-body h3, .food-body p { margin: 0; }
.food-body p { color: var(--muted); font-size: 14px; }

.food-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 900;
}

.qty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.qty button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 13px;
  background: #e9f0ff;
  color: var(--blue);
  font-weight: 900;
  font-size: 22px;
}

.checkout-bar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(calc(100% - 28px), 880px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: rgba(20, 24, 36, .96);
  color: white;
  border-radius: 22px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.checkout-bar span { display: block; color: #bdc8d8; font-size: 13px; }
.checkout-bar strong { font-size: 24px; }

.checkout-bar button {
  border: 0;
  border-radius: 15px;
  background: var(--green);
  color: white;
  padding: 14px 18px;
  font-weight: 900;
}

.collect-button {
  margin-top: 20px;
  border: 0;
  border-radius: 16px;
  background: var(--green);
  color: white;
  padding: 15px 18px;
  font-weight: 900;
  width: 100%;
}

.status-screen {
  min-height: calc(100vh - 36px);
  display: grid;
  place-items: center;
}

.ready-card {
  width: min(100%, 620px);
  text-align: center;
}

.ready-card > span {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff4d9;
  color: #a66c00;
  font-weight: 900;
}

.ready-card h1 {
  margin: 16px 0 6px;
  font-size: clamp(44px, 13vw, 86px);
  line-height: 1;
}

.progress-shell {
  height: 28px;
  border-radius: 999px;
  background: #e8eef5;
  overflow: hidden;
  margin: 22px 0 10px;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: width .5s ease;
}

#progressPercent {
  display: block;
  font-size: 34px;
}

.status-items {
  margin-top: 18px;
  display: grid;
  gap: 10px;
  text-align: left;
}

.status-items div {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fbfdff;
}

.qr-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.qr-card {
  width: min(100%, 520px);
  text-align: center;
}

.qr-card h1 {
  font-size: clamp(34px, 9vw, 58px);
  margin: 8px 0 20px;
}

.qr-card img {
  width: min(100%, 360px);
  border-radius: 22px;
}

.qr-card p {
  color: var(--muted);
  overflow-wrap: anywhere;
}

@media (min-width: 760px) {
  .classroom-map {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .classroom-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
