:root {
  --bg: #f2f1ec; --panel: #fbfaf6; --ink: #16181d; --sub: #4a515c; --micro: #6b7380;
  --faint: #9aa2ad; --hair: #d9d6cc; --bracket: #b9b4a6; --accent: #1f7ac7;
  --shadow: rgba(22,24,29,.14); --chip: #ecebe4;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0c10; --panel: #11151b; --ink: #e8eef6; --sub: #b3bfcc; --micro: #8a98a8;
    --faint: #5d6b7c; --hair: #222a35; --bracket: #334152; --accent: #62c8ff;
    --shadow: rgba(0,0,0,.45); --chip: #18202a;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0c10; --panel: #11151b; --ink: #e8eef6; --sub: #b3bfcc; --micro: #8a98a8;
  --faint: #5d6b7c; --hair: #222a35; --bracket: #334152; --accent: #62c8ff;
  --shadow: rgba(0,0,0,.45); --chip: #18202a;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 "Space Grotesk", system-ui, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px 40px; }
body { display: flex; flex-direction: column; min-height: 100vh; }
.wrap { flex: 1 0 auto; }
header.top {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 22px 0 18px; border-bottom: 1px solid var(--hair); margin-bottom: 28px;
}
.logo { font-family: "Press Start 2P", monospace; font-size: 18px; color: var(--ink); letter-spacing: .04em; }
.logo:hover { text-decoration: none; }
nav { display: flex; gap: 20px; flex-wrap: wrap; }
nav a { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--micro); }
nav a.on { color: var(--ink); }
.micro { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--micro); }
h1 { font-family: "Press Start 2P", monospace; font-size: 22px; line-height: 1.4; margin: 0 0 10px; font-weight: 400; }
h2 { font-family: "Press Start 2P", monospace; font-size: 13px; font-weight: 400; margin: 34px 0 14px; letter-spacing: .04em; }
.lead { color: var(--sub); max-width: 64ch; margin: 0 0 24px; }
.play-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: -8px 0 28px; }
.play-btn { display: inline-block; font-family: "Press Start 2P", monospace; font-size: 14px; line-height: 1.4;
  padding: 14px 20px; color: #fff; background: #2f8f3a; border: 4px solid #1b5e24; box-shadow: 0 6px 0 #0f3a15; }
.play-btn:hover { filter: brightness(1.12); color: #fff; }
.play-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #0f3a15; }
.play-btn:focus-visible { outline: 3px solid #ffd76a; outline-offset: 4px; }
.play-note { color: var(--micro); font-size: 14px; }
.panel {
  position: relative; background: var(--panel); border: 1px solid var(--hair);
  padding: 20px; box-shadow: 5px 5px 0 var(--shadow);
}
.panel::before, .panel::after {
  content: ""; position: absolute; width: 10px; height: 10px; border-color: var(--bracket); border-style: solid;
}
.panel::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.panel::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }
.num { font-variant-numeric: tabular-nums; }
.px { image-rendering: pixelated; image-rendering: crisp-edges; }

.search { display: flex; gap: 10px; margin-bottom: 26px; position: relative; }
.search input {
  flex: 1; min-width: 0; font: inherit; font-size: 17px; padding: 12px 14px;
  background: var(--panel); color: var(--ink); border: 1px solid var(--hair); outline: none;
}
.search input:focus { border-color: var(--accent); }
.suggest {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 5; background: var(--panel);
  border: 1px solid var(--hair); border-top: 0; box-shadow: 5px 5px 0 var(--shadow);
}
.suggest button {
  display: flex; width: 100%; justify-content: space-between; gap: 12px; text-align: left;
  font: inherit; color: var(--ink); background: none; border: 0; padding: 10px 14px; cursor: pointer;
}
.suggest button:hover, .suggest button.sel { background: var(--chip); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--micro); padding: 8px 10px; border-bottom: 1px solid var(--hair); }
td { padding: 10px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
tr.row { cursor: pointer; }
tr.row:hover td { background: var(--chip); }
td .hat { width: 34px; height: 22px; object-fit: contain; vertical-align: middle; }
.right { text-align: right; }

.player { display: grid; grid-template-columns: 200px 1fr; gap: 28px; align-items: start; }
@media (max-width: 640px) { .player { grid-template-columns: 1fr; } .stage { max-width: 180px; } }
.stage {
  aspect-ratio: 1; display: grid; place-items: center;
  position: relative; overflow: hidden;
}
.stage img { width: 70%; }
.stage .none { color: var(--faint); font-size: 13px; }
.stage { overflow: visible; }
.head { position: relative; width: 66%; margin-top: 18%; }
.head .face { width: 100%; display: block; border-radius: 50%; }
.head .worn { position: absolute; transform: translateX(-50%); width: auto; }
.card { position: relative; }
.card .no { position: absolute; top: 6px; left: 8px; font-size: 12px; color: var(--faint); }
.stats { display: flex; gap: 28px; flex-wrap: wrap; margin: 14px 0; }
.stat .v { font-size: 26px; font-weight: 600; }
.bar { height: 8px; background: var(--chip); border: 1px solid var(--hair); margin-top: 6px; max-width: 360px; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.card {
  background: var(--panel); border: 1px solid var(--hair); padding: 12px; position: relative;
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.card .pic { height: 56px; display: grid; place-items: center; margin-bottom: 4px; }
.card .pic img { width: 70px; height: 50px; object-fit: contain; }
.card .pic .anim, .wearhat .pic .anim { width: 70px; height: calc(70px * var(--ah) / var(--aw)); }
.card .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .meta { font-size: 13px; color: var(--sub); }
.card .glowname { font-weight: 600; letter-spacing: .04em; }
.tag { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; }
.glow { font-size: 12px; font-weight: 600; }
.card.glowing { box-shadow: inset 0 0 0 2px var(--g); }

.gfx { position: relative; }
.gfx > .fxa, .gfx > .fxb { position: absolute; pointer-events: none; display: none; }
.gfx > img { position: relative; z-index: 2; }

.gfx.fx-rings::before, .gfx.fx-rings::after,
.gfx.fx-rainbow::before, .gfx.fx-rainbow::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 54px; height: 54px;
  margin: -27px 0 0 -27px; border: 2px solid var(--g); border-radius: 50%;
  opacity: 0; animation: gring 2.6s ease-out infinite; }
.gfx.fx-rings::after, .gfx.fx-rainbow::after { animation-delay: 1.3s; }
.gfx.fx-rainbow::before, .gfx.fx-rainbow::after {
  animation: gring 2.6s ease-out infinite, grainbow 3.2s linear infinite; }
@keyframes gring {
  0% { transform: scale(.55); opacity: .75; }
  70% { opacity: 0; }
  100% { transform: scale(1.6); opacity: 0; } }

@keyframes grainbow { to { filter: hue-rotate(360deg); } }
@keyframes gspin { to { transform: rotate(360deg); } }

.gfx.fx-sparkle > .fxa, .gfx.fx-sparkle > .fxb {
  display: block; width: 4px; height: 4px; background: var(--g);
  box-shadow: 0 0 6px var(--g); animation: gtwinkle 1.8s ease-in-out infinite; }
.gfx.fx-sparkle > .fxa { left: 14%; top: 22%; }
.gfx.fx-sparkle > .fxb { right: 16%; top: 62%; animation-delay: .9s; }
.gfx.fx-sparkle::before, .gfx.fx-sparkle::after {
  content: ""; position: absolute; width: 3px; height: 3px; background: var(--g);
  box-shadow: 0 0 5px var(--g); animation: gtwinkle 1.8s ease-in-out infinite; }
.gfx.fx-sparkle::before { right: 22%; top: 14%; animation-delay: .45s; }
.gfx.fx-sparkle::after { left: 24%; bottom: 10%; animation-delay: 1.35s; }
@keyframes gtwinkle {
  0%, 100% { opacity: 0; transform: scale(.4); }
  50% { opacity: 1; transform: scale(1.5); } }

.gfx.fx-flame::before {
  content: ""; position: absolute; left: 50%; bottom: -4px; width: 46px; height: 24px;
  margin-left: -23px; border-radius: 50%; background: var(--g);
  filter: blur(8px); opacity: .55; animation: gflicker .45s steps(2, end) infinite alternate; }
@keyframes gflicker {
  from { opacity: .35; transform: scaleY(.85); }
  to { opacity: .7; transform: scaleY(1.15); } }

.gfx.fx-bubbles > .fxa, .gfx.fx-bubbles > .fxb {
  display: block; width: 7px; height: 7px; border: 1px solid var(--g);
  border-radius: 50%; bottom: 0; animation: gbubble 2.4s linear infinite; }
.gfx.fx-bubbles > .fxa { left: 30%; }
.gfx.fx-bubbles > .fxb { left: 62%; width: 5px; height: 5px; animation-delay: 1.2s; }
@keyframes gbubble {
  0% { transform: translateY(6px); opacity: 0; }
  20% { opacity: .9; }
  100% { transform: translateY(-46px); opacity: 0; } }

.gfx.fx-smoke::before, .gfx.fx-smoke::after {
  content: ""; position: absolute; left: 44%; bottom: 8px; width: 22px; height: 22px;
  border-radius: 50%; background: var(--g); filter: blur(7px); opacity: 0;
  animation: gsmoke 3.4s ease-out infinite; }
.gfx.fx-smoke::after { left: 56%; animation-delay: 1.7s; }
@keyframes gsmoke {
  0% { transform: translate(0, 6px) scale(.5); opacity: .5; }
  100% { transform: translate(-8px, -40px) scale(1.5); opacity: 0; } }

.gfx.fx-drip > .fxa {
  display: block; left: 50%; margin-left: -2px; top: 60%; width: 4px; height: 7px;
  border-radius: 0 0 3px 3px; background: var(--g); box-shadow: 0 0 6px var(--g);
  animation: gdrip 2.2s cubic-bezier(.5, 0, .9, .4) infinite; }
@keyframes gdrip {
  0%, 25% { transform: translateY(0) scaleY(.6); opacity: 0; }
  35% { opacity: 1; }
  100% { transform: translateY(34px) scaleY(1.3); opacity: 0; } }

.gfx.fx-orbit > .fxa {
  display: block; left: 50%; top: 50%; width: 42px; height: 42px; margin: -21px 0 0 -21px;
  animation: gspin 3.2s linear infinite; }
.gfx.fx-orbit > .fxa::after {
  content: ""; position: absolute; left: 50%; top: -4px; width: 7px; height: 7px;
  margin-left: -3px; border-radius: 50%; background: var(--g); box-shadow: 0 0 8px var(--g); }

.gfx.fx-spark::before {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  background: radial-gradient(circle, var(--g) 0%, transparent 62%);
  opacity: 0; animation: gspark 2.8s steps(1, end) infinite; }
@keyframes gspark {
  0%, 74%, 82%, 90%, 100% { opacity: 0; }
  76%, 84% { opacity: .55; }
  78%, 86% { opacity: 0; } }

.gfx.fx-godlike::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 70px; height: 70px; margin: -35px 0 0 -35px;
  border-radius: 50%; opacity: .8;
  background: conic-gradient(from 0deg, #ffd76a, #b46bff, var(--g), #ffd76a, #b46bff, var(--g), #ffd76a);
  -webkit-mask: radial-gradient(circle, transparent 42%, #000 44%, #000 60%, transparent 62%);
          mask: radial-gradient(circle, transparent 42%, #000 44%, #000 60%, transparent 62%);
  animation: gspin 4s linear infinite; }
.gfx.fx-godlike::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 54px; height: 54px;
  margin: -27px 0 0 -27px; border: 2px solid #ffd76a; border-radius: 50%;
  opacity: 0; animation: gring 1.8s ease-out infinite; }
.gfx.fx-godlike > .fxa, .gfx.fx-godlike > .fxb {
  display: block; width: 5px; height: 5px; background: var(--g);
  box-shadow: 0 0 8px var(--g), 0 0 2px #fff; animation: gtwinkle 1.4s ease-in-out infinite; }
.gfx.fx-godlike > .fxa { left: 10%; top: 18%; }
.gfx.fx-godlike > .fxb { right: 10%; top: 58%; animation-delay: .7s; }
.card.glowing:has(.fx-godlike) { box-shadow: inset 0 0 0 2px #ffd76a, 0 0 0 1px #b46bff; }

.head .hglow { position: absolute; transform: translateX(-50%); pointer-events: none; z-index: 1; }
.head .worn.bh, .head .hglow.bh { transform: translateX(-50%); }
.head .worn { z-index: 2; }   .al-glow .gfx::before, .al-glow .gfx::after, .al-glow .gfx > .fxa, .al-glow .gfx > .fxb { display: none !important; }
.gback { position: absolute; pointer-events: none; z-index: 0; image-rendering: pixelated; }
.head .face { position: relative; z-index: 1; }

@media (prefers-reduced-motion: reduce) {
  .gfx, .gfx *, .gfx::before, .gfx::after { animation: none !important; }
}
.loot { columns: 3 260px; column-gap: 24px; }
.loot div { break-inside: avoid; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--hair); }
.lootpic { flex: none; width: 34px; height: 34px; display: grid; place-items: center; }
.lootpic img { max-width: 32px; max-height: 32px; image-rendering: pixelated; }
.lootrow span:nth-child(2) { flex: 1; min-width: 0; }
.back { display: inline-block; margin-bottom: 18px; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; }
.empty { color: var(--micro); padding: 30px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.chip { font-size: 12px; padding: 3px 9px; border: 1px solid var(--hair); background: var(--panel); }

.credit { display: grid; grid-template-columns: 1fr auto; gap: 6px 20px; padding: 18px 0; border-bottom: 1px solid var(--hair); }
.credit .t { font-weight: 600; font-size: 18px; }
.credit .u { color: var(--sub); grid-column: 1 / -1; }
.credit .l { font-size: 13px; color: var(--micro); }
footer { margin-top: 50px; color: var(--micro); font-size: 13px; }

.mystery {
  width: 70px; height: 50px; display: grid; place-items: center;
  font-family: "Press Start 2P", monospace; font-size: 22px; color: var(--sub);
  background:
    radial-gradient(closest-side at 35% 55%, var(--faint), transparent),
    radial-gradient(closest-side at 65% 45%, var(--bracket), transparent);
  filter: blur(0.5px); border-radius: 50%;
}
.card.locked .nm { color: var(--faint); letter-spacing: .15em; }

.rmeta { color: var(--sub); margin: -6px 0 14px; font-size: 14px; }

:root { --water-a: #d7e9f4; --water-b: #b9d6ea; --sand: #e4dcc4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --water-a: #0c1e33; --water-b: #0a2746; --sand: #1a1a14; } }
:root[data-theme="dark"] { --water-a: #0c1e33; --water-b: #0a2746; --sand: #1a1a14; }






.cmds { display: grid; gap: 0; }
.cmd { display: grid; grid-template-columns: 240px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--hair); align-items: baseline; }
.cmd code { font-family: "Press Start 2P", monospace; font-size: 12px; color: var(--accent); }
@media (max-width: 640px) { .cmd { grid-template-columns: 1fr; gap: 6px; } }

:root { --ocean-top: #e3f1f8; --ocean-mid: #cfe5f1; --ocean-deep: #b2d2e6; --ray: rgba(255,255,255,.35); --bubble: rgba(255,255,255,.55); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ocean-top: #0c2440; --ocean-mid: #081a31; --ocean-deep: #040d1c; --ray: rgba(120,190,255,.06); --bubble: rgba(160,210,255,.22); } }
:root[data-theme="dark"] { --ocean-top: #0c2440; --ocean-mid: #081a31; --ocean-deep: #040d1c; --ray: rgba(120,190,255,.06); --bubble: rgba(160,210,255,.22); }
html { background: var(--ocean-deep); }
body {
  background: linear-gradient(180deg, var(--ocean-top) 0%, var(--ocean-mid) 45%, var(--ocean-deep) 100%) fixed;
  min-height: 100vh; position: relative;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: repeating-linear-gradient(105deg, transparent 0 90px, var(--ray) 90px 130px, transparent 130px 260px);
  mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
  animation: rays 18s ease-in-out infinite alternate;
}
@keyframes rays { from { transform: translateX(-40px); } to { transform: translateX(40px); } }
body::after {
  content: ""; position: fixed; left: 0; right: 0; bottom: -40px; height: 140vh; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(circle, var(--bubble) 0 3px, transparent 4px),
    radial-gradient(circle, var(--bubble) 0 2px, transparent 3px),
    radial-gradient(circle, var(--bubble) 0 4px, transparent 5px);
  background-size: 310px 380px, 190px 260px, 470px 520px;
  background-position: 40px 0, 150px 90px, 300px 200px;
  animation: bubbles 40s linear infinite;
  opacity: .8;
}
@keyframes bubbles { from { transform: translateY(0); } to { transform: translateY(-520px); } }
.wrap { position: relative; z-index: 1; }


.card, .credit, .cmd { background: transparent; }
.card { background: var(--panel); }
@media (prefers-reduced-motion: reduce) { body::before, body::after { animation: none; } }

.side { display: none; }
.sea { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.sea img { position: absolute; left: 0; top: 0; image-rendering: pixelated; width: 54px; height: 54px; will-change: transform; }

.ground {
  position: relative; height: 84px; z-index: 0; pointer-events: none; overflow: hidden; flex: 0 0 auto;
  background: linear-gradient(transparent 0, var(--sand) 34%);
  border-top: 2px solid var(--hair);
}
.ground img { position: absolute; bottom: 8px; image-rendering: pixelated; width: 54px; height: 54px; }
.ground img.crab { animation: walk 46s linear infinite; }
.ground img.crab2 { animation: walk-back 62s linear infinite; }
@keyframes walk { from { transform: translateX(-60px) scaleX(-1); } to { transform: translateX(100vw) scaleX(-1); } }
@keyframes walk-back { from { transform: translateX(100vw); } to { transform: translateX(-60px); } }

@media (prefers-reduced-motion: reduce) { .sea img, .ground img { animation: none; } }

td.hatcell, th.hatcell { width: 54px; padding: 6px 0 6px 4px; text-align: center; }

.board td.hatcell { padding-top: 16px; padding-bottom: 8px; }
.head.mini { width: 40px; margin: 0 auto; }

th.sortable { padding: 0; }
th.sortable button {
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit;
  background: none; border: 0; cursor: pointer; width: 100%; padding: 8px 10px;
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
}
th.right.sortable button { justify-content: flex-end; }
th.sortable button:hover { color: var(--ink); background: var(--chip); }
th.sortable button:focus-visible { outline: 2px solid var(--bracket); outline-offset: -2px; }
th.sortable.on { color: var(--ink); }
th.sortable .arrow { font-size: 9px; line-height: 1; }

td.cel { color: #3fb6cc; font-weight: 700; }
td.dim { color: var(--micro); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) td.cel { color: #7ef0ff; } }
:root[data-theme="dark"] td.cel { color: #7ef0ff; }

.card.hookcard .pic img { width: 56px; height: 48px; }
.card.hookcard .tag { color: var(--micro); }
.card.hookcard.on { border-color: var(--accent); }
.card.hookcard.on .tag { color: var(--accent); }

.tablewrap { overflow-x: auto; }
.wrap { width: 100%; }
.card .no .watch { margin-left: 6px; color: var(--accent); text-decoration: underline; letter-spacing: .08em; text-transform: uppercase; }
.card .no .watch:hover { text-decoration: none; }
.card .no { z-index: 3; }

.wearhat { display: flex; align-items: center; gap: 12px; }
.wearhat .pic { width: 48px; height: 34px; display: grid; place-items: center; flex: none; position: relative; }
.wearhat .pic img { width: 46px; height: 32px; object-fit: contain; position: relative; z-index: 1; }
.wearhat .wname { display: block; font-weight: 600; }
.wearhat .micro { display: block; margin-top: 3px; font-size: 10px; }
.wearboard td { vertical-align: middle; }
.sheen { position: absolute; pointer-events: none; z-index: 3;
  -webkit-mask-size: contain; mask-size: contain; -webkit-mask-position: center; mask-position: center;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  background: linear-gradient(115deg, transparent 0 46.5%, rgba(255,255,255,.9) 46.5% 49.5%,
    rgba(255,255,255,.4) 49.5% 51%, transparent 51%);
  background-size: 300% 100%; background-position: 15% 0; animation: sheen 5s infinite; }
@keyframes sheen {
  0% { background-position: 85% 0; animation-timing-function: steps(18); }
  27%, 100% { background-position: 15% 0; }
}
@media (prefers-reduced-motion: reduce) { .sheen { animation-duration: 12s; } }
.stink { position: absolute; pointer-events: none; z-index: 3; image-rendering: pixelated; }
.stinky { color: #6f9b2e; font-weight: 600; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stinky { color: #9ccb50; } }
:root[data-theme="dark"] .stinky { color: #9ccb50; }

.anim {
  display: block;
  background-repeat: no-repeat;
  background-size: calc(100% * var(--acols)) calc(100% * var(--arows));
  background-position: 0 0;
  image-rendering: pixelated; image-rendering: crisp-edges;
}

.collection {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) 18px minmax(0, 1fr);
  gap: 12px; align-items: stretch;
}
:root {
  --case-bg: linear-gradient(180deg, rgba(255,255,255,.72) 0%, rgba(236,240,244,.55) 100%);
  --case-edge: rgba(22,24,29,.14); --case-lit: rgba(255,255,255,.95);
  --case-sheen: rgba(255,255,255,.55); --case-depth: rgba(22,24,29,.10);
  --case-plinth: rgba(22,24,29,.18); --case-glow: rgba(31,122,199,.18);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --case-bg: linear-gradient(180deg, rgba(24,32,44,.78) 0%, rgba(8,11,16,.86) 100%);
  --case-edge: rgba(150,190,230,.16); --case-lit: rgba(200,230,255,.22);
  --case-sheen: rgba(170,210,255,.07); --case-depth: rgba(0,0,0,.55);
  --case-plinth: rgba(0,0,0,.6); --case-glow: rgba(98,200,255,.16);
} }
:root[data-theme="dark"] {
  --case-bg: linear-gradient(180deg, rgba(24,32,44,.78) 0%, rgba(8,11,16,.86) 100%);
  --case-edge: rgba(150,190,230,.16); --case-lit: rgba(200,230,255,.22);
  --case-sheen: rgba(170,210,255,.07); --case-depth: rgba(0,0,0,.55);
  --case-plinth: rgba(0,0,0,.6); --case-glow: rgba(98,200,255,.16);
}
.col-slot { text-align: center; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.col-slot .case {
  position: relative; overflow: hidden; margin-bottom: 8px;
  height: 96px; display: grid; place-items: center;
  background: var(--case-bg);
  -webkit-backdrop-filter: blur(6px) saturate(1.2); backdrop-filter: blur(6px) saturate(1.2);
  border: 1px solid var(--case-edge); border-radius: 3px;
  box-shadow: inset 0 1px 0 var(--case-lit), inset 0 -14px 22px -10px var(--case-depth),
              0 10px 24px -14px var(--shadow);
}
.col-slot .case::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: linear-gradient(115deg, transparent 0 22%, var(--case-sheen) 30%, transparent 44%,
                              transparent 62%, var(--case-sheen) 66%, transparent 72%);
}
.col-slot .case::after {
  content: ""; position: absolute; left: 22%; right: 22%; bottom: 14px; height: 8px;
  border-radius: 50%; background: radial-gradient(closest-side, var(--case-plinth), transparent);
}
.col-slot .pic { position: relative; z-index: 1; height: 56px; display: grid; place-items: center; }
.col-slot .pic img { width: 56px; height: 50px; object-fit: contain; }
.col-slot .pic .anim { width: 118px; height: calc(118px * var(--ah) / var(--aw)); }
.col-slot .pic .mystery { width: 60px; height: 44px; font-size: 18px; }
.col-slot .nm {
  font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.col-slot.locked .nm { color: var(--faint); letter-spacing: .15em; }
.col-slot.got .case {
  background: radial-gradient(ellipse 70% 60% at 50% 45%, var(--case-glow), transparent 70%), var(--case-bg);
}
.col-slot.hat.got .case { border-color: var(--accent); }
@media (max-width: 720px) {
  .collection { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .col-gap { display: none; }
}

img.zaphook { animation: zaphook 1.5s steps(1) infinite; }
@keyframes zaphook {
  0%   { filter: brightness(1.8) drop-shadow(0 0 3px #7cc8ff) drop-shadow(0 0 8px #2f6bff); }
  5%   { filter: none; }
  7%   { filter: brightness(1.8) drop-shadow(0 0 3px #7cc8ff) drop-shadow(0 0 8px #2f6bff); }
  13%  { filter: none; }
}

.lootsum { font-weight: 600; font-size: 18px; margin: 4px 0 8px; }
h2.lootcat { margin-top: 30px; font-size: 20px; }
h3.lootr { margin: 18px 0 6px; font-size: 15px; font-weight: 600; }
.lootrow.missing .lootpic img { filter: grayscale(1); opacity: .35; }
.lootrow.missing span:nth-child(2) { color: var(--micro); }
.lootrow.unknown span:nth-child(2) { color: var(--micro); letter-spacing: .15em; }
.lootpic .mystery.sm { width: 30px; height: 26px; font-size: 13px; }

.achv { margin-top: 16px; }
.achv ul { list-style: none; margin: 6px 0 0; padding: 0; }
.achv li { margin: 4px 0; font-size: 14px; }
.achv .watch { margin-left: 8px; color: var(--accent); text-decoration: underline; letter-spacing: .08em; text-transform: uppercase; }
.achv .watch:hover { text-decoration: none; }

.lootfold > summary { list-style: none; cursor: pointer; }
.lootfold > summary::-webkit-details-marker { display: none; }
.lootfold .tri { display: inline-block; width: 0; height: 0; margin-right: 12px; vertical-align: middle;
  border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 12px solid currentColor; }
.lootfold:not([open]) .tri { border-top: 0; border-bottom: 12px solid currentColor; }

.grid.tags { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card.tagcard canvas.nametag { display: block; width: 100%; height: auto; image-rendering: pixelated; margin: 4px 0 6px; }
.card.tagcard .tag { color: var(--micro); }
.card.tagcard.on { border-color: var(--accent); }
.card.tagcard.on .tag { color: var(--accent); }

.head canvas.face { width: 100%; height: auto; border-radius: 0; image-rendering: auto; }

.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 14px 0; }
.pager button {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--panel);
  border: 1px solid var(--hair); border-radius: 6px; padding: 8px 12px; min-width: 40px; min-height: 40px; cursor: pointer;
}
.pager button:hover:not(:disabled) { background: var(--chip); }
.pager button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pager button:disabled { opacity: .45; cursor: default; }
.pager button.on { opacity: 1; background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 700; }
.pager .gap { color: var(--micro); padding: 0 2px; }
.pager .micro { margin-left: auto; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1.tagged { margin: 0 0 4px; }
h1.tagged canvas.nametag { display: block; width: 294px; height: auto; image-rendering: pixelated; margin: -39px 0 -30px -48px; }

a.hatlink { color: inherit; text-decoration: none; }
a.hatlink:hover { text-decoration: underline; }
a.card.hatcard { color: inherit; text-decoration: none; display: block; }
a.card.hatcard:hover { box-shadow: inset 0 0 0 2px var(--line, rgba(127,127,127,.4)); }
.hathead { display: flex; gap: 24px; align-items: center; margin: 12px 0 22px; }
.hathead .pic.big { width: 132px; height: 132px; display: grid; place-items: center; }
.hathead .pic.big img, .hathead .pic.big .anim { width: 120px; height: auto; image-rendering: pixelated; }
.hathead h1 { margin: 0 0 4px; }
.sactoggle { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; margin-top: 8px; font-size: 14px; }
.hatboard tr.sac td { opacity: .62; }
.hatboard .sactag { display: block; color: #ff7b6b; }

:root {
  --sc-frame: #2a2f39; --sc-rim: #3b4250; --sc-brass: #c8963a; --sc-brass-hi: #f0cf78; --sc-brass-lo: #7a561b;
  --sc-in-1: #231a3d; --sc-in-2: #170f2b; --sc-in-3: #110b20; --sc-plinth: #3a3450; --sc-plinth-top: #5a5278;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --sc-frame: #1a1f28; --sc-rim: #2c3442; --sc-brass: #d3a447; --sc-brass-lo: #6f4e17; }
}
:root[data-theme="dark"] { --sc-frame: #1a1f28; --sc-rim: #2c3442; --sc-brass: #d3a447; --sc-brass-lo: #6f4e17; }
h2.sc-title { text-align: center; margin-top: 40px; }
.showcase { display: grid; grid-template-columns: repeat(3, minmax(0, 230px)); justify-content: center; gap: 26px; margin: 0 0 12px; }
.sc-win {
  --rc: var(--sc-brass); --st: 6px;
  position: relative; display: block; padding: 10px 10px 8px; color: inherit; text-decoration: none;
  background: var(--sc-frame);
  clip-path: polygon(0 calc(var(--st) * 2), var(--st) calc(var(--st) * 2), var(--st) var(--st), calc(var(--st) * 2) var(--st), calc(var(--st) * 2) 0,
    calc(100% - var(--st) * 2) 0, calc(100% - var(--st) * 2) var(--st), calc(100% - var(--st)) var(--st), calc(100% - var(--st)) calc(var(--st) * 2), 100% calc(var(--st) * 2),
    100% calc(100% - var(--st) * 2), calc(100% - var(--st)) calc(100% - var(--st) * 2), calc(100% - var(--st)) calc(100% - var(--st)), calc(100% - var(--st) * 2) calc(100% - var(--st)), calc(100% - var(--st) * 2) 100%,
    calc(var(--st) * 2) 100%, calc(var(--st) * 2) calc(100% - var(--st)), var(--st) calc(100% - var(--st)), var(--st) calc(100% - var(--st) * 2), 0 calc(100% - var(--st) * 2));
  box-shadow: inset 0 0 0 4px var(--sc-rim), inset 0 4px 0 4px var(--sc-rim);
}
.showcase > .sc-win { filter: drop-shadow(5px 5px 0 var(--shadow)); }
a.sc-win:hover { text-decoration: none; }
a.sc-win:hover .sc-glass { box-shadow: inset 0 0 0 2px var(--sc-brass-hi), inset 0 0 0 4px var(--sc-brass-lo), inset 0 0 0 6px color-mix(in srgb, var(--rc) 55%, transparent); }
.sc-glass {
  position: relative; aspect-ratio: 5 / 6; overflow: hidden;
  background: linear-gradient(to bottom, var(--sc-in-1) 0 34%, var(--sc-in-2) 34% 72%, var(--sc-in-3) 72%);
  box-shadow: inset 0 0 0 2px var(--sc-brass), inset 0 0 0 4px var(--sc-brass-lo), inset 0 0 0 6px color-mix(in srgb, var(--rc) 30%, transparent);
}
.sc-lamp { position: absolute; top: 4px; left: 36%; right: 36%; height: 6px; background: var(--sc-brass-hi); box-shadow: 0 2px 0 var(--sc-brass-lo); z-index: 3; }
.sc-beam {
  position: absolute; top: 10px; bottom: 16%; left: 0; right: 0; z-index: 1; pointer-events: none;
  clip-path: polygon(38% 0, 62% 0, 84% 100%, 16% 100%);
  background: linear-gradient(to bottom, rgba(255,232,170,.20) 0 30%, rgba(255,232,170,.13) 30% 62%, rgba(255,232,170,.07) 62%);
}
.sc-plinth {
  position: absolute; left: 20%; right: 20%; bottom: 0; height: 17%; z-index: 1;
  background: linear-gradient(to bottom, var(--sc-plinth-top) 0 14%, var(--sc-plinth) 14% 60%, color-mix(in srgb, var(--rc) 70%, #111) 60% 70%, var(--sc-plinth) 70%);
  box-shadow: inset 3px 0 0 rgba(255,255,255,.08), inset -3px 0 0 rgba(0,0,0,.25);
}
.sc-plinth::before { content: ""; position: absolute; left: -6%; right: -6%; top: -6px; height: 6px; background: var(--sc-plinth-top); box-shadow: inset 0 2px 0 rgba(255,255,255,.14); }
.sc-hat { position: absolute; left: 50%; bottom: 20%; width: 62%; transform: translateX(-50%); z-index: 2; display: grid; place-items: center; }
.sc-hat img { width: 100%; height: auto; image-rendering: pixelated; }
.sc-hat .anim { width: 100%; height: auto; aspect-ratio: var(--aw) / var(--ah); }
.sc-sheen {
  position: absolute; top: 0; bottom: 0; left: -40%; width: 22%; z-index: 4; pointer-events: none;
  background: linear-gradient(90deg, rgba(255,255,255,.07) 0 40%, rgba(255,255,255,.14) 40% 60%, rgba(255,255,255,.07) 60%);
  transform: skewX(-18deg); animation: scSheen 7s steps(14) infinite;
}
.showcase > .sc-win:nth-child(2) .sc-sheen { animation-delay: 2.3s; }
.showcase > .sc-win:nth-child(3) .sc-sheen { animation-delay: 4.6s; }
@keyframes scSheen { 0%, 70% { left: -40%; } 100% { left: 130%; } }
@media (prefers-reduced-motion: reduce) { .sc-sheen { animation: none; display: none; } }
.sc-plate {
  margin: 8px 6px 0; padding: 5px 6px 4px; text-align: center;
  background: linear-gradient(to bottom, var(--sc-brass-hi) 0 2px, var(--sc-brass) 2px calc(100% - 2px), var(--sc-brass-lo) calc(100% - 2px));
}
.sc-nm { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 9px/1.5 "Press Start 2P", monospace; color: #2b1d07; letter-spacing: .02em; }
.sc-foot { display: flex; justify-content: space-between; gap: 6px; padding: 5px 4px 0; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #9aa6b6; }
.sc-rar { font-weight: 600; filter: brightness(1.35); }
.sc-win.empty .sc-glass { background: linear-gradient(to bottom, var(--sc-in-2) 0 34%, var(--sc-in-3) 34%); }
.sc-win.empty .sc-plinth { --rc: #555; opacity: .6; }
.sc-win.empty .sc-lamp { background: var(--sc-brass-lo); box-shadow: none; }
.sc-hint { position: absolute; left: 0; right: 0; top: 42%; text-align: center; color: #6b7690; letter-spacing: .2em; text-transform: uppercase; font-size: 11px; }
.sc-win.empty .sc-plate { filter: saturate(.3) brightness(.7); }
.sc-win.empty .sc-foot { justify-content: center; text-transform: none; letter-spacing: .02em; color: #7b8698; font-size: 10px; }
@media (max-width: 560px) {
  .showcase { gap: 10px; }
  .sc-win { --st: 4px; padding: 6px 6px 5px; }
  .sc-nm { font-size: 7px; }
  .sc-foot { font-size: 9px; letter-spacing: .06em; }
  .sc-win.empty .sc-foot { display: none; }
}

.sc-hat.sc-thing { width: 46%; bottom: 24%; }
