:root {
  --ice: #7fe3ff;
  --black: #0b1e3f;
  --sky: #3fa9f5;
  --sky-light: #a8dcff;
  --red: #e8202a;
  --white: #fff;
  --border: 5px solid var(--black);
  --font-display: 'Archivo Black', 'Mitr', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: 'Mitr', sans-serif;
  font-weight: 500;
  color: var(--black);
  background: linear-gradient(180deg, var(--sky), var(--sky-light)) fixed;
  display: flex;
  min-height: 100vh;
}

/* Giant background letters */
.bg-word {
  position: fixed;
  inset: auto 0 -6vw auto;
  font-family: var(--font-display);
  font-size: 34vw;
  line-height: .8;
  letter-spacing: -.04em;
  color: var(--black);
  opacity: .85;
  pointer-events: none;
  z-index: 0;
  white-space: nowrap;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: 270px;
  flex-shrink: 0;
  padding: 20px;
  background: var(--black);
  border-top: 18px solid transparent;
  border-image: repeating-linear-gradient(-45deg, var(--ice) 0 12px, var(--black) 12px 24px) 18 0 0 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  z-index: 10;
}
.logo {
  font-family: var(--font-display);
  font-size: 2.2rem;
  line-height: .95;
  margin: 0;
  padding: 14px;
  background: var(--ice);
  text-transform: uppercase;
}
.logo span { color: var(--white); -webkit-text-stroke: 2px var(--black); }
nav { display: flex; flex-direction: column; gap: 12px; }
.nav-link {
  display: block;
  padding: 14px 16px;
  background: var(--white);
  color: var(--black);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  text-transform: uppercase;
  border: var(--border);
  outline: 3px solid var(--white);
  transition: background .15s;
}
.nav-link:hover { background: var(--ice); }
.nav-link.active { background: var(--ice); }
.menu-toggle { display: none; }

/* ---------- Main ---------- */
main { flex: 1; padding: 36px; min-width: 0; position: relative; z-index: 1; }
.title {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4.5vw, 3.2rem);
  line-height: 1;
  text-transform: uppercase;
  margin: 0 0 28px;
  padding: 14px 22px;
  background: var(--white);
  border: var(--border);
  background-image: repeating-linear-gradient(-45deg, var(--black) 0 8px, var(--white) 8px 16px);
  background-size: 100% 10px;
  background-position: bottom;
  background-repeat: no-repeat;
  padding-bottom: 24px;
}
.title em { font-style: normal; display: block; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.card {
  background: var(--white);
  border: var(--border);
  padding: 20px;
}
.card-accent { background: var(--ice); }
.card h3 {
  margin: 0 0 14px;
  font-family: var(--font-display), 'Mitr';
  font-size: 1.1rem;
  text-transform: uppercase;
}

label { display: block; margin-bottom: 14px; font-size: .95rem; }
input[type=number], input[type=search] {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 14px;
  font-family: var(--font-display), 'Mitr';
  font-size: 1.25rem;
  color: var(--black);
  border: var(--border);
  background: var(--white);
}
input::placeholder { color: var(--sky); }
input:focus { outline: none; background: #e6f8ff; }
input:disabled { opacity: .35; }
label.check { display: flex; align-items: center; gap: 10px; cursor: pointer; text-transform: uppercase; }
label.check input { width: 22px; height: 22px; accent-color: var(--black); }

.tag {
  display: inline-block;
  padding: 2px 10px;
  background: var(--black);
  color: var(--ice);
  font-size: .9rem;
}

/* ---------- Result ---------- */
.result { max-width: 580px; }
.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 3px solid var(--black);
  font-size: 1.05rem;
}
.row b { font-family: var(--font-display); }
.row.total {
  margin: 0 -20px;
  padding: 14px 20px;
  background: var(--black);
  color: var(--ice);
  font-size: 1.35rem;
}
.profit {
  margin: 18px 0 0;
  padding: 16px;
  text-align: center;
  font-family: var(--font-display), 'Mitr';
  font-size: 1.7rem;
  border: var(--border);
}
.profit.gain { background: var(--ice); }
.profit.loss { background: var(--red); color: var(--white); }

/* ---------- Items ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.filters input { flex: 1 1 240px; max-width: 440px; margin: 0; }
.segmented { display: flex; border: var(--border); background: var(--white); }
.segmented button {
  padding: 10px 18px;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--black);
  background: none;
  border: 0;
  cursor: pointer;
}
.segmented button + button { border-left: var(--border); }
.segmented button:hover { background: var(--ice); }
.segmented button.active { background: var(--black); color: var(--ice); }
.item { position: relative; }
.rarity {
  position: absolute;
  top: 16px; left: 16px;
  padding: 2px 8px;
  font-family: var(--font-display);
  font-size: .8rem;
  border: 3px solid var(--black);
}
.rarity-scrt { background: var(--red); color: var(--white); }
.rarity-ltd { background: #ffc61a; color: var(--black); }
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 18px;
}
.item {
  background: var(--white);
  border: var(--border);
  padding: 10px;
  text-align: center;
}
.item:hover { background: var(--ice); }
.item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: top;
  cursor: zoom-in;
  border: 3px solid var(--black);
  background: var(--white);
}
.item p { margin: 10px 0 2px; font-weight: 700; text-transform: uppercase; word-break: break-word; }
.empty {
  padding: 24px;
  border: var(--border);
  background: var(--white);
  max-width: 580px;
}
.empty code { background: var(--ice); padding: 2px 6px; }

/* ---------- Mobile ---------- */
@media (max-width: 800px) {
  .menu-toggle {
    display: block;
    position: fixed;
    top: 12px; right: 12px;
    z-index: 20;
    width: 52px; height: 52px;
    font-size: 1.5rem;
    background: var(--white);
    border: var(--border);
    border-radius: 50%;
  }
  .sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-100%);
    transition: transform .25s;
  }
  body.menu-open .sidebar { transform: none; }
  main { padding: 80px 16px 32px; }
}

/* ---------- Lightbox ---------- */
.lightbox {
  padding: 0;
  max-width: 92vw;
  max-height: 92vh;
  border: var(--border);
  background: var(--white);
}
.lightbox::backdrop { background: rgba(11, 30, 63, .8); }
.lightbox img { display: block; max-width: 92vw; max-height: 80vh; margin: auto; }
.lightbox p {
  margin: 0;
  padding: 12px 16px;
  font-family: var(--font-display);
  text-transform: uppercase;
  background: var(--black);
  color: var(--ice);
}
