:root {
  color-scheme: dark;
  --bg: #100c16;
  --panel: #1b1523;
  --panel-soft: #241a2e;
  --ink: #f8f2ff;
  --muted: #b8a9c8;
  --gold: #f4c969;
  --gold-soft: #d4aa52;
  --violet: #b89ad6;
  --line: rgba(244, 201, 105, 0.22);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(120, 69, 151, 0.18), transparent 34rem),
    linear-gradient(180deg, #15101d 0%, var(--bg) 48%, #0c0910 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 28px 28px;
}

.page-shell {
  width: min(980px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 38px;
}

.hero {
  position: relative;
  min-height: 190px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(115deg, rgba(36, 26, 46, 0.96), rgba(20, 14, 28, 0.92)),
    var(--panel);
  box-shadow: var(--shadow);
}

.hero::after {
  content: "☠";
  position: absolute;
  right: 3%;
  top: -45px;
  font-size: 220px;
  line-height: 1;
  color: rgba(244, 201, 105, 0.035);
  transform: rotate(8deg);
}

.hero-art {
  align-self: stretch;
  width: 235px;
  flex: 0 0 235px;
  position: relative;
  overflow: hidden;
}

.hero-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 56%, rgba(27, 21, 35, 0.98) 100%);
}

.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  filter: saturate(0.94) contrast(1.03);
}

.hero-copy {
  position: relative;
  z-index: 1;
  padding: 30px 30px 30px 8px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }

h1 {
  margin-bottom: 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.1rem, 7vw, 4.15rem);
  line-height: 0.96;
  letter-spacing: -0.035em;
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.98rem, 2vw, 1.12rem);
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 18px -4px 0;
  padding: 10px 4px 13px;
  scrollbar-width: thin;
  background: linear-gradient(var(--bg) 70%, transparent);
}

.tab, .refresh {
  border: 1px solid rgba(184, 154, 214, 0.2);
  background: rgba(27, 21, 35, 0.88);
  color: var(--muted);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.tab {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 9px 13px;
  border-radius: 999px;
  font-weight: 720;
  white-space: nowrap;
}

.tab:hover, .tab:focus-visible, .refresh:hover, .refresh:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(244, 201, 105, 0.6);
  color: var(--ink);
  outline: none;
}

.tab.active {
  color: #24180a;
  background: linear-gradient(180deg, #f7d77f, var(--gold));
  border-color: var(--gold);
  box-shadow: 0 5px 18px rgba(244, 201, 105, 0.17);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 20px 2px 13px;
}

.section-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 5vw, 2.35rem);
}

.refresh {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.25rem;
}

.status {
  padding: 22px 4px;
  color: var(--muted);
}

.status[hidden] { display: none; }

.posts {
  display: grid;
  gap: 14px;
}

.post {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border: 1px solid rgba(184, 154, 214, 0.16);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(31, 23, 40, 0.96), rgba(24, 18, 31, 0.96));
  box-shadow: 0 10px 28px rgba(0,0,0,0.18);
}

.post::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--category-color, var(--gold));
}

.post[data-category="events"] { --category-color: #df9c70; }
.post[data-category="news"] { --category-color: #7db8e8; }
.post[data-category="plunder-week"] { --category-color: #f4c969; }
.post[data-category="guild-info"] { --category-color: #8fd0b0; }
.post[data-category="rules"] { --category-color: #c9a4e8; }

.post-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid color-mix(in srgb, var(--category-color, var(--gold)) 55%, transparent);
  border-radius: 999px;
  color: var(--category-color, var(--gold));
  background: color-mix(in srgb, var(--category-color, var(--gold)) 8%, transparent);
  font-size: 0.73rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.post-time {
  color: #9788a5;
  font-size: 0.78rem;
  text-align: right;
}

.post-content {
  color: #f3ecf8;
  font-size: 1rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.post-content p,
.post-content ul,
.post-content ol,
.post-content blockquote,
.post-content pre {
  margin: 0 0 0.9em;
}

.post-content > :last-child { margin-bottom: 0; }

.post-content h1,
.post-content h2,
.post-content h3 {
  margin: 1em 0 0.45em;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.2;
}

.post-content h1 { font-size: 1.55rem; }
.post-content h2 { font-size: 1.35rem; }
.post-content h3 { font-size: 1.18rem; }

.post-content a {
  color: #9ccfff;
  text-underline-offset: 3px;
}

.post-content blockquote {
  margin-left: 0;
  padding-left: 13px;
  border-left: 3px solid rgba(244, 201, 105, 0.45);
  color: #cfc1da;
}

.post-content code {
  padding: 0.13em 0.38em;
  border-radius: 5px;
  background: #0f0b14;
  color: #eedfff;
}

.post-content pre {
  overflow-x: auto;
  padding: 12px;
  border-radius: 10px;
  background: #0e0a13;
}

.post-content pre code { padding: 0; }

.post-author {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid rgba(184, 154, 214, 0.12);
  color: var(--muted);
  font-size: 0.82rem;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel-soft);
}

.avatar-fallback {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--panel-soft);
}

.empty {
  padding: 42px 20px;
  border: 1px dashed rgba(184, 154, 214, 0.2);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 26px 10px 0;
  color: #81748d;
  font-size: 0.8rem;
}

@media (max-width: 620px) {
  .page-shell {
    width: min(100% - 18px, 980px);
    padding-top: 9px;
  }

  .hero {
    min-height: 165px;
    border-radius: 18px;
  }

  .hero-art {
    width: 150px;
    flex-basis: 150px;
  }

  .hero-copy { padding: 22px 14px 22px 0; }
  .tagline { max-width: 17rem; }
  .tabs { margin-top: 10px; }
  .post { padding: 17px 16px; border-radius: 15px; }
  .post-topline { align-items: flex-start; }
  .footer-dot { display: none; }
  footer { flex-direction: column; align-items: center; gap: 3px; }
}

@media (max-width: 410px) {
  .hero-art { width: 122px; flex-basis: 122px; }
  .hero-copy { padding-left: 0; }
  .hero .eyebrow { font-size: 0.64rem; }
  h1 { font-size: 2.12rem; }
  .tagline { font-size: 0.88rem; }
}

/* Discord ANSI code blocks */
.ansi-block {
  background: #1e1f22;
  color: #dbdee1;
}
.ansi-block code { color: inherit; }
.ansi-dim { opacity: 0.78; }
.ansi-bold { font-weight: 700; }
.ansi-underline { text-decoration: underline; }
.ansi-fg-black { color: #4f545c; }
.ansi-fg-red { color: #dc322f; }
.ansi-fg-green { color: #859900; }
.ansi-fg-yellow { color: #b58900; }
.ansi-fg-blue { color: #268bd2; }
.ansi-fg-magenta { color: #d33682; }
.ansi-fg-cyan { color: #2aa198; }
.ansi-fg-white { color: #f2f3f5; }
.ansi-fg-bright-black { color: #747f8d; }
.ansi-fg-bright-red { color: #ff6b6b; }
.ansi-fg-bright-green { color: #8fd694; }
.ansi-fg-bright-yellow { color: #ffd166; }
.ansi-fg-bright-blue { color: #6ea8fe; }
.ansi-fg-bright-magenta { color: #e599f7; }
.ansi-fg-bright-cyan { color: #66d9e8; }
.ansi-fg-bright-white { color: #ffffff; }
.ansi-bg-black, .ansi-bg-red, .ansi-bg-green, .ansi-bg-yellow,
.ansi-bg-blue, .ansi-bg-magenta, .ansi-bg-cyan, .ansi-bg-white {
  padding: 0.08em 0.22em;
  border-radius: 0.2em;
}
.ansi-bg-black { background: #4f545c; }
.ansi-bg-red { background: #dc322f; }
.ansi-bg-green { background: #859900; }
.ansi-bg-yellow { background: #b58900; color: #111; }
.ansi-bg-blue { background: #268bd2; }
.ansi-bg-magenta { background: #d33682; }
.ansi-bg-cyan { background: #2aa198; }
.ansi-bg-white { background: #f2f3f5; color: #111; }
