:root {
  color-scheme: dark;
  --bg: #0e0c0a;
  --ink: #1c1612;
  --paper: #f4efe6;
  --muted: #b7aea1;
  --line: #3a3228;
  --gold: #f0c14a;
  --accent: #f0c14a;
  --glow: #f0c14a;
  font-family: Manrope, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(ellipse at 50% 18%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 42%),
    var(--bg);
  color: #f3eee6;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: #8ec8ff; }

.flash, .slam, #fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
#fx { width: 100%; height: 100%; z-index: 30; }
.flash { z-index: 25; opacity: 0; background: var(--glow); }
.flash.on { animation: flash .7s ease; }
@keyframes flash {
  0% { opacity: 0; }
  12% { opacity: var(--a, .4); }
  100% { opacity: 0; }
}
.slam {
  z-index: 40;
  display: grid;
  place-items: center;
  opacity: 0;
  text-align: center;
  text-transform: uppercase;
  font-family: Unbounded, "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: clamp(52px, 13vw, 132px);
  line-height: .9;
  letter-spacing: .08em;
  text-shadow:
    0 0 18px currentColor,
    0 0 64px currentColor,
    0 18px 48px rgba(0, 0, 0, .72);
  padding: 0 16px;
}
.slam.go { animation: slam 2.6s cubic-bezier(.12, .75, .2, 1) both; }
@keyframes slam {
  0% { opacity: 0; transform: scale(1.9); filter: blur(18px); }
  16% { opacity: 1; transform: scale(.9); filter: blur(0); }
  26% { transform: scale(1.08); }
  38% { transform: scale(1); }
  74% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.16); }
}

header, main, .collection {
  width: min(1180px, calc(100% - 28px));
  margin-left: auto;
  margin-right: auto;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 8px;
  flex-wrap: wrap;
}
.brand b {
  font-family: Unbounded, "Segoe UI", sans-serif;
  font-size: 28px;
  letter-spacing: .16em;
}
.brand span { display: block; color: var(--muted); font-size: 13px; letter-spacing: .02em; }
.stats { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.stats span, .nick, .ghost, .fast {
  background: #17130f;
  border-radius: 999px;
}
.ico {
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.ico[hidden] { display: none !important; }
.ico::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
.stats span, .nick { padding: 6px 10px; font-size: 13px; }
.stats span {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: center;
  flex: 0 0 auto;
  box-sizing: border-box;
}
.you { display: flex; gap: 10px; align-items: center; }
.you-id { min-width: 0; flex: 1; }
.you-id input {
  width: 100%;
  border: 1px solid var(--line);
  background: #120e0b;
  border-radius: 10px;
  padding: 8px;
}
#you-mail { margin: 4px 0 0; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  position: relative;
  width: 64px;
  height: 64px;
  flex: none;
  padding: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 0;
  background: #120e0c center / cover no-repeat;
  display: block;
  box-shadow: 0 0 0 2px var(--accent, var(--gold));
}
.accents { display: flex; gap: 6px; margin-top: 10px; }
.accents button { width: 18px; height: 18px; border: 0; border-radius: 50%; padding: 0; }
.accents button.on { outline: 2px solid #fff; outline-offset: 2px; }
.game-set {
  margin-top: 14px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid #3a3228;
  background:
    radial-gradient(120% 80% at 50% -30%, color-mix(in srgb, var(--accent, var(--gold)) 22%, transparent), transparent 55%),
    #120e0b;
}
.game-set h2 { margin: 0 0 10px; }
.set-line {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  color: #f3eee6;
  font-size: 13px;
}
.set-line input { accent-color: var(--accent, var(--gold)); }
.set-line[hidden] { display: none; }
.set-actions { display: grid; gap: 8px; margin-top: 10px; }
.set-go {
  width: 100%;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 24%, #171614);
  color: color-mix(in srgb, var(--accent) 42%, #fff);
  padding: 8px 12px;
  font-weight: 700;
}
.set-go.danger { background: #3a221c; color: #ffb4a8; }
.set-go:disabled { opacity: .45; cursor: default; }
.set-hint { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
.auto-tiers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.auto-tiers button {
  border: 1px solid #3a3228;
  border-radius: 999px;
  background: #221c16;
  color: #f3eee6;
  padding: 6px 10px;
}
.auto-tiers button.on { background: #3a2a14; color: var(--gold); border-color: var(--accent, var(--gold)); }
#auto-pick {
  width: min(420px, calc(100vw - 28px));
  border: 0;
  padding: 0;
  background: transparent;
  color: #f3eee6;
}
#auto-pick::backdrop { background: rgba(6, 4, 2, .78); }
#auto-pick h2 { margin: 0 0 8px; font-family: Unbounded, "Segoe UI", sans-serif; font-size: 22px; }
#auto-pick .set-line { margin-top: 12px; }
.set-hint[hidden] { display: none; }
.act-list { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow: auto; margin-top: 12px; }
.act-empty { margin: 0; color: #d9d0c4; }
.act-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid #3a3228;
  background: #221c16;
}
.act-row img { width: 54px; height: 54px; object-fit: cover; border-radius: 10px; background: #120e0c; }
.act-row b { display: block; font-size: 14px; line-height: 1.2; }
.act-row small { display: block; margin-top: 3px; color: #d9d0c4; font-size: 12px; line-height: 1.3; }
.act-go {
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 24%, #171614);
  color: color-mix(in srgb, var(--accent) 42%, #fff);
  padding: 8px 12px;
  font-weight: 700;
  white-space: nowrap;
}
.act-go.danger { background: #3a221c; color: #ffb4a8; }
#act-pick {
  width: min(520px, calc(100vw - 28px));
  max-height: calc(100vh - 32px);
  border: 0;
  padding: 0;
  background: transparent;
  color: #f3eee6;
  overflow: auto;
}
#act-pick::backdrop { background: rgba(6, 4, 2, .78); }
#act-pick h2 {
  margin: 0 0 8px;
  font-family: Unbounded, "Segoe UI", sans-serif;
  font-size: 22px;
}
#act-note { margin: 0; color: #d9d0c4; line-height: 1.4; }
#unlock {
  width: min(420px, calc(100vw - 28px));
  border: 0;
  padding: 0;
  background: transparent;
  color: #f3eee6;
  overflow: visible;
}
#unlock::backdrop { background: rgba(6, 4, 2, .78); }
.unlock-sheet {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 16px;
  border-radius: 22px;
  background:
    radial-gradient(120% 70% at 50% -20%, color-mix(in srgb, var(--accent, var(--gold)) 32%, transparent), transparent 52%),
    #16130f;
  border: 1px solid #3a3228;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
  animation: unlock-in .46s cubic-bezier(.16, .84, .24, 1);
}
.unlock-sheet::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent, var(--gold)), transparent);
  transform-origin: left center;
  animation: unlock-line .7s ease both;
}
.unlock-kicker {
  margin: 0 0 4px;
  color: var(--accent, var(--gold));
  font-family: Unbounded, "Segoe UI", sans-serif;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
#unlock h2 {
  margin: 0 0 12px;
  font-family: Unbounded, "Segoe UI", sans-serif;
  font-size: 22px;
  letter-spacing: .03em;
}
.unlock-stand, .unlock-copy { margin: 0; color: #d9d0c4; line-height: 1.45; }
.unlock-copy { margin-top: 8px; }
.unlock-item {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #221c16;
  border: 1px solid #3a3228;
  animation: unlock-rise .42s ease both;
}
.unlock-item h3 { margin: 0 0 4px; font-size: 14px; color: var(--gold); }
.unlock-item p { margin: 0; color: #d9d0c4; font-size: 13px; line-height: 1.4; }
.unlock-ok {
  width: 100%;
  margin-top: 14px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 24%, #171614);
  color: color-mix(in srgb, var(--accent) 42%, #fff);
  padding: 10px 14px;
  font-weight: 700;
}
@keyframes unlock-in {
  0% { opacity: 0; transform: translateY(16px) scale(.94); }
  100% { opacity: 1; transform: none; }
}
@keyframes unlock-line {
  0% { transform: scaleX(0); }
  100% { transform: scaleX(1); }
}
@keyframes unlock-rise {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: none; }
}
body[data-pomp="5"] .levitate,
body[data-pomp="6"] .levitate { width: 112px; height: 112px; margin-left: -56px; }
body[data-pomp="7"] .float { animation-duration: 2.2s; }
body[data-pomp="7"] .levitate { width: 120px; height: 120px; margin-left: -60px; }
.ava-frame {
  position: relative;
  flex: none;
  padding: 3px;
  border-radius: 21px;
  background: transparent;
}
.ava-frame .avatar,
.ava-frame .hero-ava {
  position: relative;
  z-index: 1;
  box-shadow: none;
  border-radius: 18px;
}
.ava-frame .hero-ava img { position: static; display: block; width: 100%; height: 100%; object-fit: cover; }
.rebirth-badge {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 2;
  transform: translate(-50%, 45%);
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #14110e;
  color: var(--accent, var(--gold));
  border: 1px solid var(--accent, var(--gold));
  font-family: Unbounded, "Segoe UI", sans-serif;
  font-size: 10px;
  line-height: 15px;
  text-align: center;
  pointer-events: none;
}
.rebirth-badge[hidden] { display: none; }
.ava-frame[data-rebirth="1"] { background: transparent; }
.ava-frame[data-rebirth="1"]::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  border: 2px dashed var(--accent);
  pointer-events: none;
}
.ava-frame[data-rebirth="2"] { background: transparent; }
.ava-frame[data-rebirth="2"]::before,
.ava-frame[data-rebirth="5"]::before,
.ava-frame[data-rebirth="6"]::before,
.ava-frame[data-rebirth="6"]::after,
.ava-frame[data-rebirth="7"]::before,
.ava-frame[data-rebirth="7"]::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.ava-frame[data-rebirth="2"]::before {
  padding: 5px;
  background:
    linear-gradient(var(--accent), var(--accent)) 0 0 / 12px 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 0 0 / 2px 12px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100% 0 / 12px 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100% 0 / 2px 12px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 0 100% / 12px 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 0 100% / 2px 12px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100% 100% / 12px 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100% 100% / 2px 12px no-repeat,
    repeating-linear-gradient(45deg, var(--accent) 0 1px, transparent 1px 5px);
}
.ava-frame[data-rebirth="3"] {
  background: transparent;
  box-shadow:
    inset 0 0 0 2px var(--accent),
    inset 0 0 0 3px #120e0c,
    inset 0 0 0 5px var(--accent);
}
.ava-frame[data-rebirth="4"] {
  background: transparent;
  box-shadow: inset 0 0 0 3px var(--accent);
}
.ava-frame[data-rebirth="5"] { background: transparent; }
.ava-frame[data-rebirth="5"]::before {
  padding: 4px;
  background: conic-gradient(from var(--frame-angle), var(--accent), #fff8, var(--accent) 25%, transparent 40%, var(--accent) 55%, #fff8, var(--accent));
  animation: frame-angle 9s linear infinite;
}
.ava-frame[data-rebirth="6"] {
  background: transparent;
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 55%, transparent);
}
.ava-frame[data-rebirth="6"]::before {
  padding: 2px;
  background:
    repeating-conic-gradient(from var(--frame-angle), var(--accent) 0 10deg, transparent 10deg 18deg);
  animation: frame-angle 14s linear infinite;
}
.ava-frame[data-rebirth="6"]::after {
  inset: 3px;
  padding: 3px;
  border-radius: 15px;
  background:
    linear-gradient(var(--accent), var(--accent)) 0 0 / 11px 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 0 0 / 2px 11px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100% 0 / 11px 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100% 0 / 2px 11px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 0 100% / 11px 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 0 100% / 2px 11px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100% 100% / 11px 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100% 100% / 2px 11px no-repeat,
    linear-gradient(color-mix(in srgb, var(--accent) 75%, #fff), color-mix(in srgb, var(--accent) 75%, #fff)) 0 0 / 100% 1px no-repeat,
    linear-gradient(color-mix(in srgb, var(--accent) 75%, #fff), color-mix(in srgb, var(--accent) 75%, #fff)) 0 100% / 100% 1px no-repeat,
    linear-gradient(color-mix(in srgb, var(--accent) 75%, #fff), color-mix(in srgb, var(--accent) 75%, #fff)) 0 0 / 1px 100% no-repeat,
    linear-gradient(color-mix(in srgb, var(--accent) 75%, #fff), color-mix(in srgb, var(--accent) 75%, #fff)) 100% 0 / 1px 100% no-repeat;
}
.ava-frame[data-rebirth="7"] {
  background: transparent;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent),
    0 0 16px color-mix(in srgb, var(--accent) 75%, transparent),
    0 0 28px color-mix(in srgb, var(--accent) 35%, transparent);
  animation: badge-glow 2.4s ease-in-out infinite;
}
.ava-frame[data-rebirth="7"]::before {
  padding: 3px;
  background: conic-gradient(from var(--frame-angle), var(--accent), #fff, var(--accent) 12%, transparent 28%, var(--accent) 46%, #fff, var(--accent) 68%, transparent 82%, var(--accent));
  animation: frame-angle 5.5s linear infinite;
}
.ava-frame[data-rebirth="7"]::after {
  padding: 6px;
  background: conic-gradient(from var(--frame-angle), transparent 0 62%, #fff 78%, var(--accent) 88%, transparent 100%);
  animation: frame-angle 8s linear infinite reverse;
}
.ava-frame[data-rebirth="6"] .rebirth-badge,
.ava-frame[data-rebirth="7"] .rebirth-badge { animation: badge-glow 2.8s ease-in-out infinite; }
@keyframes frame-sheen {
  0% { filter: brightness(1); opacity: .75; }
  50% { filter: brightness(1.45); opacity: 1; }
  100% { filter: brightness(1); opacity: .75; }
}
@property --frame-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
@keyframes frame-angle { to { --frame-angle: 360deg; } }
@keyframes badge-glow {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  50% { box-shadow: 0 0 8px 1px color-mix(in srgb, var(--accent, var(--gold)) 70%, transparent); }
}
.avatar img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
#avatar-fallback {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-family: Unbounded, "Segoe UI", sans-serif;
  color: var(--gold);
  font-size: 22px;
}
#avatar-fallback[hidden],
.avatar img[hidden] { display: none; }
.avatar[data-mut="inverted"] img { filter: invert(1) hue-rotate(180deg); }
.avatar[data-mut="golden"] img { filter: sepia(1) saturate(4) brightness(1.1); }
.avatar[data-mut="cursed"] img { filter: contrast(3) saturate(5) brightness(.9); }
.avatar[data-mut="rainbow"] img { animation: hue 2.2s linear infinite; }
#google-login, #google-out { width: 100%; }
#google-login {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='6' fill='black'/%3E%3C/svg%3E");
  margin-top: 10px;
  border: 0;
  border-radius: 999px;
  background: #1a73e8;
  color: #fff;
  font-weight: 700;
  padding: 8px 12px;
}
#google-out { margin-top: 6px; }
.you-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 10px 0 14px;
}
.you-stats span {
  width: auto;
  text-align: left;
  background: #120e0b;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 12px;
}
#avatar-pick {
  width: min(520px, 94vw);
  border: 0;
  border-radius: 20px;
  padding: 14px;
  background: #16130f;
  color: #f3eee6;
}
#avatar-pick h2 { margin: 0; font-size: 16px; }
#avatar-pick::backdrop { background: rgba(0, 0, 0, .72); }
#avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 8px;
  margin-top: 12px;
  max-height: 52vh;
  overflow: auto;
}
.avatar-cell {
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #120e0c;
}
.avatar-cell img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
#mute {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' d='M2 6h3l4-3v10L5 10H2z'/%3E%3C/svg%3E");
  border: 0;
  background: color-mix(in srgb, var(--accent) 24%, #171614);
  color: color-mix(in srgb, var(--accent) 42%, #fff);
  border-radius: 999px;
  padding: 8px 14px;
}
#mute[aria-pressed="true"] { background: #2a241c; color: var(--muted); }
#google-out { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='black' stroke-width='1.8' d='M6 2H3v12h3M6 8h8M11 5l3 3-3 3'/%3E%3C/svg%3E"); background: #2a241c; color: #b7aea1; }
#share, #share-card { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='4' cy='8' r='2' fill='black'/%3E%3Ccircle cx='12' cy='4' r='2' fill='black'/%3E%3Ccircle cx='12' cy='12' r='2' fill='black'/%3E%3Cpath stroke='black' stroke-width='1.4' d='M6 7l4-2M6 9l4 2'/%3E%3C/svg%3E"); background: #1c2838; color: #9fd0ff; }
#place-card { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' d='M8 1l2 4 4 .4-3 2.8.8 4L8 10.2 4.2 12.2 5 8.2 2 5.4 6 5z'/%3E%3C/svg%3E"); background: #1a2e24; color: #7dcea0; }
#avatar-card { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='6' r='2.4' fill='black'/%3E%3Cpath fill='black' d='M3.2 13.2a4.8 4.8 0 0 1 9.6 0z'/%3E%3C/svg%3E"); background: #1c2430; color: #9ec4ff; }
#merge-card { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' d='M2 10l6 4 6-4-6-4zM2 6l6 4 6-4-6-4z'/%3E%3C/svg%3E"); background: #2a2140; color: #c9b6ff; }
#reset, #avatar-clear, .viewer-close .ico { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' d='M4 4l8 8M12 4L4 12' stroke='black' stroke-width='2'/%3E%3C/svg%3E"); }
#reset { background: #3a221c; color: #ff9a8a; }
#avatar-clear, .viewer-close .ico { background: #2a241c; color: #f3eee6; }
#inv-clear { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' d='M8 1l2 5 5 .4-4 3.2 1.2 5L8 11.8 3.8 14.6 5 9.6 1 6.4 6 6z'/%3E%3C/svg%3E"); background: #1c2430; color: #9ec4ff; }
#inv-stand { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='black' stroke-width='1.6' d='M3 3h10v7H3zM6 10v3M10 10v3M4 13h8'/%3E%3C/svg%3E"); background: #1a2e24; color: #7dcea0; }
#inv-clear[aria-pressed="true"], #inv-stand[aria-pressed="true"] { filter: brightness(1.25); }
a.linkish { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='black' stroke-width='1.8' d='M4 8h8M9 5l3 3-3 3'/%3E%3C/svg%3E"); background: color-mix(in srgb, var(--accent) 24%, #171614); color: color-mix(in srgb, var(--accent) 42%, #fff); }
#viewer-link { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='black' stroke-width='1.8' d='M4 12L12 4M7 4h5v5'/%3E%3C/svg%3E"); background: #1c2838; color: #9fd0ff; border: 0; }

main {
  display: grid;
  grid-template-columns: minmax(240px, 270px) minmax(300px, 520px) minmax(240px, 270px);
  justify-content: center;
  gap: 18px;
  align-items: start;
  padding-bottom: 10px;
}
.panel {
  background: rgba(20, 16, 13, .88);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
}
h2, h3 { font-family: Unbounded, "Segoe UI", sans-serif; font-weight: 500; }
.panel h2, .col-head h2 { margin: 0 0 10px; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }
#odds { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
#odds li { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
#odds span { color: var(--muted); }
.pity { margin: 14px 0; display: grid; gap: 6px; font-size: 13px; }
.bar { height: 8px; background: #2a241c; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: #3aa0ff; }
.bar.legend i { background: var(--gold); }
#buy-luck, #roll {
  border: 0;
  border-radius: 999px;
  font-family: Unbounded, "Segoe UI", sans-serif;
}
#buy-luck {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' d='M8 1l1.8 4.2L14 6.2 11 9l.8 4.6L8 11.4 4.2 13.6 5 9 2 6.2l4.2-1z'/%3E%3C/svg%3E");
  width: 100%;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--accent) 24%, #171614);
  color: color-mix(in srgb, var(--accent) 42%, #fff);
  border: 0;
  white-space: nowrap;
  font-size: 13px;
}
#buy-luck:disabled { opacity: .45; cursor: default; }
.hint, .source, .keys, .math, .film { color: var(--muted); font-size: 12px; line-height: 1.45; }
details { margin-top: 12px; }
summary { cursor: pointer; color: var(--gold); }
#help h3 { margin: 12px 0 4px; font-size: 13px; }
#help p { margin: 0 0 8px; color: #ddd4c8; font-size: 13px; line-height: 1.45; }

.stage { width: min(100%, 520px); margin-inline: auto; text-align: center; justify-self: center; }
.banner {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--gold);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.cabinet {
  --glow: var(--accent);
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  padding: 18px 16px 16px;
  background: linear-gradient(180deg, #2a2118, #120e0b);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  perspective: 1200px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 24px 70px rgba(0, 0, 0, .35);
}
.cabinet.hot { box-shadow: inset 0 0 0 1px var(--glow), 0 0 40px color-mix(in srgb, var(--glow) 45%, transparent), 0 24px 70px rgba(0, 0, 0, .35); }
.rays {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 240%;
  height: 240%;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  background: repeating-conic-gradient(
    from 0deg,
    transparent 0 14deg,
    color-mix(in srgb, var(--glow) 28%, transparent) 18deg,
    color-mix(in srgb, var(--glow) 55%, transparent) 20deg,
    transparent 26deg
  );
  mask-image: radial-gradient(circle, transparent 0 8%, #000 18%, #000 78%, transparent 100%);
  animation: ray-spin 38s linear infinite;
  mix-blend-mode: screen;
}
.cabinet.hot .rays { opacity: .48; }
@keyframes ray-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(1turn); }
}
@keyframes spin { to { transform: rotate(1turn); } }
.cabinet.shake { animation: shake .45s linear; }
@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(calc(var(--shake, 4px) * -1), 2px); }
  40% { transform: translate(var(--shake, 4px), -3px); }
  60% { transform: translate(calc(var(--shake, 4px) * -.5), 1px); }
  80% { transform: translate(calc(var(--shake, 4px) * .4), -1px); }
}

.card {
  --rx: 0deg;
  --ry: 0deg;
  --lift: 1;
  --gx: 50%;
  --gy: 20%;
  width: min(100%, 440px);
  margin: 0 auto;
  perspective: 1400px;
  position: relative;
  z-index: 1;
  transform: rotateX(var(--rx)) rotateY(var(--ry)) scale(var(--lift));
  transform-style: preserve-3d;
  transition: transform .16s ease;
}
.card.flipped { transform: none; }
.foil {
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: inherit;
  pointer-events: none;
  opacity: .9;
  background: linear-gradient(
    100deg,
    transparent 0%,
    transparent 36%,
    rgba(255, 255, 255, .05) 44%,
    rgba(255, 255, 255, .38) 50%,
    rgba(255, 255, 255, .05) 56%,
    transparent 64%,
    transparent 100%
  );
  background-size: 240% 100%;
  background-position: 130% 0;
  mix-blend-mode: soft-light;
  animation: foil-pass 5.6s ease-in-out infinite;
}
.card.flipped .foil { opacity: 0; }
@keyframes foil-pass {
  0%, 18% { background-position: 130% 0; }
  50% { background-position: -30% 0; }
  82%, 100% { background-position: 130% 0; }
}
.inner {
  position: relative;
  transform-style: preserve-3d;
  transition: transform .72s cubic-bezier(.18, .8, .2, 1);
}
.card.flipped .inner { transform: rotateY(180deg); }
.face { backface-visibility: hidden; border-radius: 22px; }
.front {
  position: relative;
  background-color: var(--paper);
  background-image: url("bg.png");
  background-repeat: repeat;
  background-size: 220px auto;
  color: var(--ink);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
}
.back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--gold);
  background:
    repeating-linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, transparent) 0 8px, transparent 8px 16px),
    radial-gradient(circle at 50% 40%, #3a2a16, #120e0b 72%);
  border-radius: 18px;
}
.back-mark, .reel, .tier, #roll, .combo, .stamp {
  font-family: Unbounded, "Segoe UI", sans-serif;
}
.back-mark { letter-spacing: .22em; font-size: 28px; }
.reel { min-height: 1.3em; text-transform: uppercase; font-size: 20px; }

.shot {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  background: #120e0c center / cover no-repeat;
  overflow: hidden;
  border-radius: 22px 22px 0 0;
}
.shot::before, .levitate::before, .cell::before {
  content: "";
  position: absolute;
  inset: -16px;
  background: inherit;
  background-size: cover;
  background-position: center;
  filter: blur(16px) brightness(.42) saturate(1.15);
  transform: scale(1.08);
  z-index: 0;
}
.shot a { display: block; height: 100%; position: relative; z-index: 1; }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.shot::after, .cell-tilt::after, .viewer-shot::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  box-sizing: border-box;
  border-radius: inherit;
  border: 3px solid var(--glow, transparent);
}
.shot[data-clear="1"],
.cell-tilt[data-clear="1"],
.viewer-shot[data-clear="1"],
.levitate[data-clear="1"],
.avatar[data-clear="1"],
.float[data-mut] .levitate[data-clear="1"] {
  background-color: transparent !important;
  background-image: none !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.shot[data-clear="1"]::before,
.cell-tilt[data-clear="1"]::before,
.viewer-shot[data-clear="1"]::before,
.levitate[data-clear="1"]::before,
.avatar[data-clear="1"]::before { content: none; display: none; }
.card:has(.shot[data-clear="1"]) {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.front:has(.shot[data-clear="1"]) { background: transparent; }
.front:has(.shot[data-clear="1"]) .plate {
  background-color: var(--paper);
  background-image: url("bg.png");
  background-repeat: repeat;
  background-size: 220px auto;
}
.shot[data-clear="1"] img,
.cell-tilt[data-clear="1"] img,
.levitate[data-clear="1"] img,
.avatar[data-clear="1"] img,
.viewer-shot[data-clear="1"] img {
  object-fit: contain;
  background: transparent;
}
.cabinet[data-tier="epic"] .shot { box-shadow: 0 0 24px #a855f7; }
.cabinet[data-tier="legendary"] .shot { box-shadow: 0 0 28px #f59e0b; }
.cabinet[data-tier="mythic"] .shot { box-shadow: 0 0 32px #ef4444; }
.cabinet[data-mod="inverted"] .shot img,
.cell[data-mut="inverted"] img,
.float[data-mut="inverted"] img,
#viewer[data-mut="inverted"] #viewer-gif { filter: invert(1) hue-rotate(180deg); }
.cabinet[data-mod="golden"] .shot img,
.cell[data-mut="golden"] img,
.float[data-mut="golden"] img,
#viewer[data-mut="golden"] #viewer-gif { filter: sepia(1) saturate(4) brightness(1.1); }
.cabinet[data-mod="cursed"] .shot img,
.cell[data-mut="cursed"] img,
.float[data-mut="cursed"] img,
#viewer[data-mut="cursed"] #viewer-gif { filter: contrast(3) saturate(5) brightness(.9); }
.cabinet[data-mod="rainbow"] .shot img,
.cell[data-mut="rainbow"] img,
.float[data-mut="rainbow"] img,
#viewer[data-mut="rainbow"] #viewer-gif { animation: hue 2.2s linear infinite; }
.empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  color: #efe7dc;
}
.empty span { color: #b7aea1; }
.empty[hidden], img[hidden], a[hidden] { display: none !important; }
.shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .55) 48%, transparent 62%);
  transform: translateX(-130%);
  pointer-events: none;
}
.shot.spark .shine { animation: shine .85s ease; }
@keyframes shine { to { transform: translateX(130%); } }
.mod-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex: none;
}
.mod-stack:empty { display: none; }
.mut-line { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.mod-ico {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  color: #6f675d;
  background: transparent;
  flex: none;
}
.mod-ico svg { width: 14px; height: 14px; display: block; }
.mod-ico.inverted { color: #d7d2ff; }
.mod-ico.golden { color: #f0c14a; }
.mod-ico.cursed { color: #ff7a3c; }
.mod-ico.clear { color: #b9dcff; }
.stamp {
  position: absolute;
  z-index: 6;
  top: 14px;
  right: 12px;
  padding: 4px 8px;
  border: 3px solid #ff3355;
  color: #ff3355;
  background: rgba(255, 255, 255, .86);
  letter-spacing: .08em;
  transform: rotate(12deg) scale(0);
}
.stamp.show { animation: pop .35s cubic-bezier(.2, 1.4, .3, 1) forwards; }
.stamp.dupe { border-color: #a6742a; color: #a6742a; }
@keyframes pop { to { transform: rotate(-8deg) scale(1); } }

.plate {
  height: 118px;
  padding: 14px 16px;
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-end;
  overflow: hidden;
}
.plate-main { display: flex; align-items: flex-end; gap: 8px; min-width: 0; flex: 1; }
.who { min-width: 0; text-align: left; }
.tier-side { flex: none; text-align: right; max-width: 42%; }
.tier { font-size: 18px; color: var(--glow); line-height: 1.1; }
.ticket {
  color: #6f675d;
  font-size: 12px;
  margin-top: 4px;
  min-height: 1.15em;
  text-align: right;
  white-space: normal;
}
#card-title, #viewer-title { margin: 0; font-size: 18px; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#card-desc, #viewer-meta { margin: 0; color: #5e574e; font-size: 13px; line-height: 1.2; }
#card-desc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#viewer-meta { color: #c9c0b4; margin-top: 2px; }
#sp { display: block; margin-top: 10px; min-height: 1.15em; font-size: 22px; font-variant-numeric: tabular-nums; }

.combo, .status, .film, .controls { position: relative; z-index: 2; }
.combo { min-height: 1.2em; margin: 8px 0 0; color: var(--gold); font-size: 18px; }
.combo.go { animation: bump .35s ease; }
@keyframes bump {
  0% { transform: scale(.7); }
  40% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
.status { margin: 8px 0 0; min-height: 1.35em; font-size: 15px; }
.film { margin: 2px 0 8px; min-height: 1.35em; }
.controls { display: grid; justify-items: center; gap: 8px; }
#roll {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' d='M5 3l8 5-8 5z'/%3E%3C/svg%3E");
  width: min(100%, 280px);
  height: 64px;
  background: var(--accent);
  color: var(--accent-ink, #1a1206);
  border: 0;
  font-size: 16px;
  letter-spacing: .04em;
  box-shadow: 0 8px 0 color-mix(in srgb, var(--accent) 42%, #000), 0 14px 30px color-mix(in srgb, var(--accent) 28%, transparent);
}
#roll.poor { filter: saturate(.6) brightness(.92); }
.afford { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
#roll:active { transform: translateY(4px); box-shadow: 0 4px 0 color-mix(in srgb, var(--accent) 42%, #000); }
#roll:not(.busy) { animation: idle 2.6s ease-in-out infinite; }
@keyframes idle {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.08); }
}
.fast { padding: 6px 10px; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.keys { margin: 8px 0 0; }

#feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
#feed button, .cell {
  width: 100%;
  text-align: left;
  background: #120e0b;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: inherit;
}
#feed button { padding: 8px; display: grid; grid-template-columns: 42px 1fr; gap: 8px; align-items: center; }
#feed img { width: 42px; height: 42px; object-fit: cover; object-position: center; border-radius: 6px; background: #120e0c; }
#feed small { color: var(--muted); }
.ghost { padding: 8px 12px; background: #2a241c; color: #f3eee6; margin-top: 8px; }
.stats span.pop { animation: bump .35s ease; }

.collection { padding: 8px 0 40px; }
.col-head { display: grid; gap: 10px; }
.inv-sheet {
  display: grid;
  gap: 0;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid #2c2a27;
  background: #121110;
}
.inv-main { display: flex; gap: 8px; align-items: center; }
.inv-main input { flex: 1; min-width: 0; }
#inv-edit, #inv-stack, #inv-delete {
  height: 36px;
  margin: 0;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid #34322e;
  background: #1b1a18;
  color: #d9d0c4;
  white-space: nowrap;
}
#inv-edit[aria-pressed="true"], #inv-stack[aria-pressed="true"], #inv-filter[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 22%, #171614);
  color: color-mix(in srgb, var(--accent) 40%, #fff);
  border-color: color-mix(in srgb, var(--accent) 55%, #34322e);
}
#inv-filter {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='black' stroke-width='1.6' d='M2 3h12l-4.5 5.2V13l-3 1.2V8.2z'/%3E%3C/svg%3E");
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border-radius: 10px;
  border: 1px solid #34322e;
  background-color: #1b1a18;
  color: #d9d0c4;
}
.inv-filters {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .28s ease;
}
.inv-filters.open { grid-template-rows: 1fr; }
.inv-filters-inner {
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.inv-filters.open .inv-filters-inner { padding-top: 10px; }
.inv-editbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
}
.inv-editbar[hidden] { display: none; }
.keep-line { display: flex; gap: 8px; align-items: center; color: #d9d0c4; font-size: 13px; }
.keep-line input { accent-color: var(--accent); }
.inv-bar input, .inv-sheet input, .inv-sheet select, .act-sort select {
  height: 36px;
  border: 1px solid #34322e;
  background-color: #1b1a18;
  color: #f4efe8;
  border-radius: 10px;
  padding: 0 12px;
  font: inherit;
}
.inv-sheet select, .act-sort select {
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23d9d0c4' stroke-width='1.6' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px 7px;
}
.inv-sheet input:focus, .inv-sheet select:focus {
  outline: none;
  border-color: var(--accent, var(--gold));
}
#inv-clear, #inv-stand, #inv-reset {
  height: 36px;
  margin-top: 0;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid #34322e;
  background: #1b1a18;
  color: #d9d0c4;
}
#inv-clear[aria-pressed="true"], #inv-stand[aria-pressed="true"] {
  filter: none;
  background: color-mix(in srgb, var(--accent) 22%, #171614);
  color: color-mix(in srgb, var(--accent) 40%, #fff);
  border-color: color-mix(in srgb, var(--accent) 55%, #34322e);
}
.act-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #d9d0c4;
  font-size: 13px;
}
.act-tools { display: flex; align-items: center; gap: 8px; }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper button {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid #34322e;
  background: #1b1a18;
  color: #f4efe8;
}
.stepper button:disabled { opacity: .35; }
.stepper span { min-width: 1.4em; text-align: center; font-variant-numeric: tabular-nums; }
.grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 16px;
  align-items: start;
}
.pile { position: relative; padding-bottom: calc(var(--layers) * 10px); }
.pile-back {
  position: absolute;
  z-index: 1;
  top: calc(var(--i) * 10px);
  left: calc(var(--i) * 8px);
  width: calc(100% - var(--i) * 3px);
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(232, 224, 214, .55);
}
.pile-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transform: scale(1.08);
  filter: blur(calc(1.4px + var(--i) * 0.8px)) brightness(.78);
  opacity: calc(0.92 - (var(--i) - 1) * 0.16);
}
.pile-back.pile-fade { box-shadow: 0 0 0 1px rgba(232, 224, 214, .22); }
.pile-back.pile-fade img {
  filter: blur(7px) brightness(.62);
  opacity: .28;
}
.pile .cell { position: relative; z-index: 2; }
.cell-check {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 6;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 2px solid #fff;
  background: rgba(0, 0, 0, .5);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .45);
}
.cell.is-picked .cell-check { background: var(--accent); border-color: var(--accent); }
.cell.is-picked .cell-check::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #14110e;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.cell.is-picked .cell-tilt { box-shadow: inset 0 0 0 2px var(--accent); }
.cell {
  padding: 0;
  overflow: visible;
  position: relative;
  aspect-ratio: 1 / 1;
  background: transparent;
  border: 0;
  border-radius: 14px;
  perspective: 800px;
}
.cell::before { display: none; }
.cell-tilt {
  --rx: 0deg;
  --ry: 0deg;
  --lift: 1;
  display: block;
  height: 100%;
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #120e0c;
  transform: rotateX(var(--rx)) rotateY(var(--ry)) scale(var(--lift));
  transition: transform .16s ease, box-shadow .16s ease;
}
.cell:hover, .cell:focus-visible { z-index: 4; }
.cell:hover .cell-tilt, .cell:focus-visible .cell-tilt { --lift: 1.06; }
.cell img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 0;
}
.cell-foot {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: flex-end;
  padding: 8px 10px;
  background: none;
  text-align: left;
}
.cell-name, .cell-tier, .cell-pay {
  text-shadow: 0 1px 2px #000, 0 0 8px #000;
}
.cell-name, .cell-tier { display: block; }
.cell-name {
  color: #fff;
  font-size: 12px;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cell-tier { font-style: normal; font-size: 11px; margin-top: 2px; }
.cell-pay { color: #fff; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-open {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: rgba(0, 0, 0, .55);
  opacity: 0;
  transition: opacity .15s ease;
}
.cell:hover .cell-open,
.cell:focus-visible .cell-open { opacity: 1; }
.cell-open svg { width: 14px; height: 14px; }
.empty-col { color: var(--muted); }

.hall {
  width: min(1180px, calc(100% - 28px));
  margin: 4px auto 0;
}
.hall-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hall-head h2 {
  margin: 0;
  font-family: Unbounded, "Segoe UI", sans-serif;
  font-size: 14px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
#income { margin: 0; color: var(--gold); font-variant-numeric: tabular-nums; }
#rebirth {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='black' stroke-width='2' d='M13 8a5 5 0 1 1-1.2-3.2M13 2v4H9'/%3E%3C/svg%3E");
  margin-left: auto;
  border-radius: 999px;
  border: 0;
  background: color-mix(in srgb, var(--accent) 24%, #171614);
  color: color-mix(in srgb, var(--accent) 42%, #fff);
  padding: 8px 12px;
  font-size: 13px;
}
#rebirth:disabled { opacity: .55; cursor: default; }
#tokens { margin: 0; color: var(--muted); font-size: 13px; }
a.linkish { text-decoration: none; color: color-mix(in srgb, var(--accent) 42%, #fff); margin-top: 0; }
.key { display: grid; gap: 4px; margin: 10px 0 6px; font-size: 12px; color: var(--muted); }
.key input { border: 1px solid var(--line); background: #120e0b; border-radius: 10px; padding: 8px; }
.giphy-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-decoration: none;
  border: 0;
}
.giphy-mark i {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(135deg, #00ff99, #00c2ff 55%, #9b5cff);
}
.source { max-width: 36em; }
#viewer {
  width: min(720px, calc(100vw - 28px));
  max-height: calc(100vh - 32px);
  border: 0;
  padding: 0;
  background: transparent;
  color: #f3eee6;
  overflow: auto;
}
#viewer::backdrop { background: rgba(6, 4, 2, .78); }
.viewer-sheet { padding: 16px 16px 14px; }
.sheet-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sheet-bar .unlock-kicker { margin: 0; }
.sheet-x {
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 24%, #171614);
  color: color-mix(in srgb, var(--accent) 42%, #fff);
  padding: 7px 12px;
  font-weight: 700;
}
.viewer-shot {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%, #2a241c, #0a0908 72%);
  display: grid;
  place-items: center;
}
#viewer-gif {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}
.viewer-shot { margin-inline: auto; }
.viewer-close { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.viewer-close .ghost { margin-top: 0; border-radius: 999px; }
.viewer-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-top: 14px; }
#viewer-title { font-size: 22px; }
#viewer-tier { font-size: 18px; }
.viewer-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.viewer-split > div {
  min-height: 84px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #221c16;
  border: 1px solid #3a3228;
}
.viewer-label { margin: 0 0 8px; color: #8d8478; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.mod-row { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.mod-line { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; line-height: 1; }
.mod-line .mod-ico { width: 14px; height: 14px; color: #f3eee6; }
.mod-line .mod-ico svg { width: 14px; height: 14px; }
.mod-none { color: #8d8478; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; min-height: 28px; }
.chip {
  padding: 4px 8px;
  border-radius: 999px;
  background: #2a241c;
  color: #f3eee6;
  font-size: 12px;
}
.chip.pay { color: var(--gold); }
.acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.acts .ghost, .acts a { margin-top: 0; border-radius: 999px; }
.acts a {
  color: #9fd0ff;
  text-decoration: none;
  padding: 8px 12px;
  border: 0;
  background: #1c2838;
}
#viewer .giphy-mark { margin-top: 14px; }
.dock-shade { display: none !important; }
.dock {
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 60;
  width: min(360px, calc(100vw - 24px));
  padding: 16px 16px 28px;
  overflow: auto;
  background:
    radial-gradient(120% 40% at 50% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 50%),
    #16130f;
  box-shadow: 0 0 40px rgba(0, 0, 0, .45);
  transition: transform .38s cubic-bezier(.16, .84, .24, 1);
}
.dock.left { left: 0; border-right: 1px solid var(--line); transform: translateX(-110%); }
.dock.right { right: 0; border-left: 1px solid var(--line); transform: translateX(110%); }
.dock.left.open,
.dock.right.open { transform: none; }
.dock:not(.open) { visibility: hidden; pointer-events: none; }
.dock.open { visibility: visible; pointer-events: auto; }
.dock-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.dock-head h2 { margin: 0; font-size: 16px; letter-spacing: .08em; text-transform: uppercase; }
.dock-label {
  margin: 16px 0 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
#settings-dock .set-line { margin-top: 12px; }
#settings-dock #nick,
#settings-dock .key input {
  width: 100%;
  border: 1px solid var(--line);
  background: #120e0b;
  border-radius: 10px;
  padding: 8px 10px;
}
#settings-dock #reset { margin-top: 18px; }
.dock-fab {
  position: fixed;
  z-index: 70;
  bottom: 16px;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #3a2a14;
  color: var(--gold);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .4);
}
.dock-fab.left { left: 16px; font-size: 12px; letter-spacing: .06em; font-weight: 700; }
.dock-fab.gear { right: 16px; }
.dock-fab svg { width: 26px; height: 26px; transition: transform .38s cubic-bezier(.16, .84, .24, 1); }
.dock-fab.gear[aria-expanded="true"] svg { transform: rotate(90deg); }
.boards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 0;
}
.boards article {
  min-width: 0;
  padding: 10px 12px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(20, 16, 13, .88);
}
.boards h2 { margin: 0 0 8px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.boards ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.boards li { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.boards li b,
.boards li a { color: #f3eee6; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.boards li.me b,
.boards li.me a { color: var(--gold); }
.boards li span { flex: none; font-variant-numeric: tabular-nums; }
.stands {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  justify-content: safe center;
  padding: 28px 8px 12px;
}
.stand {
  --glow: #9a9388;
  position: relative;
  flex: 0 0 168px;
  height: 244px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  overflow: visible;
}
.stand.armed { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 18px; }
.float {
  --scale: 1;
  position: absolute;
  left: 14px;
  right: 14px;
  top: 8px;
  height: 124px;
}
.fx, .ring { position: absolute; inset: 0; pointer-events: none; }
.fx i {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 5px;
  height: 5px;
  margin: -2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px 3px var(--glow);
  animation: spark 1.8s linear infinite;
  animation-delay: calc(var(--i) * -0.16s);
}
.ring {
  left: 50%;
  top: 42%;
  width: 150px;
  height: 150px;
  margin: -75px 0 0 -75px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 60%, var(--glow) 78%, #fff 86%, transparent 94%);
  mask: radial-gradient(circle, transparent 58%, #000 64%, #000 78%, transparent 84%);
  animation: spin 2.8s linear infinite;
  opacity: 0;
}
.ring-b { animation-direction: reverse; animation-duration: 4s; opacity: 0; }
.levitate {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 100px;
  height: 100px;
  margin-left: -50px;
  border-radius: 16px;
  overflow: hidden;
  background: #120e0c center / cover no-repeat;
  box-shadow: 0 18px 24px rgba(0, 0, 0, .5), 0 0 18px color-mix(in srgb, var(--glow) 55%, transparent);
  z-index: 1;
}
.float .levitate {
  animation: float 3.1s ease-in-out infinite;
  animation-delay: inherit;
  transform-origin: 50% 80%;
}
.levitate img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.levitate.ghost {
  position: absolute;
  display: grid;
  place-items: center;
  left: 50%;
  width: 100px;
  height: 100px;
  margin-left: -50px;
  top: 28px;
  border: 1px dashed #3a3228;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  color: var(--muted);
}
.levitate.ghost::before { content: none; }
.pedestal {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 96px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%, color-mix(in srgb, var(--glow) 80%, white), transparent 72%);
  box-shadow: 0 0 18px var(--glow);
  opacity: .85;
}
.stand-cap {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 28px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.stand-cap b {
  max-width: 100%;
  color: #f4efe8;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cap-muts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 6px;
  max-width: 100%;
}
.cap-muts:empty { display: none; }
.cap-muts i {
  font-style: normal;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}
.rate {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  text-align: center;
  font-size: 12px;
  color: var(--gold);
}
.stand.locked { opacity: .45; }
.stand.locked .pedestal { opacity: .25; box-shadow: none; }
.levitate[data-clear="1"]::after,
.float[data-mut] .levitate[data-clear="1"]::after {
  content: "";
  display: block;
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border-radius: inherit;
  border: 2px solid color-mix(in srgb, var(--glow) 75%, white);
}
.levitate[data-clear="1"],
.float[data-mut] .levitate[data-clear="1"],
.float[data-mut="void"] .levitate[data-clear="1"],
.float[data-mut="neon"] .levitate[data-clear="1"],
.float[data-mut="golden"] .levitate[data-clear="1"],
.float[data-mut="silver"] .levitate[data-clear="1"] {
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none;
}
.float[data-mut="glow"] .ring,
.float[data-mut="neon"] .ring { opacity: 1; }
.float[data-mut="neon"] .levitate { box-shadow: 0 0 22px var(--glow), 0 0 8px #fff; }
.float[data-mut="silver"] .levitate,
.float[data-mut="golden"] .levitate {
  box-shadow: inset 0 0 24px color-mix(in srgb, var(--glow) 70%, white), 0 0 20px var(--glow);
}
.float[data-mut="silver"] .levitate::after,
.float[data-mut="golden"] .levitate::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.72) 46%, transparent 58%);
  animation: shine 2.4s ease-in-out infinite;
}
.float[data-mut="frost"] .fx i { background: #e8f7ff; animation-name: fall; }
.float[data-mut="magma"] .fx i { background: #ff6a2a; box-shadow: 0 0 10px 3px #ff3b00; animation-name: rise; }
.float[data-mut="glitch"] .levitate img,
.float[data-mut="corrupted"] .levitate img { animation: glitch .28s steps(2) infinite; }
.float[data-mut="corrupted"] .ring,
.float[data-mut="glitch"] .ring { opacity: 1; animation-duration: .7s; }
.float[data-mut="rainbow"] .levitate { animation: float 3.1s ease-in-out infinite; }
.float[data-mut="rainbow"] .ring,
.float[data-mut="rainbow"] .ring-b {
  opacity: 1;
  background: conic-gradient(from 0deg, #ff2d55, #ff9f0a, #ffd60a, #30d158, #64d2ff, #bf5af2, #ff2d55);
  filter: drop-shadow(0 0 4px #ff2d55) drop-shadow(0 0 8px #64d2ff);
  animation: neon-ring 4.2s ease-in-out infinite;
}
.float[data-mut="rainbow"] .ring-b {
  animation-duration: 6.5s;
  animation-direction: reverse;
  filter: blur(.6px) drop-shadow(0 0 6px #bf5af2);
}
.float[data-mut="inverted"] .levitate img { animation: invert-wave 3.2s ease-in-out infinite; }
.float[data-mut="golden"] .levitate img { animation: gold-gleam 2.8s ease-in-out infinite; }
.float[data-mut="golden"] .fx i {
  width: 9px;
  height: 9px;
  margin: -4px;
  border-radius: 0;
  background: #fff4c2;
  clip-path: polygon(50% 0%, 62% 35%, 100% 38%, 70% 59%, 79% 100%, 50% 76%, 21% 100%, 30% 59%, 0% 38%, 38% 35%);
  box-shadow: 0 0 8px 1px #f0c14a;
  animation-name: star-drift;
  animation-duration: 2.6s;
}
.float[data-mut="cursed"] .ring { opacity: .95; animation-duration: 1.4s; }
.float[data-mut="cursed"] .levitate img { animation: fry 1.6s ease-in-out infinite; }
.float[data-mut="prism"] .ring { opacity: 1; }
.float[data-mut="void"] .fx i { animation-name: suck; background: #d2b4ff; }
.float[data-mut="void"] .ring { opacity: 1; animation-duration: 1.3s; }
.float[data-mut="void"] .levitate { box-shadow: 0 0 0 2px #c084fc, 0 0 28px #6d28d9, inset 0 0 30px #050208; }
.float[data-mut="celestial"] .ring,
.float[data-mut="celestial"] .ring-b,
.float[data-mut="chronos"] .ring,
.float[data-mut="chronos"] .ring-b { opacity: 1; }
.float[data-mut="celestial"] .fx i { animation-name: twinkle; }
.float[data-mut="chronos"] .levitate { animation: warp 1.1s ease-in-out infinite; }
.float[data-mut="chronos"] .ring { animation-duration: .8s; }
@keyframes neon-ring {
  0% { transform: rotate(0deg) scale(.92); }
  50% { transform: rotate(200deg) scale(1.06); }
  100% { transform: rotate(360deg) scale(.92); }
}
@keyframes invert-wave {
  0%, 100% { filter: invert(1) hue-rotate(180deg); }
  50% { filter: invert(.72) hue-rotate(230deg) brightness(1.3); }
}
@keyframes gold-gleam {
  0%, 100% { filter: sepia(1) saturate(3.2) brightness(1); }
  50% { filter: sepia(1) saturate(5.5) brightness(1.35); }
}
@keyframes star-drift {
  0% { transform: rotate(calc(var(--i) * 20deg)) translateY(16px) scale(.35) rotate(0deg); opacity: 0; }
  18% { opacity: 1; }
  55% { transform: rotate(calc(var(--i) * 20deg + 40deg)) translateY(62px) scale(1) rotate(40deg); opacity: 1; }
  100% { transform: rotate(calc(var(--i) * 20deg + 90deg)) translateY(92px) scale(.25) rotate(80deg); opacity: 0; }
}
@keyframes fry {
  0%, 100% { filter: contrast(2.4) saturate(3.2) brightness(.92); }
  40% { filter: contrast(3.6) saturate(6) brightness(1.2) hue-rotate(-16deg); }
  70% { filter: contrast(2) saturate(2.4) brightness(.8) hue-rotate(10deg); }
}
@keyframes float {
  0%, 100% { transform: translateY(0) scale(var(--scale)); }
  50% { transform: translateY(-10px) scale(var(--scale)); }
}
@keyframes spark {
  0% { transform: rotate(calc(var(--i) * 36deg)) translateY(10px) scale(.3); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: rotate(calc(var(--i) * 36deg + 40deg)) translateY(86px) scale(1); opacity: 0; }
}
@keyframes fall {
  0% { transform: translate(calc((var(--i) - 6) * 8px), -70px); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translate(calc((var(--i) - 6) * 10px), 70px); opacity: 0; }
}
@keyframes rise {
  0% { transform: translate(calc((var(--i) - 6) * 7px), 60px) scale(.5); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: translate(calc((var(--i) - 6) * 9px), -80px) scale(1.2); opacity: 0; }
}
@keyframes suck {
  0% { transform: rotate(calc(var(--i) * 24deg)) translateY(92px) scale(1); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: rotate(calc(var(--i) * 24deg + 120deg)) translateY(4px) scale(.15); opacity: 0; }
}
@keyframes twinkle {
  0%, 100% { transform: rotate(calc(var(--i) * 30deg)) translateY(64px) scale(.4); opacity: .2; }
  50% { opacity: 1; transform: rotate(calc(var(--i) * 30deg + 20deg)) translateY(72px) scale(1); }
}
@keyframes glitch {
  0% { transform: none; filter: none; }
  30% { transform: translate(-4px, 1px); filter: hue-rotate(80deg) saturate(2); }
  60% { transform: translate(4px, -2px); }
  100% { transform: translate(-2px, 2px); filter: hue-rotate(200deg); }
}
@keyframes hue { to { filter: hue-rotate(1turn); } }
@keyframes warp {
  0%, 100% { transform: skewX(0deg) scale(1); }
  40% { transform: skewX(6deg) scale(1.04, .96); }
  70% { transform: skewX(-5deg) scale(.98, 1.05); }
}
@keyframes shine { 0% { transform: translateX(-130%); } 100% { transform: translateX(130%); } }

button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

@media (max-width: 980px) {
  main { grid-template-columns: minmax(0, 520px); justify-content: center; }
  .stage { order: 1; width: 100%; }
  .dock { width: min(340px, 100vw); }
  .panel:first-child { order: 2; }
  .panel:last-child { order: 3; }
}
@media (max-width: 720px) {
  header { display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .stats { grid-column: 1 / -1; }
  #mute { grid-column: 2; grid-row: 1; justify-self: end; width: auto; }
  .shot { aspect-ratio: 1 / 1; width: 100%; height: auto; }
  #roll { height: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .slam.go { opacity: 1; }
}
