:root {
  --bg: #000000;
  --bg-panel: #111827;
  --accent: #ef4444;
  --accent-soft: rgba(239, 68, 68, 0.25);
  --text: #f9fafb;
  --muted: #9ca3af;
  --border: #27272f;
  --font-title: 'Cormorant', serif;
  --font-body: 'Inter', sans-serif;
}

@import url('https://fonts.googleapis.com/css2?family=Cormorant:wght@400;600;700&family=Inter:wght@400;500;600&display=swap');

/* Basic reset */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #1f2933 0, #020617 60%);
  color: var(--text);
  font-family: var(--font-body);
  position: relative;
  overflow-x: hidden;
}

/* Optional subtle noise + vignette */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.12'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.5) 100%);
  z-index: 1;
}

/* Header / Nav */

.cc-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.cc-header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.cc-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cc-brand-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.cc-logo {
  width: 90px;      /* tweak size here */
  height: 90px;
  object-fit: contain;
  flex-shrink: 0;
}

.cc-brand-text {
  display: flex;
  flex-direction: column;
}

.cc-site-title {
  margin: 0;
  font-family: var(--font-title);
  font-size: 1.7rem;
  letter-spacing: 0.04em;
  color: var(--accent);
}

/* Title font for major headers */
.cc-section-title,
.cc-hero-title,
.cc-site-title {
  font-family: var(--font-title);
  font-size: 2rem;
  letter-spacing: 0.02em;
  font-weight: 600;
}

.cc-section-title {
  font-family: var(--font-title);
  font-size: 2rem;
  letter-spacing: 0.02em;
  font-weight: 600;
  text-align: center;
  position: relative;
  padding-bottom: 0.75rem;
  margin-bottom: 2.25rem;
}

.cc-section-title::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 80px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent),
    transparent
  );
  opacity: 0.9;
}

.cc-site-tagline {
  margin: 0.3rem 0 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.cc-nav {
  display: flex;
  gap: 1.8rem;
  font-size: 0.85rem;
}

.cc-nav-link {
  position: relative;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
  color: var(--accent);
  padding-bottom: 2px;
}

.cc-nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.18s ease-out;
}

.cc-nav-link:hover::after {
  transform: scaleX(1);
}

/* Hero */

.cc-hero {
  padding: 2.5rem 1.5rem 1.5rem;
  display: flex;
  justify-content: center;
}

.cc-hero-inner {
  max-width: 1120px;
  text-align: center;
  position: relative;
  z-index: 5;
}

.cc-hero-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-title);
  font-size: 2.6rem;
  letter-spacing: 0.03em;
}

.cc-hero-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

/* Main layout */

.cc-main {
  position: relative;
  z-index: 5;
  max-width: 1120px;
  margin: 0 auto;
  padding: 3rem 1.5rem 3rem; /* equal space top & bottom */
}

.cc-main::before {
  content: '';
  position: absolute;
  top: 0;
  left: 1.5rem;
  right: 1.5rem;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent),
    transparent
  );
  opacity: 0.8;
}

.cc-section {
  margin-bottom: 3.5rem;
}

.cc-section-title {
  margin: 0 0 2rem;
  text-align: center;
  font-family: var(--font-title);
  font-size: 1.8rem;
  letter-spacing: 0.03em;
}

/* Icon grid */

.cc-icon-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2rem;
}

.cc-icon-card {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.cc-icon-inner {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 999px;
  border: 1px solid rgba(63, 63, 70, 0.9);
  background: radial-gradient(circle at top, #18181b 0, #020617 90%);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.22s ease-out,
    border-color 0.22s ease-out,
    box-shadow 0.22s ease-out;
}

.cc-icon-svg {
  width: 28px;
  height: 28px;
  color: #9ca3af;          /* base stroke (uses currentColor) */
  stroke-width: 2;
}

.cc-icon-card:hover .cc-icon-inner {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9);
}

.cc-icon-card:hover .cc-icon-svg {
  color: var(--accent);
}

.cc-icon-card::after {
  content: attr(data-title) "\A" attr(data-desc);
  white-space: pre-line;
  position: absolute;
  bottom: calc(100% + 0.85rem);  /* more separation above the circle */
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: 15rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.6rem;
  font-size: 0.75rem;
  line-height: 1.4;
  background: rgba(7, 7, 10, 0.98);
  border: 1px solid rgba(239, 68, 68, 0.65);
  color: var(--muted);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.9);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.18s ease-out,
    transform 0.18s ease-out;
  z-index: 10;
}

.cc-icon-card:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.cc-icon-label {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1024px) {
  .cc-icon-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .cc-icon-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .cc-icon-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Icon cards */

.cc-icon-card {
  position: relative;
  display: flex;
  justify-content: center;
  text-decoration: none;
  color: inherit;
}

/* glow field behind */
.cc-icon-card::before {
  content: '';
  position: absolute;
  inset: -22px;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.13) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.25s ease-out;
}

.cc-icon-inner {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 999px;
  border: 1px solid rgba(63, 63, 70, 0.9);
  background: radial-gradient(circle at top, #18181b 0, #020617 90%);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  text-align: center;
  transition:
    transform 0.22s ease-out,
    border-color 0.22s ease-out,
    box-shadow 0.22s ease-out;
}

.cc-icon-label {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.cc-icon-card:hover::before {
  opacity: 1;
}

.cc-icon-card:hover .cc-icon-inner {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
}

.cc-icon-card:hover .cc-icon-label {
  color: var(--accent);
}

/* Tooltip from data attributes */

.cc-icon-card::after {
  content: attr(data-title) "\A" attr(data-desc);
  white-space: pre-line;
  position: absolute;
  bottom: 100%;              
  margin-bottom: 1.5rem;    
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: 15rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.6rem;
  font-size: 0.75rem;
  line-height: 1.4;
  background: rgba(7, 7, 10, 0.98);
  border: 1px solid rgba(239, 68, 68, 0.65);
  color: var(--muted);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.9);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.18s ease-out,
    transform 0.18s ease-out;
  z-index: 10;
}

.cc-icon-card:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Section divider */

.cc-section-divider {
  border: 0;
  height: 1px;
  margin: 3.5rem 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(63, 63, 70, 0.6),
    transparent
  );
}

/* AdSense placeholder */

.cc-adsense {
  max-width: 1120px;
  margin: 0 auto 2.5rem;
  padding: 0 1.5rem;
  position: relative;
  z-index: 5;
}

.cc-adsense-slot {
  height: 5rem;
  border-radius: 0.7rem;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cc-adsense-placeholder {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* Footer */

.cc-footer {
  border-top: 1px solid var(--border);
  background: #000000;
  position: relative;
  z-index: 5;
}

.cc-footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 1.75rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted);
}

.cc-footer-left {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}

.cc-footer-right {
  display: flex;
  gap: 1.25rem;
}

.cc-footer-link {
  text-decoration: none;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
  font-size: 0.7rem;
}

.cc-footer-link:hover {
  color: #f97373;
}

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

.cc-footer a:hover {
  color: #f97373;
}

/* Responsive tweaks */

@media (max-width: 640px) {
  .cc-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .cc-nav {
    gap: 1.2rem;
  }

  .cc-hero-title {
    font-size: 2.1rem;
  }
}

/* Generator page layout */

.cc-generator-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.cc-generator-main {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cc-generator-icon {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 999px;
  border: 1px solid rgba(63, 63, 70, 0.9);
  background: radial-gradient(circle at top, #18181b 0, #020617 90%);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cc-generator-icon-svg {
  width: 26px;
  height: 26px;
  color: var(--accent);
  stroke-width: 2;
}

.cc-page-title {
  margin: 0 0 0.25rem;
  font-family: var(--font-title);
  font-size: 2.1rem;
  letter-spacing: 0.03em;
}

.cc-page-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 38rem;
}

/* Button & actions */

.cc-generator-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Minimal, on-brand button */
.cc-button-primary {
  padding: 0.85rem 1.4rem;
  border-radius: 0.7rem;
  border: 1px solid var(--accent);
  background: rgba(15, 23, 42, 0.95);
  color: var(--accent);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.15s ease-out,
    color 0.15s ease-out,
    transform 0.1s ease-out,
    box-shadow 0.15s ease-out;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.8);
}

.cc-button-primary:hover {
  background: var(--accent);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.95);
}

.cc-button-primary:active {
  transform: translateY(0);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.85);
}

.cc-button-primary.cc-button-loading {
  opacity: 0.85;
  cursor: default;
}

/* Results panel */

.cc-generator-panel {
  border-radius: 0.8rem;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.9);
  padding: 1.25rem;
}

.cc-results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));  /* <-- 2 columns */
  gap: 0.75rem;
}

.cc-empty-state {
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
  padding: 2.5rem 1rem;
}

.cc-result-card {
  background: #020617;
  border-radius: 0.6rem;
  border: 1px solid rgba(39, 39, 47, 0.9);
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  color: var(--text);
}

.cc-result-card:hover {
  background: rgba(63, 63, 70, 0.98);
  transform: translateY(-2px);
}

@media (max-width: 640px) {
  .cc-generator-header {
    flex-direction: column;
    align-items: stretch;
  }

  .cc-generator-actions {
    justify-content: flex-start;
  }

  .cc-results-grid {
    grid-template-columns: 1fr;
  }
}

/* SEO / crawlable copy blocks (Quest Hook, Tavern, Places pages) */

.cc-page-seo {
  margin: 0 0 1rem 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.cc-related {
  margin: 0 0 1rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.cc-related a:hover {
  text-decoration: underline;
}

.cc-seo-examples {
  margin: 0 0 1.25rem 0;
  padding-left: 1.1rem;
  color: var(--text);
}

.cc-seo-examples li {
  margin: 0.35rem 0;
  color: var(--muted);
}

.cc-color-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cc-color-swatch {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  border-radius: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

/* ===========================
   SHEET UI (NPC / Character)
   Reusable: .cc-sheet + .cc-sheet-grid rows with per-field rerolls
   =========================== */

/* Card wrapper */
.cc-sheet {
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  box-shadow:
    0 10px 30px rgba(0,0,0,0.25),
    inset 0 1px 0 rgba(255,255,255,0.05);
  overflow: hidden;
}

/* Header */
.cc-sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.cc-sheet-title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
  letter-spacing: 0.2px;
}

.cc-sheet-subtitle {
  margin: 6px 0 0;
  font-size: 0.92rem;
  opacity: 0.75;
}

.cc-sheet-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Grid */
.cc-sheet-grid {
  display: grid;
  grid-template-columns: 1fr;
}

/* Each row */
.cc-sheet-row {
  display: grid;
  grid-template-columns: 160px 1fr 44px;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.cc-sheet-row:last-child {
  border-bottom: none;
}

/* Label column */
.cc-sheet-label {
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.2px;
  opacity: 0.9;
}

/* Value column */
.cc-sheet-value {
  font-size: 0.98rem;
  line-height: 1.35;
  opacity: 0.92;
  word-break: break-word;
}

/* Reroll button */
.cc-sheet-reroll {
  width: 40px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  background: rgba(255,255,255,0.06);

  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease, opacity 120ms ease;
}

.cc-sheet-reroll:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.22);
  transform: translateY(-1px);
}

.cc-sheet-reroll:active {
  transform: translateY(0px);
}

.cc-sheet-reroll:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Icon size */
.cc-sheet-reroll svg {
  width: 18px;
  height: 18px;
}

/* Optional: subtle alternating rows for readability */
.cc-sheet-row:nth-child(odd) {
  background: rgba(255,255,255,0.015);
}

/* Mobile */
@media (max-width: 720px) {
  .cc-sheet-header {
    flex-direction: column;
    align-items: stretch;
  }

  .cc-sheet-actions {
    justify-content: flex-start;
  }

  .cc-sheet-row {
    grid-template-columns: 1fr 44px;
    grid-template-areas:
      "label reroll"
      "value reroll";
    align-items: start;
  }

  .cc-sheet-label {
    grid-area: label;
  }

  .cc-sheet-value {
    grid-area: value;
    opacity: 0.9;
  }

  .cc-sheet-reroll {
    grid-area: reroll;
    margin-top: 2px;
  }
}

.cc-sheet-title,
.cc-sheet-label {
  color: var(--accent);
}

.cc-reroll-icon {
  color: var(--accent);
  width: 20px;
  height: 20px;
  display: block;
}

.cc-sheet-reroll {
  color: var(--accent); /* stroke uses currentColor */
}

.cc-dice-console {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  padding: 1.5rem;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
  min-height: 300px;
  max-height: 500px;
  overflow-y: auto;
}

.cc-dice-entry {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cc-dice-entry:last-child {
  border-bottom: none;
}

.cc-dice-expression {
  color: var(--accent);
  font-weight: 600;
}

.cc-dice-result {
  color: #10b981;
  font-weight: 700;
  font-size: 1.1rem;
}

.cc-dice-details {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.cc-input {
  padding: 0.85rem 1.2rem;
  border-radius: 0.7rem;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.95);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s ease;
  min-width: 200px;
}

.cc-input:focus {
  border-color: var(--accent);
}

.cc-input::placeholder {
  color: var(--muted);
}

.cc-inline-input {
  width: auto;
  min-width: 50%;
  max-width: calc(100% - 60px);
  font: inherit;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.15); /* very subtle darkening */
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.cc-inline-input:focus {
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.25); /* slightly darker on focus */
}

textarea.cc-inline-input {
  resize: vertical;
  min-height: 60px;
  width: 100%;
}

/* Locked row - red background, WHITE icon */
.cc-sheet-row.cc-locked .cc-sheet-lock-btn {
  background: #ef4444;
  border-color: #ef4444;
}

.cc-sheet-row.cc-locked .cc-sheet-lock-btn svg {
  color: white;  /* white icon so you can see it on red background */
}

/* Optional: dim the value slightly to show it's "set" */
.cc-sheet-row.cc-locked .cc-sheet-value {
  opacity: 0.85;
}

/* Make reroll button look disabled when locked */
.cc-sheet-row.cc-locked .cc-sheet-reroll-btn {
  opacity: 0.3;
  cursor: not-allowed;
}