/* ============ Arrow — notebook / comic aesthetic ============ */

:root {
  --paper: #fbf3de;
  --card: #fff9e9;
  --ink: #141414;
  --green: #5bd35f;
  --green-soft: #7ce080;
  --yellow: #ffde59;
  --blue: #8ecdf8;
  --red-soft: #ffb3a7;
  --gray: #8a8377;
  --radius: 12px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Comic Neue", "Comic Sans MS", "Segoe Print", cursive;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(20, 20, 20, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 20, 20, 0.05) 1px, transparent 1px);
  background-size: 30px 30px;
}

/* ---------------- topbar ---------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 30px;
  background: var(--card);
  border-bottom: 2px solid var(--ink);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { flex: none; }
.brand-name { font-size: 27px; font-weight: 700; letter-spacing: 0.5px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

/* ---------------- shared bits ---------------- */

.mini-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.6px;
  color: var(--gray);
}

.mono { font-family: ui-monospace, Consolas, "Courier New", monospace; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 13px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 2px 2px 0 var(--ink);
  white-space: nowrap;
}
.pill-yellow { background: var(--yellow); }
.pill-blue { background: var(--blue); }
.pill-green { background: var(--green); }
.pill-gray { background: #e4ddcd; }
.pill-toggle { cursor: pointer; user-select: none; }
.pill-toggle input { display: none; }
.pill-toggle.is-on { background: var(--green); }

.btn {
  cursor: pointer;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-weight: 700;
  font-size: 16px;
  padding: 10px 20px;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.05s ease, box-shadow 0.05s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn:hover { transform: translate(1px, 1px); box-shadow: 3px 3px 0 var(--ink); }
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { cursor: not-allowed; opacity: 0.55; transform: none; box-shadow: 4px 4px 0 var(--ink); }

.btn-green { background: var(--green); }
.btn-yellow { background: var(--yellow); }
.btn-blue { background: var(--blue); }
.btn-sm { padding: 5px 14px; font-size: 14px; border-radius: 999px; box-shadow: 2px 2px 0 var(--ink); }
.btn-sm:hover { box-shadow: 1px 1px 0 var(--ink); }
.btn-block { width: 100%; }

.btn-big {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 26px;
  border-radius: var(--radius);
}
.btn-big .btn-main { font-size: 18px; letter-spacing: 0.5px; }
.btn-big .btn-sub { font-size: 12px; font-weight: 400; opacity: 0.8; }

.btn-dashed {
  background: transparent;
  border-style: dashed;
  box-shadow: none;
  font-weight: 400;
  font-size: 15px;
}
.btn-dashed:hover { background: rgba(20, 20, 20, 0.04); transform: none; box-shadow: none; }

/* ---------------- layout ---------------- */

.page {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 30px 20px;
}

.hero { margin-bottom: 46px; }
.hero-kicker { font-size: 20px; letter-spacing: 3px; }

.hero-title {
  margin: 6px 0 8px;
  font-size: clamp(64px, 11vw, 128px);
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: -1px;
}

.hero-sub { margin: 0 0 26px; font-size: 22px; font-weight: 700; }

.cta-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

/* ---------------- image slots ---------------- */

.img-slot { position: relative; }
.img-slot img { display: block; width: 100%; height: 100%; object-fit: contain; }

.logo-slot { width: 38px; height: 38px; flex: none; }
.logo-slot img { border: 2px solid var(--ink); border-radius: 10px; background: #fff; }

.hero { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.hero-copy { min-width: 0; }

.mascot-slot {
  flex: none;
  width: min(320px, 30vw);
  aspect-ratio: 1 / 1;
  border: 2px dashed var(--ink);
  border-radius: 18px;
  background: rgba(255, 249, 233, 0.6);
  display: grid;
  place-items: center;
  text-align: center;
  transform: rotate(2deg);
}
.mascot-slot.has-img { border: none; background: transparent; }
.slot-hint { font-size: 14px; color: var(--gray); line-height: 1.5; }

/* ---------------- $LOCK ticker ---------------- */

.ticker {
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: 4px 4px 0 var(--ink);
  background: var(--yellow);
  margin: 0 0 46px;
  transform: rotate(-0.6deg);
}
.ticker-track {
  display: flex;
  width: max-content;
  padding: 9px 0;
  white-space: nowrap;
  font-weight: 700;
  font-size: 15px;
  animation: ticker-scroll 30s linear infinite;
}
.ticker-half { padding-right: 34px; }

@keyframes ticker-scroll {
  to { transform: translateX(-50%); }
}

/* ---------------- locks section ---------------- */

.locks-section { padding-bottom: 40px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.section-head h2 { margin: 0; font-size: 42px; font-weight: 700; }
.section-tools { display: flex; align-items: center; gap: 10px; }

.lock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 28px;
}

.card {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: 5px 5px 0 var(--ink);
  padding: 18px;
}

.lock-card { display: flex; flex-direction: column; gap: 12px; }
.lock-card.is-withdrawn { opacity: 0.65; }

.card-top { display: flex; align-items: flex-start; gap: 12px; }

.coin-badge {
  flex: none;
  width: 50px;
  height: 50px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 15px;
  background: #e8e0ff;
}

.card-title { flex: 1; min-width: 0; }
.card-title .coin-name { font-size: 19px; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.card-title .coin-sym { font-size: 13px; font-weight: 700; color: var(--gray); }

.card .pill { flex: none; }

.row { display: flex; flex-direction: column; gap: 1px; }
.row .value { font-weight: 700; font-size: 18px; overflow-wrap: anywhere; }

.label-quote {
  font-style: italic;
  font-size: 14px;
  color: #5c564b;
  border-left: 3px solid var(--yellow);
  padding-left: 8px;
}

.unlock-box {
  background: var(--green);
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: 3px 3px 0 var(--ink);
  padding: 10px 14px;
  margin-top: auto;
}
.unlock-box .mini-label { color: rgba(20, 20, 20, 0.6); }
.unlock-box .unlock-time { font-size: 22px; font-weight: 700; line-height: 1.2; }
.unlock-box.is-unlocked { background: var(--yellow); }
.unlock-box.is-withdrawn { background: #e4ddcd; box-shadow: none; }

.open-lock { align-self: flex-start; }

/* ---------------- status / empty cards ---------------- */

.status-card {
  border: 2px dashed var(--ink);
  border-radius: 14px;
  padding: 34px 26px;
  text-align: center;
  margin-bottom: 28px;
  background: rgba(255, 249, 233, 0.6);
}
.status-card h3 { margin: 0 0 8px; font-size: 24px; }
.status-card p { margin: 4px 0; color: #5c564b; }
.status-card code {
  display: inline-block;
  margin-top: 8px;
  background: var(--ink);
  color: #aff3b1;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
}

/* ---------------- modals ---------------- */

.modal { border: none; background: transparent; padding: 0; }
.modal::backdrop { background: rgba(20, 20, 20, 0.4); }

.modal-card {
  width: min(500px, 94vw);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 16px;
  box-shadow: 8px 8px 0 var(--ink);
  padding: 24px;
  font-family: inherit;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
.modal-head h3 { margin: 0; font-size: 26px; }

.mode-tabs { display: flex; gap: 10px; margin-bottom: 16px; }
.tab {
  flex: 1;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  padding: 9px 0;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: 2px 2px 0 var(--ink);
}
.tab.is-active { background: var(--green); box-shadow: none; transform: translate(2px, 2px); }

.field { margin-bottom: 15px; }
.field .mini-label { display: block; margin-bottom: 5px; }
.label-soft { font-weight: 400; letter-spacing: 0; text-transform: lowercase; }

.input {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
}
.input:focus { outline: 3px solid var(--blue); outline-offset: 1px; }
.input.mono { font-size: 14px; }

.amount-row { display: flex; gap: 8px; align-items: center; }
.amount-row .input { flex: 1; }

.field-note { margin-top: 5px; font-size: 13px; color: var(--gray); min-height: 16px; }
.field-note.is-error { color: #c0392b; }

.chip-row { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 8px; }
.chip {
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  padding: 4px 12px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 2px 2px 0 var(--ink);
}
.chip:hover { background: var(--yellow); }
.chip:active { transform: translate(2px, 2px); box-shadow: none; }

.modal-status {
  margin: 12px 0;
  padding: 10px 14px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--blue);
  font-weight: 700;
  font-size: 14px;
}

.modal-fineprint { margin: 12px 0 0; font-size: 12px; color: var(--gray); text-align: center; }

/* lock detail modal */

.detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.detail-head .coin-badge { width: 58px; height: 58px; font-size: 17px; }
.detail-rows { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.detail-note {
  font-size: 14px;
  color: #5c564b;
  background: rgba(20, 20, 20, 0.05);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 14px;
}
.detail-note.is-free { background: var(--yellow); border: 2px solid var(--ink); font-weight: 700; }

/* ---------------- toasts ---------------- */

#toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 50;
  max-width: min(360px, calc(100vw - 36px));
}

.toast {
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: 4px 4px 0 var(--ink);
  background: var(--card);
  padding: 12px 16px;
  font-weight: 700;
  font-size: 14px;
  animation: toast-in 0.15s ease-out;
}
.toast.good { background: #d9f7da; }
.toast.bad { background: var(--red-soft); }
.toast.info { background: var(--blue); }

@keyframes toast-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ---------------- footer ---------------- */

.footer {
  text-align: center;
  padding: 34px 20px 40px;
  border-top: 2px solid var(--ink);
  background: var(--card);
  font-size: 15px;
}
.footer p { margin: 4px 0; }
.footer-links { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; }
.footer-links a { color: var(--ink); font-weight: 700; }
.footer-fineprint { color: var(--gray); font-size: 12px; }

/* ---------------- responsive ---------------- */

@media (max-width: 760px) {
  .mascot-slot { display: none; }
}

@media (max-width: 640px) {
  .page { padding: 30px 18px 10px; }
  .topbar { padding: 12px 18px; }
  .brand-name { font-size: 22px; }
  .hero-kicker { font-size: 15px; }
  .hero-sub { font-size: 18px; }
  .section-head h2 { font-size: 32px; }
}
