:root{
  --bg:#f3ede6;
  --panel:#fbf7f2;
  --ink:#4a4038;
  --muted:#9a8f83;
  --line:#e7ddd2;
  --accent:#c9a27a;
}
*{box-sizing:border-box}
html,body{margin:0}
body{
  font-family:"Segoe UI",system-ui,-apple-system,sans-serif;
  background:var(--bg);
  color:var(--ink);
  display:flex;justify-content:center;
  padding:16px;
  min-height:100vh;
}
#app{width:100%;max-width:520px}

.topbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.topbar h1{font-size:22px;margin:0;font-weight:600;letter-spacing:.3px}
#settingsBtn{
  border:none;background:none;font-size:20px;cursor:pointer;color:var(--muted);
  padding:4px 8px;border-radius:8px;line-height:1;
}
#settingsBtn:hover{background:var(--line)}

#roomWrap{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:16px;
  padding:10px;
  box-shadow:0 6px 20px rgba(120,100,80,.08);
}
#room{
  display:block;width:100%;height:auto;
  image-rendering:pixelated;
  image-rendering:crisp-edges;
  border-radius:10px;
}

.status{
  text-align:center;color:var(--muted);
  font-size:14px;margin:12px 4px 14px;min-height:1.2em;
}

.logbox{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px 14px;
}
.logbox h2{
  font-size:12px;text-transform:uppercase;letter-spacing:.12em;
  color:var(--muted);margin:0 0 8px;font-weight:600;
}
#log{list-style:none;margin:0;padding:0}
#log li{
  display:flex;justify-content:space-between;gap:10px;
  font-size:14px;padding:5px 0;border-top:1px solid var(--line);
}
#log li:first-child{border-top:none}
#log li .t{color:var(--muted);font-size:12px;white-space:nowrap;flex:none}
#log li.rare .msg{color:var(--accent);font-weight:600}

.foot{text-align:center;color:var(--muted);font-size:12px;margin:16px 0 4px;line-height:1.6}
.foot .credit{font-size:10px;opacity:.7}

/* modal */
.modal{
  position:fixed;inset:0;background:rgba(60,50,40,.45);
  display:flex;align-items:center;justify-content:center;padding:20px;z-index:10;
}
.modal.hidden{display:none}
.card{
  background:var(--panel);border-radius:18px;padding:22px;width:100%;max-width:340px;
  box-shadow:0 12px 40px rgba(80,60,40,.25);
}
.card h2{margin:0 0 16px;font-size:19px;font-weight:600}
.fld{display:block;margin-bottom:16px}
.fld>span{display:block;font-size:13px;color:var(--muted);margin-bottom:6px}
#nameInput{
  width:100%;padding:11px 12px;border:1px solid var(--line);border-radius:10px;
  font-size:15px;background:#fff;color:var(--ink);
}
#nameInput:focus{outline:2px solid var(--accent);border-color:transparent}
.colors{display:flex;gap:8px}
.swatch{
  flex:1;padding:9px 4px 9px;border:2px solid var(--line);border-radius:10px;
  background:#fff;cursor:pointer;font-size:12px;color:var(--ink);
  display:flex;flex-direction:column;align-items:center;gap:6px;
}
.swatch::before{content:"";width:22px;height:22px;border-radius:50%;background:var(--c);border:1px solid rgba(0,0,0,.1)}
.swatch.sel{border-color:var(--accent);background:#fdf6ee}
.primary{
  width:100%;padding:12px;border:none;border-radius:10px;
  background:var(--accent);color:#fff;font-size:15px;font-weight:600;cursor:pointer;
}
.primary:hover{filter:brightness(1.05)}
