* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #08060f;
  color: #f5edda;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

#stage {
  position: fixed;
  inset: 0;
}

#topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 12px 18px;
  pointer-events: none;
  text-shadow: 0 2px 8px #000;
}

#topbar .logo {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #ffc72c;
}

#topbar .sub {
  font-size: 11px;
  opacity: 0.7;
}

#aboutBtn, #modeBtn {
  pointer-events: auto;
  font: inherit;
  font-size: 11px;
  color: #08060f;
  background: #ffc72c;
  border: 0;
  border-radius: 6px;
  padding: 3px 10px;
  cursor: pointer;
  font-weight: 700;
}

#aboutPanel {
  position: fixed;
  top: 48px;
  left: 18px;
  z-index: 11;
  max-width: 420px;
  background: rgba(13, 10, 26, 0.95);
  border: 1px solid #4a3f6b;
  border-radius: 10px;
  padding: 6px 16px;
  font-size: 12.5px;
  line-height: 1.5;
}

#aboutPanel .fine { font-size: 10px; opacity: 0.5; }

#ui {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  padding: 12px 16px 14px;
  background: linear-gradient(transparent, rgba(8, 6, 15, 0.92) 35%);
}

#ui .row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

#ui button {
  font: inherit;
  font-size: 13px;
  color: #08060f;
  background: #ffc72c;
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 700;
}

#ui button:hover { background: #ffd95e; }

#ui button[data-load] { background: #da291c; color: #fff; }
#ui button[data-load]:hover { background: #f03a2c; }

#gameSelect {
  font: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #4a3f6b;
  background: #16122a;
  color: #f5edda;
  max-width: 290px;
  cursor: pointer;
}

#gameSelect:focus { border-color: #ffc72c; outline: none; }

#gameUrl {
  font: inherit;
  font-size: 13px;
  width: min(420px, 60vw);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #4a3f6b;
  background: #16122a;
  color: #f5edda;
  outline: none;
}

#gameUrl:focus { border-color: #ffc72c; }

.hint {
  font-size: 11px;
  opacity: 0.65;
  text-align: center;
}

.hint.tiny { font-size: 9px; opacity: 0.4; }
