/*
Theme Name: Stargazer's World
Theme URI: https://stargazersworld.com
Author: Michael Wolf & Antigravity
Author URI: https://stargazersworld.com
Description: A modern, frosted-glass TTRPG WordPress theme designed for Stargazer's World. Features a full-width 5-item featured posts slider with preview images, a prominent wizard observatory emblem, an animated rotating ancient celestial star chart background, RPG system filters, 2-column affiliate widget support, dark/light mode, and custom TTRPG shortcodes.
Version: 2.3.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: stargazer-astral-codex
Tags: blog, entertainment, two-columns, custom-logo, custom-menu, featured-images, theme-options, threaded-comments, translation-ready
*/

/* ==========================================================================
   STARGAZER'S WORLD — MODERN FROSTED GLASS & STAR CHART THEME STYLESHEET
   ========================================================================== */

:root {
  /* DARK MODE (DEFAULT) */
  --bg-space: #060913;
  --bg-deep: #0a1020;
  --bg-surface: rgba(15, 23, 42, 0.82);
  --bg-surface-elevated: rgba(24, 35, 62, 0.9);
  --glass-bg: linear-gradient(155deg, rgba(16, 25, 48, 0.86) 0%, rgba(10, 16, 32, 0.92) 100%);
  --glass-bg-strong: rgba(11, 17, 32, 0.9);
  --glass-border: rgba(255, 255, 255, 0.13);
  --glass-highlight: rgba(255, 255, 255, 0.22);

  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-rune: rgba(245, 158, 11, 0.38);
  --border-glow: rgba(56, 189, 248, 0.35);

  --gold-primary: #f59e0b;
  --gold-glow: #fbbf24;
  --gold-dark: #b45309;
  --cyan-glow: #38bdf8;
  --cyan-accent: #0284c7;
  --crimson-crit: #ef4444;
  --green-luck: #10b981;

  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;
  --text-gold: #fde68a;
  --chart-ink: #fbbf24;

  --font-display: 'Cinzel', Georgia, serif;
  --font-decorative: 'Cinzel Decorative', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'Fira Code', monospace;

  --shadow-glass: 0 12px 36px -8px rgba(0, 0, 0, 0.65), inset 0 1px 0 0 rgba(255, 255, 255, 0.12);
  --shadow-glow: 0 0 28px rgba(245, 158, 11, 0.16);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* LIGHT MODE */
[data-theme="light"],
[data-theme="parchment"] {
  --bg-space: #f3efe6;
  --bg-deep: #e8e1d1;
  --bg-surface: rgba(255, 255, 255, 0.85);
  --bg-surface-elevated: rgba(255, 255, 255, 0.95);
  --glass-bg: linear-gradient(155deg, rgba(255, 253, 248, 0.9) 0%, rgba(247, 241, 228, 0.94) 100%);
  --glass-bg-strong: rgba(255, 252, 245, 0.92);
  --glass-border: rgba(146, 64, 14, 0.18);
  --glass-highlight: rgba(255, 255, 255, 0.8);

  --border-subtle: rgba(120, 80, 40, 0.14);
  --border-rune: rgba(180, 83, 9, 0.42);
  --border-glow: rgba(2, 132, 199, 0.3);

  --gold-primary: #b45309;
  --gold-glow: #d97706;
  --gold-dark: #78350f;
  --cyan-glow: #0284c7;
  --cyan-accent: #0369a1;

  --text-main: #1c1917;
  --text-muted: #44403c;
  --text-dim: #78716c;
  --text-gold: #92400e;
  --chart-ink: #92400e;

  --shadow-glass: 0 12px 32px -8px rgba(80, 50, 20, 0.14), inset 0 1px 0 0 rgba(255, 255, 255, 0.7);
  --shadow-glow: 0 0 20px rgba(180, 83, 9, 0.12);
}

/* RESET & BASE */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-space);
  color: var(--text-main);
  line-height: 1.7;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

/* ANCIENT STAR CHART VECTOR & GPU-COMPOSITED BACKGROUND */
.ancient-star-chart-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  color: var(--chart-ink);
  overflow: hidden;
  transform: translateZ(0);
  contain: strict;
}

.star-chart-svg {
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes svgSpinCW {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes svgSpinCCW {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

#starfield-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
  opacity: 0.9;
  transform: translateZ(0);
  contain: strict;
}

/* HIGH-PERFORMANCE FROSTED GLASS UTILITY */
.frosted-glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 2;
}

/* ==========================================================================
   HEADER & NAVIGATION (FROSTED GLASS)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass-bg-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-top-bar {
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.22);
}

.top-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.38rem;
  padding-bottom: 0.38rem;
}

.sparkle { color: var(--gold-primary); }

.top-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  color: var(--gold-glow);
  border-color: var(--gold-primary);
}

.top-discord-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
}

.top-discord-link:hover {
  color: var(--gold-glow);
}

.header-main-nav {
  padding: 0.8rem 0;
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

.site-logo-img,
.custom-logo {
  max-height: 54px;
  width: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.45));
  transition: transform var(--transition-fast);
}

.site-logo-img:hover,
.custom-logo:hover {
  transform: scale(1.02);
}

.brand-emblem-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--gold-primary);
  overflow: hidden;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.3);
  flex-shrink: 0;
}

.brand-emblem-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Desktop Menu & Frosted Dropdowns */
.nav-links {
  display: none;
  align-items: center;
}

@media (min-width: 992px) {
  .nav-links { display: flex; }
}

.nav-links ul,
.nav-links .menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.nav-links li {
  position: relative;
  list-style: none;
}

.nav-links li a {
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.2rem;
  white-space: nowrap;
}

.nav-links li a:hover,
.nav-links li.current-menu-item > a {
  color: var(--gold-glow);
}

.nav-links li.menu-item-has-children > a::after {
  content: ' ▾';
  font-size: 0.75rem;
  opacity: 0.7;
}

.nav-links ul.sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border-rune);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.75);
  padding: 0.5rem 0;
  list-style: none;
  display: none !important;
  flex-direction: column;
  gap: 0;
  z-index: 1000;
}

.nav-links li:hover > ul.sub-menu,
.nav-links li:focus-within > ul.sub-menu {
  display: flex !important;
}

.nav-links ul.sub-menu li {
  width: 100%;
}

.nav-links ul.sub-menu li a {
  display: block;
  padding: 0.6rem 1.25rem;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.nav-links ul.sub-menu li a:hover {
  background: rgba(245, 158, 11, 0.14);
  color: var(--gold-glow);
  padding-left: 1.5rem;
}

.nav-extra {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-trigger-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.search-trigger-btn:hover {
  border-color: var(--gold-primary);
  color: var(--gold-glow);
  transform: translateY(-1px);
}

.mobile-menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 20px;
}

@media (min-width: 992px) {
  .mobile-menu-toggle { display: none; }
}

.mobile-menu-toggle span {
  width: 100%;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
}

/* ==========================================================================
   MOBILE DRAWER & SEARCH MODAL
   ========================================================================== */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: -340px;
  width: 310px;
  height: 100vh;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 1px solid var(--border-rune);
  z-index: 9999;
  padding: 1.5rem;
  transition: right var(--transition-smooth);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
}

.mobile-drawer.open {
  right: 0;
}

.mobile-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1rem;
}

.mobile-drawer-title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold-glow);
}

.mobile-close-btn {
  font-size: 1.25rem;
  color: var(--text-muted);
}

.mobile-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow-y: auto;
}

.mobile-nav-list ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-left: 0;
}

.mobile-nav-list ul.sub-menu {
  padding-left: 1rem;
  border-left: 1px solid var(--border-subtle);
  margin-top: 0.25rem;
}

.mobile-nav-list a {
  display: block;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  color: var(--text-muted);
}

.mobile-nav-list a:hover {
  background: var(--bg-surface);
  color: var(--gold-glow);
}

.search-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 7, 15, 0.82);
  backdrop-filter: blur(10px);
  z-index: 10000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}

.search-modal-backdrop.open {
  display: flex;
}

.search-modal-card {
  width: 90%;
  max-width: 650px;
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
}

.search-input-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 1.12rem;
  color: var(--text-main);
}

.search-close-x {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
}

/* ==========================================================================
   HOMEPAGE HERO: LARGE WIZARD LOGO + FULL-WIDTH 5-ITEM FEATURED SLIDER
   ========================================================================== */
.astral-hero-section {
  padding: 1.5rem 0 1.25rem;
}

/* Large Wizard Logo Showcase on Main Page */
.main-wizard-hero-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 1.75rem;
  position: relative;
}

.wizard-hero-emblem-wrap {
  position: relative;
  width: 585px;
  max-width: 92vw;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.wizard-astrolabe-ring {
  position: absolute;
  width: 510px;
  height: 510px;
  max-width: 85vw;
  max-height: 85vw;
  border-radius: 50%;
  border: 1px dashed var(--border-rune);
  background: radial-gradient(circle, rgba(245, 158, 11, 0.2) 0%, rgba(56, 189, 248, 0.1) 45%, transparent 72%);
  box-shadow: 0 0 60px rgba(245, 158, 11, 0.15);
  animation: svgSpinCW 90s linear infinite;
  will-change: transform;
  z-index: -1;
  pointer-events: none;
}

.wizard-hero-logo-large,
.main-wizard-logo-large {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.65));
  transition: transform var(--transition-smooth);
}

.wizard-hero-emblem-wrap:hover .wizard-hero-logo-large,
.wizard-hero-emblem-wrap:hover .main-wizard-logo-large {
  transform: scale(1.025);
}

/* Full-Width 5-Item Featured Slider */
.featured-slider-wrapper.full-width-slider {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.featured-slider-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-primary), var(--cyan-glow), var(--gold-primary));
  z-index: 5;
}

.featured-slider-track {
  position: relative;
  flex: 1;
}

.featured-slide {
  display: none;
  grid-template-columns: 1fr;
  min-height: 370px;
  animation: slideFadeIn 0.45s ease-out;
}

@media (min-width: 860px) {
  .featured-slide {
    grid-template-columns: 48% 52%;
  }
}

.featured-slide.active {
  display: grid;
}

@keyframes slideFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-image-col {
  position: relative;
  min-height: 260px;
  max-height: 430px;
  overflow: hidden;
  background: var(--bg-deep);
}

.slide-image-link {
  display: block;
  width: 100%;
  height: 100%;
}

.slide-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}

.featured-slide:hover .slide-preview-img {
  transform: scale(1.04);
}

.slide-image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(6, 9, 19, 0.05), rgba(14, 21, 38, 0.45));
  pointer-events: none;
}

.slide-content-col {
  padding: 2.25rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.system-badge,
.card-system-tag {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--gold-primary);
  color: var(--gold-glow);
  background: rgba(245, 158, 11, 0.14);
  backdrop-filter: blur(8px);
}

.hero-read-time {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.hero-title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.26;
  margin-bottom: 0.95rem;
}

.hero-title a:hover {
  color: var(--gold-glow);
}

.hero-excerpt {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.68;
  margin-bottom: 1.5rem;
}

.hero-author-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

.author-info {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.post-date {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.hero-read-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  font-size: 0.88rem;
  color: #070a12;
  padding: 0.6rem 1.3rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--gold-glow), var(--gold-primary));
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
  transition: all var(--transition-fast);
}

.hero-read-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
  color: #000;
}

/* Slider Controls Bar */
.slider-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.75rem;
  background: rgba(0, 0, 0, 0.24);
  border-top: 1px solid var(--border-subtle);
}

.slider-nav-btn {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  transition: all var(--transition-fast);
}

.slider-nav-btn:hover {
  color: var(--gold-glow);
  border-color: var(--gold-primary);
}

.slider-dots {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.slider-dot {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.slider-dot:hover,
.slider-dot.active {
  background: var(--gold-primary);
  border-color: var(--gold-glow);
  color: #070a12;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

/* ==========================================================================
   RPG SYSTEMS CATEGORY BAR
   ========================================================================== */
.system-filter-strip {
  padding: 0.5rem 0 2rem;
}

.filter-container {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.72rem 1.15rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.filter-header-label {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold-glow);
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-scroll-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}

.filter-scroll-btn:hover {
  border-color: var(--gold-primary);
  color: var(--gold-glow);
  background: rgba(245, 158, 11, 0.14);
}

.filter-chips {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.filter-chips::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  padding: 0.38rem 0.9rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.filter-chip .chip-count {
  font-size: 0.72rem;
  opacity: 0.65;
}

.filter-chip:hover,
.filter-chip.active {
  background: rgba(245, 158, 11, 0.16);
  border-color: var(--gold-primary);
  color: var(--gold-glow);
}

/* ==========================================================================
   MAIN BLOG GRID & WIDER SIDEBAR LAYOUT
   ========================================================================== */
.main-content-wrap {
  padding-top: 2.5rem;
  padding-bottom: 5rem;
}

.system-filter-strip + .main-content-wrap {
  padding-top: 0.75rem;
}

.content-layout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.25rem;
}

@media (min-width: 1024px) {
  .content-layout-grid {
    grid-template-columns: 1fr 375px;
  }
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-main);
  white-space: nowrap;
}

.astral-gem {
  color: var(--gold-primary);
}

.ornament-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-rune), transparent);
}

.chronicles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

@media (min-width: 640px) {
  .chronicles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.chronicle-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  contain: layout paint;
  transition: transform var(--transition-smooth), border-color var(--transition-smooth), box-shadow var(--transition-smooth);
}

.chronicle-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-rune);
  box-shadow: var(--shadow-glass), 0 0 24px rgba(245, 158, 11, 0.14);
}

.card-thumbnail-wrap {
  height: 200px;
  position: relative;
  overflow: hidden;
  background: var(--bg-deep);
}

.card-thumbnail-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.chronicle-card:hover .card-thumbnail-wrap img {
  transform: scale(1.05);
}

.card-thumbnail-wrap .card-system-tag {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  background: rgba(6, 9, 19, 0.78);
  z-index: 2;
}

.card-body {
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-meta-line {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.7rem;
}

.card-title a:hover {
  color: var(--gold-glow);
}

.card-summary {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  flex: 1;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.82rem;
}

.card-author {
  color: var(--text-dim);
}

.card-link {
  color: var(--gold-glow);
  font-weight: 600;
}

.card-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   SIDEBAR & NATIVE WORDPRESS WIDGET STYLING (WIDER FOR 2-PER-ROW AFFILIATES)
   ========================================================================== */
.sidebar-col {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.sidebar-card,
.sidebar-col .widget {
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(175%);
  -webkit-backdrop-filter: blur(18px) saturate(175%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  box-shadow: var(--shadow-glass);
}

.sidebar-card-title,
.sidebar-col .widget h2,
.sidebar-col .widget h3,
.sidebar-col .widget .widget-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gold-glow);
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.6rem;
}

/* Style all native WordPress widget lists (Recent Posts, Authors, Categories, Archives) */
.sidebar-col .widget ul,
.sidebar-col .widget ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.sidebar-col .widget ul li,
.sidebar-col .widget ol li {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.sidebar-col .widget ul li:last-child,
.sidebar-col .widget ol li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.sidebar-col .widget ul li a:hover {
  color: var(--gold-glow);
}

/* Author Avatars in WordPress Authors Widget */
.sidebar-col .widget img.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--gold-primary);
  display: inline-block;
  flex-shrink: 0;
}

/* Two-Column Side-by-Side Grid for Friends & Affiliations (Custom HTML / Text Widgets) */
.sidebar-col .widget_custom_html .custom-html-widget > div,
.sidebar-col .widget_text .textwidget > div,
.sidebar-col .custom-html-widget,
.affiliate-grid-2col {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.sidebar-col .widget_custom_html a,
.sidebar-col .widget_text .textwidget a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: calc(50% - 8px);
  max-width: 145px;
  transition: transform var(--transition-fast);
}

.sidebar-col .widget_custom_html a:hover,
.sidebar-col .widget_text .textwidget a:hover {
  transform: translateY(-3px);
}

.sidebar-col .widget_custom_html img,
.sidebar-col .widget_text .textwidget img {
  display: inline-block;
  padding-right: 0 !important;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  width: 125px !important;
  height: 125px !important;
  object-fit: cover;
}

/* Custom Compact Notice Widgets (CC 4.0 License & DriveThruRPG Affiliate) */
.sgw-small-notice-widget {
  padding: 1.15rem 1.35rem;
}

.sgw-small-notice-widget .sidebar-card-title {
  font-size: 0.85rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.5rem;
}

.sgw-small-notice-body {
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--text-dim);
}

.sgw-cc-license-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
}

.cc-logo-badge-link {
  display: inline-flex;
  align-items: center;
  transition: transform var(--transition-fast), filter var(--transition-fast);
}

.cc-logo-badge-link:hover {
  transform: translateY(-1px);
  filter: drop-shadow(0 4px 10px rgba(245, 158, 11, 0.25));
}

.cc-license-badge-svg {
  display: block;
  height: 36px;
  width: auto;
}

.sgw-small-notice-lead {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  line-height: 1.45;
}

.sgw-small-notice-text {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0;
}

.sgw-license-link {
  color: var(--gold-glow);
  text-decoration: underline;
  text-decoration-color: rgba(245, 158, 11, 0.4);
  text-underline-offset: 2px;
}

.sgw-license-link:hover {
  color: var(--gold-primary);
  text-decoration-color: var(--gold-primary);
}

/* Author Card */
.author-widget {
  padding: 0 !important;
  overflow: hidden;
}

.author-banner-art {
  height: 76px;
  background: linear-gradient(135deg, #1e1136, #0d1a33);
  position: relative;
}

.stargazer-avatar {
  position: absolute;
  bottom: -28px;
  left: 1.4rem;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  border: 2px solid var(--gold-primary);
  background: var(--bg-deep);
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

.stargazer-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.author-card-body {
  padding: 2.2rem 1.4rem 1.4rem;
}

.author-card-name {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
}

.author-card-role {
  font-size: 0.75rem;
  color: var(--gold-primary);
  margin-bottom: 0.65rem;
  font-family: var(--font-mono);
}

.author-card-bio {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1rem;
}

.author-social-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.social-chip {
  font-size: 0.75rem;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
}

.social-chip:hover {
  border-color: var(--gold-primary);
  color: var(--gold-glow);
}

/* Discord Card */
.discord-guild-card {
  border-color: rgba(88, 101, 242, 0.4);
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.14), var(--glass-bg));
}

.discord-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.online-indicator {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

.online-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  color: #818cf8;
}

.discord-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.discord-join-btn {
  display: block;
  text-align: center;
  padding: 0.55rem;
  background: #5865f2;
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  transition: background var(--transition-fast);
}

.discord-join-btn:hover {
  background: #4752c4;
}

/* ==========================================================================
   SINGLE POST, COMMENTS & PAGINATION
   ========================================================================== */
.single-post-article {
  border-radius: var(--radius-lg);
  padding: 2.25rem;
}

.single-header {
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.5rem;
}

.single-title {
  font-family: var(--font-display);
  font-size: 2.1rem;
  line-height: 1.25;
  margin: 0.6rem 0 0.9rem;
}

.single-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.single-featured-image {
  margin-bottom: 2rem;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.entry-content {
  font-size: 1.04rem;
  line-height: 1.8;
}

.entry-content p { margin-bottom: 1.4rem; }

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  font-family: var(--font-display);
  margin: 2.2rem 0 0.9rem;
  color: var(--gold-glow);
}

.entry-content a {
  color: var(--gold-glow);
  text-decoration: underline;
}

.entry-content blockquote {
  border-left: 3px solid var(--gold-primary);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--bg-surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text-muted);
}

.single-footer {
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-subtle);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 2.25rem;
}

.post-tags:empty {
  display: none;
  margin-bottom: 0;
}

.tags-label {
  color: var(--gold-primary);
  font-weight: 700;
  margin-right: 0.35rem;
}

.post-tags a {
  display: inline-block;
  padding: 0.24rem 0.72rem;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}

.post-tags a:hover {
  border-color: var(--gold-primary);
  color: var(--gold-glow);
  background: rgba(245, 158, 11, 0.12);
}

.single-author-box {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.post-navigation {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.9rem;
}

.post-navigation a:hover {
  color: var(--gold-glow);
}

/* Pagination */
.archive-pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.archive-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.archive-pagination .page-numbers:hover,
.archive-pagination .page-numbers.current {
  background: var(--gold-primary);
  border-color: var(--gold-glow);
  color: #070a12;
}

/* Comments */
.comments-area {
  margin-top: 3rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 2rem;
}

.comments-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  color: var(--gold-glow);
}

.comment-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.comment-body {
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.comment-form textarea,
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-top: 0.35rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  font-family: var(--font-body);
}

/* 404 Card */
.error-404-card {
  max-width: 680px;
  margin: 4rem auto;
  text-align: center;
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
}

.error-404-icon {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 3.5rem;
  color: var(--gold-glow);
  margin-bottom: 0.5rem;
}

.error-404-title {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.error-404-desc {
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.error-404-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* ==========================================================================
   SITE FOOTER
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--glass-border);
  padding: 3.5rem 0 2rem;
  position: relative;
  z-index: 10;
}

.footer-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.25rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .footer-columns {
    grid-template-columns: 1.8fr 1fr 1fr 1.2fr;
  }
}

.footer-logo img {
  max-height: 48px;
  margin-bottom: 0.85rem;
  display: block;
}

.footer-tagline {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.85rem;
}

.footer-license {
  font-size: 0.76rem;
  color: var(--text-dim);
}

.footer-license a { color: var(--gold-primary); }

.footer-heading {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--gold-glow);
  margin-bottom: 0.9rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-left: 0;
  margin: 0;
}

.footer-links > li {
  position: relative;
  list-style: none;
}

.footer-links > li > a {
  font-weight: 600;
  color: var(--text-main);
  display: inline-block;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.footer-links a:hover {
  color: var(--gold-glow);
  transform: translateX(3px);
}

/* Tree View Indentation & Branch Connectors for Footer Sub-Categories / Sub-Menus */
.footer-links ul,
.footer-links ul.sub-menu,
.footer-links ul.children,
.sidebar-col .widget_categories ul.children,
.sidebar-col .widget_pages ul.children,
.sidebar-col .widget_nav_menu ul.sub-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  margin-top: 0.42rem;
  margin-bottom: 0.25rem;
  margin-left: 0.55rem;
  padding-left: 1.05rem;
  border-left: 1px solid rgba(245, 158, 11, 0.35);
}

.footer-links ul li,
.sidebar-col .widget_categories ul.children li,
.sidebar-col .widget_pages ul.children li,
.sidebar-col .widget_nav_menu ul.sub-menu li {
  position: relative;
  list-style: none;
  font-size: 0.81rem;
  line-height: 1.45;
  color: var(--text-muted);
  padding: 0.1rem 0 !important;
  border-bottom: none !important;
}

/* Horizontal Tree Branch Line (├─ / └─) */
.footer-links ul li::before,
.sidebar-col .widget_categories ul.children li::before,
.sidebar-col .widget_pages ul.children li::before,
.sidebar-col .widget_nav_menu ul.sub-menu li::before {
  content: "";
  position: absolute;
  left: -1.05rem;
  top: 0.72em;
  width: 0.72rem;
  height: 1px;
  background: rgba(245, 158, 11, 0.42);
}

/* Small Node Dot at Branch Tip */
.footer-links ul li::after,
.sidebar-col .widget_categories ul.children li::after,
.sidebar-col .widget_pages ul.children li::after,
.sidebar-col .widget_nav_menu ul.sub-menu li::after {
  content: "";
  position: absolute;
  left: -0.38rem;
  top: calc(0.72em - 1.5px);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold-primary);
  opacity: 0.75;
}

.footer-links ul li a {
  color: var(--text-muted);
  font-weight: 400;
  display: inline-block;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.footer-links ul li a:hover {
  color: var(--gold-glow);
  transform: translateX(3px);
}

.footer-bottom-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.back-to-top:hover {
  color: var(--gold-glow);
}

/* ==========================================================================
   3D POLYHEDRAL DICE ROLLER WIDGET & FULL-SCREEN THROWN 3D DICE OVERLAY
   ========================================================================== */
.widget_sgw_dice_roller {
  border-color: var(--border-rune);
}

.sgw-dice-widget-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sgw-dice-input-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.sgw-dice-input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.sgw-dice-input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.22);
}

.sgw-dice-roll-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1.05rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  color: #060913;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.32);
  transition: transform var(--transition-fast), filter var(--transition-fast);
  flex-shrink: 0;
}

[data-theme="light"] .sgw-dice-roll-btn {
  color: #fffdf8;
  box-shadow: 0 4px 12px rgba(180, 83, 9, 0.25);
}

.sgw-dice-roll-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.sgw-dice-roll-btn:active {
  transform: translateY(0);
}

.sgw-dice-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.sgw-preset-chip {
  padding: 0.22rem 0.58rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 600;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}

.sgw-preset-chip:hover {
  border-color: var(--gold-primary);
  color: var(--gold-glow);
  background: rgba(245, 158, 11, 0.14);
}

.sgw-dice-widget-result {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(6, 9, 19, 0.55);
  border: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-muted);
}

[data-theme="light"] .sgw-dice-widget-result {
  background: rgba(146, 64, 14, 0.06);
}

.sgw-dice-widget-result code {
  font-family: var(--font-mono);
  color: var(--gold-glow);
  font-size: 0.76rem;
}

.sgw-widget-roll-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.sgw-widget-roll-expr {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--cyan-glow);
  font-weight: 600;
}

.sgw-widget-roll-total {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--gold-glow);
}

.sgw-widget-roll-detail {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-dim);
  word-break: break-word;
}

/* Full-Viewport Thrown 3D Dice Overlay (Zero cost when hidden) */
.sgw-dice-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9998;
  display: none;
  pointer-events: none;
}

.sgw-dice-overlay.active {
  display: block;
}

.sgw-dice-overlay-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.sgw-dice-hud {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  opacity: 0;
  transition: opacity 0.28s ease, transform 0.28s ease;
  pointer-events: auto;
  z-index: 9999;
}

.sgw-dice-hud.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.sgw-dice-hud-card {
  min-width: 260px;
  max-width: 90vw;
  padding: 0.9rem 1.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--gold-primary);
  background: var(--glass-bg-strong);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.78), 0 0 28px rgba(245, 158, 11, 0.25);
  text-align: center;
}

[data-theme="light"] .sgw-dice-hud-card {
  box-shadow: 0 16px 38px rgba(80, 50, 20, 0.24), 0 0 24px rgba(180, 83, 9, 0.16);
}

.sgw-dice-hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.2rem;
}

.sgw-dice-hud-expr {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cyan-glow);
}

.sgw-dice-hud-close {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1;
  padding: 0.1rem 0.3rem;
}

.sgw-dice-hud-close:hover {
  color: var(--gold-glow);
}

.sgw-dice-hud-total {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--gold-glow);
  line-height: 1.2;
}

.sgw-dice-hud-breakdown {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}


/* ==========================================================================
   STARGAZER'S WORLD — TTRPG CUSTOM COMPONENTS & SHORTCODES
   ========================================================================== */

/* 1. ADVENTURE BOXED TEXT [read_aloud] */
.ttrpg-read-aloud {
  background: linear-gradient(135deg, rgba(24, 35, 60, 0.9), rgba(15, 22, 38, 0.95));
  border-left: 4px solid var(--gold-primary);
  border-top: 1px solid var(--border-rune);
  border-right: 1px solid var(--border-rune);
  border-bottom: 1px solid var(--border-rune);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.25);
  position: relative;
}

[data-theme="parchment"] .ttrpg-read-aloud {
  background: #fbf7ee;
  border-color: #d4c5a9;
  border-left-color: var(--gold-dark);
}

.read-aloud-banner {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold-glow);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.read-aloud-content p {
  font-style: italic;
  font-size: 0.98rem;
  line-height: 1.75;
  color: var(--text-main);
}

.gothic-dropcap {
  font-family: var(--font-decorative);
  font-size: 2.8rem;
  float: left;
  line-height: 0.8;
  padding-right: 0.6rem;
  padding-top: 0.2rem;
  color: var(--gold-glow);
}

/* 2. GM SECRET NOTE [gm_note] */
.ttrpg-gm-note {
  background: rgba(56, 189, 248, 0.06);
  border: 1px dashed var(--cyan-glow);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1.75rem 0;
}

.gm-note-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.gm-note-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--cyan-glow);
}

.gm-note-body p {
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* 3. TTRPG STAT BLOCK [statblock] */
.ttrpg-statblock {
  background: var(--bg-deep);
  border: 2px solid var(--border-rune);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 2rem 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

[data-theme="parchment"] .ttrpg-statblock {
  background: #fbf7ee;
  border-color: #8c2e0b;
}

.statblock-name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--crimson-crit);
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}

.statblock-type {
  font-style: italic;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.statblock-divider {
  height: 2px;
  background: linear-gradient(90deg, var(--gold-primary), transparent);
  margin: 0.8rem 0;
}

.statblock-top-stats {
  font-size: 0.88rem;
  line-height: 1.6;
}

.statblock-abilities {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
  text-align: center;
  background: var(--bg-surface);
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-sm);
  margin: 0.5rem 0;
}

.ability-cell {
  display: flex;
  flex-direction: column;
}

.ab-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--gold-primary);
}

.ab-val {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-main);
  font-weight: 600;
}

.statblock-properties {
  font-size: 0.85rem;
  line-height: 1.6;
}

.statblock-section-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--crimson-crit);
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.3rem;
  margin: 1rem 0 0.5rem;
}

.statblock-trait {
  font-size: 0.88rem;
  margin-bottom: 0.6rem;
  line-height: 1.6;
}

/* 4. TTRPG REVIEW SCORECARD [ttrpg_rating] */
.ttrpg-review-card {
  background: linear-gradient(135deg, var(--bg-deep), var(--bg-surface-elevated));
  border: 1px solid var(--border-rune);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin: 2rem 0;
}

.review-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
}

.review-system-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gold-primary);
  letter-spacing: 0.08em;
}

.review-heading {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0.2rem 0;
}

.review-author-line {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.review-score-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: radial-gradient(circle, rgba(245, 158, 11, 0.2), transparent);
  border: 2px solid var(--gold-primary);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

.score-d20 {
  font-size: 0.8rem;
  color: var(--gold-glow);
}

.score-large {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--gold-glow);
}

.score-grade {
  font-family: var(--font-display);
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--text-muted);
}

.review-pros-cons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 600px) {
  .review-pros-cons {
    grid-template-columns: 1fr 1fr;
  }
}

.pros-column h5, .cons-column h5 {
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

.pros-column h5 { color: #34d399; }
.cons-column h5 { color: #f87171; }

.pros-column ul, .cons-column ul {
  list-style: none;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.pros-column li::before {
  content: '✓ ';
  color: #34d399;
  font-weight: bold;
}

.cons-column li::before {
  content: '✕ ';
  color: #f87171;
  font-weight: bold;
}

.review-summary-quote {
  font-style: italic;
  font-size: 0.95rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
  color: var(--text-muted);
  text-align: center;
}
