/* iSky — aerial / night-sky palette, Reddit-like density */

:root {
  --bg: #0d1117;
  --bg-elev: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #58a6ff;
  --accent-dim: #388bfd66;
  --up: #ff7b54;
  --down: #8b9dc3;
  --radius: 8px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.65rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
  color: var(--accent);
}

.logo-img {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow:
    0 0 0 1px rgba(255, 183, 120, 0.14),
    0 4px 18px rgba(0, 0, 0, 0.45);
}

.logo-mark {
  color: var(--accent);
}

.tagline {
  color: var(--muted);
  font-size: 0.8rem;
  flex: 1 1 auto;
  min-width: 12rem;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  font-size: 0.9rem;
}

.topnav a {
  color: var(--muted);
}

.topnav a:hover,
.topnav a.active {
  color: var(--text);
  text-decoration: none;
}

.user-menu {
  color: var(--muted);
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
}

.badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
}

.main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.layout-two {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 880px) {
  .layout-two {
    grid-template-columns: 1fr 280px;
    align-items: start;
  }
}

.page-title {
  font-size: 1.35rem;
  margin: 0 0 0.75rem;
  font-weight: 700;
}

.comm-header .comm-desc {
  color: var(--muted);
  margin: 0 0 1rem;
}

.panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.panel h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.comm-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.88rem;
}

.comm-list li {
  margin-bottom: 0.45rem;
}

.rules ol {
  margin: 0.25rem 0 0 1.1rem;
  padding: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.rules li {
  margin-bottom: 0.35rem;
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-row {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.5rem;
}

.vote-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 2.25rem;
  flex-shrink: 0;
}

.vote-col.small {
  min-width: 2rem;
}

.vote-col.inline {
  flex-direction: row;
  min-width: auto;
  gap: 0.25rem;
}

.vote-form {
  margin: 0;
  padding: 0;
}

.vote-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.65rem;
  line-height: 1;
  padding: 0.1rem 0.2rem;
  border-radius: 3px;
}

.vote-btn:hover {
  color: var(--text);
  background: #21262d;
}

.vote-btn.on {
  color: var(--accent);
}

.vote-col .vote-form:first-child .vote-btn.on {
  color: var(--up);
}

.vote-col .vote-form:last-child .vote-btn.on {
  color: var(--down);
}

.score {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  padding: 0.15rem 0;
}

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

.meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 0.2rem;
}

.comm-link {
  font-weight: 600;
  color: var(--text);
}

.comm-link:hover {
  color: var(--accent);
}

.comm-link[data-tooltip] {
  position: relative;
}

.comm-link[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.55rem);
  transform: translateX(-50%);
  min-width: 14rem;
  max-width: min(24rem, 80vw);
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0b1220;
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.35;
  white-space: pre-line;
  text-align: left;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 120;
}

.comm-link[data-tooltip]::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.2rem);
  transform: translateX(-50%);
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: #0b1220 transparent transparent transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 121;
}

.comm-link[data-tooltip]:hover::after,
.comm-link[data-tooltip]:hover::before,
.comm-link[data-tooltip]:focus-visible::after,
.comm-link[data-tooltip]:focus-visible::before {
  opacity: 1;
  visibility: visible;
}

.dot {
  opacity: 0.5;
}

.post-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0.15rem 0;
  line-height: 1.3;
}

.post-title a {
  color: var(--text);
}

.post-title a:hover {
  color: var(--accent);
  text-decoration: none;
}

.post-title.huge {
  font-size: 1.5rem;
  margin-top: 0.35rem;
}

.post-stats {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0.25rem 0 0;
}

.empty,
.hint {
  color: var(--muted);
}

.error {
  background: #3d1111;
  border: 1px solid #922;
  color: #f88;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
}

.auth-box,
.submit-page {
  max-width: 420px;
}

.submit-page.wide,
.stack-form.wide {
  max-width: 640px;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stack-form label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.stack-form input,
.stack-form select,
.stack-form textarea {
  font: inherit;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.stack-form textarea {
  resize: vertical;
  min-height: 120px;
}

.turnstile-wrap {
  margin: 0.5rem 0 0.25rem;
}

.btn {
  display: inline-block;
  font: inherit;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
  margin-top: 0.5rem;
  text-decoration: none;
  text-align: center;
}

.btn:hover {
  text-decoration: none;
  background: #21262d;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0d1117;
  font-weight: 600;
}

.btn.primary:hover {
  filter: brightness(1.08);
}

.btn.danger {
  border-color: #f85149;
  color: #ff7b72;
  background: #3d1111;
}

.btn.danger:hover {
  background: #5a1a1a;
  color: #ffa198;
}

.post-page {
  max-width: 1200px;
}

.post-full {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
}

.post-url {
  word-break: break-all;
  font-size: 0.9rem;
}

.embed-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0.75rem 0 0.35rem;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

/* Bleed past .post-full horizontal padding so the player uses the full card width */
.post-full .embed-wrap {
  width: calc(100% + 2.3rem);
  margin-left: -1.15rem;
  margin-right: -1.15rem;
}

.embed-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.post-body {
  margin-top: 0.75rem;
  font-size: 0.95rem;
}

.post-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.mod-actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.mod-actions .mod-inline-form {
  display: inline;
  margin: 0;
}

.btn-small {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  margin-top: 0;
}

.pin-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #f0883e;
  border: 1px solid rgba(240, 136, 62, 0.45);
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  vertical-align: middle;
}

.post-row.pinned {
  border-color: rgba(240, 136, 62, 0.35);
  box-shadow: inset 3px 0 0 #f0883e;
}

.ban-badge {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ff7b72;
  border: 1px solid #553333;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  vertical-align: middle;
}

.comments-section h2 {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
}

.reply-box {
  margin-bottom: 1rem;
}

.replying-to {
  font-size: 0.85rem;
  color: var(--muted);
}

.comment-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.comment-form label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.comment-form textarea {
  font: inherit;
  padding: 0.65rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.comment-form .comment-submit {
  align-self: flex-start;
  margin-top: 0.85rem;
}

.comment-tree {
  list-style: none;
  margin: 0;
  padding-left: calc(var(--depth, 0) * 0.75rem);
}

.comment {
  margin: 0.5rem 0 0;
}

.comment-inner {
  display: flex;
  gap: 0.5rem;
  border-left: 2px solid var(--border);
  padding-left: 0.5rem;
}

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

.comment-text {
  font-size: 0.92rem;
  margin-top: 0.25rem;
}

.comment-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.4rem;
  font-size: 0.8rem;
}

.comment-actions .comment-reply {
  color: var(--accent);
}

.comment-actions .comment-mod-form {
  margin: 0;
  display: inline;
}

/* Moderation: user directory */

.admin-users-page {
  max-width: 1100px;
}

.admin-intro {
  color: var(--muted);
  margin: -0.25rem 0 1rem;
  font-size: 0.9rem;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.admin-table th,
.admin-table td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg);
}

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

.admin-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.admin-table tr.row-banned td {
  background: rgba(248, 81, 73, 0.06);
}

.status-active {
  color: #56d364;
  font-size: 0.85rem;
}

.status-banned {
  color: #ff7b72;
  font-weight: 600;
  font-size: 0.85rem;
}

.actions-cell .inline-form {
  display: inline;
  margin: 0;
}

.actions-cell .btn-small {
  margin-top: 0;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.pager-meta {
  color: var(--muted);
}

.pager-link {
  color: var(--accent);
}

.ip-mono {
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
  font-size: 0.78rem;
  word-break: break-all;
}

.ip-cell {
  vertical-align: top;
  max-width: 14rem;
}

.ip-ban-form {
  display: inline;
  margin: 0 0 0 0.35rem;
}

.ip-ban-form .btn-small {
  margin-top: 0;
  vertical-align: middle;
}

.ip-blocked-tag {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #ff7b72;
  margin-left: 0.25rem;
}

.section-subtitle {
  font-size: 1.05rem;
  margin: 2rem 0 0.35rem;
}

.banned-ip-section {
  margin-top: 0.5rem;
}

.banned-ip-section .admin-intro {
  margin-bottom: 0.75rem;
}
