@font-face {
  font-family: "Pixel Ubuntu";
  src: url("/static/fonts/ubuntu-variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
}

@font-face {
  font-family: "Pixel Block";
  src: url("/static/fonts/black-ops-one.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #000109;
  --panel: #00020a;
  --raised: #02030b;
  --cyan: #01fcff;
  --magenta: #f90688;
  --paper: #faf9f9;
  --muted: #8c93a5;
  --line: #262c3a;
  --danger: #ff547d;
  --header: 5.5rem;
  --content: 92rem;
}

* { box-sizing: border-box; }
html { background: var(--ink); scrollbar-color: var(--cyan) var(--ink); }
body {
  min-width: 20rem;
  min-height: 100vh;
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font: 1rem/1.5 "Pixel Ubuntu", Ubuntu, system-ui, sans-serif;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: var(--cyan); }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
::selection { background: var(--magenta); color: white; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.site-header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header);
  padding: 1rem clamp(1.25rem, 3vw, 3.25rem);
  border-bottom: 1px solid var(--cyan);
  background: rgb(1 2 8 / 94%);
}
.site-header::after {
  position: absolute;
  right: 0;
  bottom: -.25rem;
  width: min(28vw, 24rem);
  height: .25rem;
  background: var(--magenta);
  content: "";
}
.brand { display: block; width: clamp(12.5rem, 20vw, 19rem); }
.brand img { width: 100%; }
.site-header ul { display: flex; align-items: center; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.nav-link, .account-button {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--paper);
  font-weight: 700;
  letter-spacing: .03em;
  text-decoration: none;
}
.nav-link { padding: .55rem .85rem; }
.nav-link:hover, .nav-link:focus-visible { color: var(--cyan); }
.signout-form { margin: 0; }
.account-button {
  gap: .55rem;
  padding: .55rem .85rem;
  border-color: var(--line);
  cursor: pointer;
  clip-path: polygon(.5rem 0,100% 0,100% calc(100% - .5rem),calc(100% - .5rem) 100%,0 100%,0 .5rem);
}
.account-button:hover { border-color: var(--cyan); color: var(--cyan); }
.account-button svg, .outline-button svg, .pocket-button svg, .icon-button svg, .viewer-button svg,
.input-shell svg, .choose-file svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 1.7;
}

main {
  width: min(100%, var(--content));
  min-height: calc(100vh - var(--header) - 4.5rem);
  margin: 0 auto;
  padding: clamp(1.25rem,2.5vw,2.5rem) clamp(1.1rem,3vw,3.25rem) 4rem;
}
.site-footer {
  display: flex;
  justify-content: flex-end;
  width: min(100%, var(--content));
  margin: 0 auto;
  padding: 1rem clamp(1.1rem,3vw,3.25rem) 1.75rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .78rem;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.site-footer p { margin: 0; }
.site-footer span { padding-inline: .4rem; color: var(--magenta); }

.upload-workspace { position: relative; }
.upload-workspace::before {
  position: absolute;
  top: 1.4rem;
  left: -.55rem;
  z-index: 2;
  width: .35rem;
  height: 6.5rem;
  background: var(--magenta);
  content: "";
}
.upload-bay {
  display: grid;
  grid-template-columns: minmax(0,1.65fr) minmax(20rem,.85fr);
  min-height: 35rem;
  overflow: hidden;
  border: 1px solid var(--cyan);
  background: var(--panel);
  clip-path: polygon(.85rem 0,100% 0,100% calc(100% - .85rem),calc(100% - .85rem) 100%,0 100%,0 .85rem);
  box-shadow: .7rem .8rem 1.8rem rgb(249 6 136 / 14%), 0 0 2.2rem rgb(1 252 255 / 5%);
}
.drop-stage {
  position: relative;
  min-width: 0;
  border-right: 1px dashed rgb(1 252 255 / 55%);
  background: var(--panel);
}
.drop-stage::before, .drop-stage::after {
  position: absolute;
  z-index: 2;
  width: 1.4rem;
  height: 1.4rem;
  border-color: var(--cyan);
  border-style: solid;
  content: "";
  pointer-events: none;
}
.drop-stage::before { top: 1.25rem; left: 1.25rem; border-width: 2px 0 0 2px; }
.drop-stage::after { right: 1.25rem; bottom: 1.25rem; border-width: 0 2px 2px 0; }
.drop-stage.dragging { background: rgb(1 252 255 / 8%); }
.drop-stage.dragging .drop-stage-hitbox { transform: scale(.985); }
#image-input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.drop-stage-hitbox {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(13rem,.72fr) minmax(22rem,1.3fr);
  gap: clamp(1.2rem,2.4vw,2.8rem);
  min-height: 100%;
  padding: 4rem clamp(2rem,3vw,3.5rem);
  cursor: crosshair;
  transition: transform 160ms ease, background 160ms ease;
}
.drop-stage-hitbox:focus-within, .drop-stage-hitbox:hover { background: rgb(1 252 255 / 3%); }
.stage-weapon {
  position: relative;
  display: grid;
  width: 100%;
  place-items: center;
}
.stage-weapon::after {
  position: absolute;
  top: 50%;
  left: 78%;
  width: clamp(4rem,7vw,7rem);
  height: 2px;
  background: var(--cyan);
  box-shadow: 0 0 .7rem rgb(1 252 255 / 78%);
  content: "";
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left center;
}
.stage-raygun {
  width: clamp(12rem,17vw,16rem);
  margin: 0;
  filter: drop-shadow(.45rem .55rem .8rem rgb(249 6 136 / 25%));
  transform: rotate(-4deg);
  transition: transform 180ms ease;
}
.drop-stage-hitbox:hover .stage-raygun, .drop-stage.loaded .stage-raygun {
  transform: rotate(-1deg) translateX(.25rem);
}
.pixel-trail { position: absolute; top: 50%; left: 78%; display: flex; align-items: center; gap: .35rem; height: .55rem; transform: translateY(-50%); }
.pixel-trail i { display: block; width: .35rem; height: .35rem; background: var(--cyan); }
.pixel-trail i:nth-child(2) { width: .55rem; background: var(--magenta); }
.pixel-trail i:nth-child(3) { width: clamp(2.8rem,5vw,5rem); height: 2px; }
.stage-copy { display: flex; align-items: center; min-width: 0; flex-direction: column; }
.stage-title, .stage-subtitle {
  font-family: "Pixel Block", "Pixel Ubuntu", sans-serif;
  color: var(--paper);
  font-size: clamp(2.3rem,3.35vw,3.35rem);
  font-weight: 400;
  letter-spacing: -.025em;
  line-height: .96;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}
.stage-subtitle { margin-top: .65rem; color: var(--cyan); font-size: clamp(1.35rem,2.25vw,2.25rem); }
.stage-divider {
  display: flex;
  align-items: center;
  width: min(19rem,70%);
  margin: 2rem 0 1.2rem;
  color: var(--muted);
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.stage-divider::before, .stage-divider::after { flex: 1; height: 1px; background: var(--line); content: ""; }
.stage-divider::before { margin-right: .8rem; }
.stage-divider::after { margin-left: .8rem; }
.choose-file, .outline-button, .pocket-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  min-height: 3rem;
  padding: .65rem 1.2rem;
  border: 1px solid var(--cyan);
  background: transparent;
  color: var(--cyan);
  font-weight: 750;
  letter-spacing: .04em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(.5rem 0,100% 0,100% calc(100% - .5rem),calc(100% - .5rem) 100%,0 100%,0 .5rem);
}
.choose-file:hover, .outline-button:hover, .pocket-button:hover { background: var(--cyan); color: var(--ink); }

.loadout-panel {
  display: flex;
  min-width: 0;
  padding: clamp(1.25rem,2.25vw,2.25rem);
  background: var(--raised);
  flex-direction: column;
}
.system-state {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin: 0 0 1rem;
  color: var(--cyan);
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.system-state::before {
  width: .5rem;
  height: .5rem;
  background: currentcolor;
  box-shadow: 0 0 0 .2rem rgb(1 252 255 / 12%);
  content: "";
}
.preview-frame {
  position: relative;
  display: grid;
  overflow: hidden;
  aspect-ratio: 16/10;
  border: 1px solid var(--line);
  background: var(--ink);
  place-items: center;
}
.preview-frame::after { position: absolute; inset: 0; border: 1px solid rgb(1 252 255 / 10%); content: ""; pointer-events: none; }
.preview-frame > img { width: 100%; height: 100%; object-fit: contain; }
.preview-placeholder { display: flex; align-items: center; gap: .65rem; color: var(--muted); font-size: .82rem; }
.preview-placeholder svg { width: 1.5rem; fill: none; stroke: currentcolor; stroke-width: 1.4; }
.file-readout { display: flex; min-width: 0; margin: .85rem 0 1.45rem; flex-direction: column; }
.file-readout strong, .file-readout span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-readout strong { font-size: .9rem; }
.file-readout span { margin-top: .2rem; color: var(--muted); font-size: .76rem; }
.password-field { display: flex; gap: .55rem; color: var(--paper); font-size: .78rem; font-weight: 700; letter-spacing: .035em; flex-direction: column; }
.password-field small { margin-left: .3rem; color: var(--muted); font-size: .67rem; font-weight: 500; text-transform: uppercase; }
.input-shell { display: flex; align-items: center; min-height: 3rem; border: 1px solid var(--line); background: var(--ink); color: var(--muted); }
.input-shell:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 3px rgb(1 252 255 / 28%); color: var(--cyan); }
.input-shell svg { margin-left: .9rem; flex: 0 0 auto; }
.input-shell input { width: 100%; min-width: 0; padding: .75rem .9rem; border: 0; outline: 0; background: transparent; color: var(--paper); }
.input-shell input::placeholder { color: var(--muted); opacity: 1; }
.form-error { margin: .75rem 0 0; padding: .65rem .8rem; border-left: .25rem solid var(--danger); background: rgb(255 84 125 / 8%); color: #ff9bb5; font-size: .82rem; }
.blast-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  min-height: 3.8rem;
  margin-top: auto;
  padding: .8rem 1.2rem;
  overflow: hidden;
  border: 0;
  background: var(--magenta);
  box-shadow: .35rem .45rem 1rem rgb(1 252 255 / 18%), 0 0 1.2rem rgb(249 6 136 / 16%);
  color: white;
  font-family: "Pixel Block", "Pixel Ubuntu", sans-serif;
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: .07em;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(.6rem 0,100% 0,100% calc(100% - .6rem),calc(100% - .6rem) 100%,0 100%,0 .6rem);
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.blast-button img { width: 5.5rem; max-height: 3.2rem; object-fit: contain; }
.blast-button:hover:not(:disabled) { transform: translate(.1rem,.1rem); box-shadow: .25rem .35rem .8rem rgb(1 252 255 / 25%), 0 0 1.4rem rgb(249 6 136 / 22%); }
.blast-button:disabled { background: #85054f; box-shadow: .25rem .35rem .8rem rgb(1 252 255 / 10%); color: rgb(255 255 255 / 72%); cursor: not-allowed; }
.blast-button.firing img { animation: fire-ray 420ms steps(2,end) infinite; }

.result-strip {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--cyan);
  background: var(--panel);
  box-shadow: .45rem .55rem 1.2rem rgb(1 252 255 / 8%);
  clip-path: polygon(.55rem 0,100% 0,100% calc(100% - .55rem),calc(100% - .55rem) 100%,0 100%,0 .55rem);
}
.result-check { display: grid; width: 2.5rem; height: 2.5rem; border: 1px solid var(--cyan); color: var(--cyan); place-items: center; }
.result-check svg { width: 1.35rem; fill: none; stroke: currentcolor; stroke-width: 2; }
.result-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.result-copy small { color: var(--muted); font-size: .67rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.result-copy a { overflow: hidden; font-size: 1.05rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.clipboard-proxy { position: fixed; inset: -100vh auto auto -100vw; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.copy-notice {
  position: fixed;
  top: calc(var(--header) + 1rem);
  right: clamp(1rem,3vw,3rem);
  z-index: 20;
  display: grid;
  grid-template-columns: 2.8rem minmax(0,1fr) 2.8rem;
  align-items: center;
  gap: .9rem;
  width: min(31rem,calc(100vw - 2rem));
  padding: 1rem;
  border: 1px solid var(--cyan);
  background: var(--panel);
  box-shadow: .6rem .75rem 1.8rem rgb(1 252 255 / 16%), 0 0 2rem rgb(249 6 136 / 8%);
  clip-path: polygon(.65rem 0,100% 0,100% calc(100% - .65rem),calc(100% - .65rem) 100%,0 100%,0 .65rem);
  animation: copy-notice-arrive 280ms cubic-bezier(.2,.8,.2,1) both;
}
.copy-notice-mark { display: grid; width: 2.8rem; height: 2.8rem; border: 1px solid var(--cyan); color: var(--cyan); place-items: center; }
.copy-notice-mark svg, .copy-notice-dismiss svg { width: 1.35rem; fill: none; stroke: currentcolor; stroke-linecap: square; stroke-width: 2; }
.copy-notice-copy { display: flex; min-width: 0; flex-direction: column; }
.copy-notice-copy strong { color: var(--cyan); font-family: "Pixel Block", "Pixel Ubuntu", sans-serif; font-size: 1.25rem; font-weight: 400; letter-spacing: .04em; text-transform: uppercase; }
.copy-notice-copy span { margin-top: .15rem; color: var(--paper); font-size: 1rem; }
.copy-notice-dismiss { display: grid; width: 2.8rem; height: 2.8rem; padding: 0; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; place-items: center; }
.copy-notice-dismiss:hover { border-color: var(--cyan); color: var(--cyan); }
.copy-notice[data-kind="fallback"] { border-color: var(--magenta); box-shadow: .6rem .75rem 1.8rem rgb(249 6 136 / 18%); }
.copy-notice[data-kind="fallback"] .copy-notice-mark { border-color: var(--magenta); color: var(--magenta); }
.copy-notice[data-kind="fallback"] .copy-notice-copy strong { color: var(--magenta); }

.recent-section { margin-top: clamp(2.5rem,5vw,4.5rem); }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.section-heading h2 { margin: 0; padding: 0 0 .65rem; border-bottom: .2rem solid var(--magenta); font-family: "Pixel Block", "Pixel Ubuntu", sans-serif; font-size: 1.25rem; font-weight: 400; letter-spacing: .08em; text-transform: uppercase; }
.section-heading span { color: var(--muted); font-size: .72rem; letter-spacing: .11em; text-transform: uppercase; }
.image-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1.1rem; }
.image-tile {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--raised);
  clip-path: polygon(.5rem 0,100% 0,100% calc(100% - .5rem),calc(100% - .5rem) 100%,0 100%,0 .5rem);
}
.image-tile:hover { border-color: var(--cyan); }
.image-thumb { position: relative; display: block; aspect-ratio: 4/3; overflow: hidden; background: #000; }
.image-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 180ms ease; }
.image-thumb:hover img { transform: scale(1.025); }
.protected-badge { position: absolute; top: .65rem; right: .65rem; display: inline-flex; align-items: center; gap: .35rem; padding: .32rem .45rem; background: var(--ink); color: var(--cyan); font-size: .64rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.protected-badge svg { width: .85rem; fill: none; stroke: currentcolor; stroke-width: 1.7; }
.image-meta { display: flex; align-items: center; gap: .8rem; padding: .8rem; }
.image-meta > div { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.image-meta strong, .image-meta a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-meta strong { font-size: .82rem; }
.image-meta a { color: var(--muted); font-size: .7rem; text-decoration: none; }
.image-meta form { margin: 0; }
.image-meta > .image-meta-actions { display: flex; align-items: center; gap: .4rem; flex: 0 0 auto; flex-direction: row; }
.icon-button { display: grid; width: 2.3rem; height: 2.3rem; padding: 0; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; place-items: center; }
.icon-button:hover { border-color: var(--cyan); color: var(--cyan); }
.icon-button.danger:hover { border-color: var(--danger); color: var(--danger); }
.copy-state-success, .viewer-collapse-icon { display: none; }
[data-copy-state="success"] .copy-state-default { display: none; }
[data-copy-state="success"] .copy-state-success { display: block; }
.icon-button.copied { border-color: var(--cyan); background: var(--cyan); color: var(--ink); }
.outline-button.copied { border-color: var(--cyan); background: var(--cyan); color: var(--ink); }
.icon-button.copy-failed, .outline-button.copy-failed { border-color: var(--magenta); color: var(--magenta); }
.empty-library { display: grid; min-height: 10rem; border: 1px dashed #303747; background: rgb(8 11 20 / 66%); text-align: center; place-content: center; }
.empty-library p { margin: .45rem 0 .1rem; font-weight: 700; }
.empty-library > span:last-child { color: var(--muted); font-size: .82rem; }
.empty-mark { width: 1rem; height: 1rem; margin: auto; background: var(--magenta); box-shadow: 1rem 0 0 var(--cyan),-1rem 0 0 var(--cyan); }

.auth-shell, .lock-panel {
  width: min(100%,34rem);
  margin: clamp(3rem,8vh,7rem) auto;
  padding: clamp(1.5rem,4vw,3rem);
  border: 1px solid var(--cyan);
  background: var(--raised);
  clip-path: polygon(.9rem 0,100% 0,100% calc(100% - .9rem),calc(100% - .9rem) 100%,0 100%,0 .9rem);
  box-shadow: .65rem .75rem 1.7rem rgb(249 6 136 / 17%), 0 0 2rem rgb(1 252 255 / 5%);
}
.auth-raygun, .lock-panel > img { width: min(13rem,60%); margin: 0 auto 1.5rem; filter: drop-shadow(.35rem .45rem .7rem rgb(249 6 136 / 25%)); }
.auth-shell h1, .lock-panel h1, .admin-intro h1, .public-image-meta h1 {
  margin: 0;
  font-family: "Pixel Block", "Pixel Ubuntu", sans-serif;
  font-size: clamp(2rem,5vw,3.6rem);
  font-weight: 400;
  letter-spacing: -.025em;
  line-height: .95;
  text-transform: uppercase;
}
.auth-shell > div p, .lock-panel > p, .admin-intro p { margin: .85rem 0 1.5rem; color: var(--muted); }
.auth-shell form, .lock-panel form { margin-top: 1.5rem; }
.pocket-button { width: 100%; border-color: var(--magenta); background: var(--magenta); color: white; }
.pocket-button:hover { border-color: var(--cyan); }
.invite-detected { padding: .7rem .85rem; border-left: .25rem solid var(--cyan); background: rgb(1 252 255 / 7%); color: var(--cyan); font-size: .83rem; }

.admin-shell { width: min(100%,68rem); margin: 2rem auto; }
.admin-intro { margin-bottom: 2rem; }
.admin-shell form[hx-post] { display: flex; gap: .75rem; padding: 1rem; border: 1px solid var(--line); background: var(--raised); }
.admin-shell input[type="email"] { min-width: 0; min-height: 3rem; padding: .7rem .9rem; border: 1px solid var(--line); outline: 0; background: var(--ink); color: var(--paper); flex: 1; }
.admin-shell input[type="email"]:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgb(1 252 255 / 28%); }
.admin-shell table { width: 100%; margin-top: 1.25rem; border-collapse: collapse; font-size: .84rem; }
.admin-shell th, .admin-shell td { padding: .8rem; border-bottom: 1px solid var(--line); text-align: left; }
.admin-shell th { color: var(--cyan); font-size: .69rem; letter-spacing: .11em; text-transform: uppercase; }
.invite-launcher { display: flex; justify-content: flex-end; padding: 0 !important; border: 0 !important; background: transparent !important; }
.blast-button.compact { min-height: 3.1rem; margin: 0; }
.blast-button.compact svg { width: 1.2rem; fill: none; stroke: currentcolor; stroke-width: 2; }
.invite-list { display: grid; gap: .75rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.invite-list li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-width: 0; padding: 1rem; border: 1px solid var(--line); background: var(--raised); }
.invite-list li > div { display: flex; min-width: 0; gap: .7rem; flex-direction: column; }
.invite-list code { overflow: hidden; color: var(--cyan); font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.invite-status { width: fit-content; padding: .2rem .4rem; background: rgb(1 252 255 / 10%); color: var(--cyan); font-size: .64rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.invite-status.spent { background: rgb(140 147 165 / 10%); color: var(--muted); }
.invite-date { color: var(--muted); font-size: .76rem; }
.empty-invites { justify-content: center !important; min-height: 7rem; border-style: dashed !important; color: var(--muted); }

.public-image-shell { width: min(100%,74rem); margin: 1rem auto; }
.public-image-frame {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0,1fr);
  min-height: 20rem;
  height: min(70vh,50rem);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
}
.viewer-toolbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: 3.5rem;
  padding: .5rem;
  border-bottom: 1px solid var(--line);
  background: var(--raised);
}
.viewer-control-group { display: flex; align-items: center; gap: .35rem; }
.viewer-button {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  place-items: center;
}
.viewer-button:hover:not(:disabled) { border-color: var(--cyan); color: var(--cyan); }
.viewer-button:disabled { color: #596072; cursor: not-allowed; }
.viewer-zoom-readout { min-width: 3.65rem; color: var(--cyan); font-size: .73rem; font-weight: 800; letter-spacing: .08em; text-align: center; }
.public-image-viewport { position: relative; min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-color: var(--cyan) #000; }
.public-image-canvas { position: relative; display: grid; min-width: 100%; min-height: 100%; background: #000; place-items: center; }
.public-image-canvas img { max-width: none; max-height: none; object-fit: contain; user-select: none; transition: width 180ms cubic-bezier(.2,.8,.2,1), height 180ms cubic-bezier(.2,.8,.2,1); }
.public-image-frame.is-fullscreen .viewer-expand-icon { display: none; }
.public-image-frame.is-fullscreen .viewer-collapse-icon { display: block; }
.public-image-frame:fullscreen, .public-image-frame.viewer-expanded {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  border: 0;
  background: #000;
}
.public-image-frame.viewer-expanded { position: fixed; inset: 0; z-index: 100; }
body.viewer-overlay-open { overflow: hidden; }
.public-image-meta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 0; }
.public-image-meta > div:first-child { min-width: 0; }
.public-image-meta h1 { font-size: clamp(1.5rem,3vw,2.5rem); overflow-wrap: anywhere; }
.public-image-meta p { margin: .25rem 0 0; color: var(--muted); font-size: .8rem; }
.public-image-actions { display: flex; align-items: center; gap: .65rem; flex: 0 0 auto; }
.lock-panel .blast-button { width: 100%; margin-top: 1.25rem; }

.upload-bay.is-firing .stage-raygun { animation: stage-recoil 440ms cubic-bezier(.2,.8,.2,1); }
.upload-bay.is-firing .stage-weapon::after { animation: beam-fire 440ms steps(3,end); }
.upload-bay.is-firing .pixel-trail i { animation: pixel-shot 440ms steps(3,end); }
.upload-bay.is-firing .pixel-trail i:nth-child(2) { animation-delay: 45ms; }
.upload-bay.is-firing .pixel-trail i:nth-child(3) { animation-delay: 85ms; }
.result-strip:not([hidden]) { animation: result-arrive 320ms cubic-bezier(.2,.8,.2,1) both; }

@keyframes fire-ray {
  0% { transform: translateX(0); }
  50% { transform: translateX(.45rem); }
  100% { transform: translateX(0); }
}

@keyframes stage-recoil {
  0%, 100% { transform: rotate(-1deg) translateX(.25rem); }
  35% { transform: rotate(-7deg) translateX(-.8rem); }
  65% { transform: rotate(1deg) translateX(.7rem); }
}

@keyframes pixel-shot {
  0% { opacity: .2; transform: translateX(-1rem) scale(.6); }
  45% { opacity: 1; }
  100% { opacity: 0; transform: translateX(clamp(3rem,7vw,7rem)) scale(1.15); }
}

@keyframes beam-fire {
  0% { opacity: 0; transform: scaleX(0); }
  35% { opacity: 1; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(1.4); }
}

@keyframes result-arrive {
  from { opacity: 0; transform: translateY(-.7rem); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes copy-notice-arrive {
  from { opacity: 0; filter: blur(.35rem); transform: translateY(-.75rem); }
  to { opacity: 1; filter: blur(0); transform: translateY(0); }
}

@media (max-width: 68rem) {
  .upload-bay { grid-template-columns: minmax(0,1.35fr) minmax(18rem,.85fr); }
  .image-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 52rem) {
  :root { --header: 4.75rem; }
  .site-header { position: sticky; top: 0; min-height: var(--header); }
  .brand { width: 11.5rem; }
  .account-button span { display: none; }
  main { padding-inline: 1rem; }
  .upload-bay { display: block; min-height: 0; }
  .drop-stage { min-height: 29rem; border-right: 0; border-bottom: 1px dashed rgb(1 252 255 / 55%); }
  .drop-stage-hitbox { display: flex; gap: 0; padding: 4rem 2rem; flex-direction: column; justify-content: center; }
  .stage-weapon, .stage-copy { width: 100%; }
  .stage-weapon::after { display: none; }
  .stage-raygun { width: clamp(10rem,34vw,14rem); margin-bottom: 1rem; }
  .pixel-trail { position: static; margin-bottom: 1.1rem; transform: none; }
  .loadout-panel { min-height: 30rem; }
  .image-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 35rem) {
  .site-header { padding-inline: .9rem; }
  .brand { width: 10.4rem; }
  .nav-link { display: none; }
  .drop-stage { min-height: 24rem; }
  .drop-stage-hitbox { padding: 3rem 1.2rem; }
  .stage-raygun { width: 9.5rem; }
  .loadout-panel { min-height: 27rem; }
  .result-strip, .public-image-meta, .admin-shell form[hx-post], .invite-list li { align-items: stretch; flex-direction: column; }
  .result-check { display: none; }
  .image-grid { grid-template-columns: 1fr; }
  .image-thumb { aspect-ratio: 16/10; }
  .public-image-frame { height: min(68vh,38rem); }
  .public-image-actions { display: grid; width: 100%; grid-template-columns: 1fr 1fr; }
  .public-image-meta .outline-button { width: 100%; }
  .admin-shell { overflow-x: auto; }
  .copy-notice { top: calc(var(--header) + .75rem); right: .75rem; width: calc(100vw - 1.5rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
