:root {
  color-scheme: dark;
  --bg: #140c13;
  --bg-deep: #0b1512;
  --panel: rgba(31, 19, 29, 0.82);
  --panel-strong: rgba(14, 31, 27, 0.92);
  --line: rgba(255, 214, 230, 0.18);
  --line-strong: rgba(45, 232, 190, 0.42);
  --text: #fff8fb;
  --muted: #b9a8b2;
  --accent: #2ce0b8;
  --accent-2: #ff9fbd;
  --accent-3: #ffd76b;
  --danger: #ff6f91;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  color: var(--text);
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 203, 147, 0.36), transparent 23rem),
    radial-gradient(circle at 88% 18%, rgba(255, 155, 190, 0.22), transparent 15rem),
    linear-gradient(155deg, #2a1825 0%, var(--bg) 46%, var(--bg-deep) 100%);
  overflow-x: hidden;
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
}

body::before {
  background-image:
    radial-gradient(circle, rgba(255, 245, 249, 0.34) 0 1px, transparent 1.5px),
    linear-gradient(105deg, transparent 0 13%, rgba(255, 195, 213, 0.12) 13.2% 13.6%, transparent 14%),
    linear-gradient(72deg, transparent 0 77%, rgba(255, 211, 224, 0.18) 77.2% 77.5%, transparent 78%);
  background-size:
    18px 18px,
    100% 100%,
    100% 100%;
  opacity: 0.55;
}

body::after {
  background:
    radial-gradient(ellipse at 4% 16%, rgba(255, 203, 228, 0.46) 0 2.8rem, transparent 2.9rem),
    radial-gradient(ellipse at 94% 61%, rgba(255, 218, 232, 0.36) 0 4.7rem, transparent 4.8rem),
    radial-gradient(ellipse at 34% 97%, rgba(255, 186, 209, 0.24) 0 5rem, transparent 5.1rem);
  filter: blur(0.2px);
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 720px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 14px max(22px, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 2px 16px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(27px, 7vw, 44px);
  line-height: 0.94;
  letter-spacing: 0;
}

.status-pill {
  flex: 0 0 auto;
  min-width: 74px;
  padding: 8px 11px;
  border: 1px solid rgba(44, 224, 184, 0.42);
  border-radius: 999px;
  background: rgba(11, 28, 24, 0.8);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 0 22px rgba(44, 224, 184, 0.18);
}

.balance-strip,
.tabs,
.checkout {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.balance-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 64px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 8px;
}

.balance-strip strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  letter-spacing: 0;
}

.muted {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ghost-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 12px;
  padding: 6px;
  border-color: rgba(44, 224, 184, 0.34);
  border-radius: 8px;
  background: rgba(2, 24, 20, 0.7);
}

.tab {
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(255, 255, 255, 0.46);
  font-weight: 900;
}

.tab.active {
  color: #051c18;
  background: linear-gradient(180deg, #33edc3, #18bda1);
  box-shadow: 0 8px 22px rgba(44, 224, 184, 0.26);
}

.hint {
  margin: 0 4px 14px;
  color: rgba(255, 248, 251, 0.72);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.gift-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.gift-card {
  position: relative;
  min-height: 162px;
  padding: 12px 10px 11px;
  border: 1px solid rgba(44, 224, 184, 0.27);
  border-radius: 8px;
  background:
    linear-gradient(160deg, rgba(41, 21, 35, 0.88), rgba(6, 33, 28, 0.86)),
    radial-gradient(circle at 45% 8%, rgba(255, 160, 193, 0.18), transparent 5.2rem);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 15px 38px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.gift-card::before {
  position: absolute;
  inset: 16px auto 16px 0;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(44, 224, 184, 0.9);
  content: "";
}

.gift-card.selected {
  border-color: rgba(255, 215, 107, 0.8);
  box-shadow:
    inset 0 0 0 1px rgba(255, 215, 107, 0.42),
    0 18px 44px rgba(255, 160, 190, 0.16),
    0 0 28px rgba(44, 224, 184, 0.19);
  transform: translateY(-2px);
}

.gift-art {
  display: grid;
  height: 70px;
  place-items: center;
}

.gift-art img,
.gift-art video,
.gift-art .lottie-gift {
  display: block;
  width: 76px;
  height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.34));
}

.gift-title {
  min-height: 34px;
  margin: 8px 0 5px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.18;
  text-align: center;
}

.gift-meta,
.gift-price {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  font-size: 14px;
  font-weight: 900;
}

.gift-meta {
  color: #ffe28a;
}

.gift-price {
  margin-top: 4px;
  color: var(--accent);
  text-shadow: 0 0 16px rgba(44, 224, 184, 0.65);
}

.checkout {
  position: relative;
  padding: 12px;
  border-color: rgba(255, 214, 230, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(37, 21, 35, 0.96), rgba(9, 31, 27, 0.96)),
    radial-gradient(circle at 20% 0, rgba(255, 160, 190, 0.18), transparent 11rem);
}

.checkout-preview {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 11px;
  align-items: center;
  margin-bottom: 12px;
}

.selected-gift-media,
.selected-gift-media img,
.selected-gift-media video,
.selected-gift-media .lottie-gift {
  display: block;
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.lottie-gift svg {
  width: 100% !important;
  height: 100% !important;
}

.checkout-preview strong {
  display: block;
  margin-top: 3px;
  font-size: 18px;
  line-height: 1.1;
}

.checkout-preview p {
  margin: 4px 0 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 10px;
}

.field span,
.field small,
.switch-row {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.field small {
  line-height: 1.35;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  outline: 0;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

input {
  height: 46px;
  padding: 0 13px;
}

textarea {
  min-height: 78px;
  padding: 12px 13px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: rgba(44, 224, 184, 0.72);
  box-shadow: 0 0 0 3px rgba(44, 224, 184, 0.12);
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 12px;
  line-height: 1.35;
}

.switch-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.primary-button {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffbad0, #ff7ca8 50%, #e76093);
  color: #210b17;
  font-size: 15px;
  font-weight: 1000;
  cursor: pointer;
  box-shadow: 0 16px 34px rgba(255, 124, 168, 0.28);
}

.primary-button:disabled {
  cursor: wait;
  filter: grayscale(0.55);
  opacity: 0.72;
}

.toast {
  position: fixed;
  z-index: 3;
  right: 14px;
  bottom: 14px;
  left: 14px;
  max-width: 560px;
  margin: 0 auto;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(9, 22, 19, 0.94);
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  border-color: rgba(255, 111, 145, 0.48);
  color: #ffd8e1;
}

@media (min-width: 560px) {
  .app-shell {
    padding-inline: 18px;
  }

  .gift-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

}
