/* NUTS browser page: black, white text, console look */
html, body {
  margin: 0;
  height: 100%;
  background: #000;
  color: #fff;
  font: 16px/1.5 Consolas, "Lucida Console", Menlo, monospace;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 16px;
}

h1 { font-size: 32px; letter-spacing: 4px; margin: 0 0 24px; }
h2 { font-size: 16px; letter-spacing: 2px; margin: 24px 0 4px; }
section { margin: 0 0 24px; }
p { margin: 4px 0; }
.dim { color: #888; }
.small { font-size: 13px; }
.bad { color: #f55; }

ul { list-style: none; margin: 8px 0; padding: 0; }
li { display: flex; align-items: center; gap: 12px; padding: 4px 0; border-bottom: 1px solid #222; }
li .wadname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
li .kind { color: #888; width: 56px; }
li label { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; cursor: pointer; }

button {
  font: inherit;
  color: #000;
  background: #fff;
  border: 0;
  padding: 6px 16px;
  letter-spacing: 2px;
  cursor: pointer;
}
button:disabled { background: #444; color: #888; cursor: default; }
button.link { background: none; color: #888; padding: 0; margin-right: 16px; letter-spacing: 0; text-decoration: underline; }
button.link:hover { color: #fff; }
#play { font-size: 20px; padding: 8px 32px; margin-right: 16px; }

input[type=text] {
  font: inherit;
  color: #fff;
  background: #000;
  border: 1px solid #888;
  padding: 6px 8px;
  width: 240px;
}

#drop { border: 1px dashed #444; padding: 16px; display: flex; align-items: center; gap: 16px; }
#drop.over { border-color: #fff; }

#game { position: fixed; inset: 0; display: flex; flex-direction: column; background: #000; }
#game[hidden] { display: none; }
#view { flex: 1; min-height: 0; position: relative; }
#canvas { position: absolute; inset: 0; width: 100%; height: 100%; outline: none; object-fit: contain; image-rendering: pixelated; }
#stats { position: absolute; left: 8px; top: 60px; margin: 0; padding: 2px 6px; background: rgba(0, 0, 0, 0.6); color: #fff; pointer-events: none; z-index: 2; white-space: pre; }
#stats[hidden] { display: none; }

/* touch controls over the picture: outlines only, so the game shows through */
#touch { position: absolute; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#touch[hidden], #stick[hidden] { display: none; }
#touchmove { position: absolute; left: 0; top: 0; bottom: 0; width: 45%; }
#touchlook { position: absolute; right: 0; top: 0; bottom: 0; width: 55%; }
#stick { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 50%; pointer-events: none; }
#knob { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; background: rgba(255, 255, 255, 0.35); border-radius: 50%; }
.tbutton {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.5);
  font-size: 13px;
  letter-spacing: 1px;
}
.tbutton.down { background: rgba(255, 255, 255, 0.35); color: #fff; }
#tfire { right: 20px; bottom: 28px; width: 96px; height: 96px; border-radius: 50%; }
#tuse { right: 132px; bottom: 20px; width: 68px; height: 68px; border-radius: 50%; }
/* (monster pick M4) a ghost has nothing to fire: its buttons are ◀ ▶ TAKE */
#touch.ghost #tfire { display: none; }
/* (UAC vs HELL) a marine's SHOP; a HELL ghost's FIRE is SUMMON */
#tuvh { right: 212px; bottom: 20px; width: 68px; height: 68px; border-radius: 50%; }
#tuvh[hidden] { display: none; }
#touch.ghost.hell #tfire { display: flex; }
#tnext { right: 20px; bottom: 140px; width: 64px; height: 44px; }
#tprev { right: 96px; bottom: 140px; width: 64px; height: 44px; }
#tmenu { left: 12px; top: 12px; width: 64px; height: 40px; }
#tmap { left: 88px; top: 12px; width: 64px; height: 40px; }
/* held upright: the picture at the top, the controls in the room under it */
@media (orientation: portrait) {
  #game.touching #canvas { bottom: auto; height: auto; aspect-ratio: 4 / 3; max-height: 60%; }
  #game.touching #stats { top: calc(75vw + 8px); white-space: normal; right: 8px; }
  #tmenu { left: 12px; top: auto; bottom: 12px; }
  #tmap { left: 88px; top: auto; bottom: 12px; }
  #tfire { right: 16px; bottom: 64px; width: 112px; height: 112px; }
  #tuse { right: 144px; bottom: 40px; width: 76px; height: 76px; }
  #tnext { right: 16px; bottom: 200px; }
  #tprev { right: 92px; bottom: 200px; }
}
#bar { padding: 4px 12px; font-size: 13px; }
#game:fullscreen #bar { display: none; }
#wadsbox[hidden] { display: none; }
