body { font-family: monospace; background: linear-gradient(135deg, #0a0a12 0%, #141420 50%, #0c0c14 100%); color:#eee; margin:0; height: 100vh; overflow: hidden; display: flex; flex-direction: column; }

/* Time-of-day corner glow */
.tod-glow {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  height: 300px;
  pointer-events: none;
  z-index: 9999;
  background: radial-gradient(circle at top right, var(--tod-color, #6677aa) 0%, transparent 70%);
  opacity: 0.125;
  transition: background 2s ease;
}
header { padding:12px 14px; border-bottom:1px solid #222; background:transparent; z-index:10; flex-shrink: 0; }
.row { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
input, button, select { background:rgba(26,26,26,0.6); color:#eee; border:1px solid #333; padding:6px 8px; border-radius:6px; }
button, select { cursor:pointer; }
button:hover, select:hover { border-color:#555; }
button.filter-active { background:#444; border-color:#666; }
select { appearance:none; -webkit-appearance:none; padding-right:24px; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M2 4l4 4 4-4'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 8px center; }
.pill { display:inline-block; padding:2px 8px; border:1px solid #333; border-radius:999px; opacity:0.9; }
#wrap { display:grid; grid-template-columns: 360px 1fr; grid-template-rows: 1fr; gap:0; flex: 1; min-height: 0; overflow: hidden; }
#thoughts { padding:10px 14px; padding-bottom:10px; height: 100%; overflow-y:auto; border-left:1px solid #222; box-sizing: border-box; }
#side { padding:10px 14px; padding-bottom:10px; height: 100%; overflow-y:auto; box-sizing: border-box; }
.muted { opacity:0.7; }
.timestamp { opacity:0.7; font-style:normal !important; font-size:11px; color:#888; }
.line { padding:2px 0; transition: background 0.2s ease; }
.line:hover { background: rgba(255,255,255,0.03); }
.line b { color:#9ad; }
.card { border:1px solid #222; border-radius:10px; padding:10px; margin-bottom:10px; background:#0f0f0f; }
.bar { height:10px; background:#222; border-radius:999px; overflow:hidden; margin-top:6px; }
.bar > div { height:10px; background:#7aa; width:0%; }
.small { font-size: 12px; }
.hint-box {
  margin-bottom: 16px;
  padding: 12px 14px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  font-size: 13px;
  color: #888;
}
#tugOfWar {
  flex: 1;
  height: 20px;
  display: flex;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #333;
  background: transparent;
}

.tug-segment {
  height: 100%;
  transition: width 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#tugGood { background: #3a6; }
#tugNeutral { background: #555; }
#tugEvil { background: #a33; }
.tug-segment span {
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  text-shadow: 0 0 3px rgba(0,0,0,0.8);
  white-space: nowrap;
}

/* Global influence bar row */
.influence-row {
  background: transparent;
  margin-top: 8px;
  margin-left: -14px;
  margin-right: -14px;
  padding-left: 14px;
  padding-right: 14px;
  position: relative;
}

/* Base tooltip styles - all tooltips should use this class */
.tooltip {
  position: absolute;
  background: #222;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 8px 12px;
  z-index: 1000;
  pointer-events: none;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  color: #eee;
}
.tooltip.hidden { display: none; }
.tooltip-title {
  font-weight: bold;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #444;
}
.tooltip-content {
  color: #ccc;
}

/* Influence bar tooltip */
.influence-tooltip {
  min-width: 140px;
}
.influence-tooltip-title {
  text-align: center;
  font-weight: bold;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #444;
}
.influence-tooltip-title.good { color: #8f8; }
.influence-tooltip-title.neutral { color: #aaa; }
.influence-tooltip-title.evil { color: #f88; }
.influence-tooltip .tier-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0;
}
.influence-tooltip .tier-count {
  text-align: right;
  font-weight: bold;
  min-width: 40px;
}
.influence-tooltip .tier-label {
  color: #ccc;
}
.influence-tooltip .tier-row.very-good .tier-count { color: #4f4; }
.influence-tooltip .tier-row.good .tier-count { color: #8f8; }
.influence-tooltip .tier-row.mostly-good .tier-count { color: #af8; }
.influence-tooltip .tier-row.neutral .tier-count { color: #888; }
.influence-tooltip .tier-row.mostly-evil .tier-count { color: #f88; }
.influence-tooltip .tier-row.evil .tier-count { color: #f44; }
.influence-tooltip .tier-row.very-evil .tier-count { color: #f00; }
.personLink, a.personLink { cursor:pointer; text-decoration: underline; color:#cce; }
.personLink:hover, a.personLink:hover { color:#eef; }
.age { color:#a9a; font-size:11px; }

/* Counter pill base styles */
.birth-pill { background:#243; border-color:#3a6; color:#8f8; }
.death-pill { background:#422; border-color:#633; color:#faa; }
.epiphany-pill { background:#324; border-color:#a8f; color:#c8f; }
.birthday-pill { background:#442; border-color:#aa6; color:#ff8; }
.queue-pill { background:#222; border-color:#444; color:#888; }
.pregnancy-pill { background:#322; border-color:#a77; color:#fcc; }
.chaos-pill { background:#311; border-color:#633; color:#f88; }

/* Clickable counter pills with hover effects */
.pill.clickable { transition: background-color 0.2s ease, border-color 0.2s ease; cursor:pointer; }
.birth-pill.clickable:hover { background:#354; border-color:#4b7; }
.death-pill.clickable:hover { background:#533; border-color:#744; }
.epiphany-pill.clickable:hover { background:#435; border-color:#b9f; }
.birthday-pill.clickable:hover { background:#553; border-color:#bb7; }
.pregnancy-pill.clickable:hover { background:#433; border-color:#b88; }

.world-healthy { background:#234; border-color:#3a6; color:#8f8; }
.world-critical { background:#432; border-color:#a63; color:#fa8; }
.world-dying { background:#422; border-color:#a33; color:#f88; animation: pulse 1s infinite; }
.world-dead { background:#400; border-color:#800; color:#f44; font-weight:bold; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
.rel-group { margin-top:8px; }
.rel-group-title { font-size:11px; color:#888; text-transform:uppercase; margin-bottom:4px; }
.rel-person { padding:2px 0; display:flex; flex-wrap:wrap; align-items:center; gap:2px; }
.rel-person.deceased > .clickable-name,
.rel-person.deceased > .age,
.rel-person.deceased > .muted,
.rel-person.deceased > .rel-inline-strength { opacity:0.5; }
.rel-person.ex-rel { font-style:italic; }
.rel-type { font-size:10px; color:#777; }
.ex-indicator { color:#f88; font-size:10px; margin-left:4px; }
.clickable-name, a.clickable-name { cursor:pointer; text-decoration:underline; color:#cce; }
.clickable-name:hover, a.clickable-name:hover { color:#eef; }
.mention-link, a.mention-link { cursor:pointer; color:#aef; font-weight:bold; }
.mention-link:hover, a.mention-link:hover { color:#cff; text-decoration:underline; }
.killer-info { color:#f88; margin-top:4px; }

/* Inline relationship strength bar */
.rel-inline-strength {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
  vertical-align: middle;
}

.rel-inline-bar {
  display: inline-block;
  width: 60px;
  height: 6px;
  background: #333;
  border-radius: 3px;
  overflow: hidden;
  vertical-align: middle;
}

.rel-inline-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #a33 0%, #aa3 50%, #3a6 100%);
  transition: width 0.3s;
  border-radius: 3px;
}

.rel-inline-text {
  font-size: 10px;
  color: #8a8;
}

/* Influence buttons */
.influence-btn { padding:6px 12px; font-size:12px; }
.influence-btn:active { transform:scale(0.95); }
.influence-btn:disabled { opacity:0.4; cursor:not-allowed; transform:none; }

/* Notification container - stacks notifications */
#notificationContainer {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 300px;
}
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}
.notification {
  padding: 12px 16px;
  border-radius: 8px;
  animation: slideIn 0.3s ease;
}
.notification.removing {
  animation: slideOut 0.3s ease forwards;
}
/* Birth notification style */
.notification.birth {
  background: #243;
  border: 1px solid #3a6;
  color: #8f8;
}
.notification.birth .notif-name { font-weight: bold; color: #afa; }
.notification.birth .notif-info { font-size: 11px; color: #8c8; margin-top: 4px; }
.notification.birth button {
  background: #354;
  border: 1px solid #3a6;
  color: #8f8;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  border-radius: 4px;
  margin-right: 4px;
}
.notification.birth button:hover { background: #465; }
/* Death notification style */
.notification.death {
  background: #422;
  border: 1px solid #a33;
  color: #faa;
}
.notification.death .notif-name { font-weight: bold; color: #faa; }
.notification.death .notif-info { font-size: 11px; color: #f88; margin-top: 4px; }
.notification.death button {
  background: #533;
  border: 1px solid #a33;
  color: #faa;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  border-radius: 4px;
  margin-right: 4px;
}
.notification.death button:hover { background: #644; }
.notif-buttons { margin-top: 8px; }
.notif-buttons button.dismiss {
  background: #333;
  border-color: #444;
  color: #aaa;
}

/* Birth modal */
#birthModal { display:none; position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.4); z-index:150; overflow:hidden; }
#birthModal.show { display:block; }
#birthModalContent { max-width:900px; margin:40px auto; padding:20px; background:#151515; border:1px solid #333; border-radius:12px; max-height:calc(100% - 80px); display:flex; flex-direction:column; overflow:hidden; }
#birthModalHeader { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; flex-shrink:0; }
#birthModalClose { background:#333; border:none; color:#eee; padding:8px 16px; border-radius:6px; cursor:pointer; }
#birthModalClose:hover { background:#444; }
#birthList { flex:1; overflow-y:auto; min-height:0; }
.birth-record { border:1px solid #333; border-radius:8px; padding:12px; margin-bottom:12px; background:#1a1a1a; }
.birth-record-header { display:flex; justify-content:space-between; align-items:center; }
.birth-record-name, a.birth-record-name { font-weight:bold; color:#afa; cursor:pointer; text-decoration:none; }
.birth-record-name:hover, a.birth-record-name:hover { text-decoration:underline; }
.birth-record-parents { color:#8c8; font-size:12px; margin-top:4px; }
.birth-record-time { color:#888; font-size:11px; }

/* Death modal */
#deathModal { display:none; position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.4); z-index:150; overflow:hidden; }
#deathModal.show { display:block; }
#deathModalContent { max-width:900px; margin:40px auto; padding:20px; background:#151515; border:1px solid #333; border-radius:12px; max-height:calc(100% - 80px); display:flex; flex-direction:column; overflow:hidden; }
#deathModalHeader { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; flex-shrink:0; }
#deathModalClose { background:#333; border:none; color:#eee; padding:8px 16px; border-radius:6px; cursor:pointer; }
#deathModalClose:hover { background:#444; }
#deathList { flex:1; overflow-y:auto; min-height:0; }
.death-record { border:1px solid #333; border-radius:8px; padding:12px; margin-bottom:12px; background:#1a1a1a; }
.death-record-header { display:flex; justify-content:space-between; margin-bottom:8px; }
.death-name, a.death-name { color:#faa; font-weight:bold; text-decoration:none; }
a.death-name:hover { text-decoration:underline; }
.death-cause { color:#fa8; }
.death-age { color:#aaa; }
.death-time { color:#888; font-size:11px; }
.death-thought { color:#ccc; font-style:italic; white-space:pre-wrap; line-height:1.5; margin-top:8px; padding:10px; background:#0f0f0f; border-radius:6px; border-left:3px solid #633; max-height:80px; overflow:hidden; }
.death-record.expanded .death-thought { max-height:none; }
.death-record { cursor:pointer; }
.death-record:hover { border-color:#444; }
#deathPageControls button { padding:4px 10px; min-width:32px; }
#deathPageControls button:disabled { opacity:0.4; cursor:not-allowed; }

/* Epiphany Records Modal */
#epiphanyModal { display:none; position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.4); z-index:150; overflow:hidden; }
#epiphanyModal.show { display:block; }
#epiphanyModalContent { max-width:900px; margin:40px auto; padding:20px; background:#151520; border:1px solid #648; border-radius:12px; max-height:calc(100% - 80px); display:flex; flex-direction:column; overflow:hidden; }
#epiphanyModalHeader { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; flex-shrink:0; }
#epiphanyModalHeader h2 { color:#c8f; }
#epiphanyModalClose { background:#333; border:none; color:#eee; padding:8px 16px; border-radius:6px; cursor:pointer; }
#epiphanyModalClose:hover { background:#444; }
#epiphanyList { flex:1; overflow-y:auto; min-height:0; }
.epiphany-record { border:1px solid #536; border-radius:8px; padding:12px; margin-bottom:12px; background:#1a1a24; cursor:pointer; }
.epiphany-record:hover { border-color:#648; }
.epiphany-record-header { display:flex; justify-content:space-between; margin-bottom:8px; }
.epiphany-name, a.epiphany-name { color:#c8f; font-weight:bold; cursor:pointer; text-decoration:none; }
.epiphany-name:hover, a.epiphany-name:hover { text-decoration:underline; }
.epiphany-age { color:#aaa; }
.epiphany-time { color:#888; font-size:11px; }
.epiphany-text { color:#ddd; white-space:pre-wrap; line-height:1.5; padding:10px; background:#0f0f14; border-radius:6px; border-left:3px solid #a8f; }
.epiphany-badge { font-size:10px; padding:2px 6px; border-radius:4px; margin-left:6px; }
.epiphany-badge.dying { background:#422; color:#faa; }
.epiphany-badge.whisper { background:#426; color:#caf; }
#epiphanyPageControls button { padding:4px 10px; min-width:32px; }
#epiphanyPageControls button:disabled { opacity:0.4; cursor:not-allowed; }

/* Birthdays Modal */
#birthdaysModal { display:none; position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.4); z-index:150; overflow:hidden; }
#birthdaysModal.show { display:block; }
#birthdaysModalContent { max-width:900px; margin:40px auto; padding:20px; background:#151520; border:1px solid #336; border-radius:12px; max-height:calc(100% - 80px); display:flex; flex-direction:column; overflow:hidden; }
#birthdaysModalHeader { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; gap:12px; flex-shrink:0; }
#birthdaysModalHeader h2 { color:#fc8; margin:0; }
#birthdaysModalClose { background:#333; border:none; color:#eee; padding:8px 16px; border-radius:6px; cursor:pointer; }
#birthdaysModalClose:hover { background:#444; }
#birthdaysList { flex:1; overflow-y:auto; min-height:0; }
.birthday-record { border:1px solid #446; border-radius:8px; padding:12px; margin-bottom:12px; background:#1a1a24; }
.birthday-record-header { display:flex; justify-content:space-between; align-items:center; }
.birthday-name, a.birthday-name { color:#8cf; font-weight:bold; cursor:pointer; text-decoration:none; }
.birthday-name:hover, a.birthday-name:hover { text-decoration:underline; }
.birthday-age { color:#fc8; }
.birthday-empty { color:#888; font-style:italic; text-align:center; padding:40px 20px; }
.birthday-thought-text { color:#ddd; white-space:pre-wrap; line-height:1.5; padding:10px; margin-top:8px; background:#0f0f14; border-radius:6px; border-left:3px solid #fc8; }

/* Birthday thought styling in feed */
.line.birthday-thought {
  border-left:3px solid #fc8;
  padding-left:8px;
  margin:2px 0;
  background: linear-gradient(90deg, rgba(255,200,100,0.1) 0%, transparent 100%);
  transition: background 0.2s ease;
}
.line.birthday-thought:hover {
  background: linear-gradient(90deg, rgba(255,200,100,0.22) 0%, rgba(255,200,100,0.05) 100%);
}
.birthday-indicator {
  display:inline-block;
  color:#fc8;
  font-size:10px;
  margin-left:6px;
  opacity:0.9;
}
.birthday-indicator::before {
  content:"\1F382";  /* Birthday cake emoji */
  margin-right:2px;
}

/* Pregnancy Records Modal */
#pregnancyModal { display:none; position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.4); z-index:150; overflow:hidden; }
#pregnancyModal.show { display:block; }
#pregnancyModalContent { max-width:900px; margin:40px auto; padding:20px; background:#151518; border:1px solid #744; border-radius:12px; max-height:calc(100% - 80px); display:flex; flex-direction:column; overflow:hidden; }
#pregnancyModalHeader { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; flex-shrink:0; }
#pregnancyModalHeader h2 { color:#fcc; margin:0; }
#pregnancyModalClose { background:#433; border:none; color:#fcc; padding:8px 16px; border-radius:6px; cursor:pointer; }
#pregnancyModalClose:hover { background:#544; }
#pregnancyList { flex:1; overflow-y:auto; min-height:0; }
.pregnancy-record { border:1px solid #644; border-radius:8px; padding:12px; margin-bottom:12px; background:#1a1518; }
.pregnancy-record:hover { border-color:#a77; }
.pregnancy-record-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.pregnancy-parents { font-size:13px; color:#ecc; }
.pregnancy-parent-name, a.pregnancy-parent-name { color:#faa; font-weight:bold; cursor:pointer; text-decoration:none; }
.pregnancy-parent-name:hover, a.pregnancy-parent-name:hover { text-decoration:underline; color:#fcc; }
.pregnancy-parent-age { color:#a88; font-size:11px; margin-left:4px; }
.pregnancy-progress-bar { height:16px; background:#2a2226; border-radius:8px; overflow:hidden; margin-top:8px; position:relative; }
.pregnancy-progress-fill { height:100%; background:linear-gradient(90deg, #744 0%, #a66 50%, #c88 100%); border-radius:8px; transition:width 0.3s ease; }
.pregnancy-progress-text { position:absolute; top:0; left:0; right:0; bottom:0; display:flex; align-items:center; justify-content:center; font-size:11px; color:#fff; font-weight:bold; text-shadow:0 0 3px rgba(0,0,0,0.8); }
.pregnancy-badge { font-size:10px; padding:2px 8px; border-radius:10px; font-weight:bold; }
.pregnancy-badge.early { background:#324; color:#aaf; }
.pregnancy-badge.late { background:#432; color:#fca; }
.pregnancy-badge.normal { background:#333; color:#aaa; }
.pregnancy-empty { color:#888; font-style:italic; text-align:center; padding:40px 20px; }

/* Karmic Adventure */
.karmic-card { border:1px solid #446; border-radius:10px; padding:10px; margin-bottom:10px; background:#1a1a2a; }
.karmic-header { color:#a8f; font-weight:bold; margin-bottom:8px; }
.karmic-soul { font-size:11px; color:#8af; margin-bottom:8px; }
.karmic-life { padding:6px; margin-bottom:6px; background:#151520; border-radius:6px; border-left:3px solid #648; }
.karmic-life-name { color:#caf; font-weight:bold; }
.karmic-life-info { font-size:11px; color:#99a; margin-top:2px; }
.karmic-life-cause { font-size:10px; color:#a88; margin-top:2px; }
.karmic-empty { color:#666; font-style:italic; font-size:12px; }
.karmic-queue { font-size:11px; color:#8a8; margin-top:8px; padding-top:8px; border-top:1px solid #333; }
.karmic-life-name { cursor:pointer; }
.karmic-life-name:hover { text-decoration:underline; }
.karmic-life-killer { font-size:10px; color:#f88; margin-top:2px; }

/* LLM Dashboard Modal */
#llmDashboardModal { display:none; position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.4); z-index:150; overflow:hidden; }
#llmDashboardModal.show { display:block; }
#llmDashboardContent { max-width:700px; margin:40px auto; padding:20px; background:#151518; border:1px solid #456; border-radius:12px; max-height:calc(100% - 80px); display:flex; flex-direction:column; overflow-y:auto; }
#llmDashboardHeader { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; flex-wrap:wrap; gap:8px; flex-shrink:0; }
#llmDashboardHeader h2 { color:#6cf; margin:0; }
#llmDashboardClose { background:#333; border:none; color:#eee; padding:8px 16px; border-radius:6px; cursor:pointer; }
#llmDashboardClose:hover { background:#444; }

.llm-section { margin-bottom:20px; padding-bottom:16px; border-bottom:1px solid #333; }
.llm-section:last-child { border-bottom:none; margin-bottom:0; }
.llm-section h3 { color:#8cf; margin:0 0 12px 0; font-size:14px; text-transform:uppercase; letter-spacing:1px; }

.llm-stats-grid { display:grid; grid-template-columns:repeat(4, 1fr); gap:12px; }
.llm-stat { background:#1a1a20; border-radius:8px; padding:12px; text-align:center; }
.llm-stat-label { display:block; font-size:11px; color:#888; margin-bottom:4px; }
.llm-stat-value { display:block; font-size:18px; font-weight:bold; color:#eee; }
.llm-stat-value.online { color:#8f8; }
.llm-stat-value.offline { color:#f88; }

/* Call breakdown bars */
.llm-breakdown-row { display:flex; align-items:center; margin-bottom:8px; gap:10px; }
.llm-breakdown-label { width:100px; font-size:12px; color:#aaa; flex-shrink:0; }
.llm-breakdown-bar-container { flex:1; height:20px; background:#222; border-radius:4px; overflow:hidden; }
.llm-breakdown-bar { height:100%; transition:width 0.3s ease; border-radius:4px; }
.llm-breakdown-bar.whisper { background:linear-gradient(90deg, #639 0%, #96c 100%); }
.llm-breakdown-bar.epiphany { background:linear-gradient(90deg, #369 0%, #6cf 100%); }
.llm-breakdown-bar.dying { background:linear-gradient(90deg, #633 0%, #c66 100%); }
.llm-breakdown-bar.error { background:linear-gradient(90deg, #633 0%, #f66 100%); }
.llm-breakdown-count { width:50px; text-align:right; font-size:13px; color:#ccc; font-weight:bold; }

/* API Keys list */
.llm-help-text { font-size:11px; color:#777; margin-bottom:12px; }
.llm-key-card { background:#1a1a20; border-radius:8px; padding:12px; margin-bottom:8px; border-left:3px solid #456; }
.llm-key-card.disabled { opacity:0.5; border-left-color:#633; }
.llm-key-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.llm-key-name { font-weight:bold; color:#8cf; }
.llm-key-status { font-size:11px; padding:2px 8px; border-radius:4px; }
.llm-key-status.enabled { background:#234; color:#8f8; }
.llm-key-status.disabled { background:#422; color:#f88; }
.llm-key-status.cooldown { background:#332; color:#fa8; }
.llm-key-stats { display:flex; gap:16px; flex-wrap:wrap; }
.llm-key-stat { font-size:11px; }
.llm-key-stat-label { color:#888; }
.llm-key-stat-value { color:#ccc; font-weight:bold; margin-left:4px; }
.llm-key-stat-value.warning { color:#fa8; }
.llm-key-stat-value.error { color:#f88; }
.llm-key-error { font-size:10px; color:#f88; margin-top:6px; padding:6px; background:#2a1a1a; border-radius:4px; }

/* Provider badges and colors */
.llm-provider-summary { display:flex; gap:8px; margin-bottom:12px; flex-wrap:wrap; }
.llm-provider-badge { font-size:11px; padding:4px 10px; border-radius:12px; font-weight:bold; }
.llm-provider-badge.groq { background:#1a2a1a; color:#8f8; border:1px solid #3a6; }
.llm-provider-badge.google { background:#1a1a2a; color:#8af; border:1px solid #46a; }
.llm-key-card.provider-groq { border-left-color:#3a6; }
.llm-key-card.provider-google { border-left-color:#46a; }
.llm-key-provider { font-size:10px; padding:2px 6px; border-radius:3px; margin-left:8px; }
.llm-key-provider.groq { background:#1a2a1a; color:#8f8; }
.llm-key-provider.google { background:#1a1a2a; color:#8af; }
.llm-key-model { font-size:10px; color:#888; margin-left:8px; }

/* Call Log */
.llm-call-log { max-height:300px; overflow-y:auto; }
.llm-call-log-entries { display:flex; flex-direction:column; gap:2px; }
.llm-call-entry { display:flex; gap:8px; align-items:center; font-size:11px; padding:4px 8px; background:#1a1a20; border-radius:4px; flex-wrap:wrap; }
.llm-call-entry.success { border-left:2px solid #4a4; }
.llm-call-entry.error { border-left:2px solid #a44; }
.llm-call-time { color:#888; font-family:monospace; min-width:70px; }
.llm-call-provider { font-size:9px; padding:1px 4px; border-radius:2px; }
.llm-call-provider.groq { background:#1a2a1a; color:#8f8; }
.llm-call-provider.google { background:#1a1a2a; color:#8af; }
.llm-call-key { color:#8cf; font-weight:bold; min-width:24px; }
.llm-call-type { color:#aaa; min-width:60px; }
.llm-call-status { font-weight:bold; min-width:32px; }
.llm-call-status.success { color:#8f8; }
.llm-call-status.error { color:#f88; }
.llm-call-duration { color:#888; font-family:monospace; min-width:50px; }
.llm-call-error { color:#f88; font-size:10px; flex-basis:100%; margin-top:2px; padding-left:70px; }

/* Glossary */
.llm-glossary dl { margin:0; }
.llm-glossary dt { color:#8cf; font-weight:bold; margin-top:10px; font-size:12px; }
.llm-glossary dt:first-child { margin-top:0; }
.llm-glossary dd { margin:4px 0 0 0; color:#aaa; font-size:12px; line-height:1.4; }
.llm-glossary dd strong { color:#fc8; }

/* Make groqStatus clickable */
#groqStatus { cursor:pointer; }
#groqStatus:hover { filter:brightness(1.2); }
.karmic-killer-link, a.karmic-killer-link { color:#faa; cursor:pointer; text-decoration:underline; }
.karmic-killer-link:hover, a.karmic-killer-link:hover { color:#fcc; }
.karmic-killer-memorial, a.karmic-killer-memorial { color:#a88; cursor:pointer; text-decoration:underline; font-style:italic; }
.karmic-killer-memorial:hover, a.karmic-killer-memorial:hover { color:#caa; }

/* Memorial popup for past lives */
#memorialModal { display:none; position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.4); z-index:150; }
#memorialModal.show { display:flex; align-items:center; justify-content:center; }
#memorialContent { max-width:400px; padding:20px; background:#1a1a2a; border:1px solid #648; border-radius:12px; }
#memorialHeader { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; }
#memorialHeader h3 { margin:0; color:#caf; }
#memorialClose { background:#333; border:none; color:#eee; padding:6px 12px; border-radius:6px; cursor:pointer; }
#memorialClose:hover { background:#444; }
.memorial-field { margin-bottom:10px; }
.memorial-label { font-size:11px; color:#888; text-transform:uppercase; }
.memorial-value { color:#ddd; margin-top:2px; }
.memorial-cause { color:#f88; }

/* Rate controls */
.rate-control { display:flex; align-items:center; gap:6px; }
.rate-btn { padding:2px 8px; min-width:24px; font-size:12px; }
.rate-value { min-width:40px; text-align:center; font-weight:bold; }
.rate-label { font-size:11px; color:#888; }
.birth-rate { color:#8f8; }
.death-rate { color:#f88; }
.reincarnation-badge { background:#326; padding:2px 6px; border-radius:4px; font-size:10px; color:#a8f; margin-left:4px; }

/* Divine Whisper styles */
.whisper-card { border:1px solid #639; border-radius:10px; padding:10px; margin-bottom:10px; background:#1a1520; }
.whisper-header { color:#a8f; font-weight:bold; margin-bottom:8px; }
.whisper-input-row { display:flex; gap:6px; margin-top:8px; align-items:flex-end; }
.whisper-input {
  width:100%;
  box-sizing:border-box;
  background:#151020;
  border:1px solid #536;
  color:#ddf;
  padding:8px;
  border-radius:6px;
  font-size:12px;
  resize:none;
  min-height:60px;
}
.whisper-input:focus { outline:none; border-color:#86a; }
.whisper-input::placeholder { color:#667; }
.whisper-btn {
  background:#426;
  border:1px solid #639;
  color:#caf;
  padding:8px 16px;
  border-radius:6px;
  cursor:pointer;
  font-weight:bold;
  align-self:flex-end;
}
.whisper-btn:hover { background:#537; border-color:#86a; }
.whisper-btn:disabled { opacity:0.4; cursor:not-allowed; }
.whisper-status { font-size:11px; margin-top:6px; min-height:16px; }
.whisper-status.error { color:#f88; }
.whisper-status.success { color:#8f8; }
.whisper-status.pending { color:#fa8; }
.whisper-cooldown { color:#a8f; }
.whisper-char-count { font-size:10px; color:#666; text-align:right; margin-top:2px; }

/* Mention autocomplete dropdown */
.whisper-input-wrapper { position:relative; flex:1; }
.mention-autocomplete {
  position:absolute;
  bottom:100%;
  left:0;
  right:0;
  background:#1a1228;
  border:1px solid #639;
  border-radius:6px;
  max-height:200px;
  overflow-y:auto;
  z-index:100;
  margin-bottom:4px;
  box-shadow:0 -4px 12px rgba(0,0,0,0.4);
}
.mention-item {
  padding:8px 10px;
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:8px;
  border-bottom:1px solid #2a2038;
}
.mention-item:last-child { border-bottom:none; }
.mention-item:hover, .mention-item.selected { background:#2a2048; }
.mention-name { color:#aef; font-weight:bold; }
.mention-type { color:#888; font-size:11px; }
.mention-deceased { color:#a66; font-size:10px; font-style:italic; }

/* Whisper thought styling in feed */
.line.whisper-thought {
  border-left:3px solid #86a;
  padding-left:8px;
  margin:4px 0;
  background: linear-gradient(90deg, rgba(102,51,153,0.15) 0%, transparent 100%);
  transition: background 0.2s ease;
}
.line.whisper-thought:hover { background: linear-gradient(90deg, rgba(102,51,153,0.28) 0%, rgba(102,51,153,0.08) 100%); }
.line.whisper-thought.whisper-good { border-left-color:#3a6; background: linear-gradient(90deg, rgba(51,170,102,0.15) 0%, transparent 100%); }
.line.whisper-thought.whisper-good:hover { background: linear-gradient(90deg, rgba(51,170,102,0.28) 0%, rgba(51,170,102,0.08) 100%); }
.line.whisper-thought.whisper-neutral { border-left-color:#888; background: linear-gradient(90deg, rgba(136,136,136,0.15) 0%, transparent 100%); }
.line.whisper-thought.whisper-neutral:hover { background: linear-gradient(90deg, rgba(136,136,136,0.28) 0%, rgba(136,136,136,0.08) 100%); }
.line.whisper-thought.whisper-evil { border-left-color:#a33; background: linear-gradient(90deg, rgba(170,51,51,0.15) 0%, transparent 100%); }
.line.whisper-thought.whisper-evil:hover { background: linear-gradient(90deg, rgba(170,51,51,0.28) 0%, rgba(170,51,51,0.08) 100%); }

.whisper-tag {
  display:inline-block;
  padding:1px 6px;
  border-radius:4px;
  font-size:10px;
  margin-left:6px;
  font-weight:bold;
}
.whisper-tag.tag-good { background:#243; color:#8f8; }
.whisper-tag.tag-neutral { background:#333; color:#aaa; }
.whisper-tag.tag-evil { background:#422; color:#f88; }
.whisper-intensity { color:#a8f; font-size:10px; margin-left:4px; }
.epiphany-intensity { font-size:10px; margin-left:4px; }
.epiphany-intensity.intensity-good { color:#8f8; }
.epiphany-intensity.intensity-neutral { color:#aaa; }
.epiphany-intensity.intensity-evil { color:#f88; }

/* Epiphany (LLM-generated) thought styling */
.line.epiphany-thought {
  border-left:2px solid #a8f;
  padding-left:8px;
  margin:2px 0;
  background: linear-gradient(90deg, rgba(168,136,255,0.08) 0%, transparent 100%);
  transition: background 0.2s ease;
}
.line.epiphany-thought:hover {
  background: linear-gradient(90deg, rgba(168,136,255,0.18) 0%, rgba(168,136,255,0.05) 100%);
}
.epiphany-indicator {
  display:inline-block;
  color:#a8f;
  font-size:10px;
  margin-left:6px;
  opacity:0.9;
}
.epiphany-indicator::before {
  content:"\1F4A1";  /* Lightbulb emoji */
  margin-right:2px;
}

/* Moral alignment badges for epiphanies */
.moral-badge {
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  margin-left: 6px;
  font-weight: bold;
  text-transform: uppercase;
}
.moral-badge.moral-good {
  background: #243;
  color: #8f8;
  border: 1px solid #3a6;
}
.moral-badge.moral-neutral {
  background: #333;
  color: #aaa;
  border: 1px solid #555;
}
.moral-badge.moral-evil {
  background: #422;
  color: #f88;
  border: 1px solid #633;
}

/* Dying thought styling */
.line.dying-thought {
  border-left:3px solid #633;
  padding-left:8px;
  margin:2px 0;
  background: linear-gradient(90deg, rgba(102,51,51,0.15) 0%, transparent 100%);
  transition: background 0.2s ease;
}
.line.dying-thought:hover {
  background: linear-gradient(90deg, rgba(102,51,51,0.28) 0%, rgba(102,51,51,0.08) 100%);
}
.line.dying-thought .thought-text {
  font-style:italic;
}
.dying-indicator {
  display:inline-block;
  color:#f88;
  font-size:10px;
  margin-left:6px;
  opacity:0.9;
}

/* Thought type filter checkboxes */
.filter-group {
  display:inline-flex;
  gap:12px;
  margin-left:12px;
}
.filter-group label {
  display:inline-flex;
  align-items:center;
  gap:4px;
  font-size:12px;
  cursor:pointer;
  color:#aaa;
}
.filter-group label:hover { color:#ddd; }
.filter-group input[type="checkbox"] {
  width:14px;
  height:14px;
  cursor:pointer;
}

/* Whisper response styling (person's reaction to divine whisper) */
.line.whisper-response {
  border-left:2px solid #86a;
  padding-left:8px;
  margin:2px 0;
  background: linear-gradient(90deg, rgba(136,102,170,0.12) 0%, transparent 100%);
  transition: background 0.2s ease;
}
.line.whisper-response:hover {
  background: linear-gradient(90deg, rgba(136,102,170,0.25) 0%, rgba(136,102,170,0.06) 100%);
}
.line.whisper-response.whisper-response-good {
  border-left-color:#3a6;
  background: linear-gradient(90deg, rgba(51,170,102,0.12) 0%, transparent 100%);
}
.line.whisper-response.whisper-response-good:hover {
  background: linear-gradient(90deg, rgba(51,170,102,0.25) 0%, rgba(51,170,102,0.06) 100%);
}
.line.whisper-response.whisper-response-evil {
  border-left-color:#a33;
  background: linear-gradient(90deg, rgba(170,51,51,0.12) 0%, transparent 100%);
}
.line.whisper-response.whisper-response-evil:hover {
  background: linear-gradient(90deg, rgba(170,51,51,0.25) 0%, rgba(170,51,51,0.06) 100%);
}
.whisper-response-indicator {
  display:inline-block;
  color:#86a;
  font-size:9px;
  margin-left:6px;
  opacity:0.8;
  font-style:normal;
  text-transform:uppercase;
}
.whisper-response-good .whisper-response-indicator { color:#3a6; }
.whisper-response-evil .whisper-response-indicator { color:#a33; }

/* Whisper queue status */
.whisper-queue-status {
  font-size:10px;
  color:#a8f;
  margin-top:4px;
}

/* ========== MOBILE RESPONSIVE STYLES ========== */

/* Mobile header bar - minimal bar always visible on mobile */
.mobile-header-bar {
  display: none;  /* Hidden on desktop */
}

/* Mobile collapsible panel */
.mobile-panel {
  /* On desktop, acts as normal container */
}

/* Hidden class for mobile toggle */
@media (max-width: 768px) {
  .hidden {
    display: none !important;
  }

  /* Minimal header bar */
  .mobile-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: transparent;
    border-bottom: 1px solid #333;
    position: relative;
    z-index: 10;
  }

  .panel-toggle {
    background: transparent;
    border: 1px solid #444;
    color: #888;
    padding: 4px 12px;
    border-radius: 4px;
    min-height: 28px;
  }

  .panel-toggle .toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
  }

  .panel-toggle.open .toggle-icon {
    transform: rotate(180deg);
  }

  /* Collapsible panel */
  .mobile-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: transparent;
  }

  .mobile-panel.open {
    max-height: 500px;  /* Enough for all content */
    border-bottom: 1px solid #333;
    overflow-y: auto;
    background: rgba(10, 10, 18, 0.9);
  }

  /* Influence bar adjustments for mobile panel */
  .mobile-panel.open .influence-row {
    margin-left: -12px;
    margin-right: -12px;
    padding-left: 12px;
    padding-right: 12px;
  }

  /* Show rows inside the panel when it's open */
  .mobile-panel > .row {
    display: none;
  }

  .mobile-panel.open > .row {
    display: flex;
  }
}

/* Mobile navigation tabs */
.mobile-tabs {
  display: none;
  background: #1a1a1a;
  border-bottom: 1px solid #333;
  padding: 8px;
  gap: 8px;
}
.mobile-tabs button {
  flex: 1;
  padding: 12px;
  font-size: 14px;
  font-weight: bold;
  border-radius: 8px;
}
.mobile-tabs button.active {
  background: #2a4a3a;
  border-color: #3a6;
  color: #8f8;
}

/* Tablet breakpoint */
@media (max-width: 1024px) {
  #wrap {
    grid-template-columns: 300px 1fr;
  }

  header .row {
    gap: 6px;
  }

  .pill {
    padding: 2px 6px;
    font-size: 11px;
  }
}

/* Mobile breakpoint */
@media (max-width: 768px) {
  /* Allow body to scroll for pull-to-refresh */
  body {
    overflow: visible;
    overflow-x: hidden;
    overflow-y: auto;
  }

  /* Header adjustments - fixed and hidden by default, revealed via swipe */
  header {
    padding: 8px 10px;
    position: fixed;
    top: -200px;
    left: 0;
    right: 0;
    z-index: 100;
    background: transparent;
    transition: top 0.4s ease-out, background 0.3s ease;
  }

  header.revealed {
    top: 0;
  }

  /* Dark background when revealed while scrolled down (not at top) */
  header.revealed.scrolled {
    background: rgba(10, 10, 18, 0.95);
  }

  header.revealed.scrolled .mobile-tabs {
    background: rgba(10, 10, 18, 0.95);
  }

  header .row {
    flex-wrap: wrap;
    gap: 6px 8px;
  }

  /* First row - status pills */
  header .row:first-child {
    justify-content: flex-start;
  }

  /* Pills and buttons */
  .pill {
    padding: 4px 8px;
    font-size: 11px;
  }

  button {
    padding: 8px 12px;
    font-size: 12px;
    min-height: 36px;
    touch-action: manipulation;
  }

  input {
    padding: 8px;
    font-size: 16px; /* Prevents iOS zoom on focus */
    min-height: 36px;
  }

  /* Hide some less important header elements on mobile */
  #trackHint {
    display: none;
  }

  /* Hide labels on mobile to save space */
  header label:not(.muted) {
    display: none;
  }

  .filter-group {
    margin-left: 0;
    margin-top: 4px;
    width: 100%;
    justify-content: flex-start;
  }

  .filter-group label {
    font-size: 12px;
    display: inline-flex !important;
  }

  /* Track input */
  #trackQuery {
    min-width: 120px !important;
    flex: 1;
  }

  /* Global influence bar - hide label */
  #tugOfWar {
    max-width: none !important;
    flex: 1 !important;
  }

  /* Auto-scroll checkbox */
  #autoScroll {
    width: 18px;
    height: 18px;
  }

  /* Main layout - stack sidebar and content, allow page scroll */
  #wrap {
    display: flex;
    flex-direction: column;
    height: auto;
    overflow: visible;
    min-height: 0;
    padding-top: 0; /* Controlled dynamically by JavaScript */
  }

  /* Mobile tabs - inside header, flows after panel */
  .mobile-tabs {
    display: flex;
    position: relative;
    z-index: 10;
    background: transparent;
    border-bottom: 1px solid #333;
  }

  /* Sidebar becomes toggleable panel - allow page-level scroll */
  #side {
    display: block;
    width: 100%;
    min-height: 500px; /* Fixed min-height instead of calc(100vh) for iOS compatibility */
    padding: 12px;
    box-sizing: border-box;
    overflow-y: visible;
    border-left: none;
    border-bottom: 1px solid #333;
    background: #0a0a12 !important; /* Solid dark background for iOS compatibility */
    color: #eee !important;
  }

  #side.hidden {
    display: none !important;
  }

  /* Thoughts feed - allow page-level scroll */
  #thoughts {
    display: block;
    width: 100%;
    min-height: 500px; /* Fixed min-height instead of calc(100vh) for iOS compatibility */
    padding: 12px;
    box-sizing: border-box;
    overflow-y: visible;
    border-left: none;
    background: #0a0a12 !important; /* Solid dark background for iOS compatibility */
    color: #eee !important;
  }

  #thoughts.hidden {
    display: none !important;
  }

  /* ========== MOBILE PANEL SPECIFIC STYLES ========== */

  /* Hide original status/gameTime in panel - mobile header bar shows these */
  .mobile-panel #status,
  .mobile-panel #gameTime {
    display: none !important;
  }

  /* Compact pills on mobile panel */
  .mobile-panel .pill {
    padding: 2px 6px;
    font-size: 10px;
  }

  /* Compact buttons in mobile panel */
  .mobile-panel button {
    padding: 4px 8px;
    font-size: 10px;
    min-height: 28px;
  }

  /* Hide less important pills on mobile to save space */
  .mobile-panel #groqStatus,
  .mobile-panel #mode,
  .mobile-panel #counts,
  .mobile-panel #peopleCount,
  .mobile-panel #queueCount {
    display: none;
  }

  /* Compact stats - birth/death/pregnancy counts */
  .mobile-panel #birthCount,
  .mobile-panel #deathCount,
  .mobile-panel #pregnancyCount {
    font-size: 10px;
    padding: 2px 6px;
  }

  /* Cards - ensure visibility on mobile with explicit colors */
  .card, .karmic-card, .whisper-card {
    display: block !important;
    padding: 10px !important;
    margin-bottom: 10px !important;
    background: #1a1a1a !important;
    border: 1px solid #444 !important;
    border-radius: 8px !important;
    color: #eee !important;
  }

  /* Hide cards that should be hidden */
  .card[style*="display: none"],
  .card[style*="display:none"] {
    display: none !important;
  }

  /* Hint box - ensure visibility on mobile */
  .hint-box {
    display: block !important;
    padding: 12px !important;
    margin-bottom: 12px !important;
    background: #1a1a2a !important;
    border: 1px solid #446 !important;
    border-radius: 8px !important;
    color: #aaa !important;
    font-size: 14px !important;
  }

  /* Ensure text is visible in side panel */
  #side b {
    color: #9ad !important;
  }

  #side .muted {
    color: #888 !important;
  }

  #side .small {
    font-size: 12px !important;
    color: #888 !important;
  }

  /* Thought lines */
  .line {
    padding: 4px 0;
    font-size: 12px;
    line-height: 1.4;
  }

  /* Modal adjustments */
  #birthModalContent,
  #deathModalContent,
  #epiphanyModalContent,
  #memorialContent,
  #birthdaysModalContent,
  #pregnancyModalContent,
  #llmDashboardContent {
    margin: 10px auto;
    padding: 15px;
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
  }

  /* Pregnancy modal mobile specific - match death/birth/epiphany modal style */
  .pregnancy-record {
    padding: 10px;
    margin-bottom: 10px;
  }

  .pregnancy-record-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .pregnancy-parents {
    font-size: 12px;
  }

  .pregnancy-progress-bar {
    height: 20px;
  }

  .pregnancy-progress-text {
    font-size: 10px;
  }

  .pregnancy-badge {
    font-size: 9px;
  }

  /* LLM Dashboard mobile */
  .llm-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .llm-stat {
    padding: 8px;
  }

  .llm-stat-value {
    font-size: 16px;
  }

  #birthList,
  #deathList,
  #epiphanyList,
  #birthdaysList,
  #pregnancyList {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
  }

  .death-record,
  .birth-record {
    padding: 10px;
  }

  /* Notification adjustments */
  #notificationContainer {
    left: 10px;
    right: 10px;
    max-width: none;
    top: var(--notification-top, 10px);
  }

  .notification {
    padding: 10px 12px;
  }

  /* Rate controls hide on mobile */
  .rate-control {
    display: none;
  }

  /* Relationships tooltip - show on tap instead of hover */
  .rel-tooltip {
    position: fixed;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%);
    z-index: 100;
    min-width: 150px;
  }
}

/* Small mobile breakpoint */
@media (max-width: 480px) {
  header {
    padding: 6px 8px;
  }

  /* Stack all header elements */
  header .row {
    flex-direction: row;
    flex-wrap: wrap;
  }

  /* Hide some status pills on very small screens */
  #peopleCount,
  #queueCount {
    display: none;
  }

  /* Full-width track input */
  #trackQuery {
    width: 100%;
    min-width: 0 !important;
  }

  /* Smaller buttons */
  button {
    padding: 6px 10px;
    font-size: 11px;
  }

  .pill {
    font-size: 10px;
    padding: 3px 6px;
  }

  /* Thoughts - keep page-level scroll for pull-to-refresh */
  #thoughts {
    padding: 8px;
  }

  .line {
    font-size: 11px;
  }

  /* Side panel - keep page-level scroll for pull-to-refresh */
  #side {
    padding: 8px;
  }

  /* Influence bar */
  #tugOfWar {
    max-width: none !important;
    height: 16px !important;
  }

  /* Filter checkboxes inline */
  .filter-group {
    gap: 8px;
  }

  /* Inline relationship bar mobile */
  .rel-inline-bar { width: 40px; }
  .rel-inline-text { font-size: 9px; }

  /* LLM Dashboard mobile */
  #llmDashboardContent {
    margin: 10px;
    padding: 15px;
    max-width: calc(100vw - 20px);
  }

  .llm-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .llm-breakdown-label {
    width: 80px;
    font-size: 11px;
  }

  .llm-key-stats {
    flex-direction: column;
    gap: 4px;
  }

  .llm-glossary dt {
    font-size: 11px;
  }

  .llm-glossary dd {
    font-size: 11px;
  }
}

/* ============================================== */
/* System Messages */
/* ============================================== */

.system-message {
  background: #1a1a2a;
  border-left: 3px solid #666;
  padding: 8px 12px !important;
  margin: 4px 0;
  border-radius: 0 6px 6px 0;
  font-style: italic;
}

.system-message .system-label {
  color: #aaa;
  font-weight: bold;
  margin-right: 8px;
}

.system-message.system-chaos {
  background: #2a1a1a;
  border-left-color: #a33;
}

.system-message.system-chaos .system-label {
  color: #f88;
}

.system-message.system-divine {
  background: #1a2a2a;
  border-left-color: #3a6;
}

.system-message.system-divine .system-label {
  color: #8f8;
}

/* ============================================== */
/* Chaos Triumph Overlay */
/* ============================================== */

.chaos-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  animation: chaosFadeIn 1s ease-out;
}

.chaos-overlay.show {
  display: flex;
}

@keyframes chaosFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.chaos-content {
  text-align: center;
  padding: 40px 60px;
  max-width: 600px;
}

.chaos-title {
  font-size: 48px;
  color: #f44;
  text-transform: uppercase;
  letter-spacing: 8px;
  margin: 20px 0;
  text-shadow: 0 0 20px #f00;
  animation: chaosGlow 1.5s infinite alternate;
}

@keyframes chaosGlow {
  from { text-shadow: 0 0 20px #f00, 0 0 40px #800; }
  to { text-shadow: 0 0 30px #f44, 0 0 60px #a00; }
}

.chaos-message {
  font-size: 18px;
  color: #aaa;
  margin: 30px 0;
  line-height: 1.6;
}

.chaos-count {
  margin: 30px 0;
  padding: 20px;
  background: #1a0a0a;
  border: 2px solid #a33;
  border-radius: 12px;
  display: inline-block;
}

.chaos-count .chaos-label {
  display: block;
  font-size: 14px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.chaos-number {
  font-size: 72px;
  color: #f44;
  font-weight: bold;
  text-shadow: 0 0 20px #f00;
}

.chaos-countdown {
  margin-top: 40px;
  padding: 20px;
}

.chaos-countdown .chaos-label {
  font-size: 14px;
  color: #666;
  margin: 0 8px;
}

.chaos-timer {
  font-size: 48px;
  color: #fc8;
  font-weight: bold;
  animation: timerPulse 1s infinite;
}

@keyframes timerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Mobile adjustments for chaos overlay */
@media (max-width: 700px) {
  .chaos-title {
    font-size: 28px;
    letter-spacing: 4px;
  }

  .chaos-message {
    font-size: 14px;
  }

  .chaos-number {
    font-size: 48px;
  }

  .chaos-timer {
    font-size: 32px;
  }
}

/* ============================================== */
/* Intro Overlay */
/* ============================================== */

.intro-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0a0a12 0%, #1a1a2e 50%, #0f0f1a 100%);
  z-index: 10000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.intro-overlay.show {
  display: flex;
}

.intro-overlay.visible {
  opacity: 1;
}

/* Progress bar at top */
.intro-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #222;
}

.intro-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  width: 20%;
  transition: width 0.3s ease;
}

/* Slides container */
.intro-slides {
  width: 100%;
  max-width: 600px;
  padding: 20px 40px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Individual slide */
.intro-slide {
  position: absolute;
  width: calc(100% - 80px);
  max-width: 560px;
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

.intro-slide.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.intro-slide.prev {
  transform: translateX(-50px);
}

.intro-slide-content {
  text-align: center;
}

/* Typography */
.intro-title {
  font-size: 48px;
  font-weight: bold;
  color: #eee;
  margin: 0 0 10px 0;
  letter-spacing: 2px;
  text-shadow: 0 0 30px rgba(102, 126, 234, 0.5);
}

.intro-subtitle {
  font-size: 18px;
  color: #888;
  margin: 0 0 30px 0;
  font-style: italic;
}

.intro-text {
  font-size: 16px;
  color: #aaa;
  margin: 20px 0;
  line-height: 1.6;
}

.intro-highlight {
  font-size: 18px;
  color: #ccc;
  margin: 30px 0;
  padding: 20px;
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 10px;
}

.intro-heading {
  font-size: 32px;
  color: #eee;
  margin: 0 0 30px 0;
  text-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

/* List styling */
.intro-list {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
}

.intro-list li {
  padding: 12px 0;
  font-size: 16px;
  color: #bbb;
  border-bottom: 1px solid #333;
  line-height: 1.5;
}

.intro-list li:last-child {
  border-bottom: none;
}

.intro-list strong {
  color: #eee;
}

.intro-note {
  color: #888;
  font-size: 14px;
}

/* Feature cards (Divine Intervention slide) */
.intro-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.intro-feature {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #333;
  border-radius: 10px;
}

.intro-feature-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.intro-feature strong {
  display: block;
  color: #eee;
  font-size: 16px;
  margin-bottom: 4px;
}

.intro-feature p {
  margin: 0;
  color: #999;
  font-size: 14px;
}

/* Enter button */
.intro-enter-btn {
  margin-top: 30px;
  padding: 16px 40px;
  font-size: 18px;
  font-weight: bold;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.intro-enter-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(102, 126, 234, 0.5);
}

/* Navigation */
.intro-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  width: 100%;
  max-width: 600px;
  box-sizing: border-box;
}

.intro-nav-btn {
  padding: 10px 24px;
  font-size: 14px;
  background: transparent;
  color: #888;
  border: 1px solid #444;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 100px;
}

.intro-nav-btn:hover:not(:disabled) {
  color: #eee;
  border-color: #666;
  background: rgba(255, 255, 255, 0.05);
}

.intro-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Dots indicator */
.intro-dots {
  display: flex;
  gap: 10px;
}

.intro-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #444;
  cursor: pointer;
  transition: all 0.2s ease;
}

.intro-dot:hover {
  background: #666;
}

.intro-dot.active {
  background: #667eea;
  box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .intro-slides {
    padding: 20px;
  }

  .intro-slide {
    width: calc(100% - 40px);
  }

  .intro-title {
    font-size: 32px;
  }

  .intro-subtitle {
    font-size: 14px;
  }

  .intro-heading {
    font-size: 24px;
    margin-bottom: 20px;
  }

  .intro-text,
  .intro-list li {
    font-size: 14px;
  }

  .intro-highlight {
    font-size: 15px;
    padding: 15px;
  }

  .intro-nav {
    padding: 15px 20px;
  }

  .intro-nav-btn {
    padding: 8px 16px;
    font-size: 12px;
    min-width: 80px;
  }

  .intro-feature {
    padding: 12px;
  }

  .intro-feature-icon {
    font-size: 24px;
  }

  .intro-enter-btn {
    padding: 14px 30px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .intro-title {
    font-size: 26px;
  }

  .intro-heading {
    font-size: 20px;
  }

  .intro-nav-btn {
    padding: 6px 12px;
    min-width: 70px;
  }

  .intro-dot {
    width: 8px;
    height: 8px;
  }
}

/* ============================================== */
/* Footer */
/* ============================================== */

#siteFooter {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 8px 20px;
  color: #666;
  font-size: 12px;
  background: #111;
  border-top: 1px solid #222;
  z-index: 50;
  transition: transform 0.4s ease-out, padding 0.4s ease-out;
}

#siteFooter.collapsed {
  transform: translateY(100%);
}

.footer-line {
  line-height: 1.6;
}


.footer-divider {
  margin: 0 10px;
  color: #444;
}

#siteFooter a {
  text-decoration: none;
  transition: color 0.2s ease;
}

#siteFooter a:hover {
  text-decoration: underline;
}

#showIntroBtn {
  color: #667eea;
}

#showIntroBtn:hover {
  color: #8a9fef;
}

.footer-discord {
  color: #5865F2;
}

.footer-discord:hover {
  color: #7289da;
}

.footer-kofi {
  color: #ff5e5b;
  margin-left: 6px;
}

.footer-kofi:hover {
  color: #ff8583;
}

/* Footer theme selector */
.footer-theme-label {
  color: #888;
  margin-right: 6px;
}

.footer-theme-select {
  background: #1a1a1a;
  color: #aaa;
  border: 1px solid #333;
  padding: 2px 20px 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
}

.footer-theme-select:hover {
  border-color: #555;
  color: #ccc;
}

.footer-theme-select:focus {
  outline: none;
  border-color: #667eea;
}

/* Mobile footer adjustments */
@media (max-width: 768px) {
  #siteFooter {
    padding: 6px 15px;
    font-size: 11px;
  }

  #siteFooter.collapsed {
    transform: translateY(100%);
  }

  .footer-divider {
    margin: 0 8px;
  }

  .footer-theme-label {
    display: none;
  }

  .footer-theme-select {
    font-size: 10px;
    padding: 2px 16px 2px 4px;
  }
}
