* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #05060c;
  color: #e6e6e6;
  font-family: "Courier New", Courier, monospace;
}

#app {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: row;
  overflow: hidden;
}

.frame {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #07081a;
}

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font-size: 14px;
  text-shadow: 0 1px 2px #000;
}

#hud[hidden] { display: none; }

#hud-name, #hud-aim {
  position: absolute;
  top: 12px;
  left: 14px;
  margin: 0;
}

#hud-aim { top: 32px; color: #f2f2f2; }

#hud-wind {
  position: absolute;
  top: 12px;
  right: 14px;
  margin: 0;
}

#hud-bottom {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 10px;
  margin: 0;
}

#hud-toast {
  position: absolute;
  top: 18%;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  color: #ffe7a0;
  font-size: 18px;
}

#overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  pointer-events: none;
}

#overlay[hidden] { display: none; }

.panel {
  width: min(760px, 100%);
  max-height: 100%;
  overflow: auto;
  background: #10131b;
  color: #e8e8e8;
  border: 2px solid #d5d5d5;
  padding: 16px;
  pointer-events: auto;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

h1, h2, h3 {
  font-weight: normal;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
}

h1 { font-size: 28px; color: #d6f5a8; }
h2 { font-size: 18px; color: #d6f5a8; }

p { margin: 0 0 10px; line-height: 1.4; }

.lede { color: #c8c8c8; }

.row, .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

button, select, input[type="text"], input[type="number"] {
  font: inherit;
  color: #e8e8e8;
  background: #1a212c;
  border: 1px solid #6f8f52;
  padding: 6px 10px;
}

button { cursor: pointer; }
button:hover { background: #243224; border-color: #d6f5a8; }
button.primary { background: #8fce6c; color: #14200c; border-color: #d6f5a8; }
button.primary:hover { background: #b6e68a; }
button.end { background: #e0a045; color: #1c1408; border-color: #f0c878; }
button.end:hover { background: #f0c070; border-color: #ffe0a0; }
button.on { background: #8fce6c; color: #14200c; }

input[type="text"] { width: 140px; }
label { display: inline-flex; gap: 6px; align-items: center; }

#toolbar {
  width: 280px;
  flex: 0 0 280px;
  height: 100%;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: #10131b;
  border-right: 2px solid #c5c5c5;
}

#toolbar[hidden] { display: none; }

.rack-label {
  margin: 0;
  color: #d6f5a8;
  letter-spacing: 0.08em;
  font-size: 13px;
}

.rack-label.hot { color: #ff8a7a; }

#hand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hand-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 6px 8px;
}

.hand-card .nm { color: #f2f2f2; }
.hand-card .meta { color: #d6f5a8; font-size: 12px; }
.hand-card .blurb { color: #9aa; font-size: 11px; line-height: 1.3; }
.hand-card.poor, button.poor { opacity: 0.55; }
.hand-card.held { border-color: #e0a045; }

.split { display: flex; gap: 6px; }
#toolbar .actions .split button { width: auto; flex: 1 1 0; }

#weapons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#weapons button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 5px 8px;
  font-size: 13px;
}

#toolbar .actions {
  flex-direction: column;
  align-items: stretch;
}

#toolbar .actions button { width: 100%; }

#forge {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#forge[hidden] { display: none; }

#forge button {
  width: 100%;
  text-align: left;
  font-size: 12px;
  padding: 4px 6px;
}

.ico {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: block;
}

.hint { margin: 0; color: #9aa; font-size: 13px; }

.shop-head, .standings, .setup-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 8px;
}

.cash { color: #d6f5a8; font-size: 18px; }

.tabs { display: flex; gap: 6px; margin-bottom: 8px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.card {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 108px;
  background: #161b26;
}

.card.have { border-color: #8fce6c; }
.card.poor { opacity: 0.55; }
.card .nm { display: flex; align-items: center; gap: 8px; }
.card .price { color: #d6f5a8; }
.card .own { color: #c4b2ff; }
.card .blurb { color: #b7b7b7; font-size: 12px; line-height: 1.35; }

.feed {
  color: #c4b2ff;
  font-size: 12px;
  line-height: 1.35;
  margin: 8px 0 0;
  max-height: 4.4em;
  overflow: auto;
}
.log { list-style: none; padding: 0; margin: 0 0 10px; }
.log li { padding: 2px 0; border-bottom: 1px solid #262a36; }
.plus { color: #d6f5a8; }
.minus { color: #ff8a7a; }

.winner { color: #d6f5a8; }

.setup-table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.setup-table td { padding: 4px 6px 4px 0; }

.field { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.field span { width: 110px; color: #b7b7b7; }

.room-code {
  font-size: 32px;
  letter-spacing: 0.28em;
  color: #d6f5a8;
  margin: 4px 0 12px;
}

#net-err { color: #ff8a7a; min-height: 1.2em; }
