: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); }
.compass {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 30;
  padding: 8px;
  background: #16181cee;
  border: 1px solid var(--brass-d);
  border-radius: 12px;
  pointer-events: auto;
}
.zoom-row { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.compass-pad { display: grid; grid-template-columns: 36px 36px 36px; gap: 4px; }
.compass button { width: 36px; height: 36px; padding: 0; font-size: 1rem; }
.zoom-row button { width: 100%; }
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%;
  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;
  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; align-items: center; gap: 8px;
  font-family: Cinzel, Palatino, serif;
  letter-spacing: 0.1em;
  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; 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; }
#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: #121014;
  min-height: 0;
}
#view { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.brief {
  position: absolute; left: 16px; top: 16px; max-width: 280px;
  background: #1c1812ee; border: 1px solid var(--brass-d); border-radius: 10px;
  padding: 10px 12px; pointer-events: none; font-size: 0.85rem; color: var(--ink);
  box-shadow: 0 8px 24px #0008; z-index: 3;
}
.brief b { color: var(--brass); font-family: Cinzel, Palatino, serif; display: block; margin-bottom: 4px; }
.status {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
  pointer-events: none; letter-spacing: 0.08em;
  font-size: 0.78rem; color: var(--amber);
  text-shadow: 0 0 12px #000;
  max-width: 86%;
  text-align: center;
  z-index: 3;
}
.status:empty { display: none; }
.status.fail { color: var(--fail); }
.modal {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: #0c0c0ed4; z-index: 5;
}
.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; }
label.hint { display: flex; flex-direction: column; gap: 4px; }

.pad { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pad button { min-width: 48px; min-height: 44px; font-size: 1.05rem; }
#pad-use {
  min-width: 72px;
  background: var(--brass);
  color: #1a120c;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}
#pad-use:hover { color: #1a120c; border-color: var(--ink); }

#file-hint {
  position: fixed; inset: 0; background: #121418; color: #efe6d8;
  place-items: center; padding: 24px; z-index: 99; text-align: center;
  font-family: sans-serif;
}
#file-hint[hidden] { display: none !important; }

@media (max-width: 820px) {
  .hud .hof { max-height: 4.5rem; min-width: 8rem; }
  .level-title { min-width: 80px; }
  .brief { max-width: 46vw; font-size: 0.75rem; }
}
