:root {
  --bg-color: #1a1a1d;
  --surface: #2b2b30;
  --surface-hover: #3f3f46;
  --border: #3f3f46;
  --text-main: #e4e4e7;
  --text-muted: #a1a1aa;
  --gold: #d4af37;
  --gold-dim: #b8972b;
  --danger: #ef4444;
  --safe: #22c55e;
  --radius: 8px;
  --font-sans: system-ui, -apple-system, sans-serif;
  --font-serif: Georgia, 'Times New Roman', serif;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: normal;
}

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

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header & Footer */
.site-header {
  background-color: var(--surface);
  border-bottom: 2px solid var(--gold);
  padding: 1rem 0;
  margin-bottom: 2rem;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-header h1 span {
  color: var(--text-muted);
  font-size: 1rem;
}

.site-header nav a, .site-footer nav a {
  margin-left: 1rem;
  font-weight: bold;
}

.site-footer {
  margin-top: 3rem;
  padding: 2rem 0;
  background-color: var(--surface);
  text-align: center;
  border-top: 1px solid var(--border);
}

.site-footer p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Typography */
.hero-section, .article-section {
  margin-bottom: 2.5rem;
}

.hero-section h2, .article-section h2 {
  color: var(--gold);
  margin-bottom: 1rem;
  font-size: 2rem;
}

.article-section h3 {
  color: var(--text-main);
  margin: 1.5rem 0 0.5rem;
}

.article-section p, .article-section ul {
  margin-bottom: 1rem;
  color: #d4d4d8;
}

.article-section li {
  margin-left: 1.5rem;
  margin-bottom: 0.5rem;
}

/* Tool */
.tool-section {
  background-color: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 3rem;
  border: 1px solid var(--border);
}

.tool-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

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

.control-panel h3 {
  margin-bottom: 1rem;
  color: var(--gold);
}

input[type="text"], input[type="number"] {
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: 4px;
}

.btn {
  display: inline-block;
  width: 100%;
  padding: 0.6rem;
  background-color: var(--gold);
  color: var(--bg-color);
  border: none;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

.btn:hover {
  background-color: var(--gold-dim);
}

.app-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
}

@media(max-width: 768px){
  .app-layout {
    grid-template-columns: 1fr;
  }
}

.loot-pool {
  background: var(--bg-color);
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  min-height: 250px;
}

.hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.drop-zone {
  min-height: 200px;
}

.drop-zone.drag-over {
  background-color: rgba(212, 175, 55, 0.1);
  border-radius: 4px;
}

/* Items */
.loot-item {
  background: var(--surface-hover);
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  border-radius: 4px;
  cursor: grab;
  display: flex;
  justify-content: space-between;
  border: 1px solid var(--border);
}

.loot-item:active {
  cursor: grabbing;
}

.item-weight {
  color: var(--gold);
  font-family: monospace;
}

/* Roster */
.party-roster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.character-card {
  background: var(--bg-color);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.character-card h4 {
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.weight-bar-bg {
  height: 8px;
  background: var(--surface-hover);
  border-radius: 4px;
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.weight-bar-fill {
  height: 100%;
  background: var(--safe);
  transition: width 0.3s, background 0.3s;
}

.weight-bar-fill.danger {
  background: var(--danger);
}

.weight-text {
  font-size: 0.85rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.char-inventory {
  flex-grow: 1;
  min-height: 100px;
  border: 1px dashed transparent;
}

.char-inventory.drag-over {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.05);
}



/* 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;
}
