@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(assets/manrope-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(assets/manrope-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #F5F7F8;
  --green: #1D8B58;
  --green-hi: #27AE6E;
  --green-dark: #17714A;
  --grad: linear-gradient(135deg, #27AE6E 0%, #1D8B58 60%, #17714A 100%);
  --ink: #0F1720;
  --gray: #8A93A0;
  --card: #FFFFFF;
  --shadow: 0 10px 30px rgba(15, 23, 32, .07), 0 2px 8px rgba(15, 23, 32, .05);
  --glow: 0 12px 28px rgba(29, 139, 88, .35);
  --dark-bg: #0D1117;
  --radius: 20px;
}

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

html, body { height: 100%; }

body {
  font-family: 'Manrope', -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(120% 50% at 50% -10%, rgba(39, 174, 110, .10), transparent 60%),
    var(--bg);
  color: var(--ink);
  user-select: none;
  overscroll-behavior: none;
}

.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(16px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  animation: rise .3s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.hidden { display: none; }

.screen.dark {
  background:
    radial-gradient(90% 45% at 50% 110%, rgba(39, 174, 110, .18), transparent 65%),
    var(--dark-bg);
}

.topbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  min-height: 50px;
}

.square-btn {
  width: 48px; height: 48px;
  background: var(--card);
  border: none;
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform .12s ease;
}
.square-btn:active { transform: scale(.92); }
.square-spacer { width: 48px; }

.lang-toggle {
  min-width: 48px; height: 42px;
  background: var(--card);
  border: none;
  border-radius: 14px;
  box-shadow: var(--shadow);
  font: inherit;
  font-size: 14px; font-weight: 800; color: var(--ink);
  letter-spacing: .04em;
  cursor: pointer;
  padding: 0 14px;
  transition: transform .12s ease;
}
.lang-toggle:active { transform: scale(.92); }

.logo { width: 150px; margin: 22px 0 6px; }

.title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.02em;
  text-align: center;
  margin: 16px 0;
}

.subtitle {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.01em;
  text-align: center;
  margin: 18px 0 10px;
}

/* Waiters */
.waiter-list { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }

.waiter-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--card);
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font: inherit;
  position: relative;
  transition: transform .12s ease;
}
.waiter-card:active { transform: scale(.97); }
.waiter-card::after {
  content: '';
  position: absolute; right: 18px; top: 50%;
  width: 9px; height: 9px;
  border-right: 2.5px solid #C4CAD2; border-top: 2.5px solid #C4CAD2;
  transform: translateY(-50%) rotate(45deg);
  border-radius: 1px;
}
.waiter-card img {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  outline: 3px solid rgba(29, 139, 88, .18);
  outline-offset: 2px;
}
.waiter-card .w-name { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.waiter-card .w-goal { font-size: 13.5px; font-weight: 500; color: var(--gray); margin-top: 4px; display: inline-block; }

/* Amount entry */
.waiter-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--card);
  border-radius: 999px;
  box-shadow: var(--shadow);
  padding: 6px 18px 6px 6px;
}
.waiter-chip img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.waiter-chip span { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }

.amount-display {
  font-size: 54px; font-weight: 800; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  margin: 10px 0 2px;
  min-height: 66px;
  display: flex; align-items: baseline; gap: 8px;
}
.amount-display .currency { font-size: 30px; font-weight: 700; color: var(--gray); }

.keypad {
  width: 100%;
  max-width: 340px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 14px 0 20px;
  flex: 1 0 auto;
  align-content: center;
}
.keypad button {
  height: 64px;
  background: var(--card);
  border: none;
  border-radius: 18px;
  box-shadow: 0 3px 10px rgba(15, 23, 32, .06);
  font: inherit;
  font-size: 25px; font-weight: 700; color: var(--ink);
  cursor: pointer;
  transition: transform .1s ease, background .1s ease;
}
.keypad button:active { transform: scale(.93); background: #EDF6F1; }

.btn-green {
  width: 100%;
  max-width: 340px;
  height: 58px;
  background: var(--grad);
  color: #fff;
  border: none;
  border-radius: 18px;
  box-shadow: var(--glow);
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.01em;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.btn-green:active { transform: scale(.97); box-shadow: 0 6px 16px rgba(29, 139, 88, .3); }
.btn-green:disabled { opacity: .35; box-shadow: none; cursor: default; }

.hint { font-size: 14px; font-weight: 500; color: var(--gray); text-align: center; margin-top: 14px; max-width: 300px; }

/* Guest screen */
.guest-photo {
  width: 168px; height: 168px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid transparent;
  background: var(--grad) border-box;
  box-shadow: 0 14px 34px rgba(29, 139, 88, .25);
  margin-top: 4px;
}
.guest-name { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 14px; }
.guest-goal {
  font-size: 17px; font-weight: 800; letter-spacing: -.01em; color: #fff;
  background: var(--grad);
  box-shadow: 0 8px 20px rgba(29, 139, 88, .3);
  border-radius: 999px;
  padding: 10px 20px;
  text-align: center; margin-top: 8px; max-width: 330px;
}

.row-card {
  width: 100%; max-width: 340px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 15px 20px;
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px;
}
.row-label { font-size: 14.5px; font-weight: 600; color: var(--gray); }
.row-value { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.row-value.big { font-size: 25px; letter-spacing: -.02em; }
.row-card.total { background: linear-gradient(135deg, rgba(39,174,110,.10), rgba(29,139,88,.05)); box-shadow: inset 0 0 0 1.5px rgba(29,139,88,.35), var(--shadow); }
.row-card.total .row-value { color: var(--green-dark); }

.tips-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  width: 100%; max-width: 340px;
}
.tip-chip {
  border: none;
  background: var(--card);
  box-shadow: 0 3px 10px rgba(15, 23, 32, .06);
  border-radius: 16px;
  padding: 12px 2px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: pointer;
  font: inherit;
  transition: transform .12s ease, box-shadow .12s ease;
}
.tip-chip:active { transform: scale(.93); }
.tip-chip .t-pct { font-size: 17px; font-weight: 800; color: var(--ink); }
.tip-chip .t-amt { font-size: 11.5px; font-weight: 600; color: var(--gray); font-variant-numeric: tabular-nums; }
.tip-chip.selected { background: var(--grad); box-shadow: var(--glow); transform: scale(1.05); }
.tip-chip.selected .t-pct { color: #fff; }
.tip-chip.selected .t-amt { color: rgba(255, 255, 255, .85); }

.link-btn {
  background: none; border: none;
  color: var(--gray);
  font: inherit;
  font-size: 14px; font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-top: 12px;
  cursor: pointer;
}
.link-btn.selected { color: var(--green); font-weight: 800; }

.btn-pay { margin-top: 18px; }

.pay-marks { display: flex; gap: 14px; margin-top: 20px; align-items: center; }
.pay-marks img { height: 32px; opacity: .9; }
.contactless { width: 44px; margin-top: 10px; opacity: .7; }

/* Tap to pay */
.tap-center {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 80px;
}
.tap-text { color: #fff; font-size: 30px; font-weight: 800; letter-spacing: -.02em; }

.card-icon {
  width: 214px; height: 135px;
  border: 4px solid #fff;
  border-radius: 20px;
  position: relative;
  animation: cardpulse 2s ease-in-out infinite;
}
@keyframes cardpulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(39, 174, 110, .5); }
  50%      { box-shadow: 0 0 0 26px rgba(39, 174, 110, 0); }
}
.card-row { display: flex; align-items: center; gap: 10px; margin: 36px 0 0 20px; }
.card-chip { width: 29px; height: 21px; border-radius: 4px; background: linear-gradient(135deg, #B8C0CB, #7E8794); }
.card-nfc { width: 24px; filter: invert(65%) sepia(6%) saturate(300%) hue-rotate(180deg); }
.card-digits { display: flex; gap: 8px; margin: 26px 0 0 22px; }
.card-digits i { width: 36px; height: 15px; border-radius: 3px; background: #2A313B; }

.progress-gif { width: 120px; border-radius: 24px; }

/* Success */
.success-gif {
  width: 150px; margin: 12px 0;
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.success-spacer { flex: 1 0 20px; }

.review-btn {
  width: 100%; max-width: 340px;
  background: var(--card);
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  cursor: pointer;
  font: inherit;
  margin-bottom: 14px;
  transition: transform .12s ease;
}
.review-btn:active { transform: scale(.97); }
.review-top { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 800; letter-spacing: -.01em; color: var(--ink); }
.review-top img { width: 26px; }
.review-stars { display: flex; gap: 6px; }
.review-stars img { width: 22px; }

/* QR */
.qr-box {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-top: 8px;
}
.qr-box svg, .qr-box img { display: block; width: 216px; height: 216px; }

/* Desktop: phone-like centered column */
@media (min-width: 700px) {
  body {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100dvh;
  }
  .screen {
    width: 430px;
    min-height: 100dvh;
    box-shadow: 0 0 0 1px rgba(15, 23, 32, .06), 0 20px 60px rgba(15, 23, 32, .12);
    background:
      radial-gradient(120% 50% at 50% -10%, rgba(39, 174, 110, .10), transparent 60%),
      var(--bg);
  }
  .screen.dark { background: var(--dark-bg); }
}
