:root {
  --text: #f7f2e8;
  --soft: rgba(247, 242, 232, 0.72);
  --muted: rgba(247, 210, 112, 0.82);
  --glass-border: rgba(255, 255, 255, 0.12);
  --positive: #78deb3;
  --negative: #ff8e88;
  --button-dark: rgba(12, 18, 28, 0.62);
  --button-border: rgba(255, 255, 255, 0.16);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(227, 181, 68, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(227, 181, 68, 0.06), transparent 22%),
    linear-gradient(180deg, #070707, #030303 68%);
}

body.home {
  background:
    linear-gradient(rgba(7, 10, 18, 0.34), rgba(7, 10, 18, 0.58)),
    url('/notsuregif.gif') center center / cover no-repeat fixed;
}

a {
  color: inherit;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--button-border);
  background: var(--button-dark);
  backdrop-filter: blur(12px);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background-color 120ms ease;
}

.button:hover,
.mini-link:hover {
  transform: translateY(-1px);
  border-color: rgba(247, 210, 112, 0.38);
}

.button.primary,
.buy-button {
  background: linear-gradient(180deg, #f4cd65, #dfac35);
  color: #251b08;
  border-color: rgba(247, 210, 112, 0.5);
}

.landing-shell {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
}

.overlay-card,
.admin-card,
.meme-panel {
  background: linear-gradient(180deg, rgba(11, 16, 25, 0.72), rgba(7, 11, 18, 0.82));
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  backdrop-filter: blur(16px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 22px 52px rgba(0, 0, 0, 0.24);
}

.page-rail {
  position: fixed;
  top: 18px;
  left: 18px;
  right: 18px;
  z-index: 4;
  align-items: center;
  justify-content: space-between;
  display: flex;
  gap: 16px;
}

.brand-mark,
.field span,
.stat-key,
.section-title {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-mark {
  color: #f4cd65;
  font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
  font-size: clamp(1.45rem, 2.8vw, 2.2rem);
  letter-spacing: 0.06em;
  text-shadow:
    0 2px 0 rgba(64, 38, 0, 0.7),
    0 10px 22px rgba(0, 0, 0, 0.24);
}

.panel-meta,
.meme-copy,
.state-copy {
  margin: 0;
  color: var(--soft);
  font-size: 0.88rem;
}

.top-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mini-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  transition:
    transform 120ms ease,
    border-color 120ms ease;
}

.hero-stage {
  width: min(1120px, 100%);
  margin-top: clamp(104px, 16vh, 168px);
  text-align: center;
  opacity: 0;
  transition: opacity 320ms ease;
}

.hero-stage.visible {
  opacity: 1;
}

.hero-title {
  margin: 0 0 18px;
  font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
  font-size: clamp(2.4rem, 7vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  -webkit-text-stroke: 1.5px #000000;
  text-shadow:
    0 4px 0 rgba(0, 0, 0, 0.54),
    0 12px 28px rgba(0, 0, 0, 0.3);
}

.hero-actions {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.action-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.action-button {
  min-width: 170px;
  min-height: 52px;
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 220ms ease,
    transform 120ms ease,
    border-color 120ms ease,
    background-color 120ms ease;
}

.action-button.visible {
  opacity: 1;
  pointer-events: auto;
}

.state-card {
  padding: 0;
}

.overlay-card {
  width: min(420px, 100%);
  margin: 0 auto;
  background: transparent;
  border: 0;
  border-radius: 0;
  backdrop-filter: none;
  box-shadow: none;
}

.state-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.bottom-stats-bar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 4;
  width: min(1120px, calc(100vw - 40px));
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  backdrop-filter: none;
  box-shadow: none;
  display: grid;
  justify-items: center;
  gap: 10px;
}

.stats-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2vw, 28px);
  flex-wrap: wrap;
  width: 100%;
}

.stat-inline {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 0;
}

.stat-inline-value {
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 900;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
}

.positive {
  color: var(--positive);
}

.negative {
  color: var(--negative);
}

.neutral {
  color: var(--soft);
}

.address-code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #e2d2a1;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

.ca-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: min(100%, 760px);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--soft);
  font: inherit;
  cursor: pointer;
}

.ca-inline:hover .address-code,
.ca-inline:hover .ca-inline-label {
  color: #f7f2e8;
}

.ca-inline-label {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

.meme-panel {
  width: min(920px, 100%);
  padding: 20px;
}

.meme-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.meme-grid {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.meme-controls {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field input {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
}

.field input:focus {
  outline: 2px solid rgba(227, 181, 68, 0.32);
  outline-offset: 1px;
}

.meme-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meme-preview {
  display: grid;
  gap: 10px;
  justify-items: center;
}

#memeCanvas {
  width: min(100%, 480px);
  height: auto;
  display: block;
  border-radius: 20px;
  background: #111722;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.26);
}

.shell {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 22px 12px 40px;
}

.shell--admin {
  max-width: 1080px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.topbar-title {
  margin: 6px 0 0;
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  line-height: 1;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-grid {
  display: grid;
  gap: 18px;
}

.admin-card {
  padding: 24px;
}

.admin-copy {
  margin: 10px 0 0;
  color: var(--soft);
  line-height: 1.5;
}

.status-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.status-label {
  color: var(--muted);
  font-weight: 700;
}

.status-value {
  text-align: right;
  word-break: break-all;
}

.admin-form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.form-feedback {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--soft);
}

.form-feedback.positive {
  color: var(--positive);
}

.form-feedback.negative {
  color: var(--negative);
}

@media (max-width: 920px) {
  .page-rail {
    position: static;
    width: 100%;
    margin: 0 auto 14px;
    flex-direction: column;
    align-items: flex-start;
  }

  .landing-shell {
    display: block;
    padding-top: 18px;
  }

  .hero-stage {
    margin-top: 0;
  }

  .hero-title {
    font-size: clamp(2.1rem, 10vw, 3.8rem);
    white-space: normal;
  }

  .bottom-stats-bar {
    position: static;
    transform: none;
    margin: 20px auto 8px;
    width: min(100%, 560px);
    max-width: 100%;
  }

  .meme-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .meme-panel-head,
  .meme-actions,
  .status-row,
  .topbar,
  .topbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .action-row {
    flex-direction: column;
    align-items: center;
  }

  .top-links {
    width: 100%;
    justify-content: flex-start;
  }

  .stats-inline {
    gap: 10px 16px;
  }

  .stat-inline {
    justify-content: center;
  }

  .stat-inline-value {
    font-size: 1.14rem;
  }

  .ca-inline {
    flex-wrap: wrap;
  }
}
