:root {
  color-scheme: dark;
  --bg: #07080c;
  --bg-elevated: #121018;
  --text: #fffaf4;
  --muted: #a9a4a0;
  --line: rgba(255, 255, 255, 0.13);
  --stroke: rgba(255, 255, 255, 0.1);
  --shadow: 0 26px 60px rgba(0, 0, 0, 0.42);
  --radius-lg: 28px;
  --radius-md: 14px;
  --font: Inter, "DM Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --wallet-lift: min(44px, 11vw);
  --wallet-dim-shift: min(12px, 3.5vw);
  --wallet-ease: cubic-bezier(0.32, 0.72, 0, 1);
  --wallet-duration: 0.52s;
  /* Smaller overlap = more of each card stays visible (wallet strip). */
  --stack-overlap: clamp(22px, 5.5vw, 30px);
  /* Even less overlap under the first card so the top card always shows a bit more. */
  --stack-overlap-top: clamp(14px, 3.6vw, 20px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 255, 255, 0.07), transparent 34%),
    linear-gradient(180deg, #121018 0%, #07080c 60%, #040507 100%);
  color: var(--text);
}

body {
  padding-bottom: calc(40px + var(--safe-bottom));
}

.page {
  max-width: 520px;
  margin: 0 auto;
  padding: 28px 18px 40px;
}

.hero {
  text-align: center;
  margin-bottom: 28px;
}

.eyebrow {
  display: inline-flex;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #d9d3cf;
  background: rgba(255, 255, 255, 0.045);
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  white-space: pre-line;
}

.lede {
  margin: 0 auto;
  max-width: 34ch;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.wallet {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding-top: 8px;
  padding-bottom: 8px;
  min-height: 200px;
  overflow: visible;
}

.wallet-error {
  margin: 0;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 107, 90, 0.45);
  background: rgba(80, 20, 20, 0.35);
  color: #fecaca;
  font-size: 0.88rem;
  line-height: 1.45;
}

.wallet-error a {
  color: #93c5fd;
  font-weight: 600;
}

.wallet-error a:hover {
  text-decoration: underline;
}

.wallet-card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 16px 16px 18px;
  margin-bottom: 0;
  overflow: hidden;
  isolation: isolate;
  transform: translateY(0) scale(1);
  transform-origin: 50% 100%;
  transition:
    transform var(--wallet-duration) var(--wallet-ease),
    margin var(--wallet-duration) var(--wallet-ease),
    box-shadow var(--wallet-duration) var(--wallet-ease),
    filter 0.35s ease;
  cursor: pointer;
  outline: none;
  color: #fffaf4;
  flex-shrink: 0;
}

.wallet-card:not(:last-child) {
  margin-bottom: calc(-1 * var(--stack-overlap));
}

/* Top-of-stack card (first in the list): keep a larger visible strip above the next card. */
.wallet-card:first-of-type:not(:last-child) {
  margin-bottom: calc(-1 * var(--stack-overlap-top));
}

.wallet-card > .card-top,
.wallet-card > .actions {
  position: relative;
  z-index: 1;
}

.wallet-card[class*="card-theme-"]::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 28%),
    radial-gradient(circle at 95% 55%, rgba(255, 255, 255, 0.11), transparent 35%);
}

.wallet-card[class*="card-theme-"]::after {
  content: "";
  position: absolute;
  right: 22px;
  bottom: 18px;
  width: 122px;
  height: 122px;
  border-radius: 36px;
  opacity: 0.16;
  transform: rotate(-12deg);
  z-index: 0;
  pointer-events: none;
}

.wallet-card.card-theme-protein {
  border: 1px solid rgba(255, 126, 154, 0.24);
  background:
    radial-gradient(circle at 84% 16%, rgba(153, 32, 57, 0.42), transparent 33%),
    linear-gradient(135deg, #3a0c19, #65192d 56%, #18090f);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.13);
}

.wallet-card.card-theme-protein::after {
  background: linear-gradient(135deg, #fff, #b20f36);
}

.wallet-card.card-theme-stol {
  color: #2b1309;
  border: 1px solid rgba(255, 175, 106, 0.52);
  background:
    radial-gradient(circle at 84% 16%, rgba(255, 151, 66, 0.55), transparent 33%),
    linear-gradient(135deg, #fff2de, #ff8a42 56%, #b73917);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.13);
}

.wallet-card.card-theme-stol::after {
  background: linear-gradient(135deg, #ff4b22, #fff);
}

.wallet-card.card-theme-buns {
  color: #271407;
  border: 1px solid rgba(255, 207, 100, 0.55);
  background:
    radial-gradient(circle at 84% 16%, rgba(255, 193, 76, 0.58), transparent 33%),
    linear-gradient(135deg, #fff4da, #ffb84d 56%, #ff7a1e);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.13);
}

.wallet-card.card-theme-buns::after {
  background: linear-gradient(135deg, #fff, #ff8a21);
}

.wallet-card.card-theme-monsta {
  border: 1px solid rgba(255, 207, 27, 0.28);
  background:
    radial-gradient(circle at 84% 16%, rgba(255, 58, 43, 0.36), transparent 33%),
    linear-gradient(135deg, #100606, #36100f 56%, #050303);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.13);
}

.wallet-card.card-theme-monsta::after {
  background: linear-gradient(135deg, #ffcf1b, #ff3a2b);
}

.wallet-card:focus-visible {
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.13), 0 0 0 3px rgba(255, 250, 244, 0.35);
}

.wallet-card.card-theme-stol:focus-visible,
.wallet-card.card-theme-buns:focus-visible {
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.13), 0 0 0 3px rgba(43, 19, 9, 0.35);
}

.wallet-card:last-child {
  margin-bottom: 0;
}

.wallet-card .card-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.wallet-card .logo-wrap {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  overflow: hidden;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  padding: 4px;
  background: #fffaf0;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24), inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.wallet-card.card-theme-stol .logo-wrap,
.wallet-card.card-theme-buns .logo-wrap {
  background: #fff;
}

.wallet-card.card-theme-monsta .logo-wrap {
  background: #070303;
}

.wallet-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.wallet-card .titles {
  flex: 1;
  min-width: 0;
}

.wallet-card .brand {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.wallet-card .tag {
  margin: 6px 0 0;
  font-size: 0.8125rem;
  font-weight: 600;
}

.wallet-card.card-theme-protein .tag {
  color: #ff8ba4;
}

.wallet-card.card-theme-stol .tag {
  color: #6c1d0d;
}

.wallet-card.card-theme-buns .tag {
  color: #7a3500;
}

.wallet-card.card-theme-monsta .tag {
  color: #ffcb2e;
}

.wallet-card .actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition: max-height 0.42s var(--wallet-ease), opacity 0.22s ease, margin var(--wallet-duration) var(--wallet-ease);
}

.wallet-card.is-open .actions {
  max-height: 120px;
  opacity: 1;
  margin-top: 16px;
  pointer-events: auto;
  transition: max-height 0.45s var(--wallet-ease), opacity 0.35s ease 0.06s, margin var(--wallet-duration) var(--wallet-ease);
}

.wallet-card.is-open {
  margin-bottom: 14px;
  transform: translateY(calc(-1 * var(--wallet-lift))) scale(1.03);
  filter: brightness(1.06);
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.55),
    0 14px 44px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.wallet-card.is-dimmed {
  transform: translateY(var(--wallet-dim-shift)) scale(0.99);
  filter: brightness(0.68) saturate(0.92);
}

.wallet-card.is-open:focus-visible {
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.55),
    0 14px 44px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 0 0 3px rgba(255, 250, 244, 0.45);
}

.wallet-card.card-theme-stol.is-open:focus-visible,
.wallet-card.card-theme-buns.is-open:focus-visible {
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.45),
    0 14px 44px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 0 0 3px rgba(43, 19, 9, 0.45);
}

.btn-delivery {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 10px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  color: #0b0b0c;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-delivery:active {
  transform: scale(0.98);
}

.btn-delivery.grab {
  background: #fff;
  color: #00b14f;
  border: 1px solid rgba(0, 177, 79, 0.35);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

.btn-delivery.grab:hover {
  filter: brightness(0.97);
}

.btn-delivery.grab:active {
  filter: brightness(0.94);
}

.btn-delivery.gojek {
  background: linear-gradient(135deg, #00aa13, #008f10);
  color: #fff;
}

.map-block {
  margin-top: 36px;
}

.map-block h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.map-hint {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

.map-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 11;
  background: var(--bg-elevated);
}

.map-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.footer {
  margin-top: 22px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}

.admin-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  width: min(520px, calc(100vw - 28px));
  max-height: min(86vh, 720px);
  margin: 0;
  padding: 0;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  background: #101014;
  color: var(--text);
  box-shadow: var(--shadow);
}

.admin-panel::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

.admin-inner {
  padding: 18px 18px 20px;
  max-height: min(86vh, 720px);
  overflow: auto;
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.admin-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.btn-close {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}

.btn-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.admin-intro {
  margin: 0 0 14px;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}

.field input {
  font: inherit;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: #0a0a0c;
  color: var(--text);
}

.field textarea {
  font: inherit;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: #0a0a0c;
  color: var(--text);
  width: 100%;
  min-height: 4.5rem;
  resize: vertical;
  line-height: 1.35;
}

.field-help {
  margin: 0 0 16px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.admin-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-card-block {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--stroke);
  background: #0c0c10;
}

.admin-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.admin-card-head h3 {
  margin: 0;
  font-size: 0.95rem;
  flex: 1;
  min-width: 0;
}

.admin-card-order {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.btn-order {
  min-width: 36px;
  padding: 6px 8px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
}

.btn-order:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}

.btn-order:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.admin-card-block .field {
  margin-bottom: 10px;
}

.admin-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
  flex-wrap: wrap;
}

.btn {
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn.primary {
  background: #f4f4f5;
  color: #0c0c0e;
}

.btn.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--stroke);
}

@media (min-width: 720px) {
  :root {
    --stack-overlap: clamp(24px, 3.2vw, 32px);
    --stack-overlap-top: clamp(16px, 2.6vw, 22px);
  }

  .page {
    max-width: 640px;
    padding-top: 40px;
  }

  .wallet-card .logo-wrap {
    width: 80px;
    height: 80px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --wallet-duration: 0.14s;
    --wallet-lift: 28px;
    --wallet-dim-shift: 8px;
  }

  .wallet-card,
  .wallet-card .actions {
    transition-duration: 0.12s;
  }
}
