:root {
  --bg: #f4f3ee;
  --panel: #ebe9e1;
  --panel-strong: #dfddd3;
  --text: #111111;
  --muted: #6d6d67;
  --line: #c9c7bd;
  --accent: #111111;
  --danger: #b42318;
  --success: #1f7a3f;

  --radius: 16px;
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Courier New",
    Courier,
    monospace;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

.page {
  width: min(100% - 32px, var(--max-width));
  margin: 0 auto;
  padding: 44px 0 28px;
}


/* =========================================================
   HEADER
========================================================= */

.site-header {
  text-align: center;
  padding: 12px 0 52px;
}

.ascii-wrap {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 18px;
}

.ascii-logo {
  display: inline-block;
  margin: 0;
  white-space: pre;
  text-align: left;
  font-size: clamp(7px, 1.15vw, 15px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: 0;
}

.tagline {
  margin: 8px 0 4px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.subtagline {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.05em;
}


/* =========================================================
   BUTTONS
========================================================= */

.primary-button,
.secondary-button,
.danger-button {
  border: 1px solid var(--text);
  border-radius: 999px;
  padding: 12px 20px;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    color 0.15s ease,
    opacity 0.15s ease;
}

.primary-button {
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.secondary-button {
  background: transparent;
  color: var(--text);
}

.danger-button {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
  font-weight: 700;
}

.danger-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.text-button {
  border: 0;
  background: transparent;
  text-decoration: underline;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
}


/* =========================================================
   WALLET STATUS
========================================================= */

.wallet-status {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-size: 13px;
}


/* =========================================================
   SECTIONS
========================================================= */

.section {
  margin-bottom: 52px;
}

.public-section {
  margin-top: 4px;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.section-heading h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.05em;
}

.section-count {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 12px;
}

.section-description {
  margin: 12px 0 18px;
  color: var(--muted);
  font-size: 13px;
}


/* =========================================================
   TABLE / POSITION LIST
========================================================= */

.table-wrap {
  width: 100%;
}

.position-table {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 16px;
  align-items: center;
}

.position-table-header {
  padding: 0 18px 10px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.positions-list {
  display: grid;
  gap: 10px;
}

.position-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 16px;
  align-items: center;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.position-card:hover {
  background: var(--panel-strong);
}

.position-pair {
  font-weight: 700;
  font-size: 16px;
}

.position-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.position-value {
  text-align: right;
  font-size: 16px;
  font-weight: 700;
}

.position-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  grid-column: 1 / -1;
}

.position-action-button {
  border: 1px solid var(--text);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  padding: 9px 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.position-action-button.primary {
  background: var(--text);
  color: var(--bg);
}

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

.empty-state {
  padding: 24px 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}


/* =========================================================
   CONTRACT SECTION
========================================================= */

.contract-section {
  text-align: center;
  margin: 64px 0 36px;
  padding: 28px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.contract-label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.contract-address {
  display: inline-block;
  word-break: break-all;
  text-decoration: none;
  font-weight: 700;
}

.contract-address:hover {
  text-decoration: underline;
}

.contract-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}


/* =========================================================
   FOOTER
========================================================= */

footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding-bottom: 24px;
}

footer p {
  margin: 5px 0;
}

footer a {
  font-weight: 700;
}

.footer-warning {
  margin-top: 14px;
  color: var(--text);
}


/* =========================================================
   MODAL
========================================================= */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.64);
}

.modal-card {
  width: min(100%, 560px);
  background: var(--bg);
  border: 1px solid var(--text);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
}

.warning-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--danger);
  color: white;
  font-weight: 700;
  font-size: 22px;
  margin-bottom: 16px;
}

.modal-card h2 {
  margin: 0 0 12px;
}

.modal-card p {
  margin: 10px 0;
}

.modal-position {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0;
  padding: 16px;
  background: var(--panel);
  border-radius: 12px;
}

.modal-warning {
  color: var(--danger);
  font-weight: 700;
}

.confirm-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 20px 0;
  cursor: pointer;
}

.confirm-check input {
  margin-top: 4px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}


/* =========================================================
   TRANSACTION TOAST
========================================================= */

.transaction-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1100;
  width: min(360px, calc(100% - 40px));
  background: var(--text);
  color: var(--bg);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
  font-size: 12px;
}

.transaction-toast a {
  display: inline-block;
  margin-top: 8px;
  color: var(--bg);
  font-weight: 700;
}


/* =========================================================
   SMALL UTILITY STATES
========================================================= */

.status-success {
  color: var(--success);
}

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


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 760px) {
  .page {
    width: min(100% - 20px, var(--max-width));
    padding-top: 24px;
  }

  .site-header {
    padding-bottom: 38px;
  }

  .ascii-logo {
    font-size: 7px;
  }

  .tagline {
    font-size: 12px;
  }

  .subtagline {
    font-size: 11px;
  }

  .position-table-header {
    display: none;
  }

  .position-card {
    grid-template-columns: 1fr;
  }

  .position-value {
    text-align: left;
  }

  .position-actions {
    justify-content: flex-start;
  }

  .modal-position {
    flex-direction: column;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions button {
    width: 100%;
  }

  .contract-address {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .ascii-logo {
    font-size: 5.8px;
  }

  .primary-button {
    width: 100%;
  }

  .wallet-status {
    width: 100%;
    justify-content: space-between;
  }

  .section-heading h2 {
    font-size: 15px;
  }

  .position-card {
    padding: 15px;
  }
}



.hook-data-input {
  flex: 1;
  min-width: 220px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  outline: none;
}

.hook-data-input:focus {
  border-color: var(--text);
}

@media (max-width: 760px) {
  .hook-data-input {
    width: 100%;
    min-width: 0;
  }
}




/* =========================================================
   CONNECT WALLET
========================================================= */

#connectWallet {
  border-radius: 0;
  border: 2px solid var(--text);
  background: var(--text);
  color: var(--bg);

  padding: 16px 24px;

  box-shadow:
    5px 5px 0 var(--bg),
    7px 7px 0 var(--text);

  letter-spacing: 0.04em;

  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

#connectWallet:hover {
  transform: translate(3px, 3px);

  box-shadow:
    2px 2px 0 var(--bg),
    4px 4px 0 var(--text);
}


/* =========================================================
   GITHUB CTA
========================================================= */

.github-cta {
  display: inline-block;

  margin: 18px 0;

  padding: 11px 16px;

  border: 1px solid var(--text);
  border-radius: 0;

  background: transparent;
  color: var(--text);

  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.04em;

  box-shadow:
    3px 3px 0 var(--text);

  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.github-cta:hover {
  transform: translate(2px, 2px);

  box-shadow:
    1px 1px 0 var(--text);
}



/* CONNECTED WALLET - MATCH CONNECT BUTTON */

.wallet-status {
  border-radius: 0;
  border: 2px solid var(--text);
  background: var(--text);
  color: var(--bg);

  padding: 14px 18px;

  box-shadow:
    5px 5px 0 var(--bg),
    7px 7px 0 var(--text);
}

.wallet-status .text-button {
  color: var(--bg);
  text-decoration: none;
  border-left: 1px solid var(--bg);
  padding-left: 12px;
  font-weight: 700;
}





.verify-lock {
  margin-top: 12px;
}

.verify-lock a {
  color: var(--text);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.verify-lock a:hover {
  text-decoration-thickness: 2px;
}

.fee-estimate {
  margin-top: 18px;
}

.fee-estimate-label {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.fee-estimate-amount {
  font-size: 14px;
  font-weight: 700;
}