:root {
  --bg: #eef2ff;
  --post-bg: #d6daf0;
  --post-border: #b7c5d9;
  --header-bg: #af0a0f;
  --text: #000;
  --text-light: #333;
  --name-color: #117743;
  --subject-color: #0f0c5d;
  --trip-color: #228854;
  --link-color: #34345c;
  --greentext: #789922;
  --highlight: #d6bad0;
  --reply-bg: #d6daf0;
  --input-bg: #fff;
  --input-border: #b7c5d9;
  --btn-bg: #d6daf0;
  --btn-hover: #c5c9e3;
  --danger: #af0a0f;
  --omitted: #707070;
  --serif: Georgia, 'Times New Roman', Times, serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.4;
  min-height: 100vh;
}

.genesis-bg {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  opacity: 0.06;
}
.genesis-bg pre {
  font-family: monospace;
  font-size: 15px;
  line-height: 1.15;
  color: var(--header-bg);
  transform: rotate(-2deg) scale(1.25) translateY(45px);
  transform-origin: top left;
  white-space: pre;
  overflow: visible;
}

.satoshi-bg {
  position: fixed;
  bottom: 0; left: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.25;
}
.satoshi-bg img {
  width: 350px;
  display: block;
}

.monero-bg {
  position: fixed;
  bottom: 0; right: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}
.monero-bg img {
  width: 300px;
  display: block;
}

.manifesto-bg {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  opacity: 0.07;
  mask-image: linear-gradient(to right, transparent 0%, black 25%, black 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 25%, black 100%);
}
.manifesto-bg pre {
  position: absolute;
  right: 0;
  top: 0;
  font-family: Georgia, serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--header-bg);
  transform: rotate(1deg);
  white-space: pre-wrap;
  overflow: visible;
  max-width: 700px;
  min-height: 100vh;
  padding: 40px 60px 40px 80px;
  background: rgba(255,255,255,0.3);
}

a { color: var(--link-color); text-decoration: none; }
a:hover { text-decoration: underline; }

.top-bar {
  background: var(--header-bg);
  color: #fff;
  padding: 4px 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.top-bar a { color: #fff; }
.top-bar .site-name { color: #fff; font-size: 15px; font-family: var(--serif); font-style: italic; }
.top-bar .board-nav a { color: #fff; }
.mod-badge a { color: #ff0; }

hr { border: none; border-top: 1px solid var(--post-border); margin: 4px 0; }

.content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 16px;
  position: relative;
  z-index: 1;
}

h1 { font-size: 20px; margin: 8px 0; font-family: var(--serif); }
h2 { font-size: 16px; margin: 12px 0 6px; color: var(--subject-color); font-family: var(--serif); }

.subtitle { color: var(--text-light); margin-bottom: 8px; }
.footer { text-align: center; padding: 8px; color: var(--omitted); }

.board-list { border-collapse: collapse; width: 100%; }
.board-list th { text-align: left; padding: 4px 12px; border-bottom: 1px solid var(--post-border); background: var(--post-bg); }
.board-list td { padding: 6px 12px; border-bottom: 1px solid #ccc; }
.board-link { font-weight: bold; font-family: monospace; font-size: 14px; color: var(--header-bg); }
.empty { color: var(--omitted); margin: 12px 0; }
.rules { margin: 8px 0 8px 20px; color: var(--text-light); line-height: 1.7; }
.rules b { color: var(--text); }

.board-title { color: var(--subject-color); }
.board-desc { color: var(--text-light); margin-bottom: 6px; }

.profile-header { display: flex; gap: 16px; align-items: flex-start; margin: 12px 0; }
.ph-identicon { flex-shrink: 0; }
.ph-info { display: flex; flex-direction: column; gap: 4px; }
.ph-name { font-size: 18px; font-weight: bold; color: var(--name-color); font-family: var(--serif); }
.ph-trip { font-size: 14px; font-weight: bold; color: var(--trip-color); font-family: var(--serif); margin: 0; }
.ph-stats { font-size: 12px; color: var(--text-light); }
.ph-boards { font-size: 12px; color: var(--text-light); }
.profile-source { color: var(--link-color); font-size: 11px; }
.profile-post { margin: 8px 0; }

.post-form { margin: 8px 0; }
.form-table { border-collapse: collapse; }
.form-table td { padding: 2px 4px; vertical-align: top; }
.form-label { text-align: right; font-weight: bold; white-space: nowrap; width: 70px; }

.help-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  font-size: 11px;
  font-weight: bold;
  color: var(--text-light);
  background: var(--btn-bg);
  border: 1px solid var(--post-border);
  border-radius: 50%;
  cursor: help;
  position: relative;
  vertical-align: middle;
}
.help-icon:hover .help-popup { display: block; }
.help-popup {
  display: none;
  position: absolute;
  right: 0;
  bottom: 100%;
  margin-bottom: 6px;
  background: var(--post-bg);
  border: 1px solid var(--post-border);
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: normal;
  color: var(--text);
  white-space: nowrap;
  box-shadow: 2px 2px 8px rgba(0,0,0,.2);
  z-index: 100;
  line-height: 1.5;
}
.help-popup code {
  background: var(--btn-bg);
  padding: 0 3px;
  border-radius: 2px;
}
.file-queue-list { margin-top: 4px; }
.file-queue-item {
  font-size: 11px;
  padding: 2px 0;
  color: var(--text-light);
}
.fq-name { font-weight: bold; color: var(--text); }
.fq-info { margin-left: 4px; }
.fq-remove {
  color: var(--danger);
  margin-left: 6px;
  font-size: 10px;
}
.fq-remove:hover { text-decoration: underline; }
.file-counter { font-size: 11px; color: var(--text-light); margin-left: 4px; }

input[type="text"], input[type="password"], input[type="email"], select, textarea {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  padding: 3px 5px;
  font-size: 13px;
  font-family: Arial, Helvetica, sans-serif;
}
input[type="text"]:focus, input[type="password"]:focus, textarea:focus {
  border-color: var(--link-color);
  outline: none;
}
input[type="submit"], button, .btn {
  background: var(--btn-bg);
  border: 1px solid var(--post-border);
  padding: 3px 12px;
  font-size: 13px;
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
}
input[type="submit"]:hover, button:hover, .btn:hover { background: var(--btn-hover); }

.btn-sm { padding: 1px 6px; font-size: 11px; }
.btn-danger { background: var(--danger); color: #fff; border-color: #800; }
.btn-danger:hover { background: #c00; color: #fff; }

.mod-table { border-collapse: collapse; width: 100%; margin: 8px 0; }
.mod-table th { text-align: left; padding: 4px 8px; border-bottom: 2px solid var(--post-border); background: var(--post-bg); }
.mod-table td { padding: 6px 8px; border-bottom: 1px solid var(--post-border); vertical-align: middle; }
.mod-table tr:hover { background: var(--reply-bg); }

.thread { margin: 8px 0; overflow: hidden; }

.post-meta { font-size: 12px; margin-bottom: 2px; clear: both; }
.subject { color: var(--subject-color); font-weight: bold; font-size: 14px; font-family: var(--serif); }
.poster-name { color: var(--name-color); font-weight: bold; }
.poster-name.has-trip { cursor: pointer; }
.poster-name.has-trip:hover { text-decoration: underline; }
.identicon-sm { vertical-align: middle; margin-left: 2px; border-radius: 2px; }
.reply-btn { color: #770; font-size: 11px; margin-left: 4px; font-weight: normal; }
.reply-btn:hover { color: #aa0; }
.capcode { font-size: 11px; font-weight: bold; padding: 1px 4px; border-radius: 2px; }
.capcode-admin { background: #af0a0f; color: #fff; }
.capcode-mod { background: #789922; color: #fff; }
.capcode-label { font-size: 11px; color: var(--text-light); cursor: pointer; }
.capcode-label:hover { color: var(--text); }
.profile-link { color: var(--name-color); text-decoration: none; }
.profile-link:hover { text-decoration: underline; }

.op-post {
  padding: 4px 0;
  display: inline-block;
  max-width: 100%;
}
.op-post .files-container { margin-bottom: 4px; }
.op-post .file-thumb { float: left; margin: 4px 12px 4px 0; }

.reply-post {
  background: var(--reply-bg);
  border: 1px solid var(--post-border);
  border-radius: 2px;
  padding: 6px 10px;
  margin: 4px 0 4px 20px;
  display: table;
  max-width: calc(100% - 24px);
  overflow-wrap: break-word;
}
.reply-post .files-container { margin-bottom: 4px; overflow: hidden; }
.reply-post .file-thumb { float: left; margin: 4px 12px 4px 0; }

.files-container { overflow: hidden; }
.files-container::after { content: ''; display: table; clear: both; }

.file-info { font-size: 11px; color: var(--text-light); margin-bottom: 2px; clear: both; }
.file-info a { color: var(--link-color); }

.thumb {
  max-width: 200px;
  max-height: 200px;
  display: block;
  cursor: pointer;
}
.thumb.expanded {
  max-width: none;
  max-height: none;
}

.media-player {
  max-width: 400px;
  max-height: 300px;
  display: block;
  background: #000;
  border-radius: 2px;
}

.video-thumb {
  position: relative;
  display: inline-block;
  cursor: pointer;
}
.video-thumb video {
  max-width: 200px;
  max-height: 200px;
  display: block;
  background: #000;
  border-radius: 2px;
}
.video-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  background: rgba(0,0,0,.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: background .15s;
}
.video-thumb:hover .video-play-overlay { background: rgba(0,0,0,.8); }
.video-play-overlay svg { margin-left: 3px; }

.audio-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--post-bg);
  border: 1px solid var(--post-border);
  border-radius: 3px;
  cursor: pointer;
  max-width: 300px;
  clear: both;
  margin: 4px 0;
  transition: background .1s;
}
.audio-card:hover { background: var(--btn-hover); }
.audio-icon { color: var(--link-color); flex-shrink: 0; }
.audio-meta { display: flex; flex-direction: column; min-width: 0; }
.audio-filename {
  font-size: 12px;
  font-weight: bold;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.audio-size { font-size: 10px; color: var(--text-light); }
.audio-duration { font-size: 10px; color: var(--text-light); }

.play-link { color: #007; font-size: 11px; }
.play-link:hover { color: #00c; }

.media-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--post-bg);
  border-top: 2px solid var(--post-border);
  z-index: 300;
  box-shadow: 0 -2px 10px rgba(0,0,0,.15);
}
.mb-inner {
  max-width: 500px;
  margin: 0 auto;
  padding: 6px 12px;
}
.mb-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.mb-icon { color: var(--link-color); flex-shrink: 0; }
.mb-title {
  font-size: 12px;
  font-weight: bold;
  color: var(--text-light);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mb-btn {
  background: none;
  border: none;
  font-size: 13px;
  font-weight: bold;
  color: var(--danger);
  cursor: pointer;
  padding: 0 4px;
}
.mb-btn:hover { color: #d00; }
.mb-audio {
  width: 100%;
  height: 36px;
}

.video-player {
  position: fixed;
  bottom: 80px;
  right: 20px;
  background: var(--post-bg);
  border: 2px solid var(--post-border);
  border-radius: 4px;
  z-index: 301;
  box-shadow: 3px 3px 12px rgba(0,0,0,.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  resize: horizontal;
  width: 480px;
  min-width: 200px;
  max-width: 90vw;
  max-height: 90vh;
}
.vp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  cursor: move;
  background: var(--btn-bg);
  border-bottom: 1px solid var(--post-border);
  flex-shrink: 0;
  min-height: 28px;
}
.vp-title {
  font-size: 11px;
  font-weight: bold;
  color: var(--text-light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.vp-close {
  font-size: 13px;
  font-weight: bold;
  color: var(--danger);
  text-decoration: none;
}
.vp-close:hover { text-decoration: none; color: #d00; }
.vp-video {
  display: block;
  flex: 1;
  min-height: 0;
  width: 100%;
  background: #000;
  object-fit: contain;
}

body.mb-open { padding-bottom: 80px; }

.quick-reply {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--post-bg);
  border: 2px solid var(--post-border);
  border-radius: 4px;
  padding: 8px 12px;
  z-index: 200;
  box-shadow: 3px 3px 12px rgba(0,0,0,.25);
  min-width: 320px;
  max-width: 480px;
}
.qr-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--post-border);
  font-weight: bold;
  color: var(--text);
}
.qr-close {
  font-size: 13px;
  font-weight: bold;
  color: var(--danger);
  text-decoration: none;
}
.qr-close:hover { color: #d00; }

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

.tripcard-popup {
  position: absolute;
  z-index: 160;
  background: var(--post-bg);
  border: 1px solid var(--post-border);
  border-radius: 4px;
  padding: 10px 14px;
  box-shadow: 2px 2px 8px rgba(0,0,0,.2);
  display: flex;
  align-items: center;
  gap: 10px;
}
.tc-icon { flex-shrink: 0; }
.tc-info { display: flex; flex-direction: column; }
.tc-label { font-size: 10px; color: var(--text-light); text-transform: uppercase; }
.tc-name { font-size: 14px; font-weight: bold; color: var(--name-color); margin-bottom: 2px; }
.tc-trip { font-size: 13px; font-weight: bold; color: var(--trip-color); font-family: monospace; }

.ban-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.5);
  z-index: 400;
}
.ban-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--post-bg);
  border: 2px solid var(--post-border);
  border-radius: 4px;
  padding: 16px 20px;
  z-index: 401;
  box-shadow: 3px 3px 15px rgba(0,0,0,.3);
  min-width: 320px;
}
.ban-modal h3 { margin: 0 0 10px; color: var(--text); font-size: 14px; }
.ban-modal table { border-collapse: collapse; }
.ban-modal td { padding: 4px 6px; vertical-align: top; }
.ban-modal input[type="text"] { width: 200px; }

.media-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  background: #ccc;
  border: 2px dashed #999;
  border-radius: 4px;
  color: #666;
}
.media-placeholder span { font-size: 11px; margin-top: 4px; }

.media-preview-link { cursor: pointer; }
.media-preview-link:hover { opacity: 0.8; }

.media-float-preview {
  position: fixed;
  z-index: 500;
  max-width: 300px;
  max-height: 300px;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
  border-radius: 4px;
  pointer-events: none;
}
.media-float-preview img {
  display: block;
  max-width: 300px;
  max-height: 300px;
  border-radius: 4px;
}

@media (max-width: 1550px) {
  .manifesto-bg { display: none; }
  .genesis-bg pre { transform: rotate(-2deg) scale(1.1) translateY(20px); }
}

@media (max-width: 750px) {
  .monero-bg { display: none; }
  .content { padding: 8px; }
  .reply-post { margin-left: 4px; }
  .form-table { width: 100%; }
  input[type="text"], textarea { width: 100%; }
  .top-bar { font-size: 12px; flex-wrap: wrap; }
  .quick-reply { left: 5px; right: 5px; min-width: auto; bottom: 5px; transform: none; top: auto; }
  .media-player { max-width: 100%; }
  .video-player { right: 5px; left: 5px; width: auto; min-width: 160px; max-width: none; max-height: none; bottom: 70px; }
  .vp-video { flex: 1; min-height: 0; max-width: none; max-height: none; }
}
