/* MeowChan - estilos base (celular primeiro, telas maiores nos @media) */

/* ---------- Temas ---------- */
.theme-yotsuba {
  --bg: #ffffee;
  --grad-top: #fed6af;
  --text: #800000;
  --muted: #707070;
  --link: #0000ee;
  --link-hover: #dd0000;
  --reply-bg: #f0e0d6;
  --reply-border: #d9bfb7;
  --highlight-bg: #f0c0b0;
  --highlight-border: #d99f91;
  --title: #af0a0f;
  --subject: #cc1105;
  --name: #117743;
  --greentext: #789922;
  --quotelink: #000080;
  --label-bg: #eeaa88;
  --label-border: #800000;
  --label-text: #800000;
  --hr: #d9bfb7;
  --input-bg: #ffffff;
  --input-text: #000000;
  --input-border: #aaaaaa;
  --box-bg: #ffffff;
  --box-border: #800000;
  --box-head-bg: #fca;
  --box-head-text: #800000;
}
.theme-yotsuba-b {
  --bg: #eef2ff;
  --grad-top: #d1d5ee;
  --text: #000000;
  --muted: #707070;
  --link: #34345c;
  --link-hover: #dd0000;
  --reply-bg: #d6daf0;
  --reply-border: #b7c5d9;
  --highlight-bg: #d6bad0;
  --highlight-border: #ba9dbf;
  --title: #af0a0f;
  --subject: #0f0c5d;
  --name: #117743;
  --greentext: #789922;
  --quotelink: #dd0000;
  --label-bg: #9988ee;
  --label-border: #000000;
  --label-text: #000000;
  --hr: #b7c5d9;
  --input-bg: #ffffff;
  --input-text: #000000;
  --input-border: #aaaaaa;
  --box-bg: #ffffff;
  --box-border: #34345c;
  --box-head-bg: #b7c5d9;
  --box-head-text: #000000;
}
.theme-futaba {
  --bg: #ffffee;
  --grad-top: #ffffee;
  --text: #800000;
  --muted: #707070;
  --link: #0000ee;
  --link-hover: #dd0000;
  --reply-bg: #f0e0d6;
  --reply-border: #d9bfb7;
  --highlight-bg: #f0c0b0;
  --highlight-border: #d99f91;
  --title: #800000;
  --subject: #cc1105;
  --name: #117743;
  --greentext: #789922;
  --quotelink: #000080;
  --label-bg: #eeaa88;
  --label-border: #800000;
  --label-text: #800000;
  --hr: #d9bfb7;
  --input-bg: #ffffff;
  --input-text: #000000;
  --input-border: #aaaaaa;
  --box-bg: #ffffee;
  --box-border: #800000;
  --box-head-bg: #eeaa88;
  --box-head-text: #800000;
}
.theme-tomorrow {
  --bg: #1d1f21;
  --grad-top: #1d1f21;
  --text: #c5c8c6;
  --muted: #909090;
  --link: #81a2be;
  --link-hover: #5f89ac;
  --reply-bg: #282a2e;
  --reply-border: #111111;
  --highlight-bg: #1d1d21;
  --highlight-border: #000000;
  --title: #c5c8c6;
  --subject: #b294bb;
  --name: #c5c8c6;
  --greentext: #b5bd68;
  --quotelink: #5f89ac;
  --label-bg: #282a2e;
  --label-border: #111111;
  --label-text: #c5c8c6;
  --hr: #282a2e;
  --input-bg: #282a2e;
  --input-text: #c5c8c6;
  --input-border: #444444;
  --box-bg: #282a2e;
  --box-border: #111111;
  --box-head-bg: #373b41;
  --box-head-text: #c5c8c6;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }

body {
  margin: 0;
  padding: 8px 16px 24px;
  background: var(--bg) linear-gradient(var(--grad-top), var(--bg) 200px) no-repeat;
  color: var(--text);
  font: 12px/1.5 Verdana, Geneva, "DejaVu Sans", sans-serif;
}
a { color: var(--link); }
a:hover { color: var(--link-hover); }
hr { border: 0; border-top: 1px solid var(--hr); margin: 8px 0; clear: both; }
img { max-width: 100%; }
.small { font-size: 11px; }
.empty { text-align: center; padding: 16px 0; }
.js-only { display: none; }
html.js .js-only { display: block; }

/* ---------- Navegação entre boards ---------- */
.boardnav {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  margin: 0 0 12px;
}
.boardnav > span { display: contents; }
.boardnav .bn-deco { display: none; }
.boardnav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  background: var(--reply-bg);
  border: 1px solid var(--reply-border);
  color: var(--link);
  font-weight: bold;
  text-decoration: none;
}
.boardnav a.bn-board::before,
.boardnav a.bn-board::after { content: "/"; }
.boardnav a.current { background: var(--highlight-bg); border-color: var(--highlight-border); color: var(--text); }
.boardnav .bn-home { font-size: 11px; }

/* ---------- Cabeçalho do board ---------- */
.boardBanner { text-align: center; margin: 4px 0 8px; }
.boardBanner .banner { display: block; margin: 0 auto 6px; width: 300px; height: auto; border: 1px solid var(--text); }
/* Um banner para cada cor do gato; aparece só o da cor escolhida. */
.boardBanner .banner-orange { display: none; }
html.skin-orange .boardBanner .banner-tuxedo { display: none; }
html.skin-orange .boardBanner .banner-orange { display: block; }
.boardTitle {
  margin: 0;
  font-family: Tahoma, sans-serif;
  font-size: 24px;
  letter-spacing: -1px;
  color: var(--title);
}
.boardSubtitle { margin: 2px 0 0; font-size: 11px; }

.replymode {
  background: var(--label-bg);
  color: var(--label-text);
  border: 1px solid var(--label-border);
  text-align: center;
  font-weight: bold;
  padding: 4px;
  margin: 8px 0;
}
.locked-notice { text-align: center; font-weight: bold; }

/* ---------- Formulário de postagem ---------- */
.postFormWrap { margin: 8px 0; }
.postFormWrap > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  background: var(--label-bg);
  border: 1px solid var(--label-border);
  color: var(--label-text);
  font-weight: bold;
  cursor: pointer;
  user-select: none;
}
.postFormWrap > summary::-webkit-details-marker { display: none; }
.postFormWrap[open] > summary { margin-bottom: 10px; }

.postForm { position: relative; width: 100%; max-width: 480px; margin: 0 auto; }
.pf-row { margin-bottom: 8px; }
.pf-row > label { display: block; font-weight: bold; font-size: 12px; margin-bottom: 2px; }
.postForm input[type="text"],
.postForm textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 8px;
  font: 16px Verdana, Geneva, sans-serif; /* 16px no celular: menos que isso o iPhone dá zoom ao tocar */
  color: var(--input-text);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 0;
}
.postForm textarea { min-height: 130px; resize: vertical; }
.postForm input[type="file"] { width: 100%; min-height: 44px; font-size: 12px; color: var(--text); }
.pf-spacer { display: none; }
.postForm button[type="submit"] {
  min-height: 44px;
  width: 100%;
  padding: 4px 16px;
  font: bold 12px Verdana, Geneva, sans-serif;
  color: #000;
  background: #e4e4e4;
  border: 2px solid;
  border-color: #fff #555 #555 #fff;
  cursor: pointer;
}
.postForm button[type="submit"]:active { border-color: #555 #fff #fff #555; }
.postForm button[disabled] { opacity: .7; cursor: wait; }
.pf-count { font-size: 11px; color: var(--muted); text-align: right; margin-top: 2px; }
.pf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.rules { font-size: 11px; margin: 8px 0 0; padding-left: 18px; }

/* ---------- Links de navegação (Voltar, Catálogo...) ---------- */
.navlinks {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 4px;
}
.navlinks a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  background: var(--reply-bg);
  border: 1px solid var(--reply-border);
  text-decoration: none;
  font-size: 12px;
}

/* ---------- Posts ---------- */
.thread::after { content: ""; display: block; clear: both; }
.post { display: flow-root; overflow-wrap: anywhere; }
.post.op { margin: 4px 0; }
.replyContainer { display: flex; margin: 4px 0; }
.sideArrows { display: none; color: var(--reply-border); margin-right: 2px; }
.post.reply {
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 8px;
  background: var(--reply-bg);
  border: 1px solid var(--reply-border);
  border-top: 0;
  border-left: 0;
}
.post.highlight { background: var(--highlight-bg); border-color: var(--highlight-border); }

.postInfo { line-height: 1.7; }
.subject { color: var(--subject); font-weight: bold; }
.name { color: var(--name); font-weight: bold; }
.trip { color: var(--name); }
.capcode { color: #ff0000; }
.you { color: var(--muted); font-weight: normal; font-size: 11px; }
.dateTime { white-space: nowrap; }
.postNum { white-space: nowrap; }
.postNum a { color: inherit; text-decoration: none; }
.postNum a:hover { color: var(--link-hover); }
.postNum .quotePost,
.replylink a { display: inline-block; padding: 8px 4px; margin: -8px -4px; }
.backlinks { font-size: 11px; }
.backlinks a { margin-right: 4px; }

.postMessage { margin: 8px 0 4px; }
.greentext { color: var(--greentext); }
a.quotelink { color: var(--quotelink); }
a.quotelink:hover { color: var(--link-hover); }
.deadlink { color: var(--quotelink); text-decoration: line-through; }

.file { margin-bottom: 2px; }
.fileText { font-size: 11px; }
.fileThumb { float: left; margin: 4px 12px 6px 0; }
.fileThumb img { display: block; max-width: 110px; max-height: 110px; }
.op .fileThumb img { max-width: 140px; max-height: 140px; }
.fileThumb.expanded { float: none; display: block; }
/* .post na frente: precisa vencer o ".op .fileThumb img" do desktop. */
.post .fileThumb.expanded img { max-width: 100%; max-height: none; }

.summary { color: var(--muted); font-size: 11px; margin: 6px 0; }
.thread-stats { text-align: center; font-size: 11px; color: var(--muted); }

.quote-preview {
  position: fixed;
  z-index: 900;
  max-width: 500px;
  padding: 6px 8px;
  background: var(--reply-bg);
  border: 1px solid var(--reply-border);
  box-shadow: 2px 2px 6px rgba(0, 0, 0, .3);
  pointer-events: none;
}

/* ---------- Paginação ---------- */
.pagelist { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.pagelist a,
.pagelist strong {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  background: var(--reply-bg);
  border: 1px solid var(--reply-border);
  text-decoration: none;
}
.pagelist strong { background: var(--highlight-bg); }

/* ---------- Catálogo ---------- */
.catalog { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; padding: 4px 0; }
.catalog-item { text-align: center; font-size: 11px; overflow-wrap: anywhere; }
.catalog-thumb { display: block; }
.catalog-thumb img { max-height: 150px; box-shadow: 0 0 5px rgba(0, 0, 0, .25); }
.catalog-noimg {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
  border: 1px dashed var(--reply-border);
  color: var(--muted);
}
.catalog-meta { font-size: 10px; margin: 4px 0 2px; }

/* ---------- Página inicial ---------- */
.home { max-width: 750px; margin: 0 auto; }
.home-logo { text-align: center; margin: 8px 0 12px; }
.logo { display: block; width: 100%; max-width: 370px; height: auto; margin: 0 auto; color: var(--title); }
.logo-paw { fill: var(--name); }
.tagline { margin: 4px 0 0; font-style: italic; }

.box { background: var(--box-bg); border: 1px solid var(--box-border); margin: 0 0 12px; }
.box-title {
  margin: 0;
  padding: 6px 10px;
  font-size: 12px;
  background: var(--box-head-bg);
  color: var(--box-head-text);
  border-bottom: 1px solid var(--box-border);
}
.box-body { padding: 10px; }
.box-body p { margin: 0 0 8px; }
.box-body p:last-child { margin-bottom: 0; }

.board-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.board-list a { display: flex; align-items: center; gap: 6px; min-height: 44px; font-size: 12px; }
.board-desc { display: block; font-size: 11px; color: var(--muted); margin-top: -6px; }
.new-badge { color: #ff0000; font-size: 10px; font-weight: bold; }

.popular { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.popular-item { display: flex; flex-direction: column; gap: 2px; text-decoration: none; text-align: center; font-size: 11px; }
.popular-thumb { display: flex; align-items: center; justify-content: center; height: 100px; }
.popular-thumb img { max-height: 100px; }
.popular-noimg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border: 1px dashed var(--reply-border);
  font-size: 22px;
  font-weight: bold;
}
.popular-board { color: var(--muted); font-size: 10px; }
.popular-teaser { color: var(--text); overflow-wrap: anywhere; }

.recent { list-style: none; margin: 0; padding: 0; }
.recent li { padding: 8px 0; border-bottom: 1px dotted var(--hr); overflow-wrap: anywhere; }
.recent li:last-child { border-bottom: 0; }
.recent a { display: inline-block; padding: 4px 0; font-weight: bold; }
.recent-text { display: block; font-size: 11px; }

.counter {
  display: inline-block;
  padding: 2px 6px;
  font-family: "Courier New", monospace;
  font-weight: bold;
  letter-spacing: 3px;
  color: #33ff33;
  background: #000;
  border: 2px inset #888;
}

/* ---------- Erro ---------- */
.error-box { text-align: center; padding: 32px 8px; }
.error-title { color: #ff0000; font-size: 20px; font-weight: bold; }

/* ---------- Rodapé ---------- */
.sitefooter { text-align: center; font-size: 11px; margin-top: 16px; }
/* Idiomas: no celular, botões em duas colunas iguais; no desktop, uma linha de links. */
.langs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 12px 0;
}
.langs-label { grid-column: 1 / -1; }
.langs-deco { display: none; }
.langs a,
.langs strong {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 6px;
  font-size: 13px;
  background: var(--reply-bg);
  border: 1px solid var(--reply-border);
}
.langs a { color: var(--link); }
.langs strong { background: var(--highlight-bg); border-color: var(--highlight-border); color: var(--text); }
.footer-tools { margin: 12px 0; }
html.js .footer-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; }
.footer-tool { display: inline-flex; align-items: center; gap: 6px; }
.footer-tools select {
  min-height: 44px;
  padding: 0 8px;
  font-size: 16px;
  color: var(--input-text);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
}
.badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 12px 0; }
.badge88 {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 31px;
  font: bold 9px/1.1 verdana, sans-serif;
  text-align: center;
  border: 1px solid #000;
}
.badge-a { background: #ff9900; color: #000; }
.badge-b { background: #ffffff; color: #000080; }
.badge-c { background: #000080; color: #ffff00; }
.badge-d { background: #006600; color: #ffffff; }
.copyright { color: var(--muted); }

.blink { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) {
  .blink { animation: none; }
}

/* Botão "Denunciar" de cada post: um formulário (funciona sem JS) com cara de link pequeno. */
.reportForm { display: inline; }
.reportForm button {
  display: inline-block;
  padding: 15px 6px; /* alvo de ~44 px no toque, sem mudar a altura da linha */
  margin: -15px -6px;
  background: none;
  border: 0;
  font: inherit;
  font-size: 11px;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
}
.reportForm button:hover { color: var(--link-hover); }

/* Painel de moderação (/mod) */
.mod-panel { max-width: 900px; margin: 0 auto; }
.mod-panel h1 { font-size: 22px; }
.mod-panel h2 { font-size: 16px; margin-top: 20px; }
.mod-list { list-style: none; margin: 0; padding: 0; }
.mod-row { margin: 0 0 8px; padding: 8px; background: var(--reply-bg); border: 1px solid var(--reply-border); }
.mod-meta { margin: 0 0 4px; font-size: 12px; }
.mod-text { margin: 0 0 8px; overflow-wrap: anywhere; }
.mod-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mod-action { display: inline-flex; flex-wrap: wrap; gap: 4px; margin: 0; }
.mod-action button,
.mod-action select,
.mod-login input,
.mod-login button { min-height: 44px; font: inherit; }
.mod-login { display: grid; gap: 8px; max-width: 320px; }
.mod-logout { margin: 0 0 8px; }
.mod-notice { padding: 8px; background: var(--reply-bg); border: 1px solid var(--reply-border); }

/* ---------- Tablet ---------- */
@media (min-width: 600px) {
  .catalog { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .popular { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .board-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Desktop: visual clássico do imageboard ---------- */
/* Só com mouse (pointer: fine): um tablet de toque largo continua com os alvos grandes do celular. */
@media (min-width: 768px) and (pointer: fine) {
  body { padding: 5px 10px 24px; }

  .boardnav { display: block; margin: 0 0 8px; font-size: 10px; color: var(--muted); }
  .boardnav > span { display: inline; }
  .boardnav .bn-deco { display: inline; }
  .boardnav a { display: inline; min-height: 0; padding: 0; background: none; border: 0; font-weight: normal; }
  .boardnav a.bn-board::before,
  .boardnav a.bn-board::after { content: none; }
  .boardnav a.current { background: none; font-weight: bold; color: var(--link); }
  .boardnav .bn-home { font-size: inherit; }
  .bn-right { float: right; }

  .boardTitle { font-size: 28px; letter-spacing: -2px; }

  .postFormWrap > summary {
    display: block;
    min-height: 0;
    text-align: center;
    background: none;
    border: 0;
    color: var(--link);
    font-size: 18px;
  }
  .postFormWrap > summary::before { content: "["; color: var(--text); }
  .postFormWrap > summary::after { content: "]"; color: var(--text); }
  .postFormWrap > summary:hover { color: var(--link-hover); }

  .postForm { width: 440px; }
  .pf-row { display: grid; grid-template-columns: 90px 1fr; gap: 2px; margin-bottom: 2px; }
  .pf-row > label {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0 6px;
    font-size: 11px;
    background: var(--label-bg);
    border: 1px solid var(--label-border);
    color: var(--label-text);
  }
  .pf-spacer { display: block; }
  .pf-count { grid-column: 2; }
  .postForm input[type="text"],
  .postForm textarea { min-height: 0; padding: 3px 4px; font-size: 12px; }
  .postForm textarea { min-height: 100px; }
  .postForm input[type="file"] { min-height: 0; font-size: 11px; }
  .postForm button[type="submit"] { width: auto; min-height: 0; justify-self: start; font-size: 11px; padding: 2px 14px; }
  .rules { margin-left: 92px; }

  .navlinks { display: block; font-size: 11px; }
  .navlinks a { display: inline; min-height: 0; padding: 0; background: none; border: 0; margin-right: 6px; font-size: inherit; text-decoration: underline; }
  .navlinks a::before { content: "["; color: var(--text); }
  .navlinks a::after { content: "]"; color: var(--text); }

  .sideArrows { display: block; }
  .post.reply { flex: 0 1 auto; max-width: calc(100% - 20px); padding: 4px 6px; }
  .postInfo { line-height: 1.4; }
  .postNum .quotePost,
  .replylink a,
  .reportForm button { padding: 0; margin: 0; }
  .mod-action button,
  .mod-action select,
  .mod-login input,
  .mod-login button { min-height: 0; }
  .postMessage { margin: 10px 40px 10px 20px; }
  .op .postMessage { margin-left: 20px; }
  .fileThumb { margin: 3px 20px 5px 20px; }
  .fileThumb img { max-width: 125px; max-height: 125px; }
  .op .fileThumb img { max-width: 250px; max-height: 250px; }
  .summary { margin-left: 20px; }

  .pagelist { display: inline-flex; gap: 0; padding: 4px 6px; background: var(--reply-bg); border: 1px solid var(--reply-border); }
  .pagelist a,
  .pagelist strong { min-width: 0; min-height: 0; padding: 0 4px; background: none; border: 0; }
  .pagelist strong::before, .pagelist a::before { content: "["; color: var(--text); }
  .pagelist strong::after, .pagelist a::after { content: "]"; color: var(--text); }
  .pl-catalog { margin-left: 8px; }

  .board-list a { min-height: 0; font-size: 12px; }
  .board-desc { margin-top: 0; }
  .recent li { padding: 4px 0; }
  .recent a { padding: 0; }
  .recent-text { display: inline; }
  .sitefooter { font-size: 10px; }
  .langs { display: block; }
  .langs-deco { display: inline; }
  .langs a,
  .langs strong { display: inline; min-height: 0; padding: 0; font-size: inherit; background: none; border: 0; }
  .footer-tools select { min-height: 0; font-size: 11px; padding: 1px 4px; }
}
