* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #07090d;
  --surface: #0d1118;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f5f7fa;
  --muted: #858d9a;
  --accent: #facc15;
  --danger: #ef4444;
  --success: #22c55e;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  background: radial-gradient(circle at 50% -18%, rgba(250, 204, 21, 0.065), transparent 34%), var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input {
  font: inherit;
}

.app {
  width: min(1380px, calc(100% - 48px));
  margin: 0 auto;
}

.header {
  min-height: 285px;
  padding: 64px 0 40px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  border-bottom: 1px solid var(--border);
}

.header-main {
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  color: #aeb6c2;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
}

h1 {
  font-size: clamp(48px, 7vw, 92px);
  line-height: 0.88;
  letter-spacing: -0.065em;
  font-weight: 800;
}

.subtitle {
  margin-top: 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-meta span {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: #9ba3af;
  font-size: 11px;
  white-space: nowrap;
}

.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 77px;
  padding: 18px 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.filters::-webkit-scrollbar {
  display: none;
}

.filter {
  flex: 0 0 auto;
  padding: 8px 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: #929aa6;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease;
}

.filter:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
}

.filter.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #080a0d;
}

.collection-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 34px 0 20px;
}

.section-label {
  display: block;
  margin-bottom: 7px;
  color: #626b77;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.17em;
}

.collection-head h2 {
  color: #eef1f5;
  font-size: 25px;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.count {
  padding-bottom: 2px;
  color: #727b87;
  font-size: 11px;
  white-space: nowrap;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  padding-bottom: 70px;
}

.card-item {
  position: relative;
  min-width: 0;
  min-height: 274px;
  padding: 21px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 23px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
  transition: transform 200ms ease, border-color 200ms ease, background 200ms ease;
}

.card-item::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 35%, rgba(255, 255, 255, 0.035), transparent 65%);
  transform: translateX(-100%);
  transition: transform 600ms ease;
}

.card-item:hover {
  transform: translateY(-3px);
  border-color: rgba(250, 204, 21, 0.22);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
}

.card-item:hover::before {
  transform: translateX(100%);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 38px;
}

.card-type {
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.card-index {
  color: #535c68;
  font-family: monospace;
  font-size: 10px;
}

.card-number {
  width: 100%;
  padding: 13px 12px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.27);
  color: #b9c0ca;
  font-family: monospace;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: 0.065em;
  text-align: center;
  white-space: nowrap;
}

.card-holder {
  margin-top: 14px;
  padding-left: 10px;
  border-left: 2px solid var(--accent);
  color: #7d8794;
  font-size: 11px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.card-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 25px;
  padding-top: 14px;
  border-top: 1px dashed rgba(255, 255, 255, 0.07);
}

.price-label {
  display: block;
  margin-bottom: 3px;
  color: #606a76;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.price {
  color: var(--accent);
  font-size: 23px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.balance {
  color: #10b981;
  font-size: 16px;
  font-weight: 850;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.get-btn {
  width: 100%;
  margin-top: 17px;
  padding: 11px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #080a0d;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease;
}

.get-btn:hover {
  background: #fde047;
  transform: translateY(-1px);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal.open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(14px);
}

.modal-box {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 27px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 25px;
  background: #0d1118;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.55);
  animation: modalIn 220ms ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.close {
  position: absolute;
  top: 17px;
  right: 17px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: #8b94a1;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}

.modal-eyebrow {
  color: #68717e;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.modal-box h3 {
  margin-top: 7px;
  padding-right: 40px;
  color: #f5f7fa;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.modal-description {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.qr-box {
  margin: 16px 0 0;
  padding: 14px;
  border-radius: 19px;
  background: #fff;
  text-align: center;
}

.qr-label {
  margin-bottom: 8px;
  color: #777;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.qr-box img {
  display: block;
  width: min(150px, 50vw);
  height: min(150px, 50vw);
  margin: auto;
  object-fit: contain;
}

.qr-amount {
  margin-top: 6px;
  color: #111;
  font-size: 16px;
  font-weight: 800;
}

.expiry-wrap {
  margin: 10px 0 14px;
  text-align: center;
}

.expiry-label {
  color: #68717e;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.expiry-timer {
  margin-top: 2px;
  color: #f5f7fa;
  font-family: monospace;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.expiry-warning {
  margin-top: 4px;
  color: var(--danger);
  font-size: 9px;
  line-height: 1.35;
  font-weight: 800;
}

/* Payment Form Styles */
.payment-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  color: #9ba3af;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.form-group input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.12);
}

.form-group input.error {
  border-color: var(--danger);
}

.form-group input.success {
  border-color: var(--success);
}

.error-msg {
  color: var(--danger);
  font-size: 10px;
  min-height: 14px;
}

.telegram-btn {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 17px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: #080a0d;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease;
  margin-top: 4px;
}

.telegram-btn:hover {
  background: #fde047;
  transform: translateY(-1px);
}

/* Confirm Animation States */
.telegram-btn.loading {
  background: #eab308;
  pointer-events: none;
}

.telegram-btn.loading .btn-text {
  visibility: hidden;
}

.telegram-btn.loading .arrow {
  display: none;
}

.telegram-btn.loading .spinner {
  display: inline-block;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border: 2px solid rgba(8, 10, 13, 0.2);
  border-top-color: #080a0d;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.telegram-btn.success-anim {
  background: var(--success);
  color: #fff;
  pointer-events: none;
}

.telegram-btn.success-anim .btn-text {
  width: 100%;
  text-align: center;
}

.telegram-btn.success-anim .arrow,
.telegram-btn.success-anim .spinner {
  display: none;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.arrow {
  font-size: 17px;
}

.modal-note {
  margin-top: 10px;
  color: #606975;
  font-size: 9px;
  line-height: 1.4;
  text-align: center;
}

@media (max-width: 900px) {
  .app { width: min(100% - 32px, 1380px); }
  .header { min-height: 260px; padding-top: 50px; }
  h1 { font-size: clamp(48px, 10vw, 72px); }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .app { width: calc(100% - 24px); }
  .header { min-height: auto; padding: 38px 0 28px; align-items: flex-start; flex-direction: column; gap: 24px; }
  .eyebrow { margin-bottom: 15px; }
  h1 { font-size: clamp(45px, 14vw, 64px); }
  .subtitle { margin-top: 17px; font-size: 13px; }
  .header-meta { width: 100%; }
  .header-meta span { flex: 0 0 auto; }
  .filters { min-height: 68px; padding: 15px 0; margin: 0 -12px; padding-left: 12px; padding-right: 12px; }
  .collection-head { padding: 27px 0 17px; }
  .collection-head h2 { font-size: 22px; }
  .card-grid { grid-template-columns: 1fr; gap: 12px; padding-bottom: 45px; }
  .card-item { min-height: 0; padding: 20px; }
  .card-top { margin-bottom: 32px; }
}

@media (max-width: 400px) {
  .app { width: calc(100% - 20px); }
  .header { padding-top: 30px; }
  h1 { font-size: 44px; }
  .header-meta { gap: 6px; }
  .header-meta span { padding: 7px 10px; font-size: 10px; }
  .card-item { padding: 18px; border-radius: 20px; }
  .card-number { font-size: 12px; letter-spacing: 0.045em; }
  .card-bottom { margin-top: 21px; }
  .balance { font-size: 14px; }
  .modal { padding: 12px; }
  .modal-box { padding: 23px 18px; border-radius: 22px; }
  .qr-box { margin-top: 15px; padding: 12px; }
  .expiry-wrap { margin-top: 8px; margin-bottom: 10px; }
  .expiry-warning { font-size: 9px; }
}