@font-face {
  font-family: 'Arial';
  src: url('fonts/arial.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Arial';
  src: url('fonts/arialbd.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
}

@font-face {
  font-family: 'Arial';
  src: url('fonts/ariali.ttf') format('truetype');
  font-weight: normal;
  font-style: italic;
}

@font-face {
  font-family: 'Arial';
  src: url('fonts/arialbi.ttf') format('truetype');
  font-weight: bold;
  font-style: italic;
}

@font-face {
  font-family: 'Arial Narrow';
  src: url('fonts/ARIALN.TTF') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Arial Narrow';
  src: url('fonts/ARIALNB.TTF') format('truetype');
  font-weight: bold;
  font-style: normal;
}

@font-face {
  font-family: 'Arial Narrow';
  src: url('fonts/ARIALNI.TTF') format('truetype');
  font-weight: normal;
  font-style: italic;
}

@font-face {
  font-family: 'Arial Narrow';
  src: url('fonts/ARIALNBI.TTF') format('truetype');
  font-weight: bold;
  font-style: italic;
}

@font-face {
  font-family: 'Arial Black';
  src: url('fonts/ariblk.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
}

* {
  font-family: Arial, sans-serif;
}

body {
  font-size: 14px;
  background-color: #eefaff;
}

a {
  color: #007ab0;
}

a:hover {
  color: #005386;
}

footer {
  text-align: center;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.site-header-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.site-title {
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: 36px;
  color: #8f685f;
  line-height: 1.1;
}

.site-subtitle {
  font-family: Arial, sans-serif;
  font-weight: bold;
  font-size: 16px;
  color: #8f685f;
}

.news-section {
  text-align: center;
}

.news-section h2 {
  font-size: 15px;
  font-weight: bold;
  margin-bottom: 6px;
}

.site-logo {
  max-width: 144px;
  max-height: 144px;
  width: auto;
  height: auto;
}

@media (max-width: 480px) {
  .site-header {
    flex-direction: column;
    align-items: center;
  }

  .site-header-text {
    align-items: center;
  }
}

.flash-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 720px;
  z-index: 9999;
}

.flash-message {
  font-size: 14px;
  color: #000;
  border: 1px solid #000;
  padding: 0.5em 1em;
  margin-bottom: 4px;
  background-color: #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.flash-close {
  cursor: pointer;
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1;
}

.flash-danger  { background-color: #f0d6d6; }
.flash-success { background-color: #d8f0d6; }
.flash-warning { background-color: #f0e7c2; }

.banner {
  text-align: center;
}

.banner img {
  max-width: 100%;
  height: auto;
}

.board-top {
  text-align: center;
}

.board-description {
  max-width: 720px;
  margin: 0 auto;
}

.board-top h1 {
  font-size: 20px;
  font-family: 'Arial Black';
  color: #e42727;
}

.pagination {
  background-color: #d6e7f0;
  padding: 6px;
  width: fit-content;
}

.thread-title {
  font-size: 15px;
  margin-bottom: 4px;
}

.post-author {
  color: #d0494e;
}

button.link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: #007ab0;
  text-decoration: underline;
  cursor: pointer;
}

button.link:hover {
  color: #005386;
}

.link-admin,
button.link.link-admin {
  color: #d74849;
}

.link-admin:hover,
button.link.link-admin:hover {
  color: #b2222f;
}

.img-wrapper {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

.img-filename {
  margin-bottom: 6px;
  overflow-wrap: break-word;
  word-break: break-all;
}

.post-image {
  max-width: 192px;
  max-height: 240px;
  cursor: zoom-in;
}

.reply-post .post-image {
  max-width: 144px;
  max-height: 192px;
}

#img-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 16px;
  box-sizing: border-box;
}

#img-overlay img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.6);
  cursor: zoom-out;
}

.post-content {
  margin-top: 6px;
}

.thread-post > *:first-child,
.reply-post > *:first-child {
  margin-top: 0;
}

.thread-post > *:last-child,
.reply-post > *:last-child {
  margin-bottom: 0;
}

.reply-count {
  margin-bottom: 6px;
}

.thread-post {
  padding: 16px;
  margin-bottom: 6px;
}

.reply-post {
  background-color: #d6e7f0;
  padding: 16px;
  margin-bottom: 6px;
}

blockquote {
  margin: 0 0 0 16px;
  padding: 0;
}

@media (max-width: 576px) {
  blockquote {
    margin-left: 8px;
  }
}

.post-body {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.post-body-image {
  flex-shrink: 0;
}

.post-body-text {
  flex: 1;
  min-width: 0;
}

@media (max-width: 480px) {
  .post-body {
    flex-direction: column;
  }
}

.greentext {
  color: #548f3d;
}

.spoiler {
  background-color: #000;
  color: transparent;
  cursor: pointer;
}

.spoiler:hover,
.spoiler:focus {
  color: inherit;
  background-color: transparent;
  outline: none;
}

.new-thread-button {
  text-align: center;
}

.reply-to-ref {
  margin: 0 0 6px 0;
  font-size: 13px;
}

.reply-link {
  display: block;
  margin-top: 6px;
}

.separator-line {
  color: #a8b9c1;
  margin-bottom: 12px;
}

.font-size-1 {
  font-size: 14px;
}

.font-size-2 {
  font-size: 15px;
}

.font-size-3 {
  font-size: 16px;
}

.font-size-4 {
  font-size: 20px;
}

.font-size-5 {
  font-size: 36px;
}

.home-tables {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 12px auto 12px auto;
}

.htable {
  width: 100%;
}

.htable-head {
  height: 24px;
  border: 1px solid #000;
  padding: 0 6px;
  display: flex;
  align-items: center;
  font-weight: bold;
  font-size: 13px;
  box-sizing: border-box;
}

.htable-body {
  background-color: #ffffff;
  border: 1px solid #000;
  border-top: none;
  padding: 6px;
  box-sizing: border-box;
}

.htable-body p {
  margin: 0 0 6px 0;
}

.board-desc {
  font-size: 12px;
}

.htable-body p:last-child {
  margin-bottom: 0;
}

.htable-pair {
  display: flex;
  gap: 10px;
}

.htable-pair .htable {
  flex: 1;
  min-width: 0;
}

@media (max-width: 576px) {
  .htable-pair {
    flex-direction: column;
    gap: 12px;
  }
}

.htable-head-yellow  { background: #ffdd60; }
.htable-head-yellow2 { background: #ffcf69; }
.htable-head-orange  { background: #ffbb83; }
.htable-head-blue    { background: #75daff; }
.htable-head-pink    { background: #ff759e; }

.archive-wrap {
  max-width: 720px;
  margin: 12px auto;
}

.archive-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #000;
  background: #ffffff;
  font-size: 13px;
}

.archive-table th,
.archive-table td {
  padding: 4px 8px;
  border-bottom: 1px solid #ddd;
  text-align: left;
}

.archive-table th {
  font-weight: bold;
}

.archive-table tbody tr {
  background: #ffffff;
}

.archive-table tbody tr:last-child td {
  border-bottom: none;
}

.archive-num {
  white-space: nowrap;
  width: 64px;
}

.archive-link {
  white-space: nowrap;
  width: 64px;
  text-align: center;
}

.archive-title {
  width: 100%;
}

.archive-empty {
  background: #ffffff;
  border: 1px solid #000;
  padding: 8px;
  font-size: 13px;
}

.popular-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.catalog-grid .popular-card-img {
  max-width: 120px;
}

@media (max-width: 480px) {
  .popular-grid,
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.popular-card-reply {
  font-size: 13px;
  color: inherit;
  opacity: 0.75;
}

.popular-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px;
  overflow: hidden;
}

.popular-card-img-link {
  display: block;
  line-height: 0;
}

.popular-card-board {
  font-size: 14px;
  font-weight: bold;
  text-align: center;
}

.popular-card-img {
  max-width: 80px;
  height: auto;
  display: block;
}

#new-thread-form,
[id^="form-reply-"] {
  max-width: 100%;
  box-sizing: border-box;
}

#new-thread-form fieldset {
  max-width: 480px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
}

[id^="form-reply-"] fieldset {
  max-width: 480px;
  width: 100%;
  box-sizing: border-box;
}

#new-thread-form input[type="text"],
#new-thread-form textarea,
[id^="form-reply-"] input[type="text"],
[id^="form-reply-"] textarea {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.popular-card-content {
  font-size: 14px;
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  width: 100%;
  text-align: center;
}

.admin-edit-form {
  max-width: 720px;
}

.admin-edit-form input[type="text"],
.admin-edit-form textarea {
  width: 100%;
  box-sizing: border-box;
}

.admin-table {
  border-collapse: collapse;
  width: 100%;
  max-width: 720px;
  font-size: 0.9em;
}
.admin-table th,
.admin-table td {
  padding: 6px 10px;
  border: 1px solid #000;
  text-align: left;
  vertical-align: top;
}

.post-actions-toggle {
  cursor: pointer;
  user-select: none;
}

.form-inline {
  display: inline;
}

.form-inline--gap {
  margin-left: 4px;
}

.ts-status {
  display: block;
  margin-top: 4px;
  font-size: 0.9em;
}

.coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 16px);
  gap: 28px;
}

.coming-soon img {
  width: 180px;
  height: auto;
}

.coming-soon p {
  font-family: "Arial Black", Arial, sans-serif;
  font-size: 2rem;
  color: #8f685f;
}

.error-page {
  text-align: center;
}

.back-link-center {
  text-align: center;
}

.empty-notice {
  margin: 0;
}

.ban-notice {
  padding: 10px 14px;
  background: #f0d6d6;
  border: 1px solid #c00;
  display: inline-block;
  margin: 4px 0;
  line-height: 1.7;
}

nav {
  display: flex;
  align-items: flex-start;
}

.nav-main {
  flex: 1 1 0;
  min-width: 0;
}

.theme-toggle {
  flex-shrink: 0;
  font-size: 15px;
  line-height: 1;
  padding: 2px 0 2px 8px;
}

.theme-toggle-row {
  display: flex;
  justify-content: flex-end;
  padding: 2px 0;
}

body.dark {
  background-color: #041013;
  color: #e5e5e5;
}

body.dark a {
  color: #72c5ff;
}

body.dark a:hover {
  color: #8adbff;
}

body.dark button.link {
  color: #72c5ff;
}

body.dark button.link:hover {
  color: #8adbff;
}

body.dark .site-title,
body.dark .site-subtitle {
  color: #9f786f;
}

body.dark .htable-body {
  background-color: #1d2528;
  color: #ffffff;
  border-color: #394144;
}

body.dark .htable-head {
  color: #000000;
  border-color: #394144;
}

body.dark .htable-head-yellow  { background: #e6c649; }
body.dark .htable-head-yellow2 { background: #e4b752; }
body.dark .htable-head-orange  { background: #e19e67; }
body.dark .htable-head-blue    { background: #4db6da; }
body.dark .htable-head-pink    { background: #ee6790; }

body.dark .archive-table,
body.dark .archive-table tbody tr,
body.dark .archive-empty {
  background-color: #1d2528;
  color: #ffffff;
}

body.dark .archive-table,
body.dark .archive-table th,
body.dark .archive-table td {
  border-color: #394144;
}

body.dark .board-top h1 {
  color: #ff6251;
}

body.dark .reply-post,
body.dark .pagination {
  background-color: #0f2029;
}

body.dark hr.separator-line {
  color: #2c3437;
  border-color: #2c3437;
}

body.dark .post-author {
  color: #f56b6a;
}

body.dark .link-admin,
body.dark button.link.link-admin {
  color: #f05e5c;
}

body.dark .link-admin:hover,
body.dark button.link.link-admin:hover {
  color: #ff7a75;
}

body.dark .greentext {
  color: #84c069;
}

body.dark .spoiler {
  background-color: #e5e5e5;
}

body.dark .spoiler:hover,
body.dark .spoiler:focus {
  background-color: transparent;
}

body.dark .flash-message {
  color: #ffffff;
}

body.dark .flash-danger {
  background-color: #624d4e;
  border-color: #7d6868;
}

body.dark .flash-success {
  background-color: #4d6253;
  border-color: #687d6a;
}

body.dark .flash-warning {
  background-color: #5f624d;
  border-color: #797d68;
}

body.dark .flash-info {
  background-color: #616161;
  border-color: #7d7d7d;
}

body.dark .admin-table,
body.dark .admin-table th,
body.dark .admin-table td {
  border-color: #394144;
}

body.dark .admin-table {
  background-color: #1d2528;
  color: #e5e5e5;
}

#new-thread-form .ban-notice {
  display: block;
  max-width: 480px;
  margin: 4px auto;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.form-group-p {
  margin: 1em 0;
}
