:root {
  --panel: rgba(10,14,40,.72); --card: rgba(10,14,40,.72); --edge: #27407a; --dark: rgba(4,7,24,.85);
  --ink: #eef2fb; --soft: #bfcae4; --muted: #8d9ac0;
  --up: #4ade80; --down: #f87171; --gold: #f5c542; --cyan: #7dd3fc; --orange: #fb923c;
  --sv: #a855f7; --scrt: #f59e0b; --ltd: #ef4444;
  --g: #22c55e; --y: #eab308; --r: #f87171;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; color: var(--ink);
  background: #02030a; /* only a fallback: the space canvas covers it */
  min-height: 100vh;
}
a { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 22px;
  border-bottom: 1px solid #3a5aa044; background: rgba(4,7,24,.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 5; }
/* the logo and name, 50% bigger */
.brand { display: flex; align-items: center; gap: 18px; text-decoration: none; }
.logo { width: 66px; height: 66px; border-radius: 50%; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-size: 33px; letter-spacing: .4px; }
.brand-text small { color: var(--soft); font-size: 18px; }
.updated { color: var(--muted); font-size: 12px; }

main { max-width: 1180px; margin: 0 auto; padding: 18px 16px 40px; }
.search { display: flex; justify-content: center; margin: 10px 0 18px; }
.search input { width: min(640px, 100%); font-size: 18px; padding: 12px 16px; color: var(--ink);
  background: rgba(6,10,32,.8); border: 2px solid #1f9d4c; border-radius: 12px; outline: none; }
.search input:focus { border-color: var(--up); }

.tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.tabs button, .tabs select { background: var(--card); color: var(--soft); border: 1px solid var(--edge);
  border-radius: 8px; padding: 6px 12px; font-weight: 600; font-size: 14px; cursor: pointer; }
.tabs button.on { background: #1f9d4c; color: #fff; border-color: #1f9d4c; }
.tabs button.gold { color: var(--gold); } .tabs button.cyan { color: var(--cyan); }
.tabs button.gold.on, .tabs button.cyan.on { color: #fff; }
.tabs .spacer { flex: 1; }
.count { color: var(--muted); font-size: 13px; margin-left: 6px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.card { position: relative; background: var(--card); border: 2px solid #34508f; border-radius: 12px; padding: 8px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  text-align: center; cursor: pointer; transition: transform .08s ease, box-shadow .08s ease; }
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px #000a, 0 0 0 1px #4a70c055; }
/* rarity edges like in the game: Secret = a flowing rainbow, Souvenir (SV) = flowing yellow / orange / dark orange,
   Limited = plain red (no animation). The moving edge is a thin ring laid over the card's border. */
@property --spin { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes bv-spin { to { --spin: 360deg; } }
.card.Limited { border-color: #c00018; }   /* a deeper red: #ef4444 looked orange */
.card.Secret, .card.Souvenir { border-color: transparent; }
.card.Secret::before, .card.Souvenir::before {
  content: ""; position: absolute; inset: -2px; border-radius: 12px; padding: 2px; pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: bv-spin 3s linear infinite;
}
.card.Secret::before {
  background: conic-gradient(from var(--spin), #ff2a2a, #ff9f1a, #ffe81a, #3dff6e, #1ae0ff, #3d6bff, #b23dff, #ff2ad4, #ff2a2a);
}
.card.Souvenir::before {
  background: conic-gradient(from var(--spin), #ffd400, #ff8c00, #c2410c, #ff8c00, #ffd400, #ff8c00, #c2410c, #ff8c00, #ffd400);
}
@media (prefers-reduced-motion: reduce) { .card.Secret::before, .card.Souvenir::before { animation: none; } }
.card .pic { width: 100%; aspect-ratio: 1; border-radius: 8px; background: var(--dark); object-fit: contain; display: block; }
.card .nopic { width: 100%; aspect-ratio: 1; border-radius: 8px; background: var(--dark); display: flex; align-items: center;
  justify-content: center; color: var(--muted); font-size: 12px; }
.card .by { position: absolute; top: 12px; right: 12px; font-size: 12px; font-weight: 700; padding: 0 5px;
  border-radius: 5px; background: var(--dark); border: 1px solid currentColor; }
.by.C { color: var(--cyan); } .by.M { color: var(--gold); }
.card .v { font-weight: 800; margin-top: 6px; font-size: 15px; color: var(--up); }
.card .v.unknown { color: var(--muted); }
.card .bv { font-weight: 700; font-size: 13px; color: var(--soft); }
.card .d { font-weight: 700; font-size: 13px; }
.card .n { font-size: 13px; margin-top: 4px; }
.note { font-size: 12px; margin-top: 2px; }
.note.troll, .bv.troll { color: var(--down); } .note.good, .bv.good { color: var(--g); }
.tier-OC { color: var(--gold) !important; } .tier-ER { color: var(--orange) !important; } .tier-R { color: var(--cyan) !important; }

.list { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; gap: 14px; align-items: center; background: var(--card); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid var(--edge);
  border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.row img, .row .nopic { width: 72px; height: 72px; border-radius: 8px; object-fit: contain; background: var(--dark); flex: none; }
.row .t1 { font-weight: 700; font-size: 16px; }
.row .t2 { font-weight: 700; color: var(--up); }
.row .t3 { color: var(--soft); font-size: 13px; }
.row .t4 { color: var(--muted); font-size: 12px; font-style: italic; }
.empty { color: var(--muted); text-align: center; padding: 40px 10px; }

.item { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); background: var(--panel); border: 1px solid var(--edge); border-radius: 14px; padding: 16px 18px; }
.back { float: right; background: #1c2f66; color: var(--ink); border: 0; border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.item-head { display: flex; gap: 14px; align-items: center; }
.i-pic { width: 84px; height: 84px; border-radius: 10px; background: var(--dark); object-fit: contain; }
.item h1 { margin: 0; font-size: 24px; }
.i-value { margin-top: 10px; font-size: 34px; font-weight: 800; color: var(--up); }
.trend { font-size: 16px; margin-left: 12px; }
.i-bv { font-size: 19px; font-weight: 700; margin-top: 2px; }
.i-bv .muted { font-size: 13px; font-weight: 400; margin-left: 10px; }
.i-demand { margin-top: 8px; display: flex; align-items: center; gap: 10px; font-weight: 700; flex-wrap: wrap; }
.bar { display: inline-flex; gap: 3px; } .bar i { width: 13px; height: 13px; border-radius: 3px; background: #23305c; display: inline-block; }
.i-info { margin-top: 10px; color: var(--soft); line-height: 1.6; }
#chart { width: 100%; margin-top: 10px; }
.legend { text-align: right; }

.foot { max-width: 1180px; margin: 0 auto; padding: 18px 16px 30px; color: var(--muted); font-size: 12px;
  display: flex; flex-direction: column; gap: 4px; }
/* demand colours as classes (the site's safety rules forbid inline styles) */
.dg { color: var(--g); } .dy { color: var(--y); } .dr { color: var(--r); } .dm { color: var(--muted); }
.bar i.g { background: var(--g); } .bar i.y { background: var(--y); } .bar i.r { background: var(--r); }

/* the login page (private mode) */
.login { max-width: 360px; margin: 12vh auto; background: var(--panel); border: 1px solid var(--edge); border-radius: 16px;
  padding: 28px; text-align: center; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.login img { width: 72px; height: 72px; border-radius: 50%; }
.login h1 { margin: 10px 0 4px; } .login p { color: var(--soft); margin: 0 0 16px; }
.login input { width: 100%; font-size: 16px; padding: 10px 12px; border-radius: 10px; border: 2px solid #1f9d4c;
  background: rgba(6,10,32,.8); color: var(--ink); }
.login button { margin-top: 12px; width: 100%; padding: 10px; border: 0; border-radius: 10px; background: #1f9d4c;
  color: #fff; font-weight: 700; font-size: 16px; cursor: pointer; }
.bad { color: var(--down) !important; }

@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .i-value { font-size: 28px; } .updated { display: none; }
  .logo { width: 50px; height: 50px; } .brand { gap: 12px; }        /* phones: still bigger, but fits */
  .brand-text b { font-size: 26px; } .brand-text small { font-size: 14px; }
}
