* { box-sizing: border-box; }

body { min-width: 300px; }

main { min-height: 70vh; }

.home,
.error,
.downtime,
.legal {
  max-width: 720px;
  margin: 4rem auto;
  padding: 1rem;
}

.downtime { text-align: center; }
.downtime-message { margin-top: 1.25rem; white-space: pre-wrap; font-size: 1.05rem; }
.changelog { margin-top: 2rem; }
.changelog-entry { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 0.8rem; padding: 0.75rem 0; border-top: 1px solid rgba(90, 90, 90, 0.45); }
.changelog-entry time { font-size: 0.85rem; white-space: nowrap; opacity: 0.78; }
.changelog-entry h3 { margin: 0 0 0.2rem; font-size: 1rem; }
.changelog-entry p { margin: 0; line-height: 1.4; }
.changelog-empty { opacity: 0.75; font-style: italic; }
.legal { max-width: 860px; line-height: 1.5; }
.legal > header { text-align: left; }
.legal > header h1 { margin-bottom: 0.25rem; }
.policy-date { margin: 0 0 1rem; font-size: 0.85rem; opacity: 0.72; }
.policy-lead { font-size: 1.08rem; }
.legal section { margin: 1.8rem 0; }
.policy-content h2 { margin: 1.8rem 0 0.65rem; }
.policy-content p { white-space: pre-wrap; }
.legal li { margin: 0.45rem 0; }
.legal-links { margin-top: 0.5rem; }

.post-form {
  margin: 1rem auto 2rem;
  max-width: 520px;
}

.post-form details > summary {
  cursor: pointer;
  font-weight: bold;
  margin: 0 auto 0.6rem;
  text-align: center;
}

.post-form form { margin-bottom: 0; }
.post-form table { width: 100%; }
.post-form input,
.post-form textarea { width: 100%; }
.post-form input[type="file"] { width: 100%; }
.post-form button { min-width: 7rem; }

.giko-chase-lane {
  position: relative;
  height: 84px;
  margin: -0.15rem 0 0.4rem;
  overflow: hidden;
  pointer-events: none;
}

.giko-chase-pack {
  position: absolute;
  bottom: 0;
  left: -270px;
  width: 255px;
  height: 82px;
  animation: giko-chase-crossing 8s linear infinite;
  will-change: left;
  z-index: 2;
}

.giko-chase-roubon {
  position: absolute;
  bottom: 0;
  left: -90px;
  width: 70px;
  height: 82px;
  animation: roubon-chase-crossing 18s linear infinite;
  will-change: left;
  z-index: 1;
}

.chase-character {
  position: absolute;
  bottom: 0;
  width: 68px;
  height: 80px;
}

.chase-naitoapple { left: 0; }
.chase-giko { left: 122px; }
.chase-roubon { left: 0; }

.chase-frame {
  position: absolute;
  right: 0;
  bottom: 0;
  display: block;
  width: auto;
  height: 78px;
  max-width: none;
  backface-visibility: hidden;
}

.chase-frame-one { display: block; }
.chase-frame-two { display: none; }

.chase-runner.chase-alt-frame .chase-frame-one { display: none; }
.chase-runner.chase-alt-frame .chase-frame-two { display: block; }

@keyframes giko-chase-crossing {
  from { left: -270px; }
  to { left: calc(100% + 20px); }
}

@keyframes roubon-chase-crossing {
  from { left: -90px; }
  to { left: calc(100% + 20px); }
}

.tier-maker {
  --tier-text: #252525;
  --tier-muted: #626262;
  width: min(960px, calc(100% - 2rem));
  margin: 0.8rem auto 1rem;
  color: var(--tier-text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10pt;
}
.tier-maker > details { border: 1px solid #727272; background: rgba(225, 225, 225, 0.96); }
.tier-maker summary { padding: 0.55rem 0.75rem; color: var(--tier-text); font-weight: bold; cursor: pointer; }
.tier-row { display: grid; grid-template-columns: 7rem minmax(0, 1fr); min-height: 3.6rem; border-top: 1px solid #858585; background: rgba(225, 225, 225, 0.94); color: var(--tier-text); }
.tier-label { display: grid; place-items: center; padding: 0.55rem; border-right: 1px solid #858585; color: #252525; font-size: 1.05rem; text-align: center; }
.tier-members { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; padding: 0.45rem; }
.tier-candidate { display: inline-flex; flex-direction: column; padding: 0.35rem 0.55rem; border: 1px solid #767676; background: #f2f2f2; color: var(--tier-text); font-weight: bold; }
.tier-candidate small { color: var(--tier-muted); font-size: 0.72rem; font-weight: normal; }
.tier-empty { color: var(--tier-muted); font-style: italic; }
.tier-color-0 .tier-label { background: #ef9999; }
.tier-color-1 .tier-label { background: #efbd8f; }
.tier-color-2 .tier-label { background: #e8dc92; }
.tier-color-3 .tier-label { background: #a9d39e; }
.tier-color-4 .tier-label { background: #9ec7dc; }
.tier-color-5 .tier-label { background: #b7a7d6; }
.tier-unranked .tier-label { background: #b9b9b9; }
.tier-ballot { border-top: 1px solid #858585; }
.tier-ballot form { padding: 0 0.75rem 0.75rem; color: var(--tier-text); }
.tier-instructions { margin: 0 0 0.6rem; }
.personal-tier-board { margin-bottom: 0.55rem; border: 1px solid #858585; border-bottom: 0; }
.personal-tier-row:first-child { border-top: 0; }
.tier-dropzone { min-height: 3.6rem; transition: background-color 100ms ease, box-shadow 100ms ease; }
.tier-dropzone.drag-over { background: rgba(255, 255, 255, 0.72); box-shadow: inset 0 0 0 3px #2d7351; }
.personal-tier-candidate { display: inline-flex; align-items: center; min-height: 2.25rem; padding: 0.35rem 0.65rem; border: 1px solid #696969; background: #f4f4f4; color: var(--tier-text); cursor: grab; user-select: none; touch-action: manipulation; }
.personal-tier-candidate:active { cursor: grabbing; }
.personal-tier-candidate.is-dragging { opacity: 0.45; }
.personal-tier-candidate.is-selected { outline: 3px solid #2d7351; outline-offset: 1px; }
.personal-tier-candidate:focus-visible, .tier-dropzone:focus-visible { outline: 3px solid #2d7351; outline-offset: -2px; }
.tier-dropzone .tier-empty { display: none; pointer-events: none; }
.tier-dropzone:not(:has(.personal-tier-candidate)) .tier-empty { display: inline; }
.tier-ballot-status { min-height: 1.25em; margin: 0 0 0.45rem; color: #8b1b1b; font-weight: bold; }

.thread { margin-bottom: 0.5rem; }
.boardlist {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.board-links { min-width: 0; }
.boardlist .top-styles {
  float: none;
  flex: 0 0 auto;
  margin-left: auto;
  padding: 0;
  white-space: nowrap;
}
.boardlist .top-styles select {
  width: auto;
  max-width: 11rem;
  font: inherit;
}
.thread-status { display: inline-block; margin: 0 0.4rem 0.3rem 0; font-weight: bold; }
.thread-locked { text-align: center; font-weight: bold; }
.report-select { float: left; margin: 1px 6px 0 0; }
.report-panel { margin: 1rem 0 1.5rem; }
.report-panel summary { cursor: pointer; font-weight: bold; }
.report-panel form { margin: 0.5rem 0 0; }
.report-panel input { width: min(24rem, 60vw); }
.pagination {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: fit-content;
  margin: 1rem 0 1.5rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid #8b8b8b;
  background: rgba(225, 225, 225, 0.94);
}
.page-numbers { display: flex; gap: 0.35rem; }
.current-page { font-weight: bold; }
.page-direction.disabled { color: #777; }
.delete-link { display: inline-block; margin-left: 0.5rem; font-size: 0.8rem; }
.delete-link summary { display: inline; cursor: pointer; }
.delete-link form { display: inline; margin-left: 0.35rem; }
.delete-link button { margin-right: 0.25rem; }
.post-image { max-width: 255px; max-height: 255px; }
.post-audio { display: block; width: min(360px, 85vw); height: 54px; }
.post-video { display: block; width: min(480px, 85vw); max-height: 480px; background: #111; }
.flash-attachment { position: relative; display: grid; width: min(550px, 85vw); min-width: 255px; gap: 0.45rem; justify-items: center; padding: 0.65rem; border: 1px solid #707070; background: rgba(35, 35, 35, 0.88); color: #eee; }
.flash-placeholder { display: block; max-width: 100%; height: auto; }
.flash-launch { min-width: 12rem; min-height: 2.5rem; cursor: pointer; }
.flash-attachment small { max-width: 30rem; text-align: center; }
.flash-frame { display: block; width: min(550px, 85vw); max-width: 100%; aspect-ratio: 11 / 8; border: 0; background: #111; }
.flash-close-player { position: static; justify-self: end; min-height: 30px; padding: 4px 14px; border: 1px solid #777; border-radius: 3px; background: #ddd; color: #111; font-weight: bold; cursor: pointer; }
.flash-close-player:hover, .flash-close-player:focus-visible { background: #fff; }
.post.op .files.single-file .flash-attachment { float: left; margin: 0 20px 0 0; }

.catalog-view { padding: 0.5rem 0.75rem 1.5rem; }
.catalog-mode-links { margin: 0 auto 0.75rem; text-align: center; }
.catalog-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem 1rem; margin: 0 auto 1rem; }
.catalog-controls label { display: flex; align-items: center; gap: 0.35rem; }
.catalog-controls select, .catalog-controls input { font: inherit; }
.catalog-grid { --catalog-width: 205px; --catalog-height: 300px; --catalog-image-width: 200px; --catalog-image-height: 150px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--catalog-width)), var(--catalog-width))); justify-content: center; align-items: start; gap: 6px; }
.catalog-grid.size-very-small { --catalog-width: 110px; --catalog-height: 190px; --catalog-image-width: 100px; --catalog-image-height: 80px; }
.catalog-grid.size-large { --catalog-width: 280px; --catalog-height: 390px; --catalog-image-width: 270px; --catalog-image-height: 220px; }
.catalog-card { width: 100%; height: var(--catalog-height); overflow: hidden; padding: 5px; border: 1px solid rgba(90, 90, 90, 0.55); background: rgba(182, 182, 182, 0.18); box-sizing: border-box; text-align: center; font-size: 12px; }
.catalog-card:hover, .catalog-card:focus-within { border-color: currentColor; background: rgba(210, 210, 210, 0.3); }
.catalog-thread-link { display: block; color: inherit; text-decoration: none; }
.catalog-thumbnail { display: block; width: auto; height: auto; max-width: min(100%, var(--catalog-image-width)); max-height: var(--catalog-image-height); margin: 0 auto 5px; object-fit: contain; box-shadow: 0 0 4px rgba(0, 0, 0, 0.5); }
.catalog-counts, .catalog-subject { display: block; margin: 0.2rem 0; }
.catalog-subject { font-weight: bold; }
.catalog-excerpt { overflow-wrap: break-word; word-break: normal; white-space: pre-wrap; }
.catalog-card[hidden] { display: none; }
@media (max-width: 520px) {
  .post.op .files.single-file .flash-attachment { float: none; margin-right: 0; }
  .catalog-view { padding-inline: 0.35rem; }
  .catalog-controls { align-items: stretch; flex-direction: column; }
  .catalog-controls label { justify-content: space-between; }
}
.youtube-embeds {
  clear: both;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  max-width: 100%;
  padding-top: 0.75rem;
}
.youtube-embed { width: min(560px, 100%); margin: 0; }
.youtube-player { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.youtube-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.youtube-embed figcaption { margin-top: 0.25rem; font-size: 0.85rem; }
.image-link { cursor: zoom-in; }
.image-link[aria-expanded="true"] { cursor: zoom-out; }
.post .post-image.is-loading { opacity: 0.45; }
.post .post-image.is-expanded {
  float: none !important;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: none !important;
  margin-right: 0;
  cursor: zoom-out;
}
.post .files {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem;
}
.post.has-multiple-files .files {
  width: max-content;
  max-width: 100%;
}
.post .file { flex: 0 0 auto; }
.post:target {
  scroll-margin-top: 3rem;
  outline: 3px solid #c40000;
  outline-offset: 3px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7), 0 0 12px 5px rgba(196, 0, 0, 0.45);
  animation: targeted-post-pulse 0.7s ease-out 1;
}
@keyframes targeted-post-pulse {
  from { outline-color: #ff3b30; box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.9), 0 0 20px 10px rgba(255, 59, 48, 0.75); }
}
@media (prefers-reduced-motion: reduce) {
  .post:target { animation: none; }
}
.post-form input[type="file"] + small { display: block; margin-top: 0.2rem; }
img.board_image {
  width: 317px !important;
  height: 100px !important;
  max-width: calc(100% - 16px);
  object-fit: fill;
  border: 0 !important;
  box-shadow: none !important;
  filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.38));
}
.archive-notice {
  width: fit-content;
  max-width: calc(100% - 2rem);
  margin: 1rem auto;
  padding: 0.65rem 0.9rem;
  border: 1px solid currentColor;
  background: rgba(238, 238, 238, 0.9);
  text-align: center;
}
.empty { text-align: center; margin: 3rem; }

footer {
  min-height: 3rem;
  padding: 0.75rem 0;
  text-align: center;
}

footer .styles {
  float: none;
  padding: 0;
}

@media (max-width: 600px) {
  .changelog-entry { grid-template-columns: 1fr; gap: 0.25rem; }
  form table,
  form tbody,
  form tr,
  form th,
  form td { display: block; width: 100%; }

  form table tr th { padding: 3px; }
  div.post { padding-left: 4px; }
  div.post.reply { max-width: 98% !important; }
  .boardlist { gap: 0.4rem; }
  .boardlist .top-styles label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .boardlist .top-styles select { max-width: 8.5rem; }
  .tier-maker { width: calc(100% - 0.75rem); }
  .tier-row { grid-template-columns: 5.5rem minmax(0, 1fr); }
  .post.has-multiple-images .files {
    display: grid;
    float: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    max-width: 100%;
    gap: 0.5rem;
  }
  .post.has-multiple-images .file {
    width: auto;
    min-width: 0;
    max-width: 100%;
  }
  .post.has-multiple-images .fileinfo {
    margin: 0 0 0.2rem;
    overflow-wrap: anywhere;
    font-size: 0.78rem;
  }
  .post.has-multiple-images .image-link {
    display: block;
    width: 100%;
  }
  .post.has-multiple-images .post-image:not(.is-expanded) {
    display: block;
    box-sizing: border-box;
    width: 100% !important;
    height: min(42vw, 180px) !important;
    max-width: 100%;
    max-height: none;
    margin: 0 !important;
    padding: 3px;
    object-fit: contain;
  }
}
