:root {
  --steel: #16181c;
  --steel-2: #1e2228;
  --brass: #c4a574;
  --brass-d: #8a6a3e;
  --cyan: #3ecfff;
  --steam: #5ee0c8;
  --ink: #e8e0d4;
  --dim: #9a9184;
  --fail: #e07050;
  --ok: #7dcea0;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  background: radial-gradient(1200px 800px at 50% 20%, #242830, 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%;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
}
#menu[hidden], #play[hidden] { display: none !important; }
.pitch {
  width: min(720px, 94vw);
  background: linear-gradient(#2a2e36, #14161a);
  border: 1px solid var(--brass-d);
  border-radius: 16px;
  padding: 22px 22px 18px;
  box-shadow: 0 20px 60px #000a, inset 0 1px 0 #c4a57433;
}
.pitch img.card {
  width: 100%;
  max-height: 140px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #3a3428;
  display: block;
  margin-bottom: 10px;
}
.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;
  font-weight: 600;
}
.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 {
  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;
  background: linear-gradient(#2a2e36, #16181c);
  border: 1px solid #3a3428;
  border-radius: 10px;
  box-shadow: inset 0 1px 0 #4a4030, 0 8px 24px #0008;
  flex-wrap: wrap;
}
.brand {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0;
  font-family: Cinzel, Palatino, serif;
  letter-spacing: 0.14em;
  color: var(--brass);
  min-width: 3rem;
  z-index: 2;
}
.level-title { margin-left: 8px; }
.brand img { width: 28px; height: 28px; border-radius: 6px; }
.stat { display: flex; flex-direction: column; min-width: 56px; }
.stat b { font-variant-numeric: tabular-nums; font-size: 1.05rem; 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; letter-spacing: 0.08em; }
.sight {
  width: 72px; height: 22px;
  border: 1px solid var(--brass-d);
  border-radius: 999px;
  background: #0c1014;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 8px #000;
}
.sight-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #2a6a50, #c4c070 60%, var(--fail));
  position: relative;
  transition: width 0.2s linear;
}
.sight-fill.puff::after {
  content: "";
  position: absolute; right: -6px; top: -8px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #9ad4e8; opacity: 0.7;
  animation: steampuff 0.8s ease-out infinite;
}
@keyframes steampuff {
  0% { transform: translate(0,0) scale(0.6); opacity: 0.7; }
  100% { transform: translate(8px,-14px) scale(1.4); opacity: 0; }
}
.sight em {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 0.62rem; letter-spacing: 0.16em;
  color: var(--ink); font-style: normal;
}
#view-wrap {
  position: relative;
  border: 2px solid var(--brass-d);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 0 4px #0c0c0e, inset 0 0 40px #0006;
  background: #12161c;
  min-height: 0;
}
#view { width: 100%; height: 100%; display: block; cursor: pointer; }
.status {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
  pointer-events: none; letter-spacing: 0.16em; text-transform: uppercase;
  font-size: 0.78rem; color: var(--steam);
  text-shadow: 0 0 12px #000;
}
.status.fail { color: var(--fail); }
.modal {
  position: fixed;
  inset: 0; display: grid; place-items: center;
  background: #0c0c0ed4; z-index: 80;
}
.modal[hidden] { display: none !important; }
.panel {
  width: min(440px, 92vw);
  background: linear-gradient(#2a2e36, #14161a);
  border: 1px solid var(--brass);
  border-radius: 12px; padding: 22px;
  box-shadow: 0 20px 60px #000a;
}
.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; }
.grow { flex: 1; }
.ad-slot { min-height: 0; margin-top: 12px; }
.ad-slot[data-ad-state="off"] { display: none; }
label.hint { display: flex; flex-direction: column; gap: 4px; }
