:root {
  --steel: #16120e;
  --brass: #c4a574;
  --brass-d: #8a6a3e;
  --cyan: #3ecfff;
  --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 640px at 50% -8%, #2a2218 0%, transparent 55%), 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;
}
#menu { min-height: 100%; max-height: 100%; display: grid; place-items: start center; padding: 12px; overflow: auto; }
#menu[hidden], #play[hidden] { display: none !important; }
.pitch {
  width: min(920px, 96vw);
  background: linear-gradient(#2a2e36, #14161a);
  border: 1px solid var(--brass-d);
  border-radius: 16px;
  padding: 16px 18px 18px;
  box-shadow: 0 20px 60px #000a, inset 0 1px 0 #c4a57433;
}
.pitch img.card {
  width: 100%;
  max-height: min(56vh, 520px);
  object-fit: cover;
  object-position: center 42%;
  border-radius: 12px;
  border: 1px solid #3a3428;
  display: block;
  margin-bottom: 12px;
}
.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; }
.beasts { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 8px; margin: 12px 0; }
.beast {
  text-align: center;
  padding: 8px 8px 10px;
}
.beast canvas {
  display: block;
  width: 100%;
  height: 76px;
  background: #12161c;
  border-radius: 8px;
  border: 1px solid #3a3428;
  margin-bottom: 6px;
}
.beast b { display: block; color: var(--brass); font-family: Cinzel, Palatino, serif; }
.beast span { display: block; color: var(--dim); font-size: 0.75rem; line-height: 1.3; }
.beast.on { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan); }
.panel.beasts-panel { width: min(760px, 94vw); max-height: min(88vh, 720px); overflow: auto; }
.pitch .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
#play { display: grid; grid-template-rows: auto 1fr auto; height: 100%; padding: 10px; gap: 8px; }
.hud, .dock {
  display: flex; align-items: center; gap: 12px; padding: 8px 14px; flex-wrap: wrap;
  background: linear-gradient(#2a2e36, #16181c); border: 1px solid #3a3428; border-radius: 10px;
}
.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 { font-variant-numeric: tabular-nums; color: var(--cyan); }
.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: 120px; }
.level-title small { display: block; color: var(--dim); font-family: "Source Sans 3", sans-serif; }
#view-wrap {
  position: relative; border: 2px solid var(--brass-d); border-radius: 12px; overflow: hidden;
  background: #12161c; min-height: 0;
}
#view { width: 100%; height: 100%; display: block; touch-action: none; }
.status {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
  pointer-events: none; font-size: 0.78rem; color: var(--amber); z-index: 3;
}
.modal { position: absolute; inset: 0; display: grid; place-items: center; background: #0c0c0ed4; z-index: 5; }
.modal[hidden] { display: none !important; }
#animal-modal { z-index: 6; }
#pause-modal { z-index: 5; }
.modal.ready {
  background: transparent;
  pointer-events: none;
  align-items: end;
  z-index: 4;
}
.ready-msg {
  margin: 0 0 12%;
  padding: 10px 18px;
  font-family: Cinzel, Palatino, serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
  background: #0c0c0ecc;
  border: 1px solid var(--brass-d);
  border-radius: 10px;
}
.panel {
  width: min(440px, 92vw);
  background: linear-gradient(#2a2e36, #14161a);
  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); }
.panel.amazing { border-color: var(--amber); text-align: center; }
.panel.amazing h2 { color: var(--amber); font-size: 1.6rem; letter-spacing: 0.08em; }
.yell { color: var(--ink) !important; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; }
.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; }
.hof select { width: 100%; margin-bottom: 4px; font-size: 0.75rem; }
.pad { display: flex; gap: 8px; }
#pad-flap {
  min-width: 160px; min-height: 48px;
  background: var(--brass); color: #1a120c;
  text-transform: uppercase; letter-spacing: 0.12em; 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: 5.5rem; min-width: 8rem; }
  .level-title { min-width: 80px; }
}
