html, body { margin: 0; padding: 0; width: 100%; height: 100%; }
#app { display: flex; flex-direction: column; height: 100vh; background: #0f1215; color: #e7ecef; }

.hud { display: grid; grid-template-columns: repeat(5, 1fr) auto auto; gap: 10px; align-items: center; padding: 12px; background: #161b20; border-bottom: 1px solid #22282e; }
.stat { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.stat.time { grid-template-columns: auto auto; font-weight: 600; }
.label { color: #8ea6b2; font-size: 12px; }
.value { font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: #1f252b; border-radius: 6px; overflow: hidden; }
.fill { height: 100%; width: 50%; background: linear-gradient(90deg, #3ad29f, #22b17f); transition: width .25s ease; }
#staminaFill { background: linear-gradient(90deg, #6aa9ff, #3e7fe0); }
#hungerFill { background: linear-gradient(90deg, #ffb86b, #e88a2a); }
#moraleFill { background: linear-gradient(90deg, #b87bff, #8a4be8); }

.icon-btn { background: #1b2229; color: #cfe3ea; border: 1px solid #25303a; border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.icon-btn:hover { background: #222a32; }

.main { display: grid; grid-template-rows: 1fr auto auto; height: calc(100vh - 60px); }
.log { padding: 16px; overflow-y: auto; }
.entry { background: #151a1f; border: 1px solid #222931; border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.entry .title { font-weight: 700; margin-bottom: 6px; color: #cfe3ea; }
.entry .meta { font-size: 12px; color: #8ea6b2; margin-bottom: 6px; }
.entry .narration { line-height: 1.5; }

.quick-actions { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 8px 16px; border-top: 1px solid #22282e; background: #111519; }
.quick-actions button { padding: 10px 12px; background: #20262d; color: #e7ecef; border: 1px solid #2a333c; border-radius: 10px; cursor: pointer; }
.quick-actions button:hover { background: #252c35; }

.input-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px 16px; border-top: 1px solid #22282e; background: #0f1215; }
.input-row input { background: #161c22; color: #e7ecef; border: 1px solid #26303a; border-radius: 10px; padding: 12px; outline: none; }
.input-row input:focus { border-color: #3ad29f; box-shadow: 0 0 0 2px #3ad29f33; }
.input-row button { padding: 12px 16px; background: #27b586; color: #071216; border: none; border-radius: 10px; font-weight: 700; cursor: pointer; }
.input-row button:hover { background: #22a377; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; justify-content: center; }
.modal.hidden { display: none; }
.sheet { width: 100%; max-width: 720px; background: #151a1f; border: 1px solid #222931; border-radius: 16px 16px 0 0; padding: 16px; }
.sheet h2 { margin: 0 0 8px 0; }
.sheet .content { color: #cfe3ea; }
.sheet .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.toggle { display: inline-flex; gap: 8px; align-items: center; margin-top: 8px; }

.loading { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.35); }
.loading.hidden { display: none; }
.spinner { width: 48px; height: 48px; border: 5px solid #2a333c; border-top-color: #3ad29f; border-radius: 50%; animation: spin 1s linear infinite; }
.tip { margin-top: 8px; color: #cfe3ea; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .hud { grid-template-columns: repeat(3, 1fr) auto auto; row-gap: 6px; }
  .quick-actions { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 520px) {
  .hud { grid-template-columns: repeat(2, 1fr) auto; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
}

