/* "Make your own tracker" pages (login.html, tracker.html) — on top of site.css */

/* ---- top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  min-height: 68px; padding: 10px clamp(14px, 3vw, 56px);
  background: linear-gradient(180deg, #2a0f4d, #1a0b2e);
  border-bottom: 4px solid var(--ink);
  box-shadow: 0 6px 0 rgba(13, 8, 18, .55);
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.brand img { width: 46px; height: 46px; flex: none; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .5)); transition: transform .5s var(--smooth); }
.brand:hover img { transform: rotate(-8deg) scale(1.06); }
.brand b { font-family: var(--pixel); font-weight: 700; font-size: 20px; text-transform: uppercase; text-shadow: var(--px-outline); white-space: nowrap; }
.brand small { display: block; font-family: var(--spooky); font-size: 22px; letter-spacing: 1px; color: var(--slime); -webkit-text-stroke: 2px var(--slime-deep); paint-order: stroke fill; line-height: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.me { font-family: var(--pixel); font-weight: 700; font-size: 13px; color: var(--muted); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.save-state { font-family: var(--pixel); font-weight: 700; font-size: 11px; text-transform: uppercase; color: #8a7aa6; white-space: nowrap; }
.save-state.bad { color: #ff6b6b; }

/* ---- game buttons ---- */
.btn {
  --b1: #b7ff7a; --b2: #46d11c; --txt: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 20px;
  font-family: var(--pixel); font-weight: 700; font-size: 15px; text-transform: uppercase; text-decoration: none;
  color: var(--txt);
  background: linear-gradient(180deg, var(--b1), var(--b2));
  border: 4px solid var(--ink); border-radius: 14px;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .22), 0 5px 0 var(--ink);
  cursor: pointer; white-space: nowrap;
  transition: transform .4s var(--smooth), filter .25s;
}
.btn:hover { transform: translateY(-3px); filter: brightness(1.08); }
.btn:active { transform: translateY(2px); transition-duration: .1s; }
.btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.btn[disabled] { filter: grayscale(.6) brightness(.8); cursor: default; transform: none; }
.btn.purple { --b1: #d48bff; --b2: var(--purple); --txt: #fff; text-shadow: 2px 2px 0 var(--ink); }
.btn.dark { --b1: #4a3470; --b2: #2a1846; --txt: #fff; text-shadow: 2px 2px 0 var(--ink); }
.btn.red { --b1: #ff8a8a; --b2: var(--red); --txt: #fff; text-shadow: 2px 2px 0 var(--ink); }
.btn.small { height: 40px; padding: 0 14px; font-size: 12px; border-width: 3px; border-radius: 12px; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .22), 0 4px 0 var(--ink); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* ---- form fields ---- */
.form { display: flex; flex-direction: column; gap: 12px; }
.form[hidden] { display: none; }
.label { display: flex; flex-direction: column; gap: 6px; }
.label > span { font-family: var(--pixel); font-weight: 700; font-size: 12px; text-transform: uppercase; color: var(--muted); }
.input {
  width: 100%; height: 52px; padding: 0 16px;
  font-size: 18px; font-weight: 600; color: #fff;
  background: #0f0818;
  border: 3px solid var(--ink); border-radius: 14px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .07), inset 0 5px 0 rgba(0, 0, 0, .35);
  outline: 0;
  transition: box-shadow .2s var(--ease-out);
}
.input:focus { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .07), 0 0 0 3px var(--slime); }
.input::placeholder { color: #6f6088; }
.input.code { height: 64px; text-align: center; font-family: var(--pixel); font-size: 32px; letter-spacing: 10px; }
.msg { min-height: 20px; margin: 0; font-weight: 600; font-size: 15px; color: #ff8a8a; text-align: center; }
.msg.info { color: #c9f5a8; }
.note { margin: 0; font-size: 14px; color: var(--muted); text-align: center; }
.linkish { background: none; border: 0; padding: 0; color: var(--slime); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---- log in / sign up ---- */
.auth { min-height: calc(100vh - 72px); display: grid; place-items: center; padding: 40px 16px 70px; }
.auth-card {
  --frame: linear-gradient(160deg, #d6ffb4, #49c62a 55%, #1f7a12);
  width: min(440px, 100%);
  padding: 6px;
  background: var(--frame);
  border: 4px solid var(--ink); border-radius: 26px;
  box-shadow: 0 10px 0 var(--ink), 0 0 60px rgba(125, 255, 42, .18);
}
.auth-in {
  display: flex; flex-direction: column; gap: 16px;
  padding: 24px 22px 22px;
  background: linear-gradient(180deg, var(--night-3), var(--night-2) 40%);
  border: 3px solid var(--ink); border-radius: 19px;
}
.auth-head { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.auth-head img { width: 96px; height: 96px; filter: drop-shadow(0 6px 4px rgba(0, 0, 0, .5)); }
.auth-head h1 { margin: 6px 0 0; font-family: var(--pixel); font-weight: 700; font-size: 26px; text-transform: uppercase; text-shadow: var(--px-outline); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 6px; background: #0f0818; border: 3px solid var(--ink); border-radius: 16px; }
.seg button {
  height: 42px; border: 3px solid transparent; border-radius: 11px; background: none;
  font-family: var(--pixel); font-weight: 700; font-size: 14px; text-transform: uppercase; color: var(--muted);
  cursor: pointer; transition: background .3s, color .3s;
}
.seg button.on { color: #fff; background: linear-gradient(180deg, #c45bff, var(--purple)); border-color: var(--ink); text-shadow: 2px 2px 0 var(--ink); }
.seg button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.email-box { display: flex; flex-direction: column; gap: 10px; padding: 12px; background: #2a1846; border: 3px solid var(--ink); border-radius: 14px; }
.email-box[hidden] { display: none; }
.email-box p { margin: 0; font-size: 15px; color: #eee4fb; }

/* ---- "make your own tracker" banner on the value list ---- */
.cta {
  --accent: var(--slime);
  position: relative;
  display: flex; align-items: center; gap: 16px;
  max-width: 1040px; margin: 22px auto 0; padding: 14px 18px;
  color: #fff; text-decoration: none;
  background: linear-gradient(100deg, #2f6b2a, #173d16 45%, #24163c);
  border: 4px solid var(--ink); border-radius: 20px;
  box-shadow: inset 0 4px 0 rgba(255, 255, 255, .1), inset 0 -6px 0 rgba(0, 0, 0, .3), 0 7px 0 var(--ink);
  overflow: hidden;
  transform: translate3d(0, 0, 0);
  transition: transform .55s var(--smooth);
}
.cta::after {
  content: ""; position: absolute; inset: -4px; z-index: -1; border-radius: inherit;
  box-shadow: 0 13px 0 var(--ink), 0 18px 40px -8px rgba(125, 255, 42, .45);
  opacity: 0; transition: opacity .55s var(--smooth);
}
.cta:hover { transform: translate3d(0, -5px, 0); }
.cta:hover::after { opacity: 1; }
.cta:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.cta .socket { width: 66px; height: 66px; }
.cta .socket img { width: 52px; height: 52px; }
.cta-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cta-text b { font-family: var(--pixel); font-weight: 700; font-size: 21px; line-height: 1.1; text-transform: uppercase; text-shadow: var(--px-outline); }
.cta-text small { font-size: 15px; color: #d8f5c8; }
.cta .btn { margin-left: auto; flex: none; pointer-events: none; }
.cta:hover .btn { filter: brightness(1.1); }

/* ---- tracker page ---- */
.app { padding-top: 26px; }
.app .stats-row { margin-top: 0; }
.app .deck .select { flex: 1 1 0; min-width: 0; }
.stats-row .f-text small { font-family: var(--pixel); font-weight: 700; font-size: 12px; line-height: 1.1; text-transform: uppercase; color: var(--muted); }
.stats-row .f-text b.num {
  font-family: var(--chunky); font-weight: 400; font-size: clamp(26px, 2.5vw, 36px); line-height: 1.05; text-transform: none;
  -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 0 4px 0 var(--ink);
}
.f-accounts { --accent: #44c3ff; }
.f-animatronics { --accent: #ffb547; }
.f-index { --accent: #c46bff; }
.section-head { display: flex; align-items: center; gap: 14px; margin: 34px 0 14px 4px; }
.section-title { margin: 0; font-family: var(--pixel); font-weight: 700; font-size: 22px; text-transform: uppercase; text-shadow: var(--px-outline); }
.section-head .btn { margin-left: auto; }

.accounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px; }
.acct {
  position: relative;
  display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 12px;
  width: 100%; padding: 11px 13px 12px 11px;
  text-align: left; color: #fff;
  background: linear-gradient(180deg, #33205a, var(--night-2));
  border: 4px solid var(--ink); border-radius: 18px;
  box-shadow: inset 0 4px 0 rgba(255, 255, 255, .08), inset 0 -6px 0 rgba(0, 0, 0, .3), 0 7px 0 var(--ink);
  cursor: pointer;
  transform: translate3d(0, 0, 0);
  transition: transform .5s var(--smooth);
}
.acct:hover { transform: translate3d(0, -5px, 0); }
.acct:active { transform: translate3d(0, 1px, 0); transition-duration: .15s; }
.acct:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.acct.on { background: linear-gradient(180deg, #2f6b2a, #173d16); outline: 3px solid var(--slime); outline-offset: 2px; }
.av {
  display: grid; place-items: center;
  width: 64px; height: 64px; overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #5a3a8a, #1e0d36);
  border: 3px solid var(--ink); border-radius: 14px;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .3);
  font-family: var(--pixel); font-weight: 700; font-size: 24px; text-shadow: 2px 2px 0 var(--ink);
}
.av img { width: 100%; height: 100%; object-fit: cover; }
.acct-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.acct-name { font-family: var(--pixel); font-weight: 700; font-size: 16px; line-height: 1.15; text-shadow: var(--px-outline); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 2px 2px 4px; margin: -2px -2px -4px; }
.acct-user { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-row { margin-top: 3px; font-size: 14px; }
.acct-x {
  position: absolute; top: 8px; right: 8px;
  display: grid; place-items: center; width: 30px; height: 30px; padding: 0;
  background: #2a1846; border: 3px solid var(--ink); border-radius: 9px; color: #fff;
  cursor: pointer; opacity: 0; transition: opacity .25s, background .25s;
}
.acct:hover .acct-x, .acct-x:focus-visible { opacity: 1; }
.acct-x:hover { background: var(--red); }
.acct-x svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3.5; stroke-linecap: round; }
@media (hover: none) { .acct-x { opacity: 1; } }

/* "add" tiles (account + animatronic) */
.add-tile {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 96px; padding: 12px;
  font-family: var(--pixel); font-weight: 700; font-size: 15px; text-transform: uppercase; color: #c9f5a8;
  background: rgba(125, 255, 42, .05);
  border: 4px dashed rgba(125, 255, 42, .45); border-radius: 18px;
  cursor: pointer;
  transition: background .3s, border-color .3s, transform .5s var(--smooth);
}
.add-tile:hover { background: rgba(125, 255, 42, .11); border-color: var(--slime); transform: translateY(-4px); }
.add-tile:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.add-tile .plus { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(180deg, #b7ff7a, #46d11c); border: 3px solid var(--ink); color: var(--ink); font-size: 30px; line-height: 1; box-shadow: 0 4px 0 var(--ink); }
.grid .add-tile { flex-direction: column; min-height: 100%; aspect-ratio: auto; border-radius: 20px; }
.grid .add-tile .plus { width: 72px; height: 72px; font-size: 48px; border-radius: 18px; }
.add-acct { display: flex; gap: 10px; align-items: center; padding: 10px; background: linear-gradient(180deg, #33205a, var(--night-2)); border: 4px solid var(--ink); border-radius: 18px; box-shadow: 0 7px 0 var(--ink); }
.add-acct[hidden] { display: none; }
.add-acct .input { height: 48px; font-size: 16px; }

/* cards (owner row, traits) */
.owner { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 8px 7px 7px; background: #140b20; border-top: 3px solid var(--ink); font-size: 14px; text-align: left; }
.owner .av { width: 28px; height: 28px; flex: none; border-width: 2px; border-radius: 8px; font-size: 13px; box-shadow: none; }
.owner > span:not([class]) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.traits { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin: -4px 0 8px; }
.trait {
  padding: 2px 7px 1px;
  font-family: var(--pixel); font-weight: 700; font-size: 10px; text-transform: uppercase;
  color: #fff; text-shadow: 1px 1px 0 var(--ink);
  background: linear-gradient(180deg, #ff6b6b, #b0122a);
  border: 2px solid var(--ink); border-radius: 6px;
}
.t-phantom { background: linear-gradient(180deg, #9ad1c9, #3f7f78); }
.t-fire { background: linear-gradient(180deg, #ffb547, #e5530c); }
.t-glitch { background: linear-gradient(180deg, #7a7aff, #2e1a8a); }
.t-anniversary { background: linear-gradient(90deg, #ffe14a, #ff7ad9, #b02cff); }
.t-golden-balloon-boy-plush { background: linear-gradient(180deg, #fff0a0, #e09400); color: var(--ink); text-shadow: none; }
.count-tag { margin-left: auto; padding: 1px 7px 0; font-family: var(--chunky); font-size: 15px; color: var(--ink); background: var(--cash); border: 2px solid var(--ink); border-radius: 8px; }

/* ---- picker / detail window ---- */
.inspect.green { --tier: var(--slime); --frame: linear-gradient(160deg, #d6ffb4, #49c62a 55%, #1f7a12); }
.pick-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 260px; overflow-y: auto; overscroll-behavior: contain;
  padding: 6px; margin: 0; list-style: none;
  background: #0f0818; border: 3px solid var(--ink); border-radius: 14px;
  scrollbar-width: thin; scrollbar-color: #4a3470 transparent;
}
.pick {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 10px;
  width: 100%; padding: 4px 10px 4px 4px;
  text-align: left; color: #fff;
  background: #1c1030; border: 2px solid transparent; border-radius: 10px;
  cursor: pointer; transition: background .2s, border-color .2s;
}
.pick:hover { background: #2a1846; }
.pick.on { border-color: var(--slime); background: #23402a; }
.pick img { width: 44px; height: 44px; object-fit: contain; }
.pick b { display: block; font-family: var(--pixel); font-weight: 700; font-size: 13px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 1px 1px 0 var(--ink); }
.pick .rarity { font-size: 11px; }
.pick-empty { padding: 18px; text-align: center; color: var(--muted); }
.opt-title { font-family: var(--pixel); font-weight: 700; font-size: 12px; text-transform: uppercase; color: var(--muted); margin-top: 10px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opts .chip { box-shadow: 0 3px 0 var(--ink); }
.toggle { position: relative; }
.toggle.off { opacity: .45; filter: saturate(.3); }
.toggle.off:hover { opacity: .8; }
.toggle.on { outline: 3px solid #fff; outline-offset: 2px; }
.trait-opt {
  padding: 6px 10px 5px;
  font-family: var(--pixel); font-weight: 700; font-size: 12px; text-transform: uppercase;
  border: 3px solid var(--ink); border-radius: 10px;
  cursor: pointer;
}
.row2 { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.stepper { display: flex; align-items: center; height: 52px; background: #0f0818; border: 3px solid var(--ink); border-radius: 14px; overflow: hidden; }
.stepper button { width: 44px; height: 100%; border: 0; background: #2a1846; color: #fff; font-size: 22px; font-weight: 700; cursor: pointer; }
.stepper button:hover { background: #3a2a52; }
.stepper output { min-width: 40px; text-align: center; font-family: var(--chunky); font-size: 22px; }
.select-input { appearance: none; padding-right: 40px; background: #0f0818 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 9'%3E%3Cpath d='M1.5 1.5 7 7l5.5-5.5' fill='none' stroke='%23b9a6d6' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 16px center / 14px 9px; cursor: pointer; }
.select-input option { background: #1c1030; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.actions .btn { flex: 1 1 auto; }

/* share switch */
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 700; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .knob { position: relative; width: 58px; height: 32px; flex: none; background: #3a2a52; border: 3px solid var(--ink); border-radius: 20px; transition: background .3s; }
.switch .knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); transition: transform .35s var(--smooth); }
.switch input:checked + .knob { background: var(--slime); }
.switch input:checked + .knob::after { transform: translateX(26px); }
.switch input:focus-visible + .knob { outline: 3px solid #fff; outline-offset: 2px; }
.share-link { display: flex; gap: 8px; }
.share-link[hidden] { display: none; }
.share-link .input { font-size: 15px; }

.read-only .edit-only { display: none !important; }
.loading { padding: 80px 20px; text-align: center; font-family: var(--pixel); font-weight: 700; font-size: 18px; text-transform: uppercase; color: var(--muted); }

@media (max-width: 820px) {
  .cta { flex-wrap: wrap; }
  .cta .btn { width: 100%; margin-left: 0; }
}
@media (max-width: 560px) {
  .topbar { min-height: 58px; gap: 8px; padding: 8px 10px; }
  .brand img { width: 38px; height: 38px; }
  .brand b { font-size: 14px; }
  .brand small { font-size: 17px; }
  .me, .save-state { display: none; }
  .btn.small { height: 36px; padding: 0 10px; font-size: 11px; }
  .auth { padding: 24px 10px 50px; }
  .auth-in { padding: 18px 14px; }
  .cta { margin-top: 16px; padding: 12px; gap: 12px; }
  .cta .socket { width: 52px; height: 52px; }
  .cta .socket img { width: 40px; height: 40px; }
  .cta-text b { font-size: 16px; }
  .cta-text small { font-size: 13px; }
  .stats-row .f-text small { font-size: 10px; }
  .stats-row .f-text b.num { font-size: 22px; -webkit-text-stroke-width: 3px; }
  .section-title { font-size: 17px; }
  .accounts {
    grid-template-columns: none; grid-template-rows: repeat(2, auto); grid-auto-flow: column; grid-auto-columns: 82%;
    gap: 10px; margin: 0 -10px; padding: 4px 10px 14px;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 10px; scrollbar-width: none;
  }
  .accounts::-webkit-scrollbar { display: none; }
  .acct, .accounts .add-tile { scroll-snap-align: start; }
  .owner { padding: 5px 6px 6px 5px; gap: 5px; font-size: 12px; }
  .owner .av { width: 22px; height: 22px; }
  .trait { font-size: 8px; }
  .grid .add-tile .plus { width: 52px; height: 52px; font-size: 34px; }
  .row2 { grid-template-columns: 1fr; }
}

/* small windows (share, confirm): one column */
.inspect.slim { width: min(460px, 100%); }
.inspect.slim .inspect-body { grid-template-columns: minmax(0, 1fr); }
.inspect.slim .info { contain: none; overflow: visible; padding: 22px 22px 20px; }
