:root {
  --bg: #05070b;
  --panel: rgba(255,255,255,0.045);
  --border: rgba(255,255,255,0.14);
  --text: #f8f8f8;
  --muted: #a7a7b3;
  --gold: #ffd23f;
  --gold2: #f7b500;
  --danger: #ff6680;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  overflow-x: clip;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  overscroll-behavior-x: none;
  background:
    radial-gradient(circle at top, rgba(255,210,63,0.08), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.page {
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  padding: 20px 34px 18px;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  font-weight: 800;
  letter-spacing: .02em;
}

.brand {
  font-size: 18px;
}

.counter {
  font-size: 14px;
  color: var(--muted);
  text-align: right;
}

.counter strong {
  color: var(--gold);
  font-size: 18px;
}

.hero {
  flex: 1;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 26px 0 22px;
}

.owner-label {
  margin: 0;
  font-size: 18px;
  letter-spacing: .08em;
  font-weight: 800;
  color: #ffffff;
}

.owner-name {
  margin: 12px auto 6px;
  font-size: clamp(64px, 10vw, 130px);
  line-height: 0.9;
  font-weight: 950;
  color: var(--gold);
  text-transform: uppercase;
  white-space: normal;
  max-width: 95vw;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-overflow: clip;
  text-shadow: 0 0 36px rgba(255,210,63,.18);
}

.owner-message {
  color: var(--muted);
  font-size: 18px;
  margin: 0 auto 20px;
  max-width: 720px;
  overflow-wrap: anywhere;
}

.timer-card {
  width: min(480px, 92vw);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  padding: 18px;
  margin: 0 auto 14px;
}

.timer-label {
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .04em;
}

.timer {
  margin-top: 6px;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 900;
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cta {
  width: min(480px, 92vw);
  height: 58px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(180deg, var(--gold), var(--gold2));
  color: #111;
  font-size: 19px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(255,210,63,.18);
}

.cta:hover {
  transform: translateY(-1px);
}

.cta:disabled {
  cursor: wait;
  opacity: .65;
  transform: none;
}

.helper {
  color: var(--muted);
  margin: 10px 0 0;
  font-size: 14px;
}

.bottom {
  width: min(900px, 100%);
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  padding: 18px;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 0;
}

.section-title {
  font-size: 14px;
  font-weight: 900;
  margin: 0 0 12px;
  color: var(--text);
  letter-spacing: .04em;
}

.scoreboard-column {
  min-width: 0;
  padding: 2px 18px;
}

.scoreboard-column + .scoreboard-column {
  border-left: 1px solid var(--border);
}

.owner-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  color: var(--muted);
  margin-bottom: 7px;
  align-items: baseline;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.owner-row strong {
  color: var(--text);
  display: block;
  overflow-wrap: anywhere;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.owner-row span {
  min-width: 0;
}

.record-card {
  text-align: center;
  align-self: start;
}

.record-name {
  color: var(--gold);
  font-size: 28px;
  font-weight: 900;
  margin: 8px 0 4px;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.record-time {
  font-size: 18px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
}

.empty-state {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.footer {
  padding-top: 14px;
  display: block;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.shell.narrow {
  display: grid;
  width: min(680px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 48px 0;
  place-items: center;
}

.claim-panel {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  padding: 28px;
}

.claim-panel.center {
  text-align: center;
}

.claim-panel h1 {
  margin: 0 0 22px;
  font-size: clamp(2.1rem, 7vw, 4.6rem);
  line-height: 1;
}

.kicker {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

form {
  display: grid;
  gap: 16px;
}

form[hidden],
[hidden] {
  display: none !important;
}

label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  outline: none;
  padding: 14px 16px;
}

input:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255,210,63,.14);
}

textarea {
  resize: vertical;
}

.form-meta,
.form-status {
  color: var(--muted);
}

.form-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: .9rem;
}

.form-status.error {
  color: var(--danger);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 20px;
  border-radius: 8px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  border: 0;
  color: #111;
  background: linear-gradient(180deg, var(--gold), var(--gold2));
}

.secondary-button {
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.link-button {
  width: fit-content;
}

.share-panel {
  display: grid;
  gap: 14px;
  text-align: center;
}

.share-panel[hidden] {
  display: none;
}

.share-panel h2 {
  margin: 0;
  color: var(--gold);
  font-size: clamp(2rem, 6vw, 4.5rem);
  line-height: 1;
}

.share-panel h3 {
  margin: 0;
  color: var(--gold);
  font-size: clamp(1.8rem, 5vw, 3.6rem);
  line-height: 1;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(10px);
}

.modal-panel {
  position: relative;
  width: min(640px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #0b0d12;
  padding: 24px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .45);
}

.modal-panel h2 {
  margin: 0 0 18px;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: .96;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, .06);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.payment-panel {
  width: min(500px, calc(100vw - 24px));
  max-height: min(660px, calc(100vh - 28px));
  overflow: hidden;
  padding: 16px;
}

.payment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  padding: 0 48px 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.payment-header .kicker {
  margin-bottom: 6px;
}

.payment-header h2 {
  margin: 0;
  font-size: clamp(1.85rem, 4vw, 2.5rem);
  line-height: 1;
  white-space: nowrap;
}

.payment-price {
  color: var(--gold);
  font-size: 26px;
  font-weight: 950;
  line-height: 1;
}

.payment-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.checkout-stack {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.wallet-mount:empty {
  display: none;
}

.wallet-mount {
  min-height: 44px;
}

.checkout-mount {
  min-height: 56px;
  max-height: 120px;
  padding: 10px;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(0, 0, 0, 0.22);
  scrollbar-width: thin;
}

.card-placeholder {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(248,248,248,.48);
  font-size: 16px;
  white-space: nowrap;
}

.payment-submit {
  position: static;
  z-index: 2;
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  text-transform: uppercase;
  font-size: 15px;
  line-height: 1.1;
  box-shadow: 0 12px 30px rgba(255,210,63,.12);
}

@media (max-width: 760px) {
  html,
  body {
    position: relative;
    max-width: 100vw;
    touch-action: pan-y;
  }

  .page {
    padding: 10px 14px 14px;
  }

  .hero {
    flex: 0;
    padding: 24px 0 18px;
  }

  .hero > div {
    width: 100%;
    min-width: 0;
  }

  .topbar {
    font-size: 13px;
    align-items: flex-start;
    gap: 10px;
  }

  .brand {
    font-size: 14px;
    line-height: 1.15;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .counter {
    font-size: 11px;
    line-height: 1.15;
    white-space: nowrap;
  }

  .owner-label {
    font-size: 12px;
    max-width: 280px;
    margin: 0 auto;
  }

  .owner-name {
    margin-top: 10px;
    font-size: clamp(32px, 10vw, 48px);
    line-height: .98;
    max-width: 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: break-word;
    word-break: normal;
  }

  .owner-message {
    font-size: 14px;
    margin: 8px auto 14px;
    max-width: 100%;
  }

  .timer-card {
    width: 100%;
    max-width: 100%;
    padding: 13px 10px;
    margin-bottom: 12px;
  }

  .timer {
    font-size: clamp(28px, 9vw, 40px);
    letter-spacing: .02em;
  }

  .cta {
    width: 100%;
    height: 54px;
    font-size: 15px;
    padding: 0 12px;
  }

  .helper {
    font-size: 13px;
  }

  .bottom {
    width: 100%;
    max-width: 100%;
    grid-template-columns: 1fr;
    padding: 13px;
    margin-top: 6px;
  }

  .scoreboard-column {
    padding: 0;
  }

  .scoreboard-column + .scoreboard-column {
    border-left: 0;
    border-top: 1px solid var(--border);
    margin-top: 14px;
    padding-top: 14px;
  }

  .owner-row {
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 8px;
    font-size: 13px;
  }

  .record-name {
    font-size: clamp(22px, 8vw, 30px);
  }

  .record-time {
    font-size: 16px;
  }

  .footer {
    text-align: center;
    font-size: 12px;
  }

  .modal-backdrop {
    padding: 10px;
    align-items: end;
  }

  .payment-modal {
    align-items: center;
    place-items: center;
  }

  .modal-panel {
    width: 100%;
    max-height: calc(100vh - 20px);
    padding: 20px;
    border-radius: 14px 14px 0 0;
  }

  .modal-panel h2 {
    font-size: clamp(1.9rem, 12vw, 3.2rem);
  }

  .payment-panel {
    width: min(420px, calc(100vw - 24px));
    max-height: calc(100dvh - 28px);
    padding: 12px;
    border-radius: 14px;
  }

  .checkout-mount {
    min-height: 56px;
    max-height: 120px;
    padding: 10px;
  }

  .payment-header {
    align-items: flex-start;
    margin-bottom: 8px;
    padding-right: 48px;
  }

  .payment-header h2 {
    font-size: clamp(1.55rem, 7vw, 1.95rem);
    white-space: normal;
  }

  .payment-price {
    font-size: 22px;
  }

  .payment-form {
    gap: 8px;
  }

  .payment-submit {
    min-height: 50px;
    padding: 0 16px;
    font-size: 14px;
  }

  .form-meta {
    display: grid;
  }
}
