*, *::before, *::after { box-sizing: border-box; }
html, body, figure, h1, h2, p, dl, dd, ul { margin: 0; }
ul { padding: 0; }
body { min-height: 100vh; }
.container { min-height: 100dvh; }

.topbar { position: sticky; top: 0; z-index: 2; }
.topbar-stats, .bars { display: flex; flex-wrap: wrap; }
.bar-wrap { min-width: 0; flex: 1; }
.bar-label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 3px; }
.bar-bg { height: 5px; overflow: hidden; border-radius: 3px; }
.bar-fill { height: 100%; border-radius: inherit; }
.rank-badge { display: inline-block; vertical-align: baseline; border-radius: 2px; }

.attr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.attr-row { display: flex; justify-content: space-between; flex-wrap: wrap; min-width: 0; }
.attr-val { font-weight: 650; }
.panel-title { margin-bottom: 8px; }
summary { border-bottom: 1px solid; }
.log-entry { border-bottom: 1px dashed #dcccac; }
.log-entry:last-child { border-bottom: 0; }
.log-date { margin-right: 8px; }
.log-event { color: #76441d; }
.log-system { color: #655e4b; }
.log-bad { color: #79301f; }

.action-bar { display: grid; z-index: 3; }
.action-btn, .modal-btn, .start-btn, .slot-btn { cursor: pointer; }
button:disabled { cursor: not-allowed; }
.start-screen, .ending-screen { text-align: center; }
.name-input, .child-name-input {
  min-height: 44px;
  max-width: 100%;
  font: inherit;
  font-size: 16px;
}
.child-name-input {
  width: 100%;
  padding: 8px 10px;
  margin: 5px 0 12px;
  border: 1px solid #b9a986;
  border-radius: 2px;
  background: #fffaf0;
  color: #25332a;
}
.modal { overflow-y: auto; overscroll-behavior: contain; }
.modal-text { white-space: pre-line; margin-bottom: 16px; }
.modal-btn { display: block; width: 100%; margin: 8px 0 0; padding: 8px 12px; }
.slot-list { display: grid; gap: 8px; margin: 6px 0 12px; }
.slot-row { padding: 10px 12px; border: 1px solid #cdbb97; }
.slot-sub { font-size: 12px; color: #655e4b; }
.slot-head { font-weight: 700; }
.slot-actions { display: flex; gap: 7px; margin-top: 5px; }
.slot-btn { padding: 6px 12px; }