:root {
  --steel: #120e0a;
  --brass: #c4a574;
  --brass-d: #8a6a3e;
  --ink: #efe6d8;
  --dim: #9a9184;
  --fail: #e07050;
  --ok: #7dcea0;
  --amber: #e8c040;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  background:
    radial-gradient(1100px 620px at 50% -12%, #3a2818 0%, transparent 52%),
    var(--steel);
  color: var(--ink);
  overflow: hidden;
}
a { color: var(--brass); text-decoration: none; letter-spacing: 0.12em; }
button, select, input {
  font: inherit; color: var(--ink);
  background: #2a241c; border: 1px solid var(--brass-d); border-radius: 8px;
  padding: 6px 10px; cursor: pointer;
}
button:hover, select:hover { border-color: var(--brass); color: var(--brass); }
button.primary {
  background: linear-gradient(#3a3228, #2a241c);
  color: var(--brass); letter-spacing: 0.14em; text-transform: uppercase; padding: 10px 18px;
}
button:disabled { opacity: 0.4; cursor: default; }
#menu { min-height: 100%; display: grid; place-items: center; padding: 24px; overflow: auto; }
#menu[hidden], #play[hidden] { display: none !important; }
.pitch {
  width: min(720px, 94vw);
  background: linear-gradient(#2a2218, #14110c);
  border: 1px solid var(--brass-d); border-radius: 16px; padding: 22px;
  box-shadow: 0 20px 60px #000a, inset 0 1px 0 #c4a57433;
}
.pitch img.card { width: 100%; border-radius: 12px; border: 1px solid #3a3428; display: block; margin-bottom: 14px; }
.kicker { letter-spacing: 0.28em; text-transform: uppercase; color: var(--dim); font-size: 0.75rem; }
.pitch h1 { font-family: Cinzel, Palatino, serif; color: var(--brass); margin: 6px 0 8px; }
.pitch p { color: var(--dim); line-height: 1.45; }
.pitch .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
#play { position: relative; display: grid; grid-template-rows: auto 1fr auto auto; height: 100%; padding: 10px; gap: 8px; }
#fx-layer {
  position: absolute; inset: 0; width: 100%; height: 100%;
  grid-area: 1 / 1 / -1 / -1;
  pointer-events: none; z-index: 4;
}
#view.holding, #view-wrap.holding, #view-wrap.holding #view { cursor: none !important; }
.hud, .dock, .belt {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px; flex-wrap: wrap;
  background: linear-gradient(#2a241c, #16120e); border: 1px solid #3a3428; border-radius: 10px;
  box-shadow: inset 0 1px 0 #c4a57422;
}
.hud { position: relative; z-index: 5; }
.brand { display: flex; align-items: center; gap: 8px; font-family: Cinzel, Palatino, serif; color: var(--brass); }
.brand img { width: 28px; height: 28px; border-radius: 6px; }
.stat { display: flex; flex-direction: column; min-width: 52px; }
.stat b { color: var(--amber); font-variant-numeric: tabular-nums; }
.stat span { font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.level-title { font-family: Cinzel, Palatino, serif; flex: 1; min-width: 140px; }
.level-title small { display: block; color: var(--dim); font-family: "Source Sans 3", sans-serif; font-size: 0.75rem; letter-spacing: 0.02em; }
.how-link {
  display: inline-flex; align-items: center;
  border: 1px solid var(--brass-d); border-radius: 8px;
  padding: 6px 12px; color: var(--brass);
}
.how-link:hover { border-color: var(--brass); }
#view-wrap {
  position: relative; overflow: hidden; min-height: 0;
  border: 3px solid var(--brass);
  border-radius: 6px;
  background: #0a0806;
  box-shadow:
    0 0 0 5px #2a1c12,
    0 0 0 7px #8a6a3e,
    inset 0 0 80px #0006;
}
#view { width: 100%; height: 100%; display: block; touch-action: none; user-select: none; }
.status {
  position: absolute; left: 18px; right: 18px; bottom: 14px;
  background: #1c1610ee; border: 1px solid var(--brass-d); border-radius: 8px;
  padding: 8px 12px; color: var(--amber); font-size: 0.85rem; z-index: 3;
  pointer-events: none;
  box-shadow: 0 8px 24px #0008;
}
.modal { position: absolute; inset: 0; display: grid; place-items: center; background: #0c0a08d8; z-index: 5; }
.modal[hidden] { display: none !important; }
.panel {
  width: min(440px, 92vw);
  background: linear-gradient(#2a241c, #14110c);
  border: 1px solid var(--brass); border-radius: 12px; padding: 22px;
}
.panel h2 { font-family: Cinzel, Palatino, serif; color: var(--brass); margin: 0 0 8px; }
.panel p { color: var(--dim); }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.hint { color: var(--dim); font-size: 0.8rem; }
label.hint { display: flex; flex-direction: column; gap: 4px; }
.rooms, .inv { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.belt { position: relative; z-index: 3; justify-content: space-between; align-items: flex-end; background: linear-gradient(#241c14, #16120e); }
.rooms button.room-chip {
  width: 68px; padding: 4px;
  display: flex; flex-direction: column; gap: 3px; align-items: center;
  font-size: 0.62rem; letter-spacing: 0.04em; color: var(--dim);
}
.rooms button.room-chip img {
  width: 100%; height: 38px; object-fit: cover; border-radius: 4px;
  border: 1px solid #3a3428; display: block; filter: grayscale(0.2);
}
.rooms button.room-chip.on { border-color: var(--amber); color: var(--amber); }
.rooms button.room-chip.on img { border-color: var(--amber); filter: none; box-shadow: 0 0 10px #e8c04044; }
.rooms button.room-chip:disabled img { filter: grayscale(1) brightness(0.45); }
.rooms button.room-chip.soon img { filter: grayscale(1) brightness(0.42); }
.rooms button.room-chip .soon-tag {
  font-style: normal; font-size: 0.52rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--brass);
}
.item {
  width: 74px; padding: 6px 4px 5px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: radial-gradient(circle at 40% 30%, #2a2218, #14100c);
}
.item .glyph { width: 48px; height: 48px; display: block; }
.item .item-name {
  font-size: 0.62rem; line-height: 1.15; text-align: center;
  color: var(--dim); max-width: 68px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.item.on { border-color: var(--amber); color: var(--amber); box-shadow: 0 0 12px #e8c04055; }
.item.on .item-name { color: var(--amber); }
.item.held { opacity: 0.48; }
.empty { color: var(--dim); font-size: 0.78rem; }
#pad-nudge { min-width: 120px; min-height: 44px; background: var(--brass); color: #1a120c; font-weight: 700; }
#file-hint {
  position: fixed; inset: 0; background: #121418; color: #efe6d8;
  place-items: center; padding: 24px; z-index: 99; text-align: center;
}
#file-hint[hidden] { display: none !important; }
@media (max-width: 820px) {
  .hud .hof { max-height: 4.5rem; min-width: 8rem; }
  .level-title { min-width: 80px; }
  .level-title small { display: none; }
  .rooms button.room-chip { width: 56px; }
  .item { width: 62px; }
  .item .glyph { width: 40px; height: 40px; }
}
