html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #14100c;
  font-family: Georgia, 'Times New Roman', serif;
  color: #e8dcc8;
}
canvas { display: block; }

#toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  max-width: 70vw;
  padding: 10px 18px;
  background: rgba(20, 14, 8, 0.92);
  border: 1px solid #6b5636;
  border-radius: 8px;
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 30;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

#inventory {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 20;
}
.inv-item {
  padding: 6px 12px;
  background: rgba(20, 14, 8, 0.85);
  border: 1px solid #6b5636;
  border-radius: 999px;
  font-size: 14px;
}

#panel {
  position: fixed;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  width: min(560px, 92vw);
  background: rgba(24, 17, 10, 0.95);
  border: 1px solid #6b5636;
  border-radius: 12px;
  padding: 14px 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 25;
}
#panel.show { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.panel-title { font-size: 18px; color: #f0d9a8; margin-bottom: 8px; }
.panel-body { font-size: 15px; line-height: 1.45; }
.panel-body img { max-width: 140px; border-radius: 4px; display: block; margin: 8px auto; }
.panel-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.btn {
  font-family: inherit;
  font-size: 14px;
  padding: 7px 14px;
  background: #3a2c1a;
  color: #e8dcc8;
  border: 1px solid #8a6d3f;
  border-radius: 8px;
  cursor: pointer;
}
.btn:hover { background: #4d3a22; }
.btn.dial {
  width: 38px;
  padding: 7px 0;
  text-align: center;
}

#door-input {
  font-family: inherit;
  font-size: 16px;
  letter-spacing: 0.35em;
  width: 150px;
  padding: 7px 10px;
  background: #171008;
  color: #f0d9a8;
  border: 1px solid #8a6d3f;
  border-radius: 8px;
  text-transform: uppercase;
}

#start, #victory {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: radial-gradient(ellipse at center, rgba(30, 22, 12, 0.96), rgba(10, 7, 4, 0.98));
  z-index: 40;
  text-align: center;
  padding: 20px;
}
#start h1, #victory h1 { font-size: 44px; margin: 0; color: #f0d9a8; letter-spacing: 0.08em; }
#start p { max-width: 420px; line-height: 1.5; color: #cbb894; }
#start button, #victory button {
  font-family: inherit;
  font-size: 18px;
  padding: 12px 28px;
  background: #4d3a22;
  color: #f0d9a8;
  border: 1px solid #8a6d3f;
  border-radius: 10px;
  cursor: pointer;
}
#start button:hover, #victory button:hover { background: #5f4829; }
.hidden { display: none !important; }
