/* RoomStuffer — Dungeon Dressing Randomizer */
:root {
  --bg: #1a1614;
  --bg-surface: #241f1c;
  --bg-card: #2d2622;
  --bg-input: #332c27;
  --border: #4a3f37;
  --border-light: #5c4e44;
  --text: #e8ddd4;
  --text-muted: #a89888;
  --text-dim: #7a6c60;
  --accent: #c8956c;
  --accent-hover: #dba57a;
  --accent-dim: #8a6544;
  --danger: #c86c6c;
  --danger-dim: #8a4444;
  --success: #7cb87c;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 2px 12px rgba(0,0,0,0.4);
  --font: 'Georgia', 'Times New Roman', serif;
  --font-mono: 'Courier New', Courier, monospace;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { color: var(--accent-hover); text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

.skip-link {
  position: absolute; top: -100%; left: 1rem;
  background: var(--accent); color: var(--bg);
  padding: 0.5rem 1rem; border-radius: var(--radius-sm);
  z-index: 100; font-weight: 700;
}
.skip-link:focus { top: 1rem; }

/* Header */
.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  position: sticky; top: 0; z-index: 50;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.logo { display: flex; align-items: center; gap: 0.5rem; color: var(--text); }
.logo:hover, .logo:focus { color: var(--accent); text-decoration: none; }
.logo-icon { width: 28px; height: 28px; color: var(--accent); }
.logo-text { font-size: 1.25rem; font-weight: 700; letter-spacing: 0.5px; }
.logo-text-sm { font-size: 1rem; font-weight: 700; color: var(--text); }

.main-nav ul { display: flex; list-style: none; gap: 1.5rem; }
.main-nav a { color: var(--text-muted); font-size: 0.95rem; }
.main-nav a:hover, .main-nav a:focus,
.main-nav a[aria-current="page"] { color: var(--accent); text-decoration: none; }

/* Hero */
.hero { padding: 4rem 0 3rem; text-align: center; }
.hero h1 { font-size: 2.5rem; line-height: 1.2; margin-bottom: 1rem; color: var(--text); }
.hero-sub { font-size: 1.15rem; color: var(--text-muted); max-width: 600px; margin: 0 auto 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.6rem 1.25rem; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.95rem; font-weight: 600;
  cursor: pointer; border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-decoration: none; line-height: 1.3;
}
.btn:hover, .btn:focus { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover, .btn-primary:focus { background: var(--accent-hover); color: var(--bg); }
.btn-secondary { background: var(--bg-card); color: var(--text); border-color: var(--border); }
.btn-secondary:hover, .btn-secondary:focus { background: var(--bg-input); border-color: var(--border-light); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover, .btn-ghost:focus { color: var(--text); border-color: var(--border-light); }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: var(--danger-dim); }
.btn-danger-ghost:hover, .btn-danger-ghost:focus { color: var(--danger); border-color: var(--danger); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.85rem; }
.btn-lg { padding: 0.8rem 1.75rem; font-size: 1.05rem; }
.btn-preset { background: var(--bg-input); color: var(--text-muted); border-color: var(--border); }
.btn-preset:hover, .btn-preset:focus { color: var(--text); border-color: var(--accent-dim); }

/* Sections */
.section-title { font-size: 1.75rem; margin-bottom: 0.5rem; }
.section-sub { color: var(--text-muted); margin-bottom: 1.5rem; }

.generator-section { padding: 2rem 0 3rem; }
.info-section { padding: 3rem 0; background: var(--bg-surface); border-top: 1px solid var(--border); }
.saved-section { padding: 3rem 0; }
.custom-section { padding: 3rem 0; background: var(--bg-surface); border-top: 1px solid var(--border); }
.tips-section { padding: 3rem 0; border-top: 1px solid var(--border); }

/* Generator Layout */
.gen-layout { display: grid; grid-template-columns: 300px 1fr; gap: 2rem; margin-top: 1.5rem; }

.gen-controls { display: flex; flex-direction: column; gap: 1.25rem; }
.control-group { display: flex; flex-direction: column; gap: 0.35rem; }
.control-label { font-size: 0.85rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.control-select, .control-textarea {
  background: var(--bg-input); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem; font-family: var(--font); font-size: 0.95rem;
  width: 100%; appearance: none;
}
.control-select:focus, .control-textarea:focus {
  outline: 2px solid var(--accent-dim); outline-offset: 0; border-color: var(--accent-dim);
}
.control-textarea { resize: vertical; min-height: 60px; }

.preset-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.gen-actions { display: flex; gap: 0.75rem; margin-top: 0.5rem; }

/* Output */
.gen-output { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.output-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem; background: var(--bg-input);
  border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 0.5rem;
}
.output-header h3 { font-size: 1rem; color: var(--text-muted); }
.output-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.output-area { padding: 1rem; min-height: 200px; }

.empty-state { text-align: center; padding: 2rem; color: var(--text-dim); }
.empty-state p { margin-top: 0.75rem; }
.empty-icon { width: 48px; height: 48px; color: var(--text-dim); }
.empty-state-sm { padding: 1rem; }

/* Room Cards */
.room-card {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1rem; margin-bottom: 1rem;
}
.room-card:last-child { margin-bottom: 0; }
.room-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.75rem; padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.room-card-title { font-weight: 700; font-size: 1.05rem; }
.room-card-meta { font-size: 0.8rem; color: var(--text-dim); }
.room-details { display: flex; flex-direction: column; gap: 0.4rem; }
.room-detail {
  display: flex; align-items: flex-start; gap: 0.5rem;
  font-size: 0.92rem;
}
.room-detail-label {
  font-weight: 700; color: var(--accent); min-width: 60px;
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.3px;
  padding-top: 1px;
}
.room-detail-text { flex: 1; }
.room-detail-lock {
  background: none; border: none; color: var(--text-dim);
  cursor: pointer; padding: 0.15rem; font-size: 1rem; line-height: 1;
  flex-shrink: 0;
}
.room-detail-lock:hover, .room-detail-lock:focus { color: var(--accent); }
.room-detail.locked .room-detail-lock { color: var(--accent); }
.room-quirk {
  margin-top: 0.5rem; padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
  font-style: italic; color: var(--text-muted); font-size: 0.88rem;
}

/* Info Grid */
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin: 1.5rem 0; }
.info-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
}
.info-num {
  width: 32px; height: 32px; background: var(--accent); color: var(--bg);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; margin-bottom: 0.75rem;
}
.info-card h3 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.info-card p { color: var(--text-muted); font-size: 0.92rem; }

.scenario-block, .assumptions-block {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; margin-top: 1.5rem;
}
.scenario-block h3, .assumptions-block h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.scenario-block p, .assumptions-block ul { color: var(--text-muted); font-size: 0.92rem; }
.assumptions-block ul { padding-left: 1.25rem; }
.assumptions-block li { margin-bottom: 0.35rem; }

/* Saved Sets */
.saved-list { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }
.saved-set-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}
.saved-set-info { flex: 1; }
.saved-set-name { font-weight: 700; margin-bottom: 0.2rem; }
.saved-set-meta { font-size: 0.8rem; color: var(--text-dim); }
.saved-set-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

/* Custom Entries */
.custom-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: 1.5rem; }
.custom-col { display: flex; flex-direction: column; gap: 0.35rem; }
.custom-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }

/* Tips */
.tips-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: 1.5rem; }
.tip-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
}
.tip-card h3 { font-size: 1rem; margin-bottom: 0.4rem; color: var(--accent); }
.tip-card p { color: var(--text-muted); font-size: 0.9rem; }

/* Footer */
.site-footer {
  background: var(--bg-surface); border-top: 1px solid var(--border);
  padding: 2.5rem 0 1.5rem; margin-top: auto;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; margin-bottom: 1.5rem; }
.footer-brand p { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.5rem; }
.footer-links h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 0.5rem; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 0.3rem; }
.footer-links a { color: var(--text-muted); font-size: 0.9rem; }
.footer-links a:hover, .footer-links a:focus { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 1rem; text-align: center; }
.footer-bottom p { color: var(--text-dim); font-size: 0.85rem; }
.footer-bottom a { color: var(--text-muted); }

/* Toast */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.75rem 1.25rem; font-size: 0.9rem;
  box-shadow: var(--shadow); z-index: 100;
  animation: toastIn 0.2s ease-out;
}
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Print */
@media print {
  .site-header, .site-footer, .gen-controls, .output-actions,
  .hero, .info-section, .saved-section, .custom-section, .tips-section,
  .skip-link, .toast { display: none !important; }
  body { background: #fff; color: #000; }
  .gen-output { border: none; }
  .room-card { break-inside: avoid; border: 1px solid #999; margin-bottom: 0.75rem; }
  .room-detail-lock { display: none; }
  .container { max-width: 100%; padding: 0; }
  .gen-layout { display: block; }
  .output-area { padding: 0; }
}

/* Responsive */
@media (max-width: 900px) {
  .gen-layout { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .custom-grid { grid-template-columns: 1fr 1fr; }
  .tips-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .hero h1 { font-size: 1.75rem; }
  .hero-sub { font-size: 1rem; }
  .header-inner { flex-direction: column; gap: 0.5rem; }
  .main-nav ul { gap: 1rem; flex-wrap: wrap; justify-content: center; }
  .output-header { flex-direction: column; align-items: flex-start; }
  .custom-grid { grid-template-columns: 1fr; }
  .tips-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .preset-buttons { flex-direction: column; }
  .gen-actions { flex-direction: column; }
  .saved-set-card { flex-direction: column; align-items: flex-start; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
