:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #090806;
  color: #f8efe0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 18% 8%, rgba(222, 159, 86, 0.22), transparent 30%), #090806;
}

.topbar {
  position: fixed;
  top: 64px;
  left: 12px;
  z-index: 30;
  width: auto;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.saver-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(248, 239, 224, 0.16);
  border-radius: 999px;
  background: rgba(9, 8, 6, 0.88);
  color: #f8efe0;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.saver-summary span,
.saver-greeting {
  color: #e9b872;
  font-weight: 800;
}

.saver-greeting {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.saver-greeting:hover {
  color: #ffdca6;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.saver-summary strong {
  display: inline;
  margin: 0;
  font-size: 0.86rem;
}

.point-pill {
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(248, 239, 224, 0.08);
  cursor: help;
}

.sound-toggle {
  border: 1px solid rgba(233, 184, 114, 0.32);
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(248, 239, 224, 0.07);
  color: #d8c7ad;
  cursor: pointer;
  font: 800 0.76rem ui-monospace, monospace;
}

.sound-toggle[aria-pressed="true"] {
  border-color: rgba(126, 231, 135, 0.55);
  color: #7ee787;
}

.sound-toggle[title*="does not allow"] {
  border-color: rgba(255, 107, 107, 0.45);
  color: #ffb3a7;
}

.app-tabs {
  position: fixed;
  right: 28px;
  top: 76px;
  width: min(760px, calc(100vw - 56px));
  z-index: 35;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}

.tab-button,
.login-open,
.modal-heading button {
  border: 1px solid rgba(248, 239, 224, 0.14);
  border-radius: 999px;
  padding: 10px 14px;
  background: #20170f;
  color: #f8efe0;
  cursor: pointer;
  font-weight: 800;
}

.tab-button {
  min-width: 0;
  flex: 1 1 auto;
  margin-bottom: -1px;
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  background: #15100b;
  text-align: center;
}

.tab-button.active,
.login-open:hover {
  border-color: #e9b872;
  color: #e9b872;
}

.tab-button.active {
  background: #2b1e12;
  box-shadow: 0 6px 0 #2b1e12;
}

.tabs-toggle {
  flex: 0 0 54px;
  text-align: center;
  margin-left: auto;
}

.app-tabs.tabs-collapsed .tab-button[data-tab] {
  display: none;
}

.login-open {
  background: #1c160f;
}

.hidden {
  display: none !important;
}

.action-feedback {
  position: fixed;
  left: 50%;
  top: 18px;
  z-index: 60;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 28px));
  padding: 10px 16px;
  border: 1px solid rgba(55, 255, 119, 0.55);
  border-radius: 999px;
  background: rgba(18, 46, 24, 0.94);
  color: #dcffe4;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.36);
}

.action-feedback.bad-feedback {
  border-color: rgba(0, 0, 0, 0.8);
  background: rgba(8, 8, 8, 0.94);
  color: #ffffff;
}

.login-dialog {
  width: min(420px, calc(100% - 32px));
  border: 1px solid rgba(248, 239, 224, 0.16);
  border-radius: 24px;
  background: #16110c;
  color: #f8efe0;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
}

.login-dialog::backdrop {
  background: #000000;
}

.modal-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.login-message {
  min-height: 1.2em;
  margin: 0;
  color: #ffb3a7;
}

.shell {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 28px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
  position: relative;
}

.hero,
.panel {
  border: 1px solid rgba(248, 239, 224, 0.14);
  border-radius: 26px;
  background: #1c160f;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.32);
}

.hero {
  padding: 30px;
}

.eyebrow,
.label {
  margin: 0;
  color: #e9b872;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 12px 0 14px;
  max-width: 680px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.7rem, 7vw, 5.6rem);
  line-height: 0.92;
}

h2,
h3,
h4 {
  margin: 0;
}

p {
  color: #d8c7ad;
  line-height: 1.6;
}

.status-panel {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.status-panel > div {
  padding: 18px;
  border-radius: 18px;
  background: #2a2016;
}

.record-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.record-grid div {
  padding: 18px;
  border-radius: 18px;
  background: #2a2016;
}

strong {
  display: block;
  margin-top: 8px;
  font-size: 1.8rem;
}

.status-panel,
.admin-panel,
.events-panel {
  grid-column: 1 / -1;
}

.world-panel {
  grid-column: 1 / -1;
  grid-row: 1;
}

.shell.tabs-open .world-panel {
  grid-column: 1 / -1;
  grid-row: 1;
}

.detail-panel {
  grid-column: 2;
  align-self: start;
  position: fixed;
  right: 28px;
  top: 67px;
  z-index: 25;
  width: min(560px, calc(100vw - 56px));
  max-height: calc(100vh - 92px);
  overflow: auto;
  border-top-right-radius: 0;
}

.overlay-panel:not(.detail-panel) {
  grid-column: 1 / -1;
  position: fixed;
  right: 28px;
  top: 67px;
  z-index: 24;
  width: min(560px, calc(100vw - 56px));
  max-height: calc(100vh - 92px);
  overflow: auto;
  border-top-right-radius: 0;
}

.shell.tabs-open .overlay-panel:not(.hidden),
.shell.tabs-open .detail-panel:not(.hidden):not(.collapsed) {
  margin-top: 0;
}

.detail-panel.collapsed {
  display: none;
}

.panel {
  padding: 18px;
}

canvas {
  width: 100%;
  margin-top: 16px;
  display: block;
  border-radius: 18px;
  background: #11140e;
  cursor: grab;
  user-select: none;
}

canvas.dragging {
  cursor: grabbing;
}

.map-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
}

.map-row canvas {
  min-width: 0;
  margin-top: 0;
  flex: 1 1 auto;
}

.map-row:fullscreen {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 18px;
  background: #090806;
  align-items: stretch;
}

.map-row:fullscreen canvas {
  height: 100%;
  border-radius: 16px;
}

.map-row:fullscreen .assist-tools {
  align-self: center;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading span,
#knowledge {
  color: #e9b872;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.86rem;
}

.brand-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-heading img {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.login-form {
  display: grid;
  gap: 10px;
}

.generation-picker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: #d8c7ad;
}

.map-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  margin-left: 12px;
}

.map-toggles {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  margin-left: 12px;
  color: #d8c7ad;
  font: 0.82rem ui-monospace, monospace;
}

.map-toggles label {
  padding: 7px 9px;
  border: 1px solid rgba(248, 239, 224, 0.12);
  border-radius: 999px;
  background: #261d14;
}

.assist-tools {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 auto;
}

.intervention-hand {
  width: 178px;
  display: grid;
  gap: 8px;
  flex: 0 0 auto;
}

.intervention-heading {
  display: grid;
  gap: 5px;
  padding: 8px 9px;
  border: 1px solid rgba(248, 239, 224, 0.12);
  border-radius: 14px;
  background: #17110c;
}

.intervention-heading strong {
  color: #e9b872;
  font: 900 0.72rem ui-monospace, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intervention-heading button {
  border: 0;
  padding: 0;
  background: transparent;
  color: #d8c7ad;
  cursor: pointer;
  font: 0.72rem ui-monospace, monospace;
  text-align: left;
}

.intervention-heading button:hover {
  color: #ffdca6;
}

.intervention-card {
  min-height: 94px;
  display: grid;
  grid-template-columns: 32px 1fr;
  align-content: start;
  gap: 3px 8px;
  padding: 10px;
  border: 1px solid rgba(126, 231, 135, 0.38);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(38, 29, 20, 0.98), rgba(18, 46, 24, 0.82));
  color: #f8efe0;
  cursor: grab;
  text-align: left;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.intervention-card.bad-card {
  border-color: rgba(255, 107, 107, 0.48);
  background: linear-gradient(145deg, rgba(38, 29, 20, 0.98), rgba(58, 23, 23, 0.86));
}

.intervention-card:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.intervention-card span {
  grid-row: span 2;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(248, 239, 224, 0.1);
  color: #ffd166;
  font: 900 1rem ui-monospace, monospace;
}

.intervention-card b {
  font-size: 0.9rem;
  line-height: 1.05;
}

.intervention-card small {
  grid-column: 1 / -1;
  color: #d8c7ad;
  font-size: 0.74rem;
  line-height: 1.25;
}

.assist-tool {
  border: 1px solid rgba(233, 184, 114, 0.45);
  border-radius: 999px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: #2f2417;
  color: #f8efe0;
  cursor: grab;
  font-size: 1.35rem;
  line-height: 1;
  white-space: pre-line;
}

.bad-tool {
  border-color: rgba(255, 95, 95, 0.72);
  background: #3a1717;
}

.assist-tool:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.clan-legend {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 8;
  width: min(290px, calc(100% - 80px));
  max-height: calc(100% - 24px);
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(248, 239, 224, 0.16);
  border-radius: 18px;
  background: rgba(9, 8, 6, 0.78);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(8px);
}

.sound-popup {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 9;
  transform: translateX(-50%);
  width: min(440px, calc(100% - 112px));
  padding: 10px 14px;
  border: 1px solid rgba(233, 184, 114, 0.48);
  border-radius: 999px;
  background: rgba(9, 8, 6, 0.84);
  color: #fff5d6;
  font: 900 0.82rem ui-monospace, monospace;
  text-align: center;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.clan-legend > strong {
  display: block;
  margin: 0 0 8px;
  color: #e9b872;
  font: 900 0.76rem ui-monospace, monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.clan-legend-card {
  width: 100%;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  padding: 8px;
  border: 1px solid var(--clan-color);
  border-radius: 14px;
  background: rgba(38, 29, 20, 0.86);
  color: #f8efe0;
  text-align: left;
  cursor: pointer;
}

.clan-legend-card:hover {
  background: rgba(59, 45, 30, 0.96);
}

.clan-legend-card.at-war {
  box-shadow: inset 0 0 0 1px rgba(255, 107, 107, 0.45);
}

.clan-swatch {
  width: 12px;
  height: 28px;
  border-radius: 999px;
  background: var(--clan-color);
  color: #fff5d6;
  box-shadow: 0 0 0 1px rgba(255, 245, 214, 0.28);
  display: grid;
  place-items: center;
  font: 900 0.68rem ui-monospace, monospace;
}

.clan-legend-main {
  min-width: 0;
}

.clan-legend-main b,
.clan-legend-main small,
.clan-legend-card em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clan-legend-main b {
  color: #fff5d6;
  font-size: 0.88rem;
}

.clan-legend-main small,
.clan-legend-card em {
  color: #d8c7ad;
  font-size: 0.72rem;
  font-style: normal;
}

.clan-legend-card em {
  max-width: 76px;
  color: #e9b872;
}

.population-status .clan-status-card span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.clan-status-symbol {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  color: #fff5d6;
  font: 900 0.78rem ui-monospace, monospace;
  box-shadow: 0 0 0 1px rgba(255, 245, 214, 0.28);
}

.population-status {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.status-panel .population-status {
  grid-column: 1 / -1;
  margin-top: 0;
  padding: 0;
  background: transparent;
}

.population-status div {
  min-width: 0;
  padding: 10px 8px;
  border-radius: 14px;
  background: #261d14;
}

.population-status div.warning {
  border: 1px solid rgba(255, 209, 102, 0.65);
  background: #4a3512;
}

.population-status div.critical {
  border: 1px solid rgba(255, 49, 49, 0.72);
  background: #4a1717;
}

.population-status span,
.population-status strong {
  display: block;
}

.population-status span {
  color: #bda98b;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.population-status strong {
  margin-top: 4px;
  font-size: clamp(0.9rem, 1.5vw, 1.25rem);
}

.population-status small {
  display: block;
  margin-top: 4px;
  color: #d8c7ad;
  font-size: 0.76rem;
}

.population-status meter {
  width: 100%;
  margin-top: 8px;
}

.onboarding-tip,
.cycle-summary,
.active-objectives,
.saver-rank,
.achievements {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(248, 239, 224, 0.12);
  border-radius: 16px;
  background: #261d14;
  color: #eadbc5;
}

.onboarding-tip button {
  margin-left: 10px;
  border: 1px solid rgba(233, 184, 114, 0.35);
  border-radius: 999px;
  padding: 6px 10px;
  background: #3a2a18;
  color: #e9b872;
  cursor: pointer;
  font-weight: 800;
}

.cycle-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.war-log {
  display: grid;
  gap: 6px;
  margin: 10px 0;
}

.animal-summary {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.animal-summary div {
  padding: 10px 12px;
  border-left: 3px solid #e9b872;
  border-radius: 12px;
  background: #261d14;
}

.animal-summary span,
.animal-summary small {
  display: block;
  color: #d8c7ad;
}

.animal-summary strong {
  display: inline;
  margin: 0;
  font-size: 1rem;
}

.war-log div {
  padding: 8px 10px;
  border-left: 3px solid #ff6b6b;
  border-radius: 10px;
  background: rgba(74, 23, 23, 0.56);
}

.war-log strong,
.war-log span {
  display: block;
}

.war-log span {
  color: #eadbc5;
  font-size: 0.84rem;
}

.cycle-summary span,
.achievement {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(248, 239, 224, 0.08);
  font-size: 0.84rem;
}

.achievement[title*="Harmed"],
.achievement[title*="fear"],
.achievement[title*="damage"],
.achievement[title*="hardship"],
.achievement[title*="destructive"] {
  background: rgba(0, 0, 0, 0.28);
  color: #ffd0d0;
}

.cycle-summary small {
  flex-basis: 100%;
  color: #bda98b;
}

.achievements {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.generation-picker select,
.map-controls button,
.history-controls button {
  border: 1px solid rgba(248, 239, 224, 0.16);
  border-radius: 12px;
  padding: 9px 11px;
  background: #261d14;
  color: #f8efe0;
}

.active-objectives {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.objectives-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.objectives-heading strong {
  color: #e9b872;
  font: 900 0.78rem ui-monospace, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.objectives-heading button {
  border: 1px solid rgba(233, 184, 114, 0.32);
  border-radius: 999px;
  padding: 6px 10px;
  background: #17110c;
  color: #d8c7ad;
  cursor: pointer;
  font: 800 0.72rem ui-monospace, monospace;
}

.objectives-heading button:hover {
  color: #ffdca6;
}

.objective-card {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(233, 184, 114, 0.18);
  border-radius: 14px;
  background: rgba(23, 17, 12, 0.72);
}

.objective-card b,
.objective-card span,
.objective-card strong {
  display: block;
}

.objective-card b {
  color: #fff5d6;
  font-size: 0.92rem;
}

.objective-card span {
  margin-top: 4px;
  color: #d8c7ad;
  font-size: 0.78rem;
  line-height: 1.25;
}

.objective-card strong {
  margin-top: 8px;
  color: #e9b872;
  font: 900 0.72rem ui-monospace, monospace;
}

.objective-card meter {
  width: 100%;
  margin-top: 7px;
}

#zoom-label {
  min-width: 48px;
  color: #e9b872;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  text-align: center;
}

.history-controls {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.history-controls button:disabled {
  opacity: 0.45;
}

.login-form input,
.login-form button,
.danger-button {
  border: 1px solid rgba(248, 239, 224, 0.16);
  border-radius: 14px;
  padding: 12px 14px;
  background: #261d14;
  color: #f8efe0;
}

.login-form button,
.danger-button {
  cursor: pointer;
  font-weight: 800;
}

.danger-button {
  margin-top: 12px;
  background: #5b2424;
}

.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.admin-note {
  margin-bottom: 0;
  font-size: 0.92rem;
}

.db-stats-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
}

.db-stats-heading button {
  border: 1px solid rgba(248, 239, 224, 0.16);
  border-radius: 12px;
  padding: 9px 11px;
  background: #261d14;
  color: #f8efe0;
  cursor: pointer;
}

.db-stats {
  margin-top: 12px;
  overflow-x: auto;
}

.db-stats table {
  width: 100%;
  border-collapse: collapse;
}

.top-savers table {
  width: 100%;
  margin-top: 14px;
  border-collapse: collapse;
}

.savers-panel h3 {
  margin-top: 18px;
}

.db-stats th,
.db-stats td,
.top-savers th,
.top-savers td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(248, 239, 224, 0.12);
  text-align: left;
}

.db-stats td:last-child,
.db-stats th:last-child {
  text-align: right;
}

.top-savers td:last-child,
.top-savers th:last-child {
  text-align: right;
}

#person-detail {
  margin-top: 16px;
}

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

.person-profile {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.person-vitals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.person-vitals span {
  padding: 10px;
  border-radius: 14px;
  background: #261d14;
  color: #bda98b;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.person-vitals strong {
  margin-top: 4px;
  color: #f8efe0;
  font-size: 1rem;
  text-transform: none;
  letter-spacing: 0;
}

.portrait {
  width: 112px;
  height: 132px;
  flex: 0 0 auto;
  border: 1px solid rgba(248, 239, 224, 0.16);
  border-radius: 26px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.34);
}

.structure-portrait {
  width: 112px;
  height: 132px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(248, 239, 224, 0.16);
  border-radius: 26px;
  background: #17110c;
  color: #e6c08a;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.34);
  font: 700 0.85rem ui-monospace, monospace;
  text-transform: uppercase;
}

.person-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: #e9b872;
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.person-link:hover {
  color: #ffdca6;
}

.empty {
  color: #bda98b;
}

.trait-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.trait-grid section {
  padding: 12px;
  border-radius: 14px;
  background: #261d14;
}

ol {
  margin: 16px 0 0;
  padding-left: 22px;
  color: #eadbc5;
}

.life-timeline {
  padding-left: 0;
  list-style: none;
}

.life-timeline li {
  padding: 8px 10px;
  border-left: 3px solid rgba(233, 184, 114, 0.36);
  border-radius: 8px;
  background: rgba(248, 239, 224, 0.035);
}

.life-timeline span {
  display: inline-block;
  min-width: 72px;
  color: #e9b872;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-weight: 900;
}

.life-timeline .timeline-birth,
.life-timeline .timeline-relationship,
.life-timeline .timeline-discovery {
  border-left-color: #7ee787;
}

.life-timeline .timeline-conflict,
.life-timeline .timeline-death {
  border-left-color: #ff6b6b;
}

li {
  margin: 9px 0;
}

#events li {
  padding: 8px 10px;
  border-left: 3px solid rgba(233, 184, 114, 0.28);
  border-radius: 8px;
  background: rgba(248, 239, 224, 0.035);
}

#events li.event-saver,
#events li.event-birth,
#events li.event-success,
#events li.event-discovery {
  border-left-color: #7ee787;
}

#events li.event-destroyer,
#events li.event-death,
#events li.event-conflict,
#events li.event-extinction {
  border-left-color: #ff6b6b;
}

#events li.event-environment {
  border-left-color: #ffd166;
}

#events li.event-clan {
  border-left-color: #ffcf5a;
}

#events li.event-migration {
  border-left-color: #8ed7ff;
}

#events li.favorite-event {
  box-shadow: inset 0 0 0 1px rgba(247, 233, 103, 0.32);
  background: rgba(247, 233, 103, 0.07);
}

.favorite-person {
  margin-top: 8px;
  border: 1px solid rgba(247, 233, 103, 0.4);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(247, 233, 103, 0.12);
  color: #f7e967;
  cursor: pointer;
  font-weight: 900;
}

#events span {
  color: #e9b872;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  margin-right: 10px;
}

#events strong {
  display: inline;
  margin: 0 10px 0 0;
  font-size: 0.78rem;
  text-transform: uppercase;
}

#app-version {
  position: fixed;
  left: 12px;
  bottom: 10px;
  z-index: 20;
  padding: 7px 10px;
  border: 1px solid rgba(248, 239, 224, 0.16);
  border-radius: 999px;
  background: #090806;
  color: #e9b872;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.78rem;
}

@media (max-width: 860px) {
  .topbar {
    top: 60px;
    left: 14px;
    right: 72px;
    width: auto;
  }

  .saver-summary {
    flex-wrap: wrap;
    border-radius: 18px;
  }

  .brand-heading {
    align-items: flex-start;
  }

  .brand-heading img {
    width: 44px;
    height: 44px;
  }

  .shell {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .status-panel,
  .population-status,
  .active-objectives,
  .trait-grid {
    grid-template-columns: 1fr;
  }

  .app-tabs {
    left: 14px;
    right: 14px;
    top: 64px;
    width: auto;
  }

  .world-panel,
  .detail-panel {
    grid-column: 1;
    position: static;
  }
}
.home-link {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 1000;
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  color: #fff;
  background: rgba(15, 23, 42, 0.72);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.home-link:hover,
.home-link:focus-visible {
  background: rgba(56, 189, 248, 0.9);
  outline: none;
}
