:root { --sand: #e9c98f; --ink: #1b140e; --panel: rgba(24, 18, 12, 0.88); --line: rgba(233, 201, 143, 0.35); --hot: #ff9a3c; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d0a07; color: var(--sand);
  font: 15px/1.35 "Trebuchet MS", "Segoe UI", system-ui, sans-serif; -webkit-user-select: none; user-select: none; touch-action: none; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
button { font: inherit; font-weight: 700; letter-spacing: 0.06em; color: var(--ink); background: var(--sand); border: 0;
  border-radius: 6px; padding: 10px 18px; cursor: pointer; }
button:hover, button.sel { background: #fff0cc; }
button.ghost { background: transparent; color: var(--sand); border: 1px solid var(--line); }
button:disabled { opacity: 0.4; cursor: default; }
kbd { font: 11px monospace; padding: 1px 4px; border: 1px solid currentColor; border-radius: 3px; opacity: 0.7; }

.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.25), rgba(0,0,0,0.7)); }
#title { background: radial-gradient(ellipse at 50% 80%, rgba(255,140,40,0.18), rgba(0,0,0,0.75)); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 22px 26px; width: min(420px, 100%);
  display: flex; flex-direction: column; gap: 10px; text-align: center; max-height: 100%; overflow: auto; }
.panel.wide { width: min(720px, 100%); }
.panel h1 { margin: 0; font-size: 56px; letter-spacing: 0.18em; color: #ffd59a; text-shadow: 0 3px 0 #6b3a12, 0 0 30px rgba(255,140,40,0.5); }
.panel h2 { margin: 0 0 4px; letter-spacing: 0.15em; }
.tag { margin: -4px 0 8px; opacity: 0.8; letter-spacing: 0.1em; }
.small { font-size: 13px; opacity: 0.85; }
#menuMain, #menuNew, #menuHow { display: flex; flex-direction: column; gap: 10px; }
.pick { display: flex; gap: 10px; }
.pick button { flex: 1; display: flex; flex-direction: column; padding: 16px; }
.pick small { font-weight: 400; opacity: 0.7; }
.how { text-align: left; margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#hud button { pointer-events: auto; }
#top { position: absolute; left: 12px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
#clock { display: flex; gap: 10px; align-items: baseline; background: var(--panel); padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); }
#clock b { font-size: 18px; }
#clock span { opacity: 0.85; }
#time { font-family: monospace; font-size: 16px; }
#res { display: flex; flex-wrap: wrap; gap: 6px; }
.r { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; font-size: 13px; }
.r b { color: #fff3d6; margin-left: 4px; }
.r.bump { animation: bump 0.5s; }
@keyframes bump { 0% { transform: scale(1.3); background: #6b3a12; } 100% { transform: scale(1); } }
#vitals { position: absolute; left: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 6px; width: 220px; }
.bar { position: relative; height: 22px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; background: linear-gradient(#b8432a, #7e2414); }
.bar span { position: relative; padding-left: 8px; font-size: 13px; line-height: 22px; }
#morale { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; font-size: 13px; }
#topBtns { position: absolute; right: 12px; top: 10px; display: flex; gap: 8px; }
#prompt { position: absolute; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 14px; min-width: 220px; text-align: center; display: none; }
#prompt.on { display: block; }
#prog { height: 5px; background: rgba(255,255,255,0.12); border-radius: 3px; margin-top: 6px; overflow: hidden; }
#progBar { display: block; height: 100%; width: 0; background: var(--hot); }
#bUse { position: absolute; right: 18px; bottom: 26px; width: 84px; height: 84px; border-radius: 50%; font-size: 17px; }
#toasts { position: absolute; right: 12px; top: 60px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.toast { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; font-size: 13px; animation: toast 3.2s forwards; }
@keyframes toast { 0% { opacity: 0; transform: translateY(-6px); } 8%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }
#banner { position: absolute; left: 50%; top: 28%; transform: translateX(-50%); text-align: center; font-size: 30px; font-weight: 700;
  letter-spacing: 0.12em; color: #ffe1b0; text-shadow: 0 2px 8px #000; opacity: 0; transition: opacity 0.6s; width: 90%; }
#banner small { display: block; font-size: 15px; letter-spacing: 0.04em; font-weight: 400; margin-top: 6px; }
#banner.on { opacity: 1; }

#zones { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; text-align: left; }
.zone { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.zone h3 { margin: 0; display: flex; justify-content: space-between; }
.stars { color: var(--hot); letter-spacing: 2px; }
.tiers { display: flex; gap: 4px; font-size: 11px; }
.tiers span { flex: 1; text-align: center; padding: 3px 0; border-radius: 4px; background: rgba(255,255,255,0.06); opacity: 0.6; }
.tiers span.done { background: #6b3a12; opacity: 1; }
.tiers span.lock { opacity: 0.3; }
.zone .need { font-size: 13px; opacity: 0.9; }
.zone .need .short { color: #ff7a5a; }
.zone .what { font-size: 13px; opacity: 0.75; }

@media (max-width: 640px) {
  .panel h1 { font-size: 40px; }
  #zones { grid-template-columns: 1fr; }
  #clock b { font-size: 15px; }
  #clock { gap: 6px; padding: 4px 8px; font-size: 12px; }
  #vitals { width: 160px; }
  #prompt { bottom: 130px; min-width: 0; width: calc(100% - 140px); left: 12px; transform: none; }
  #top { right: 118px; }
  #topBtns button { padding: 8px 10px; }
  #toasts { top: auto; bottom: 200px; left: 12px; align-items: flex-start; }
  #topBtns kbd { display: none; }
}
