:root {
  --bg-top: #f7d699;
  --bg-bottom: #d66b2d;
  --card: rgba(36, 20, 12, 0.86);
  --card-border: rgba(255, 244, 220, 0.12);
  --text: #fff4dc;
  --muted: rgba(255, 244, 220, 0.72);
  --danger: #ffdbc1;
  --shadow: 0 24px 60px rgba(58, 24, 8, 0.28);
  --glass: rgba(255, 250, 240, 0.18);
  --glass-border: rgba(255, 244, 220, 0.35);
  --surface: rgba(255, 244, 220, 0.08);
  --surface-strong: rgba(255, 244, 220, 0.12);
  --button-copy: #3c2200;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(255, 245, 219, 0.45), transparent 28%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(10px);
}

body::before {
  width: 14rem;
  height: 14rem;
  top: 8%;
  left: -4rem;
  background: rgba(255, 241, 209, 0.18);
}

body::after {
  width: 18rem;
  height: 18rem;
  right: -6rem;
  bottom: 6%;
  background: rgba(125, 39, 5, 0.18);
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.card {
  width: min(100%, 30rem);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 2rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  padding: 1.25rem;
}

.card.wide {
  width: min(100%, 38rem);
}

.eyebrow {
  margin: 0 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--muted);
}

h1,
h2 {
  margin: 0;
  line-height: 0.96;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
}

h2 {
  font-size: 1.1rem;
}

p {
  margin: 0;
}

.lede {
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.stack {
  display: grid;
  gap: 1rem;
}

.stack-lg {
  display: grid;
  gap: 1.5rem;
}

.split {
  display: grid;
  gap: 1rem;
}

.surface {
  border-radius: 1.15rem;
  background: var(--surface);
  padding: 1rem;
}

.gated-content {
  display: grid;
  gap: 1rem;
  opacity: 0;
  transform: translateY(0.75rem) scale(0.985);
  transition:
    opacity 260ms ease,
    transform 260ms ease;
}

.gated-content.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.lock-panel {
  transform-origin: top center;
  transition:
    opacity 240ms ease,
    transform 240ms ease,
    max-height 320ms ease,
    margin 320ms ease,
    padding 320ms ease;
}

.lock-panel.is-visible {
  opacity: 1;
  transform: scale(1);
  max-height: 18rem;
}

.lock-panel.is-exiting {
  opacity: 0;
  transform: scale(0.94);
  max-height: 0;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
}

.surface.strong {
  background: var(--surface-strong);
}

.field-label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.text-input {
  width: 100%;
  border: 1px solid rgba(255, 244, 220, 0.14);
  border-radius: 1rem;
  background: rgba(255, 251, 241, 0.92);
  color: #2d1909;
  padding: 0.95rem 1rem;
  font: inherit;
}

.text-input:focus {
  outline: 2px solid rgba(255, 209, 89, 0.6);
  outline-offset: 2px;
}

.actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.hold-button {
  border: 0;
  cursor: pointer;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.primary-button,
.secondary-button {
  border-radius: 1rem;
  padding: 0.95rem 1.15rem;
}

.primary-button {
  color: var(--button-copy);
  background: linear-gradient(180deg, #ffe0a1 0%, #ffbf4d 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 18px 32px rgba(61, 25, 0, 0.22);
  font-weight: 700;
}

.secondary-button {
  color: var(--text);
  background: rgba(255, 244, 220, 0.12);
}

.preview-row {
  display: flex;
  gap: 0.65rem;
  align-items: stretch;
}

.preview-row .text-input {
  flex: 1;
}

.count-wrap {
  padding: 2rem 0 1rem;
  text-align: center;
}

.count-label {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-size: 0.82rem;
}

.count-value {
  margin-top: 0.3rem;
  font-size: clamp(4.5rem, 20vw, 7rem);
  font-weight: 700;
  line-height: 0.95;
}

.status,
.error-text {
  min-height: 1.4em;
  color: var(--danger);
  font-size: 0.95rem;
}

.counter-topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.counter-topbar a {
  text-decoration: none;
  color: var(--muted);
}

.counter-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: var(--surface);
  color: var(--muted);
}

.counter-meta strong {
  color: var(--text);
  font-size: 0.95rem;
  word-break: break-word;
  text-align: right;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.45rem 0.7rem;
  background: rgba(255, 244, 220, 0.12);
  color: var(--text);
  font-size: 0.84rem;
}

.hold-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-radius: 1.5rem;
  padding: 1rem 1.1rem;
  color: var(--button-copy);
  background: linear-gradient(180deg, #ffe0a1 0%, #ffbf4d 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 18px 32px rgba(61, 25, 0, 0.22);
  transition: transform 140ms ease, box-shadow 140ms ease;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

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

.hold-button:active,
.hold-button.is-holding {
  transform: translateY(1px) scale(0.995);
  box-shadow:
    inset 0 2px 8px rgba(99, 49, 5, 0.2),
    0 10px 18px rgba(61, 25, 0, 0.18);
}

.hold-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.beer-glass {
  position: relative;
  flex: 0 0 3.7rem;
  width: 3.7rem;
  height: 5.25rem;
  border: 3px solid var(--glass-border);
  border-radius: 0.6rem 0.6rem 0.95rem 0.95rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 250, 240, 0.06) 42%, var(--glass)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.15), transparent 26%, transparent 74%, rgba(255, 255, 255, 0.08));
  overflow: hidden;
  box-shadow: inset 0.32rem 0 0 rgba(255, 255, 255, 0.08);
}

.beer-glass::after {
  content: "";
  position: absolute;
  top: 0.92rem;
  right: -1.05rem;
  width: 1rem;
  height: 2.5rem;
  border: 3px solid rgba(255, 244, 220, 0.42);
  border-left: 0;
  border-radius: 0 0.95rem 0.95rem 0;
}

.beer-fill {
  position: absolute;
  inset: auto 0 0 0;
  height: 0%;
  background:
    linear-gradient(180deg, rgba(255, 228, 136, 0.95) 0%, rgba(250, 183, 44, 0.98) 40%, #cf7510 100%);
  transition: height 80ms linear;
}

.beer-foam {
  position: absolute;
  left: 0.22rem;
  right: 0.22rem;
  top: 0.18rem;
  height: 0.9rem;
  background: rgba(255, 251, 240, 0.92);
  border-radius: 0.65rem 0.65rem 0.45rem 0.45rem;
  box-shadow:
    0 0 0 0.22rem rgba(255, 251, 240, 0.22),
    0 0.2rem 0.35rem rgba(255, 251, 240, 0.14);
}

.button-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  -webkit-user-select: none;
  user-select: none;
}

.button-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.button-subtitle {
  margin-top: 0.15rem;
  color: rgba(60, 34, 0, 0.75);
  font-size: 0.92rem;
}

.pin-form {
  display: grid;
  gap: 0.75rem;
}

.pin-row,
.share-card {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.share-card .text-input,
.pin-row .text-input {
  flex: 1;
}

.page-link {
  color: var(--text);
  text-decoration: none;
}

@media (min-width: 760px) {
  .split {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    align-items: start;
  }
}

@media (max-width: 480px) {
  .card {
    padding: 1rem;
    border-radius: 1.5rem;
  }

  .counter-topbar,
  .pin-row,
  .share-card,
  .preview-row {
    flex-direction: column;
    align-items: stretch;
  }

  .hold-button {
    gap: 0.85rem;
    padding: 0.95rem;
  }

  .beer-glass {
    flex-basis: 3.2rem;
    width: 3.2rem;
    height: 4.6rem;
  }

}
