/* THE SWAMP /fug/ — FugStation menu skin over an imageboard. */
:root {
  --green: #7dbb2a;
  --dgreen: #3f6b12;
  --cream: #f0e3a1;
  --sky: #2f7de1;
  --black: #07070c;
  --red: #e0322e;
  --gold: #ffd23a;
  --g-x: #5b8cff;
  --g-o: #ff5b5b;
  --g-t: #5fd16b;
  --g-s: #ff7ad9;
  --quote: #ff9d9d;
  --field: #0a0f3a;
  --dim: #aab3e8;
}

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

html {
  background-color: #04040b;
  /* faint low-saturation rainbow arc rising from below the fold */
  background-image:
    radial-gradient(ellipse 150% 95% at 50% 112%,
      transparent 58%,
      hsla(0, 45%, 62%, .13) 59.5%, hsla(30, 45%, 62%, .13) 61.5%, hsla(55, 45%, 62%, .12) 63.5%,
      hsla(110, 30%, 55%, .12) 65.5%, hsla(205, 40%, 62%, .13) 67.5%, hsla(265, 30%, 62%, .13) 69.5%,
      transparent 71%),
    radial-gradient(ellipse 120% 70% at 50% 0%, #0d1236 0%, #05050f 60%, #04040b 100%);
  background-attachment: fixed;
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: #fff;
  font-family: "DotGothic16", "MS Gothic", "Osaka-Mono", monospace;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: none;
  font-smooth: never;
  overflow-x: hidden;
}

/* starfield: hard-edged 1-2px stars on three tiling layers */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 17px 23px, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 141px 87px, #cfd6ff 0 1px, transparent 1.5px),
    radial-gradient(circle at 73px 161px, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 196px 12px, #ffe9b0 0 1px, transparent 1.5px),
    radial-gradient(circle at 51px 233px, #fff 0 1.5px, transparent 2px),
    radial-gradient(circle at 263px 199px, #b9c6ff 0 1px, transparent 1.5px),
    radial-gradient(circle at 311px 61px, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 229px 281px, #fff 0 1px, transparent 1.5px);
  background-size: 337px 307px, 337px 307px, 337px 307px, 337px 307px, 337px 307px, 337px 307px, 337px 307px, 337px 307px;
  opacity: .8;
}

/* subtle CRT scanlines */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .14) 0 1px, transparent 1px 3px);
}


a { color: var(--cream); }
a:hover { color: #fff; }
::selection { background: var(--green); color: var(--black); text-shadow: none; }

button, input, textarea, select { font: inherit; color: inherit; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 14px 14px 40px; }

/* ---- FF7 menu window ---- */
.win {
  background: linear-gradient(180deg, #3a4bc0 0%, #1a237e 55%, #0b1046 100%);
  border: 2px solid #e9e9f2;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px #6c78d8, 0 0 0 2px #0a0a18;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
}

/* ---- header ---- */
.top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 6px 0 14px;
}
.brand { flex: 0 0 auto; display: block; line-height: 0; }
.logo { height: 84px; width: auto; display: block; }
.logo.gone { display: none; }
.title-win { flex: 1 1 auto; padding: 10px 18px 12px; }
.title-win h1 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(24px, 4.2vw, 40px);
  letter-spacing: 1px;
  line-height: 1.1;
}
.title-win h1 .slash { color: var(--green); }
.title-win .tag { margin: 4px 0 0; color: var(--cream); font-size: 14px; }

/* ---- menu bar + verbs ---- */
.menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 14px;
  padding: 6px 10px;
  margin-bottom: 14px;
}
.menu .spacer { flex: 1 1 auto; }
.verb {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 26px;
  border: 0;
  background: none;
  color: #fff;
  text-decoration: none;
  text-shadow: 2px 2px 0 #000;
  cursor: pointer;
  white-space: nowrap;
  font-size: 16px;
}
.verb::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  width: 18px;
  height: 11px;
  margin-top: -6px;
  background: url("/board/hand.svg") no-repeat center / 18px 11px;
  image-rendering: pixelated;
  opacity: 0;
}
.verb:hover::before, .verb:focus-visible::before, .verb[aria-current="page"]::before { opacity: 1; }
.verb:hover::before, .verb:focus-visible::before { animation: point .5s steps(2) infinite; }
@keyframes point { 50% { transform: translateX(-3px); } }
.verb:focus-visible { outline: 1px dashed var(--cream); outline-offset: 0; }
.verb[disabled] { opacity: .55; cursor: default; }
.verb[disabled]::before { display: none; }
.g { font-family: "Segoe UI Symbol", "DejaVu Sans", sans-serif; font-weight: 700; }
.gx { color: var(--g-x); }
.go { color: var(--g-o); }
.gt { color: var(--g-t); }
.gs { color: var(--g-s); }
.verb.big { font-size: 20px; padding-top: 6px; padding-bottom: 6px; }

.x-slot { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--dim); }
.x-slot .handle { color: #fff; }

/* ---- X glyph + handle ---- */
.xg {
  display: inline-block;
  width: .85em;
  height: .85em;
  vertical-align: -1px;
  background: url("/board/x.svg") no-repeat center / contain;
  filter: drop-shadow(1px 1px 0 #000);
}
.handle { color: #cfe0ff; text-decoration: none; font-weight: 400; }
.handle:hover { text-decoration: underline; }

/* ---- sticky welcome ---- */
.sticky-op { padding: 12px 16px 14px; margin-bottom: 14px; overflow: hidden; }
.sticky-op .shrug { float: right; width: 132px; height: auto; margin: 0 0 6px 14px; }
.sticky-op blockquote { margin: 8px 0 0; }
.sticky-op .big-fug { font-size: 28px; color: var(--green); line-height: 1; }
.sticky-op .rules-toggle { float: right; margin: -4px -6px 0 10px; font-size: 14px; }
.sticky-op.collapsed blockquote, .sticky-op.collapsed .shrug { display: none; }
.pin { color: var(--black); background: var(--gold); text-shadow: none; padding: 0 5px; border-radius: 2px; font-size: 13px; }

/* ---- forms ---- */
.form-win { padding: 12px 14px 10px; margin-bottom: 14px; }
.form-win[hidden] { display: none; }
.form-title { color: var(--cream); margin: 0 0 8px; font-size: 18px; }
.post-form { display: grid; gap: 8px; }
.post-form .row { display: grid; grid-template-columns: 92px 1fr; align-items: start; gap: 10px; }
.post-form .row > span:first-child { padding-top: 5px; color: var(--cream); }
.post-form input[type="text"], .post-form textarea, .tool-input, .catalog-bar input, .catalog-bar select {
  width: 100%;
  background: var(--field);
  border: 1px solid #c9cdea;
  border-radius: 3px;
  box-shadow: inset 2px 2px 0 #000;
  padding: 6px 8px;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
  outline: none;
}
.post-form textarea { resize: vertical; min-height: 110px; }
.post-form input:focus, .post-form textarea:focus, .tool-input:focus, .catalog-bar input:focus, .catalog-bar select:focus { border-color: var(--gold); }
.post-form input::placeholder, .post-form textarea::placeholder { color: #6d76b8; }
.post-form input:disabled { opacity: .5; }
.file-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.file-pick input[type="file"] { display: none; }
.file-name { color: var(--dim); font-size: 14px; word-break: break-all; }
.file-preview { max-width: 64px; max-height: 64px; border: 1px solid #c9cdea; display: none; }
.file-preview.on { display: block; }
.x-opts { display: flex; flex-wrap: wrap; gap: 4px 16px; padding-top: 4px; }
.chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.chk input { accent-color: var(--green); width: 16px; height: 16px; }
.submit-row { align-items: center !important; }
.submit-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.counter { color: var(--dim); font-size: 14px; }
.counter.over { color: var(--g-o); }
.form-msg { margin: 0; min-height: 1.4em; font-size: 15px; color: var(--cream); }
.form-msg.err { color: #ffb0ae; }
.form-msg.ok { color: var(--green); }
.form-hint { font-size: 13px; color: var(--dim); margin: 0; }

/* ---- catalog ---- */
.catalog-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0 0 12px; }
.catalog-bar[hidden] { display: none; }
.catalog-bar input { max-width: 260px; }
.catalog-bar select { width: auto; }
.catalog-bar .count { color: var(--dim); font-size: 14px; text-shadow: 1px 1px 0 #000; }
.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 12px; }
.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 8px 10px;
  text-decoration: none;
  color: #fff;
  min-width: 0;
  transition: transform .08s steps(2);
}
.card:hover, .card:focus-visible { transform: translateY(-2px); border-color: var(--gold); outline: none; }
.card .cthumb-box { width: 100%; height: 170px; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .35); border: 1px solid #0a0a18; }
.card img { max-width: 100%; max-height: 170px; object-fit: contain; display: block; }
.card .cmeta { margin-top: 6px; font-size: 13px; color: var(--dim); }
.card .cmeta b { color: #fff; font-weight: 400; }
.card .csub { color: var(--gold); text-align: center; font-size: 15px; margin-top: 2px; overflow-wrap: anywhere; }
.card .ctext { font-size: 14px; text-align: center; overflow-wrap: anywhere; max-height: 7.3em; overflow: hidden; margin-top: 2px; }
.card .you-tag { color: var(--cream); }
.empty { text-align: center; color: var(--cream); text-shadow: 2px 2px 0 #000; padding: 30px 0; }
.empty[hidden] { display: none; }

/* ---- posts ---- */
.thread { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.post { padding: 8px 12px 10px; max-width: 100%; overflow-wrap: anywhere; }
.post.op { width: 100%; margin-bottom: 6px; }
.post.reply { margin-left: 22px; position: relative; min-width: min(360px, calc(100% - 22px)); max-width: calc(100% - 22px); }
.post.reply::before { content: ">>"; position: absolute; left: -22px; top: 8px; color: #5b6396; text-shadow: none; font-size: 14px; }
.post:target, .post.hl { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold), 0 0 0 2px #0a0a18; }
.post.same-id { border-color: var(--g-s); }
.post-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 15px; }
.post-head .subject { color: var(--gold); }
.post-head .name { color: var(--cream); }
.post-head .date { color: var(--dim); font-size: 14px; }
.post-head .no { color: #fff; text-decoration: none; }
.post-head .no .num { cursor: pointer; }
.post-head .no:hover { color: var(--gold); }
.post-head .you { color: var(--cream); font-size: 14px; }
.pid {
  font-size: 12px;
  padding: 0 4px;
  border-radius: 2px;
  color: #fff;
  cursor: pointer;
  text-shadow: 1px 1px 0 #000;
  border: 1px solid rgba(0, 0, 0, .5);
}
.actions { display: inline-flex; gap: 10px; margin-left: auto; font-size: 13px; }
.actions a, .actions button { background: none; border: 0; padding: 0; color: var(--dim); cursor: pointer; text-decoration: none; text-shadow: 1px 1px 0 #000; }
.actions a:hover, .actions button:hover { color: #fff; }
.backlinks { width: 100%; font-size: 13px; display: flex; flex-wrap: wrap; gap: 2px 8px; }
.backlinks:empty { display: none; }
.fileinfo { font-size: 13px; color: var(--dim); margin: 4px 0 2px; overflow-wrap: anywhere; }
.fileinfo a { color: var(--cream); }
.thumb-link { float: left; margin: 4px 16px 6px 0; line-height: 0; }
.thumb-link img { display: block; border: 1px solid #0a0a18; background: rgba(0, 0, 0, .3); }
.thumb-link.expanded { float: none; display: block; margin-right: 0; }
.thumb-link.expanded img { max-width: 100%; height: auto; width: auto; }
.text { margin: 6px 0 0; min-height: 1em; white-space: normal; }
.post::after { content: ""; display: block; clear: both; }
.gtx { color: var(--green); }
.ql { color: var(--quote); text-decoration: underline; text-underline-offset: 2px; }
.ql:hover { color: #fff; }
.ql.dead { text-decoration: line-through; }
.ext { color: #9cc8ff; }

.report-pop { display: inline-flex; flex-wrap: wrap; gap: 4px 8px; font-size: 13px; }
.report-pop button { color: var(--cream) !important; }

/* hover preview of quoted posts */
.post.preview { position: fixed; z-index: 40; max-width: min(620px, 92vw); min-width: 0; pointer-events: none; margin: 0 !important; }
.post.preview::before { display: none; }
.preview .actions, .preview .backlinks { display: none; }

.thread-status { margin: 10px 0 0; font-size: 14px; color: var(--dim); text-shadow: 1px 1px 0 #000; }
.thread-status b { color: var(--cream); font-weight: 400; }
.sank { padding: 18px; text-align: center; }

/* ---- toast ---- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 60;
  padding: 10px 16px;
  max-width: min(560px, 92vw);
  font-size: 15px;
}
.toast.err { border-color: #ffb0ae; }
.toast a { color: var(--gold); }

/* ---- footer ---- */
.foot { text-align: center; color: #6d76b8; font-size: 13px; margin-top: 26px; text-shadow: 1px 1px 0 #000; }
.foot a { color: #9aa3dc; }

/* ---- admin ---- */
.admin-row { padding: 10px 12px; margin-bottom: 10px; }
.admin-row .meta { font-size: 13px; color: var(--dim); }
.admin-row .text { white-space: pre-wrap; }
.admin-row .post { margin: 8px 0; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 2px 8px; }
.tool-input { max-width: 320px; }
.tool-input.short { max-width: 120px; }

/* ---- mobile ---- */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .wrap { padding: 10px 8px 30px; }
  .top { gap: 10px; margin-top: 2px; }
  .logo { height: 54px; }
  .title-win { padding: 8px 12px 10px; }
  .title-win .tag { font-size: 12px; }
  .menu { padding: 4px 4px; gap: 0 8px; }
  .verb { font-size: 15px; padding-right: 6px; padding-left: 22px; }
  .verb.big { font-size: 18px; }
  .sticky-op .shrug { width: 84px; }
  .post-form .row { grid-template-columns: 1fr; gap: 3px; }
  .post-form .row > span:first-child { padding-top: 0; font-size: 14px; }
  .post-form .row.submit-row > span:first-child { display: none; }
  .catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .card .cthumb-box { height: 130px; }
  .card img { max-height: 130px; }
  .catalog-bar input { max-width: none; flex: 1 1 140px; }
  .post.reply { margin-left: 0; min-width: 0; max-width: 100%; width: 100%; }
  .post.reply::before { display: none; }
  .thumb-link { margin-right: 10px; }
  .thumb-link img { max-width: 40vw; height: auto; }
  .actions { margin-left: 0; }
}
